Skip to content

Core Concepts ​

How the concepts relate ​

mermaid
flowchart LR
  subgraph ws["Context knowledge workspace"]
    direction LR
    src["Sources"] --> plan["Work-start report"]
    req["Requirements"] --> plan
    plan -->|you confirm| idx["Indexers write pages"]
    idx --> cand["Candidates"]
    cand -->|Review| kn["Approved knowledge"]
  end
  kn --> pkg["Packages and sites"]

Everything lives in one Context knowledge workspace. You register sources and describe requirements; the Agent proposes what to write in a work-start report; after you confirm it, Indexers write pages that arrive as Candidates; Review admits them into approved knowledge; builds turn that knowledge into packages and sites. The terms below follow the same order. How the workflow decides each next step is explained last; you do not need it to get started.

Context knowledge workspace ​

A local directory, usually committed to Git, that holds everything about one body of knowledge:

DirectoryHolds
src/Source, phase and package declarations, plus indexers.yaml requirements
sources/Registered sources and captured evidence
knowledge/Approved knowledge and durable decisions
dist/Built packages (reproducible, ignored by Git)
.tmp/Disposable runtime state and reports (ignored)

The CLI owns writes under sources/, knowledge/, dist/ and the runtime state; the Agent edits project configuration only when the current step asks for it. Every directory and file is described in The Context Knowledge Workspace.

Sources, capture, notes and sessions ​

A source is a registered boundary: a repository module, a local document directory or an online document. Registering a source records its identity and permission boundary; it does not decide what knowledge to write and does not grant permission to read beyond it. Capture preserves document bodies and resources as auditable snapshots; repositories are read at a pinned commit and need no capture.

Every approved page records the source version it was written from. That version is the page's baseline. An update compares the new source version with the baseline, revises only the affected pages and then moves the baseline forward; see Updating Knowledge.

Notes are curated excerpts and observations; sessions are saved conversation summaries. Both are imported directly and become evidence like any other source; see Notes and Conversation Summaries.

Requirements and Indexers ​

Requirements in src/indexers.yaml record who the knowledge is for, the questions it must answer and which sources are authorized. Indexers are Agent Skills that read one kind of source and write source-grounded articles. There are four kinds of Indexer, for code, documents, notes and sessions, and each kind can have several Skills; Context ships built-in ones and teams can create their own. The Agent picks the relevant Indexers for each task during planning. See Built-in Indexers and The Indexer System.

Work-start report and managed mode ​

Before substantial new work, the Agent researches representative material and writes a work-start report: the scope, the Skills it will use and the first pages to expect. Writing starts only after you confirm it. Missing information that would change the scope is asked, not guessed. See Confirming the Work-Start Report.

In ordinary mode you also review the proposed structure and the Candidate pages. If you explicitly authorize fully managed mode, the Agent performs the review decisions that can be delegated and reports the results; human-only decisions still stop for you, and the work-start report still needs your confirmation. See Fully Managed Mode.

Candidates, Review and approved knowledge ​

Articles the Agent writes are submitted as Candidates: drafts bound to source evidence and checked for coverage and stale inputs. Review shows readable titles, paths, summaries and content; approval applies the pages to knowledge/ as durable Markdown, while rejection sends them back to writing. A rejected Candidate's status lives only in the temporary lifecycle ledger; knowledge/ holds approved pages alone.

When a round of work ends, the approved pages are applied and the outputs rebuilt: the approved pages are written into knowledge/, the record of articles and their citations is refreshed, the packages and sites you chose are built again, and the Agent commits the knowledge workspace to Git.

Each section of approved knowledge keeps its evidence: references to exact source locations. Together they form the evidence chain that lets readers and Agents verify a statement. Which articles and sections exist, and what each section cites, is recorded in knowledge/structure.yaml, refreshed when approved pages are applied. Navigation is separate: the knowledge map in src/knowledge-map.yaml decides how sites group and order pages. Moving a page in the knowledge map does not change its URL.

Packages and sites ​

A build turns approved knowledge into an output: an Agent knowledge package, a documentation site or LLM documents. Every build emits an inventory that maps distributed files back to the knowledge workspace. See Packages and Sites.

How the workflow chooses the next step ​

You can skip this until something stops unexpectedly. The CLI observes the knowledge workspace and records outcomes as Facts; conversation claims are not completion evidence. From the Facts, the workflow selects one Route: the current action, the resources to read for it and its completion contract. A Gate pauses a Route for a decision that needs a person or additional authority, such as confirming the work-start report or a review. That is why a task can be interrupted and resumed: the next step is recomputed from the workspace, not remembered by the Agent. See Workflow Execution.

核心概念 ​

概念之间的关系 ​

mermaid
flowchart LR
  subgraph ws["Context 知识工作区"]
    direction LR
    src["来源"] --> plan["开工报告"]
    req["需求"] --> plan
    plan -->|你确认| idx["Indexer 写作页面"]
    idx --> cand["候选"]
    cand -->|审核| kn["已批准的知识"]
  end
  kn --> pkg["知识包与站点"]

所有内容都放在同一个 Context 知识工作区里。你登记来源、描述需求;Agent 在开工报告中提出要写什么;你确认后,Indexer 写出页面,以候选的形式提交;审核把它们收录为已批准的知识;构建再把这些知识产出为知识包和站点。下面的术语按同样的顺序介绍。工作流如何决定下一步,放在最后说明,入门时不需要了解。

Context 知识工作区 ​

一个本地目录,通常提交到 Git,保存某一套知识的全部内容:

目录存放内容
src/来源、阶段和知识包的声明,以及 indexers.yaml 中的需求
sources/已登记的来源和采集到的证据
knowledge/已批准的知识和长期有效的决策
dist/构建出的知识包(可复现,被 Git 忽略)
.tmp/可随时丢弃的运行时状态和报告(被忽略)

sources/、knowledge/、dist/ 和运行时状态都由 CLI 负责写入;只有当前步骤要求时,Agent 才会修改项目配置。每个目录和文件的说明见 Context 知识工作区。

来源、采集、笔记与会话 ​

来源是一条登记过的边界:一个仓库模块、一个本地文档目录或一篇在线文档。登记来源会记录它的身份和权限边界;它不决定要写哪些知识,也不授予读取边界之外内容的权限。采集把文档正文和资源保存为可审计的快照;仓库按固定提交读取,无需采集。

每个已批准的页面都会记录它所依据的来源版本,这个版本就是页面的基线。更新时,会把新的来源版本与基线比较,只修订受影响的页面,然后把基线前移;参见 更新知识。

笔记是整理过的摘录和观察;会话是保存下来的对话摘要。两者都直接导入,和其他来源一样成为证据;参见 笔记与会话摘要。

需求与 Indexer ​

src/indexers.yaml 中的需求记录了知识写给谁、必须回答哪些问题、授权使用哪些来源。Indexer 是 Agent Skill,每个负责读取一类来源并写出有来源依据的文章。Indexer 分为代码、文档、笔记和会话四类,每类可以有多个 Skill;Context 内置了一些,团队也可以自行创建。Agent 在规划时为每个任务挑选合适的 Indexer。详见 内置 Indexer 和 Indexer 体系。

开工报告与全托管模式 ​

开始实质性的新工作前,Agent 会调研有代表性的材料,并写一份开工报告:范围、将使用的 Skill,以及预计最先产出的页面。只有你确认后才开始写作。会改变范围的缺失信息会向你询问,而不是猜测。参见 确认开工报告。

在普通模式下,你还要审核拟定的结构和候选页面。如果你明确授权全托管模式,Agent 会执行可委托的审核决定并汇报结果;只能由人做的决定仍会停下来等你,开工报告也仍需你确认。参见 全托管模式。

候选、审核与已批准的知识 ​

Agent 写出的文章以候选的形式提交:它们是绑定了来源证据的草稿,并核对覆盖度与输入是否过期。审核展示可读的标题、路径、摘要和内容;批准后,页面以长期保存的 Markdown 写入 knowledge/,拒绝则退回重写。被拒绝候选的状态只保存在临时的生命周期账本中;knowledge/ 只存放已批准的页面。

一轮工作结束时,会应用已批准的页面并重建产出:已批准的页面写入 knowledge/,文章及其引用的记录随之刷新,你选定的知识包和站点重新构建,Agent 再把知识工作区提交到 Git。

已批准知识的每个小节都保留自己的证据,即指向来源确切位置的引用。它们共同构成 证据链,让读者和 Agent 能够核实每一处陈述。有哪些文章和小节、每个小节引用了什么,都记录在 knowledge/structure.yaml 中,并在应用已批准页面时刷新。导航是另一回事:src/knowledge-map.yaml 中的知识地图决定站点页面如何分组与排序。在知识地图中移动页面不会改变它的 URL。

知识包与站点 ​

构建把已批准的知识变成一种产出:Agent 知识包、文档站或 LLM 文档。每次构建都会生成一份清单,把分发出去的文件对应回知识工作区。详见 知识包与站点构建。

工作流如何选择下一步 ​

在流程意外停下之前,你可以跳过这一节。CLI 观察知识工作区,并把结果记录为 Facts;对话中的说法不能作为完成的证据。工作流根据 Facts 选出一个 Route:当前要做的动作、为此要读的资源以及它的完成约定。Gate 会让 Route 暂停,等待需要人或更高权限做出的决定,例如确认开工报告或审核。正因如此,任务可以中断后再恢复:下一步是根据知识工作区重新计算的,而不是靠 Agent 记住。详见 工作流运行。