In this article

🔍 What is OpenWiki: structured documentation for (and by) language models

OpenWiki is a TypeScript CLI that scans your repo, extracts documents, code comments and markdown files, synthesizes them via LLM, and produces a wiki that lives in Open Knowledge Format (OKF) — a Google Cloud schema that does for knowledge what JSON Schema does for data: articles, concepts, relationships, tags, all declarative and parseable by a model.

It's not a wiki for humans to read in a browser: it's interchange format between codebase and agents. The wiki lives in the repo (openwiki/ folder), is versioned in git, and when an agent needs to understand «where does the billing business logic live?» or «what are the concurrency constraints on the cache?», it queries the local wiki — no external fetch, zero latency. LangChain built it for their products (langgraph, deepagents, LangSmith), but it applies to any stack: Python, .NET, Node.js, Go, doesn't matter; the CLI reads the source, the wiki is format-agnostic.

Repo snapshot
repo       langchain-ai/openwiki
language   TypeScript · license MIT · v0.5.0 (July 2026)
platform   npm i -g openwiki · agnostic to Python/Node/Go source
what       CLI that generates OKF wiki for coding agents
updates    CI/GitHub Actions / GitLab CI — post-merge auto
format     Open Knowledge Format (Google Cloud), JSON+YAML
context    Local, no upload — file lives in repo

Official repo · langchain-ai/openwiki ↗

Snapshot as of September 28, 2026: active LangChain project, ~4.4k stars and growing traction.

⚙️ How it works: repo scan → LLM synthesis → OKF wiki

The cycle is simple, but the result is sophisticated. The CLI starts with openwiki --init, asks for model and API key (supports OpenAI, Anthropic, Ollama local, OpenRouter — any provider that exposes standard API), then scans the repo looking for markdown files, docstrings, structured comments and code files in supported languages. It doesn't download anything from the internet — everything it sees is in your repo.

For each concept found (function, module, pattern, database table), it sends the model a synthetic request: «Summarize this artifact and its dependencies, extract thematic tags, link to related concepts I've found so far». The model responds with OKF structure — name, description, typed fields, relationships — not prose, but declaration. The wiki ends up in openwiki/ and the master list lives in openwiki/manifest.json. At that point, commit and push, and the wiki is versioned alongside the code.

Terminal · generating your first wiki
npm install -g openwiki

cd ~/code/my-project
openwiki --init
  Model? claude-3-5-sonnet
  API key? sk-ant-...

# Scanning: 47 TypeScript files, 12 markdown docs, 3 SQL files
# Summarizing 134 concepts...
# Writing openwiki/*.md (OKF format)

git add openwiki/ && git commit -m 'chore: initial wiki generation'
git push

ls openwiki/
  api-routing.md  database-schema.md  auth-flow.md  [...]

Quickstart · official README ↗

First generation typically takes 2–5 minutes depending on repo size and API quota.

🔄 Automatic updates: CI trigger, fresh wikis, zero latency for agents

After init, the true value of OpenWiki lives in automatic updates. The CLI integrates workflows for GitHub Actions, GitLab CI and Bitbucket Pipelines: you copy a YAML into your repo, and every merge to main triggers openwiki --update. It doesn't rebuild the wiki from scratch (that would be expensive), it reads the commit history (what changed), examines delta files, updates touched concepts and re-serializes only artifacts that changed. The wiki lives in the repo, is committed, and it doesn't matter which branch the agent consults: the wiki it sees matches the code it's reading.

This is the design that makes OpenWiki different from a static README or even Sphinx/Docusaurus docs: the agent doesn't do a Google Cloud search, doesn't query a remote API — the wiki is local and synchronized with the code. A PR changes an endpoint? The wiki updates in the same merge commit. The agent working on the next PR already sees the new documentation. No sync lag, no versioning hell.

GitHub Actions · openwiki-update.yml
name: OpenWiki Update
on: [push]

jobs:
  wiki:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: {fetch-depth: 0}

      - uses: actions/setup-node@v4
        with: {node-version: '20'}

      - name: Generate wiki
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          npm install -g openwiki
          openwiki code --update --print

      - name: Create PR
        uses: peter-evans/create-pull-request@v5
        with:
          branch: openwiki/update
          title: 'chore: update wiki from main'
          commit-message: 'Update wiki from latest commits'

Workflow template · docs ↗

Copy-paste into your .github/workflows/ and never think about wiki maintenance again: CI keeps it fresh.

🤖 Using with agents: how agents consult the wiki and why it's not invisible

Here's where the design gets interesting. OpenWiki generates the wiki in OKF, but has no HTTP API — there's no server the agent queries. The wiki lives in the filesystem. So either: the agent has the repo cloned locally (case for Claude Code, Codex, Cursor), or reads it via MCP (Model Context Protocol — OpenWiki supports this natively), or you embed it in the system prompt by extracting relevant sections. In all cases, the wiki is not invisible to the agent — the agent knows it exists and can consult it intentionally.

This differs from a vector database RAG where the agent doesn't know how many documents it retrieved or what filters applied. Here the wiki is front-stage: a well-designed agent starts by saying «I'm reading this repo's wiki, the structure is [X], core concepts are [Y], let me start from [Z]». And if the wiki is wrong, incomplete or stale — maybe the repo was refactored but nobody re-educated the wiki — the agent notices and can communicate it (or fix it and open a PR).

Claude Code MCP config · reading the wiki from system
{
  "mcpServers": {
    "openwiki": {
      "command": "openwiki",
      "args": ["mcp", "--repo", "."]
    }
  }
}

# Agent now has available:
# - openwiki/search <query>: search the wiki
# - openwiki/get <concept>: read full document
# - openwiki/concepts: list all indexed concepts

MCP setup · README ↗

Once configured, the agent can query the wiki without you telling it to.

📚 Open Knowledge Format: the common language between wiki and models

OKF didn't come out of nowhere. Google Cloud standardized it to integrate knowledge management systems with LLMs: each OKF article is YAML with well-defined fields — title, slug, category, keywords, body in markdown. It's not a bizarre structure: it's a coherent schema that a model recognizes and knows how to navigate.

For developers, this means: once your wiki is in OKF, it's not locked to OpenWiki. You can export it to Obsidian, process it with Python scripts for reporting, include it in Docusaurus docs, or use it as training data for fine-tuning a local model. The wiki isn't a silo; it's a neutral artifact your repo owns and anyone can read.

Structure of an OKF article in OpenWiki
Create a new repositoryOwner * / Repository name *your-username/claude-marketplaceDescription (optional)My personal Claude Code marketplacePublicAnyone on the internet can see this repository.PrivateYou choose who can see and commit to this repository.Create repository

Title, category, keywords and markdown body: all declarative, no magic strings.

🏢 Why it matters for developers and SMBs

For a developer using coding agents (Claude Code, Codex, Cursor + MCP), OpenWiki changes the relationship between agent and codebase. You'll never dump the entire README into the instruction, never navigate vector search screens, never hope the agent guesses a feature that isn't commented. The wiki is there, versioned, updated by CI, and the agent knows where to search. It's onboarding that maintains itself: when a junior arrives, you hand them the repo and the wiki is already fresh.

For an SMB scaling agents through engineering processes, the story is broader. OpenWiki doesn't just reduce the burden of maintaining documentation by hand (the CLI generates it), it creates a versioned and controllable artifact where governance and context coexist. You review a wiki PR like you'd review a code PR. You see in history when a concept was refactored. You can even use it as foundation for fine-tuning an internal model — «this is our design, this is how we read code». The wiki becomes structured corporate property, not secrets in file comments.

⚠️ Limits to know before adopting

The project is actively maintained (LangChain uses it internally), but the challenge of generating good OKF from varied code is real: a disorganized codebase produces a disorganized wiki. Files without docstrings, modules with generic names (utils, helpers), undocumented patterns remain invisible to the CLI. Wiki quality depends on source documentation quality plus the model's ability to infer patterns — it's not magic.

Second limit: API costs. Generating a wiki for a 100k LoC codebase the first time costs — not always, but proportional to what the model must synthesize. Incremental updates are far cheaper (only changed files). But you need to know that your agents' budget includes wiki-generation budget. LangChain offers lightweight models and local Ollama to contain cost, but it's a conscious trade-off.

  • Depends on source quality: poorly documented codebase → poorly structured wiki; no magic fix for bad practices.
  • API cost at first generation: requires N tokens to model to synthesize the repo; incremental updates are cheaper.
  • Requires a model: local Ollama or remote provider; nothing offline without a pre-downloaded local model.
  • Wiki is repo property: must live in git to stay updated; if you .gitignore openwiki/, you lose it.

✅ Getting started

If you use Claude Code (plugin locally) and your repo has at least 10–20 TypeScript/Python files with some docstrings: npm i -g openwiki, copy the GitHub Actions workflow (or GitLab), and generate your first wiki on a test branch. Read the generated OKF articles — you can fix them by hand or run --update on specific sections if needed.

In the broader picture, OpenWiki completes the context spectrum I've described in recent weeks: coding agents move from monolithic instructions to searchable wikis, to specialized MCPs, to fine-tuning on specific projects. OpenWiki is the bridge between the code you have and the context your agents can actually use. It's not a product, it's a paradigm shift in how repos talk to agents — and an SMB adopting it today gives their agents the right context much faster than one reading READMEs and spinning with ls -R.

Two approaches to agent context

Dumping README into instruction

  • Agent sees context but monolithic
  • Doesn't change without new conversation training
  • Wastes tokens on every message
  • Each new agent starts from zero

OKF wiki from OpenWiki

  • Agent consults on-demand
  • Automatic update from CI
  • Uses tokens only for relevant sections
  • Fresh onboarding for every agent, every time

Not competitive: complementary. README for humans, wiki for agents.

Frequently asked questions about OpenWiki

What is OpenWiki?

It's an open source CLI from LangChain that automatically generates a codebase documentation wiki in Open Knowledge Format (OKF), structured for direct LLM and coding agent consumption. It scans the repo, synthesizes concepts via model, and produces a wiki that lives in the repo and updates itself from CI.

How is it different from Docusaurus, Sphinx or Obsidian wiki?

Docusaurus and Sphinx produce HTML for humans from markdown. OpenWiki produces OKF — structured format — for agents. Obsidian is local but manual. OpenWiki is automatic, versioned in git, and CI-updated: the wiki always reflects current code.

What is Open Knowledge Format (OKF)?

It's a YAML schema standardized by Google Cloud to represent knowledge articles — title, slug, category, keywords, body. A model recognizes it and knows how to navigate it. It's not proprietary to OpenWiki: once your wiki is OKF, it's portable to any tool supporting the standard.

How much does it cost to generate a wiki with OpenWiki?

Depends on repo size and model choice. First generation costs N tokens to model to synthesize concepts. Incremental updates (--update) are much cheaper because they touch only modified files. Supports local Ollama, OpenAI, Anthropic, OpenRouter: choose your cost-vs-quality trade-off.

Does the agent automatically know a wiki exists, or do you have to tell it?

With MCP (Model Context Protocol), the agent has the tool available automatically and can search it. Otherwise you'd include it in system prompt or explicitly tell it to consult. OpenWiki is not invisible: the agent knows it exists.

Does the wiki stay local in the repo, or upload to cloud?

Stays local in the repo, versioned in git. No upload, no external server, zero latency. If you want, you can host the wiki on a website, but that's not a native OpenWiki feature.

Let's talk

If this topic is relevant to you, write to me: comparing notes on code and AI is always time well spent.

All articles