Introducing OpenWiki, an open source agent for repo documentationOpenWiki 正式亮相:一款面向代码仓库文档的开源 Agent

Brace Sproul
July 1, 2026
4
min
Go back to blog

Today we're releasing OpenWiki, an open source agent and CLI for generating and maintaining documentation for codebases.今天,我们正式发布 OpenWiki。这是一款开源 Agent 和命令行工具,用于生成和维护代码库文档。

Agents write better code when they understand the repo they're working in. They need to know where key logic lives, how files connect, and which patterns the codebase expects. Good documentation gives agents that context, which leads to more informed code changes and fewer avoidable mistakes.Agent 只有真正理解所工作的代码仓库,才能写出更优质的代码。它们需要清楚核心逻辑的位置、文件之间的关联方式,以及代码库遵循的规范。优质的文档能为 Agent 提供这些上下文,帮助其做出更明智的代码修改,减少本可避免的错误。

The problem is that documentation is hard to keep current. Writing the initial docs takes time, and updating them every time the code changes is even harder. In large repos with frequent PRs, docs can fall out of date quickly.问题在于文档很难保持时效性。编写初始文档已经耗费时间,而每次代码变更后还要同步更新则更加困难。在大型仓库中,如果 PR 频繁提交,文档很快就会过时。

OpenWiki handles that work automatically. It creates a wiki for your repo, connects that wiki to your coding agent, and keeps it updated as your code changes.OpenWiki 可以自动完成这些工作。它会为仓库创建 Wiki,将其与编程 Agent 关联,并在代码发生变更时持续更新。

Why wikis for agents为什么 Agent 需要 Wiki

We were inspired by existing work around codebase wikis, including DeepWiki, AutoWiki, and Karpathy’s LLM Wiki concept. The shared idea is simple. A wiki gives humans and agents a structured way to understand a codebase without forcing all context into one giant file.我们受到了现有代码库 Wiki 工作的启发,包括 DeepWiki、AutoWiki 以及 Karpathy 的 LLM Wiki 理念。这些方案的核心思路很简单:Wiki 为人类和 Agent 提供了一种结构化的方式来理解代码库,而无需将所有上下文都塞进一个庞大的文件中。

That matters because most coding agents already read files like AGENTS.md or CLAUDE.md for instructions. Those files are useful, but they’re not the right place to store hundreds of pages of repo documentation. They should point the agent toward the right context, then let the agent retrieve what it needs.这一点很重要,因为大多数编程 Agent 已经会读取 AGENTS.md 或 CLAUDE.md 等文件来获取指令。这些文件虽然有用,但并不适合用来存储成百上千页的仓库文档。它们应该为 Agent 指明正确的上下文所在,然后让 Agent 自行检索所需内容。

OpenWiki follows that model. It generates a repo wiki, then updates your agent instruction files with a reference to that wiki. From there, your coding agent can discover and use the docs automatically.OpenWiki 遵循的就是这一模式。它会生成仓库 Wiki,然后在 Agent 指令文件中添加对该 Wiki 的引用。此后,编程 Agent 就能自动发现并调用这些文档。

Getting started快速开始

OpenWiki is designed to be easy to run from the command line.OpenWiki 的设计便于通过命令行直接运行。

Install it with npm:使用 npm 安装:

npm install -g openwiki

then run:然后运行:

openwiki --init

The init command asks for a model provider and API key, then generates documentation for your repo.init 命令会要求输入模型提供商和 API 密钥,随后为仓库生成文档。

OpenWiki supports both open and closed model providers, including OpenRouter, Fireworks, Baseten, OpenAI, and Anthropic. By default, it uses OpenRouter with an open model, but you can configure the provider that works best for your setup.OpenWiki 支持开源和闭源模型提供商,包括 OpenRouter、Fireworks、Baseten、OpenAI 和 Anthropic。默认情况下,它使用 OpenRouter 搭配开源模型,但也可以根据你的环境配置最合适的提供商。

Because OpenWiki is built on top of DeepAgents, it also supports tracing to LangSmith. If you provide a LangSmith API key, OpenWiki will trace runs to a LangSmith project so you can inspect exactly what the agent did while generating or updating your docs.由于 OpenWiki 构建于 DeepAgents 之上,它还支持向 LangSmith 发送追踪记录。配置 LangSmith API 密钥后,OpenWiki 会将运行追踪同步到 LangSmith 项目,方便你准确查看 Agent 在生成或更新文档时的具体操作。

How OpenWiki connects to your coding agentOpenWiki 如何连接编程 Agent

After generating the wiki, OpenWiki updates your repo’s agent instruction files. If your repo uses AGENTS.md, CLAUDE.md, or both, OpenWiki adds a reference to the generated wiki and explains when the agent should use it.生成 Wiki 后,OpenWiki 会更新仓库中的 Agent 指令文件。如果仓库使用了 AGENTS.md、CLAUDE.md 或两者兼有,OpenWiki 会在其中添加对生成 Wiki 的引用,并说明 Agent 应在何时使用它。

We chose this approach because putting the entire wiki inside an instruction file would add too much context. In a large repo, the wiki can span hundreds of files. Loading all of that into every agent run would be wasteful and hard to maintain.之所以采用这种方式,是因为将整个 Wiki 放入指令文件会引入过多上下文。在大型仓库中,Wiki 可能涵盖数百个文件,每次运行 Agent 都加载全部内容既浪费资源,又难以维护。

A short reference works better. Your coding agent already reads the instruction file. Once OpenWiki adds the reference, the agent can find the wiki when it needs repo context, without requiring you to change your workflow.简短的引用效果更好。编程 Agent 本来就会读取指令文件,OpenWiki 添加引用后,Agent 在需要仓库上下文时即可自动找到 Wiki,无需改变现有工作流。

Keeping the wiki up to date保持 Wiki 持续更新

Generating docs once is useful. Keeping them current is where OpenWiki becomes more valuable.一次性生成文档固然有用,但让文档保持最新才是 OpenWiki 真正的价值所在。

OpenWiki includes a GitHub Action that can run on a schedule, for example once a day. The action runs OpenWiki with the update flag. OpenWiki checks which commits landed since the last run, uses git diffs to understand what changed, then updates the wiki with the relevant context.OpenWiki 内置了 GitHub Action,支持定时运行,例如每天一次。该 Action 会携带 update 标记运行 OpenWiki,检查自上次运行以来有哪些新提交,通过 git diffs 了解变更内容,并据此更新 Wiki 中的相关部分。

That means the workflow can run in the background. As your codebase changes, OpenWiki updates the documentation. Your coding agent keeps picking up the latest wiki through the existing instruction file reference.这意味着工作流可以在后台运行。代码库发生变更时,OpenWiki 自动更新文档;而编程 Agent 则通过指令文件中已有的引用,持续获取最新的 Wiki 内容。

Built for codebases first优先为代码库打造

This first release focuses on wikis for codebases. The goal is to make it easier for agents to understand the repos they work in, without asking developers to manually write and maintain detailed docs.首个版本聚焦于代码库 Wiki,目标是让 Agent 更容易理解所操作的仓库,无需开发者手动编写和维护详细文档。

Over time, we think the OpenWiki concept can apply more broadly. Agents need durable context for many kinds of work, not just coding. Codebase documentation is the first use case, but the same pattern can help agents maintain useful context across other workflows too.长期来看,OpenWiki 的理念可以应用于更广泛的领域。Agent 在许多工作中都需要持久化的上下文,远不止编程。代码库文档是第一个应用场景,但同样的模式也能帮助 Agent 在其他工作流中维护有价值的上下文。

Try it立即试用

OpenWiki is open source and available now.OpenWiki 已开源,现在即可使用。

You can install it, run openwiki --init, and generate a wiki for your repo in a few minutes.只需安装并运行 openwiki --init,几分钟内就能为仓库生成 Wiki。

Check out the repo here: https://github.com/langchain-ai/openwiki在此查看仓库:https://github.com/langchain-ai/openwiki

S
e
e
w
h
a
t
y
o
u
r
a
g
e
n
t
i
s
r
e
a
l
l
y
d
o
i
n
g

LangSmith, our agent engineering platform, helps developers debug every agent decision, eval changes, and deploy in one click.