Skip to content
context4aiPublic

About

A knowledge workflow for engineering teams and their AI agents: turn code, documents and notes into reviewed, versioned knowledge with traceable evidence.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

170 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Context

CI npm version Node.js License: MIT

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:

Watch the 4-minute introduction to Context

Why 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.

Quick start

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 install

This 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@c4a

Restart 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.

How it works

Context knowledge workflow: production, updates and retrieval

  1. Register sources — repositories at pinned revisions, document directories, notes and conversation summaries.
  2. Capture evidence — document bodies, code symbols, relationships and source fingerprints.
  3. Plan the structure — the Agent proposes collections, pages and sections for confirmation.
  4. Write reviewable drafts — every section stays bound to its evidence and is checked for coverage and stale inputs.
  5. Review and approve — through an HTML review report, or delegated to the Agent when you choose.
  6. 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.

Outputs

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).

Ecosystem

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

Repository layout

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.

Documentation

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.

Contributing

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 verify

Read 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.

License

MIT. Third-party components are listed in THIRD_PARTY_NOTICES.md.

About

A knowledge workflow for engineering teams and their AI agents: turn code, documents and notes into reviewed, versioned knowledge with traceable evidence.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages