A knowledge workflow for engineering teams and their AI agents.
Context turns code repositories, documents, notes and conversations into reviewed, versioned knowledge in which every claim leads back to its source. Agents read the knowledge first and follow its evidence chain to the original only when they need exact detail.
Documentation · Quick Start · 简体中文 · Contributing · Release Notes
Watch the 4-minute introduction to Context:
- Knowledge as an index. Indexer Skills extract what matters from each source and stack into a compact knowledge base, typically around 1/100 of the source size, and record where every claim came from.
- Evidence you can follow. Each section keeps its file, line range and revision, so an Agent can read the original remotely instead of cloning and searching it again. See Evidence Chains.
- A workflow, not a summarizer. Sources, structure, drafts, review and builds are explicit steps with recorded decisions. A team can stop, resume, review and update the same workspace over months.
- Updates and versions. When sources move, Context compares what changed, updates only the affected pages, and records a version with a changelog.
- Several outputs from one workspace. Agent knowledge packages, multilingual documentation websites, LLM documents and package Skills.
On real developer questions from a large team and production monorepo, Agents using Context knowledge resolved more questions in less than half the time and about a ninth of the cost of a plain LLM Wiki setup. See the Knowledge Retrieval Benchmark for the method and results.
You need Node.js 20 or newer and Bun, which knowledge workspaces use to install their dependencies. Install the CLI and its Agent plugin once. The plugin is installed for the Claude Code, Codex and Cursor hosts that are available on the machine:
npm install -g @c4a/context-cli@latest
context plugin installThis repository is also a plugin marketplace. In Claude Code or Codex you can
add it and install the c4a plugin through the host instead of
context plugin install; the CLI is still required, because the plugin
delegates the workflow and the bundled Indexers to it:
claude plugin marketplace add context4ai/context && claude plugin install c4a@c4a
codex plugin marketplace add context4ai/context && codex plugin add c4a@c4aRestart the Agent session and describe the knowledge you want:
/c4a:context Build an Agent knowledge package from this repository and our
architecture documents. Keep code references traceable and ask me before
approving the final structure.
You do not need to learn lifecycle commands first. The Agent follows the workflow, asks when a decision is yours, and reports what it produced. Continue with Installation and The Workflow at a Glance.
| Entry | Use it to |
|---|---|
/c4a:context |
Create, produce, update, review and build a knowledge workspace |
/c4a:context-plan |
Plan a large project or a broad source update in stages |
/c4a:context-inspect-search |
Answer questions from knowledge and trace answers to their sources |
/c4a:context-repo-content |
Maintain same-repository docs and Skills without starting production |
The Code, Markdown, Note and Sessions Indexer Skills are selected by the workflow rather than invoked directly. See Commands and Skills.
- Register sources — repositories at pinned revisions, document directories, notes and conversation summaries.
- Capture evidence — document bodies, code symbols, relationships and source fingerprints.
- Plan the structure — the Agent proposes collections, pages and sections for confirmation.
- Write reviewable drafts — every section stays bound to its evidence and is checked for coverage and stale inputs.
- Review and approve — through an HTML review report, or delegated to the Agent when you choose.
- Verify, version and build — the approved workspace becomes the declared outputs.
The workflow is defined with Agent Graph: current workspace facts select the next legal step, and the Agent loads only the procedures that step needs. Re-entering a workspace resumes from its real state rather than from the conversation. Watch a sanitized replay of a real run or read Why a Workflow.
Context itself never calls a model. The user owns goals, source permissions and review decisions; the Agent reads evidence, proposes structure and writes; Context records facts, validates evidence, applies decisions and builds deterministically. See Core Concepts.
| Output | Description |
|---|---|
| Knowledge package | Approved knowledge for Agents, with indexes, optional Skills and query helpers |
| Documentation site | A static website with search, a knowledge-map navigation and multiple languages |
| LLM documents | llms.txt and consolidated text for model context and evaluation |
Every build emits an inventory that maps distributed files back to approved knowledge. Context stops at a complete local build; publishing belongs to your hosting or registry tooling. The Context documentation is itself a Context workspace, built from this repository and its sibling projects (source).
| Project | Role |
|---|---|
| Agent Graph | Graph Engineering for Agent Skills; the runtime behind the Context workflow |
| Source Graph | Code search and reading at pinned Git revisions; Context reads code evidence through it remotely |
| Portal | context4ai.org: the homepage and the documentation site |
You install one package, @c4a/context-cli. It provides the context command
and the Agent plugin, and bundles the code extractors. Knowledge workspaces it
creates depend on @c4a/context.
| Path | Contents |
|---|---|
packages/context-cli |
@c4a/context-cli: the CLI, workflow runtime, Agent plugin and website builder |
packages/context |
@c4a/context: the SDK a workspace's src/index.ts uses to declare sources and outputs |
plugins/context |
Skills and Indexers shipped in the Agent plugin |
packages/core, packages/extract* |
Shared contracts and language extractors bundled into the CLI |
packages/dev-cli, packages/tui |
Tools for developing and releasing this repository |
Each package has its own README. Module Layout explains how the packages depend on each other and where a change lands; ARCHITECTURE.md covers the internals.
| Section | Start with |
|---|---|
| Getting Started | What is Context · Quick Start · The Knowledge Workspace |
| Guides | Registering Sources · Updating Knowledge · Asking Questions · Creating an Indexer · Building a Knowledge Service |
| How It Works | Architecture Overview · Knowledge Lifecycle · Knowledge for Agents |
| Reference | CLI Commands · Project API · Skills · FAQ |
The documentation site has an LLM-ready version for Agents. Package-level references stay in this repository: the SDK guide, the Agent integration guide and the plugin contract.
Context uses Bun for development; published packages run on Node.js 20 or newer.
git clone https://github.com/context4ai/context.git
cd context
bun install
bun run verifyRead CONTRIBUTING.md before opening a pull request and DEVELOPMENT.md for local CLI, plugin, verification and release workflows. Questions go to GitHub Discussions (see SUPPORT.md); vulnerabilities follow SECURITY.md. Participation is governed by the Code of Conduct.
MIT. Third-party components are listed in THIRD_PARTY_NOTICES.md.
