
Distills code and database knowledge into a persistent, governed map of the entire repository—helpin
Distills code and database knowledge into a persistent, governed map of the entire repository—helpin
AOCI-CODE is an indexing method that establishes global software-project cognition for AI Agents and provides a persistent, governable repository cognition map.
English | 简体中文
1.1 Keep developing a system inside a Code Agent. In Codex, Claude Code, Cursor, OpenCode, and similar Agents, grow a system from nothing into a complete 500,000-line codebase plus its database. The Agent always works with the whole-system cognition the AOCI index provides instead of searching and re-reading the entire codebase for every task. Non-professional developers can keep iterating on their own systems; professional developers can hand the whole system to an Agent for collaborative evolution and keep their attention on architecture and design decisions.
1.2 Understand an existing system in one step and take over its development. For an existing system of up to 500,000 lines, one sentence has the Agent build whole-system cognition; it reports how well it has mastered the system, then takes over development seamlessly. The supported scale is set by the index size, not by the line count as such: in practice a 700,000-line commercial system is developed this way today, with an index of about 300K tokens.
1.3 Change the people, the Agent, or the conversation without losing cognition. The index lives in the repository next to the code and is versioned by Git. When a project changes its project manager or developers, switches to another Agent, or opens a new conversation, one read of the index picks up where things left off, seamlessly across Agents and conversations.
1.4 After the first index, maintenance is automatic. The MCP detects code changes and issues the Entries that need updating; the Agent fills them in as it finishes each development task, so the index always matches the current code version and development is never interrupted.
2.1 The first index takes time. The Agent reads every managed file and writes one Entry per file, so a larger system takes longer: about 1 hour for 200,000 lines of code, depending on the model and the Agent's speed. The index is built in batches, and an interrupted build resumes where it stopped.
2.2 For a system with a database, build the database index too. MySQL and PostgreSQL are supported, and openGauss 6.0.5 with constraints. Build the code index first, then the database index; when code cognition and table-level cognition are delivered together, the Agent understands the system more completely.
2.3 Read-only on your system, no Internet, no stored credentials. AOCI-CODE only reads your source code and database table structures, never business data. It writes its index files and its own state inside the project directory, plus the status page's registration in your user cache directory. It never reaches the Internet and uploads nothing: the only connections it opens are to the database you declare, for catalog metadata, and its own loopback status page. Database credentials are referenced only by environment-variable name, never stored. The index text is written locally by your own Agent through the model channel you already use; AOCI-CODE adds no new data exit.
Give the following instruction to your AI Agent to download AOCI-CODE and integrate it; after restarting the Agent, send the second instruction to build the index:
…After restarting the Agent, send this one:
First confirm the AOCI MCP server is connected, then build the AOCI index for this project. When it is complete, give me the AOCI panel link.The Agent starts the panel in the background with aoci ui --detach --json and hands you the link; what the panel shows and its other commands are under “AOCI panel”.
The index is authored through AOCI's MCP tools, and the MCP server that init has just written was not loaded in the session that wrote it, so index building has to follow the restart. A host that loads MCP servers dynamically may not need one; “Host integration” explains how to tell.
If your project has a database (PostgreSQL and MySQL are supported, plus constrained openGauss 6.0.5), building a database index is recommended as well. First declare the source as described under “Database Cognition” and provide the connection-string environment variable in the host environment (AOCI stores no credentials), then send:
Build the AOCI database index for this project.If the context has been compacted, or you want the Agent to re-establish its cognition of the system, send this:
Using only AOCI, establish whole-framework cognition of this project, tell me your mastery of each area as a percentage, and whether you can take over development.AOCI (AI-Oriented Cognition Infrastructure) is cognition infrastructure positioned between AI Agents and software systems.
Large models handle reasoning, Agents handle planning and execution, and AOCI organizes code, configuration, tests, and database structures into continuously maintainable system cognition bound to the current system version, for Agents to read and understand before acting.
AOCI-CODE originates from AOCI. Put simply, AOCI-CODE distills the information from source code, database structures, and other assets that materially affects how AI understands and modifies a system into a high-information-density, plain-text index combining symbols and semantics.
AOCI-CODE applies this method to projects through the aoci CLI and MCP Server.
When model context is limited, an AI Agent can read the index first, acquire most of the project’s key information in one pass, and then enter a specific development task. This reduces repeated searching and code re-learning while improving continuity across tasks and sessions.
Names in this document have the following roles: AOCI refers to the cognition paradigm and protocol, while AOCI-CODE refers to the project and the index itself that embody this method.
In the current Volume-first layout, AOCI-CODE organizes the index as governed, plain-text cognition assets stored with the project:
aoci.txt): declares the composition and activation entry point of the current CognitionSet;aoci.meta.txt): stores the tag dictionary, FRAS rules, and model-authoring constraints;aoci.code.txt): stores model-authored cognition for code and other repository assets;aoci.database.txt): stores optional table-level cognition when Database Cognition is enabled.Root, Meta, and participating object Volumes together form the current Whole-Index. On top of these assets, the workflow has three stages:
index role.aligned.These plain-text cognition assets are stored with the project and can be versioned with Git. When cognition remains aligned with the current system version, different AI Agents and later sessions can read and reuse the same Whole-Index.
Obtain AOCI-CODE from canonical source or use a signed package from GitHub Releases. Before using a prebuilt binary, follow the basic, recommended, or full verification level in the installation guide, and report which level completed. Give this README and the verified binary's stable absolute path to a trusted AI Agent such as Codex, Claude Code, Cursor, or OpenCode. The AI Agent can follow the in-project instructions to initialize AOCI, integrate MCP, and build the first index.
The time required to generate complete cognition for the first time depends on repository size. A normal integration consists of preparing the binary, having the AI Agent or user initialize the target repository, asking the host to “build the index,” and verifying alignment. Subsequent development does not require a repeated “maintain the index” reminder at the end of every request; project rules and the AOCI MCP workflow guide the AI Agent through incremental cognition maintenance after managed objects change.
go.mod, make, and the other tools required by the repository;The signed-package route and executable verification commands are in the installation guide. The source-build route remains available below.
[!IMPORTANT] AOCI-CODE v0.1.0-rc13 is the current release candidate. It is Fair Source/source-available software under FSL-1.1-MIT; see LICENSE. Build from canonical source or use a signed package from the v0.1.0-rc13 GitHub Release after following the release verification procedure.
The signed Release binary identifies itself as aoci version 0.1.0-rc13. A
source build identifies the exact checkout instead and may report a development
version such as v0.1.0-rc13-1-g (plus -dirty when applicable),
together with its Git commit. These identify different build inputs and are not
a version conflict.
To download with GitHub CLI, authenticate first, then download the tagged Release assets:
gh auth login
gh release download v0.1.0-rc13 --repo aoci-spec/aoci-codeFor an anonymous download, use the v0.1.0-rc13 Release page in a browser and download the required archive and verification assets there.
Clone the canonical repository, build the binary, and keep its resulting path stable:
git clone https://github.com/aoci-spec/aoci-code.git
cd aoci-code
mkdir -p build
make build
./build/aoci --versionOn Windows, build the same canonical source in PowerShell:
git clone https://github.com/No open issues yet, or sync has not completed.