# Building Docs for Agents, Not Humans: Inside OpenWiki
<!--
ref: @content/youtube/langchain/2026-08-14-building-docs-for-agents-not-humans-inside-openwiki
version: 3
updated_at: 2026-10-31T19:04:48.736Z
-->

From LangChain, 2026-08-14: The presenter argues that general-purpose memory is the next big shift for agents, and that code-repo documentation is a well-bounded place to start.

**[Watch on YouTube](https://www.youtube.com/watch?v=XNX-1h2K-9U)**


*Synthesized from a LangChain engineer (the OpenWiki presenter) on LangChain, 2026-08-14.*

The speaker is a LangChain engineer on the OpenWiki project. The transcript does not give their name; a host named "Shawn" introduces them, and they refer to LangChain's CEO as "Harris."

## Core Thesis
The presenter argues that general-purpose memory is the next big shift for agents, and that code-repo documentation is a well-bounded place to start. Agents now write most of the code, so repo docs should be built for agents to read: short, self-contained fragments with predictable headings, deterministic metadata and cross-links, sized to fit the context window. The docs also have to keep themselves up to date with no extra work from developers. OpenWiki is a CLI built on these ideas.

## Key Insights
- **Where it came from.** LangChain's CEO asked what this year's big theme would be, given that last year's was OpenClaw and personal agents. The presenter answered "general purpose memory." They describe memory as an open research problem for about 3.5–4 years that nobody has yet solved in a general-purpose way. Codebase docs were picked as the first domain because it is well defined. The plan is to expand to other kinds of memory later.
- **Three design principles:** (1) build the docs for agents to consume, (2) make setup trivial with a CLI and short onboarding, and (3) have the docs update themselves. Claude Code can already write a decent repo wiki if you ask it to. The hard part is keeping that wiki accurate over time.
- **Human docs and agent docs are shaped differently.** Human docs tell a story: a quick start, background, pages that flow into each other, screenshots and videos. Agents pull fragments, not whole pages or folders. That means every concept has to stand alone, headings have to be precise and predictable so they can be filtered and searched, and content has to fit the context window. One example: a stray base64 string in a tool result can add 50,000 tokens.
- **What the output looks like.** It resembles Karpathy's "LLM wiki": plain markdown files with a set structure and links between them.
  - `quickstart.md` always exists. The agent is told to read it first for a high-level view of the repo and the wiki.
  - Topic directories are chosen by the agent. OpenWiki deliberately does not prescribe topics. It only gives guidance on roughly how many files to write, how large each should be, and that each file should cover one focused topic, so an agent rarely needs to combine context from several files.
  - An `index.md` per directory lists that directory's files so an agent can scan it quickly.
  - `log.md` is a changelog. It shows agents the wiki's history and gives human reviewers one place to see what changed in each update.
- **Google's Open Knowledge Format (OKF).** OpenWiki adopted OKF, which adds deterministic YAML front matter to every markdown file. The fields are `type`, `title`, `description`, resource tags, and `timestamp`, and arbitrary custom fields are allowed. The talk covers OKF 0.1; 0.2 had just been released, with support expected within about a day. The presenter's point is that retrieval is harder than generation. Generating docs with an agent is fairly easy, while filtering on fields like "give me every architecture doc" or on tags is what makes retrieval work well.
- **Cross-linking.** OKF resource tags can point to specific source files, and markdown links between docs let an agent jump from a snippet in doc A to the related doc B. Markdown links are not specific to OKF, but OKF puts strong emphasis on cross-linking pages.
- **Early eval results.** The team ran a subset of 20 Deep SWE (coding-agent benchmark) tasks with and without a generated wiki. Without OpenWiki, about 7–8 tasks succeeded; with it, about 9–10. The bigger gain was efficiency: fewer tool calls, fewer searches, less output, and a significant drop in token use. The presenter calls this early and promising, with more benchmarks to be published.
- **What they got wrong: humans do read it.** The presenter built for agents only, assuming people just use agents to write code. Users pushed back quickly because they wanted to read the docs too. The team responded by adding diagrams (sequence diagrams, state diagrams, flowcharts). Agents produce them cheaply, and the presenter guesses they may help agents as well, though there are no evals on that yet.
- **How `openwiki init` works:**
  1. A setup wizard asks for LLM API keys, the model, and a "wiki brief": a high-level prompt with repo-specific instructions that adds to, but does not replace, the built-in generation prompts.
  2. It writes scaffolding. This includes a GitHub Actions workflow with a daily cron, and an edit to `AGENTS.md` and/or `CLAUDE.md` that injects context telling the agent what OpenWiki is, how to access it, and when to consult it. That injection is currently the only way agents learn the wiki exists.
  3. The agent runs. It reads the repo, writes a plan, and reads the **git history** (commits and titles) rather than only the current snapshot. Then it writes the docs.
  4. A deterministic pass checks OKF compliance on every file and writes `index.md` files and the changelog. The agent then adds specifics about what it changed, and some metadata files are updated.
- **How `openwiki update` works.** It is triggered by the scheduled GitHub Action. It first checks git history against `last update.json`. If nothing has changed, it exits without running the agent. Otherwise it fetches every commit merged since the last run, updates the affected docs, and opens a PR for you to merge. Once the scaffolding is merged, you can "forget about" OpenWiki.
- **Current status.** OpenWiki is open source and MIT licensed, published on npm, has many GitHub stars and forks, and supports about 10–15 LLM providers. Open source was chosen for adoption and because agent-doc workflows often need repo-specific changes, which forking allows.
- **Roadmap.** Better prompting, driven by the Deep SWE evals, especially for large repos and for self-updates. Also dedicated search, filter and query tools for the wiki, to replace reliance on the `AGENTS.md` note. Unmerged experiments with those tools already show gains.

## Actionable Takeaways
1. Install with `npm install openwiki`, then run `openwiki init` in the repo. Provide API keys, pick a model, and write a wiki brief describing how the repo should be navigated.
2. Review and merge the generated scaffolding: the GitHub Actions workflow with its daily cron, and the edits to `AGENTS.md` / `CLAUDE.md` that tell your coding agent to consult the wiki.
3. The default update schedule is daily. For very active repos (the presenter's example is about 2,000 commits a day), change the Action to run every 4, 6 or 8 hours.
4. Review wiki-update PRs by reading `log.md` first. Only open individual doc files when you need more detail.
5. Whether you use OpenWiki or not, structure agent-facing docs this way: a `quickstart.md` entry point, one topic per file, an `index.md` per directory, OKF YAML front matter (`type`, `title`, `description`, resource tags, `timestamp`), and markdown cross-links between related docs.
6. Keep large blobs such as base64 strings out of agent-retrievable docs so one tool call can't consume tens of thousands of tokens.
7. Feed git history, not just the current code, into doc generation so the docs reflect how and why the code changed.
8. Add diagrams if humans will also read the docs. Agents can generate them at little cost.
9. If you have repo-specific workflows, fork the MIT-licensed repo and customize it. The presenter suggests trying it first on your worst-documented repo.

## Notable Quotes
> "My answer to that was general purpose memory." — LangChain OpenWiki presenter

> "Keeping your docs up to date automatically and maintaining those docs is a much trickier problem." — LangChain OpenWiki presenter

> "Generating docs is fairly easy with agents. Uh, retrieving from these docs is a lot more difficult." — LangChain OpenWiki presenter

> "Very quickly, we found out people want to read these as well." — LangChain OpenWiki presenter

> "Try it out on your worst documented repo." — LangChain OpenWiki presenter

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*