Codebase knowledge layer for AI coding agents
Project description
Corpis
A codebase knowledge layer for AI coding agents. Corpis analyses every source file in your project, distils each one into a structured logic record (purpose, mechanics, decision history), and makes the whole thing queryable in plain English.
Every AI agent working in your repo — Claude, Gemini, GPT — can query Corpis before reading source files, getting instant grounded answers without burning context.
Install
pip install corpis
Quickstart
cd my-project
corpis init # scaffold corpis/, create .env, write agent instruction files
# add your OPENAI_API_KEY to corpis/.env
corpis genesis # ingest the codebase (run once)
corpis query # start asking questions
Commands
| Command | Description |
|---|---|
corpis init |
Scaffold Corpis in the current project |
corpis genesis [--reset] |
Ingest all source files into the knowledge corpus |
corpis query |
Interactive TUI chat interface (or pipe: echo "question" | corpis query) |
corpis update <file> "<why>" |
Update a file's record after a code change |
corpis delete <file> |
Remove a file's record from the corpus |
corpis cache |
Browse the semantic answer cache |
How it works
-
Genesis — walks your repo, sends each file to GPT-4o, and writes a structured logic record: what the code does, why it exists, and how it works. Records are stored in
corpis/docs/organised by business domain. -
Query — two-stage agentic retrieval: scout (semantic search across all records) → AI selects the most relevant ones → synthesise a grounded answer. Answers are cached semantically so identical or paraphrased questions return instantly.
-
Update — after every code change, run
corpis update <file> "<why>". The record gets a new dated changelog entry and any stale cached answers are invalidated automatically.
Agent integration
corpis init writes instruction files for every major AI coding agent:
CLAUDE.md— imperative instructions for Claude CodeAGENTS.md— instructions for OpenAI Codex / GPT agentsGEMINI.md— instructions for Gemini CLI
Agents are instructed to query Corpis before reading source files and to run corpis update after every change — keeping the knowledge corpus current without any manual effort.
Requirements
- Python 3.9+
- OpenAI API key (used for embeddings and synthesis)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file corpis-0.1.2.tar.gz.
File metadata
- Download URL: corpis-0.1.2.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cf72231ed1f991029962b67d2dcf9faa9f344402aecfae34cbd23e0f0918cff
|
|
| MD5 |
e25b76e6f2380be74aa3fc05c28220c6
|
|
| BLAKE2b-256 |
eedcd37253447e982fd916e800bf641726329113d7b664c50a2b1708cdc0d7dd
|
File details
Details for the file corpis-0.1.2-py3-none-any.whl.
File metadata
- Download URL: corpis-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b2075ac8615ce4dcf40abbb567b570b7f3c32f73322d98dc4904d5aa4ef221
|
|
| MD5 |
8e1fedda5e19479001477efb08fc0dad
|
|
| BLAKE2b-256 |
81b6b41c51b5781dc02a6e34e413ac0f988be28fcbf9c3dfea5f9f791b26190e
|