OpenWiki
langchain-ai/openwiki β an open-source CLI that writes and maintains documentation for your codebase, built specifically for agents. It generates a wiki under openwiki/, keeps it current as the repo changes, and wires your coding agent to consult it. Where OpenKB compiles arbitrary documents into a personal wiki, OpenWiki is narrowed to one job: keep an always-current agent-facing map of the code. That makes it the packaged, LLM-driven counterpart of the hand-written DOX doc tree.
Links
Description
- Generate.
openwikicreates initial documentation inopenwiki/when no wiki exists. Ifopenwiki/already exists, it refreshes that documentation from repository changes (openwiki --update). - Agent wiring. OpenWiki automatically appends prompting to your
AGENTS.mdand/orCLAUDE.md, instructing your coding agent to reference the wiki when searching for context. If neither file exists, it creates one. This is the same mechanism the DOX tree relies on β the agentβs always-in-context entry file points it at the doc layer. - Stay fresh via CI. A shipped GitHub Action (
openwiki-update.yml) opens a PR once a day with documentation updates. Drop it into.github/workflows/to keep docs from rotting β the perennial reason agent docs are worthless. - Interactive by default. The CLI stays open after each run for follow-up messages;
-p/--printdoes a one-shot non-interactive run that prints the final assistant output.
Download or use
npm install -g openwiki- GitHub: https://github.com/langchain-ai/openwiki
- Commands:
openwiki --initβ configure inference provider, API key, modelopenwikiβ interactive CLI (stays open)openwiki "Please generate documentation for this repository"β start with an initial requestopenwiki -p "Summarize what you can do"β single command, non-interactive, exitsopenwiki --updateβ refresh existing docsopenwiki --help
- Config & secrets saved to
~/.openwiki/.env. Optional LangSmith API key traces runs to a project namedopenwiki.
Reasoning for
This vault runs the Karpathy LLM-wiki pattern by hand for knowledge; OpenWiki applies the same compile-once-keep-current idea to code, aimed at agents rather than humans. Worth tracking as the LangChain-backed entry in the crowded βkeep the agentβs context map currentβ space β the automated cousin of DOX and a complement to OpenSpec (see the two-axes framing below). The daily-PR GitHub Action is the notable design choice: it treats doc drift as a CI problem, not a discipline problem β relevant to Brainβs own index-maintenance protocol and to Harness Engineering.
π Where it sits β DOX vs OpenSpec vs OpenWiki
Three tools attack the same enemy (poor agent context awareness) from different angles:
- DOX = space, by hand. A tree of
AGENTS.mdfiles the agent writes and updates inline as it edits β tightly coupled to the code, one doc per folder. - OpenSpec = time. Versioned change contracts describing what to build and why before writing code; deliberately no backfill.
- OpenWiki = space, automated. A separate
openwiki/wiki an LLM regenerates from repo diffs on a schedule, then points the agent at viaAGENTS.md/CLAUDE.md. Less tightly coupled than DOX (a generated wiki, not per-folder inline docs), but self-maintaining without developer discipline. See Spec-Driven + Self-Documenting for the space/time synthesis.
Customizing
Supports OpenRouter, Fireworks, Baseten, OpenAI and Anthropic out of the box. A few models are pre-defined (GLM 5.2, Kimi K2.6, Sonnet 5, etc.), and each provider accepts a custom model ID. PRs welcome for new providers/models.
Alternatives considered
- OpenKB (VectifyAI) β compiles any documents into a persistent, OKF-compliant Obsidian wiki with vectorless PageIndex retrieval; broader input, not code-specific.
- DOX β zero-dependency per-folder
AGENTS.mdtree, maintained inline by the agent; no separate wiki, no CI, no LLM pipeline of its own. - Karpathyβs manual workflow β the hand-driven origin of the compile-to-wiki idea.
Resources
- Repo: langchain-ai/openwiki
- GitHub Action example: openwiki-update.yml
- LLM Knowledge Bases β the compile-once-keep-current pattern this generalizes
- DOX β Self-Documenting AGENTS.md β the hand-written per-folder counterpart
- Spec-Driven + Self-Documenting β the two-axes (space/time) context-engineering synthesis
- Context Engineering Β· Progressive Disclosure Β· Harness Engineering
Template: tool