What is Context
Context is a knowledge workflow for engineering teams and their AI agents. It turns code repositories, documents, notes and conversations into reviewed, versioned knowledge in which every claim leads back to its source, then builds that knowledge into Agent knowledge packages, documentation sites and LLM documents. Agents read the knowledge first and follow its evidence chain to the original only when they need exact detail.
You describe what knowledge you need and where the material lives. Your Agent reads the evidence, proposes a structure and explains its decisions. Context keeps the process legal and repeatable: it records source boundaries, checks evidence coverage, stages reviewable candidates, preserves provenance, verifies the approved result and builds the output you chose.
How it fits together
The diagram shows the path from material to the people and Agents who ask questions.
flowchart TB
subgraph produce["Produce"]
direction LR
src["Code, documents, notes, sessions"] -->|registered and captured| agent["Your Agent with Context skills"]
end
subgraph approve["Review"]
direction LR
review["Human review"] -->|approves| kb["Approved knowledge"]
end
subgraph use["Use"]
direction LR
out["Package, site, LLM Docs"] -->|answers with sources| users["Agents, Bots, developers"]
end
produce -->|writes candidates| approve
approve -->|builds| useContext is not a one-shot summarizer. Source snapshots, review state, approved knowledge and package inventories stay in a local Context knowledge workspace, so the result can be inspected, versioned and refreshed when sources change.
What makes it different
- An index with evidence chains, not copied prose. Indexers keep only what answers a reader's questions and record where each statement came from. In one large production monorepo, about 202 MB of code and documents became about 1.75 MB of reviewed knowledge, roughly 1/115 of the source volume. See Knowledge for Agents and Evidence Chains and Index First.
- Skills and a CLI inside the Agents you already use. Context does not call an LLM and is not a hosted platform. Its skills run in Claude Code, Codex, Cursor or a managed Agent, and the local CLI performs the deterministic work. See Why a Workflow.
- Review before anything is published. People own the goal, source permission, structure and review decisions; drafts become approved Markdown only after review. See Knowledge Lifecycle.
- Knowledge that follows its sources. Sources are pinned, and a later change reopens only the affected pages. See Keeping Knowledge Current.
- One body of knowledge, several outputs. The same approved pages build an Agent knowledge package, a documentation site and LLM Docs, each mapped back to the knowledge workspace through a build inventory. See Packages and Sites.
Who it is for
Context helps when knowledge exists but is not yet ready for an Agent to use. Typical requests:
- turn product, architecture, operations or FAQ documents into a navigable knowledge base;
- connect code structure with explanatory documents while keeping exact source evidence;
- combine several repositories and document sets into one reviewed knowledge package;
- update an existing knowledge workspace when its sources change, without rebuilding everything.
In a measured comparison on real developer questions, Agents answering from Context knowledge fully solved more questions with far fewer tool calls than with an LLM Wiki; see Knowledge Retrieval benchmark.
Source Graph and Agent Graph
Two companion projects carry parts of the workflow:
- Source Graph searches and reads repositories at a pinned commit over the web, MCP, HTTP and a CLI. Context ships an optional evidence plugin so that an Agent reading code through Source Graph also receives the knowledge sections that cite it, without cloning the repository. See the Source Graph overview.
- Agent Graph is the work-contract layer under the Context workflow. Context observes knowledge workspace facts and executes actions; Agent Graph evaluates those facts and selects the next legal step, which keeps a long workflow resumable and testable. See Why Graph Engineering and Workflow Execution.
How you get it
Context is delivered as an npm CLI plus an Agent plugin. Install both once, restart the Agent session, then describe the knowledge goal to the /c4a:context entry in plain language. Continue with Installation and Quick Start.
Context 是什么
Context 是面向研发团队及其 AI Agent 的知识工作流。它把代码仓库、文档、笔记和会话转化为经过审核、带版本的知识,其中每一条论述都能追溯到来源;再把这些知识构建成 Agent 知识包、文档站点和 LLM 文档。Agent 先读知识,只有需要精确细节时才沿证据链回到原文。
你只需说明需要什么知识、材料在哪里。Agent 负责阅读证据、提出结构并解释自己的决策。Context 则保证整个过程合规且可重复:记录来源边界、检查证据覆盖、暂存可审核的候选、保留出处、验证已批准的结果,并构建你选择的产物。
整体如何运作
下图展示了从原始材料到提问的人和 Agent 的完整路径。
flowchart TB
subgraph produce["生产"]
direction LR
src["代码、文档、笔记、会话"] -->|"登记并采集"| agent["装有 Context 技能的 Agent"]
end
subgraph approve["审核"]
direction LR
review["人工审核"] -->|"批准"| kb["已批准的知识"]
end
subgraph use["使用"]
direction LR
out["知识包、站点、LLM Docs"] -->|"附来源作答"| users["Agent、Bot、开发者"]
end
produce -->|"写出候选"| approve
approve -->|"构建"| useContext 不是一次性的摘要工具。来源快照、审核状态、已批准的知识和知识包清单都保存在本地的 Context 知识工作区中,因此结果可以检查、做版本管理,并在来源变化时刷新。
有何不同
- 带证据链的索引,而不是照搬原文。 Indexer 只保留能回答读者问题的内容,并记录每条论述的出处。在一个大型生产 monorepo 中,约 202 MB 的代码和文档最终变成约 1.75 MB 经过审核的知识,约为源材料体量的 1/115。参见写给 Agent 的知识和证据链与索引优先。
- 技能和 CLI 就在你已在用的 Agent 里。 Context 本身不调用 LLM,也不是托管平台。它的技能运行在 Claude Code、Codex、Cursor 或托管 Agent 中,确定性的工作由本地 CLI 完成。参见为什么是工作流。
- 发布前必须审核。 目标、来源授权、结构和审核决策都由人来定;草稿只有通过审核才会成为已批准的 Markdown。参见知识生命周期。
- 知识跟随来源变化。 来源会固定版本,之后的变更只会重新打开受影响的页面。参见知识的持续更新。
- 一份知识,多种产物。 同一批已批准的页面可以构建出 Agent 知识包、文档站点和 LLM Docs,每种产物都通过构建清单映射回知识工作区。参见知识包与站点构建。
适合谁
当知识已经存在、但还不能直接给 Agent 使用时,Context 就能派上用场。典型需求包括:
- 把产品、架构、运维或 FAQ 文档整理成便于浏览的知识库;
- 把代码结构和解释性文档关联起来,同时保留精确的来源证据;
- 把多个仓库和多套文档合并成一个经过审核的知识包;
- 在来源变化时更新已有的知识工作区,而不必全部重建。
在一次基于真实开发者问题的对比测评中,基于 Context 知识作答的 Agent 完全解决的问题更多,工具调用次数也远少于使用 LLM Wiki 时;参见知识检索测评。
Source Graph 与 Agent Graph
工作流中的部分环节由两个配套项目承担:
- Source Graph 通过网页、MCP、HTTP 和 CLI,在固定提交上搜索和阅读仓库。Context 提供一个可选的证据插件:Agent 通过 Source Graph 阅读代码时,也能同时拿到引用这段代码的知识章节,无需克隆仓库。参见 Source Graph 定位与能力。
- Agent Graph 是 Context 工作流底层的工作契约层。Context 负责观察知识工作区事实并执行动作;Agent Graph 负责评估这些事实并选出下一个合法步骤,从而让漫长的工作流可以中断恢复、可以测试。参见为什么是 Graph Engineering和工作流运行。
如何获取
Context 以 npm CLI 加 Agent 插件的形式交付。两者只需安装一次,重启 Agent 会话后,用自然语言向 /c4a:context 入口描述你的知识目标即可。接下来请阅读安装和快速开始。