Adaptive, file-based project knowledge for AI coding agents
Project description
agent-knowledge
Persistent, file-based project memory for AI coding agents.
One command gives any project a knowledge vault that agents read on startup, maintain during work, and carry across sessions -- no database, no server, just markdown files and a CLI.
Install
pip install agent-knowledge-cli
Quick Start
cd your-project
agent-knowledge init
Open Cursor, Claude, or Codex in the repo -- the agent picks up from there.
init automatically:
- infers the project slug from the directory name
- creates an external knowledge vault at
~/agent-os/projects/<slug>/ - symlinks
./agent-knowledgeinto the repo as the local handle - detects Cursor, Claude, and Codex and installs integration files
- bootstraps the memory tree and marks onboarding as
pending - prints the prompt to kick off first-time agent ingestion
How It Works
your-project/
.agent-project.yaml # project config
AGENTS.md # instructions agents read on startup
agent-knowledge/ # symlink -> ~/agent-os/projects/<slug>/
STATUS.md # onboarding state + sync timestamps
Memory/
MEMORY.md # root entrypoint (read first)
stack.md # flat branch note
perception/
perception.md # branch entry (same name as folder)
fusion.md # subtopic note
decisions/
decisions.md # decision log
Evidence/ # imported/extracted material
Outputs/ # generated views (never canonical)
Sessions/ # ephemeral session state
Knowledge lives outside the repo so it persists across branches, tools,
and clones. The symlink gives every tool a stable ./agent-knowledge path.
When an agent opens the repo it reads AGENTS.md and STATUS.md.
If onboarding is pending, it inspects the project, imports evidence,
infers the ontology from the actual repo, and writes curated memory.
After that, maintenance is automatic.
Branch Convention
The memory tree uses a same-name branch-note convention:
- Flat note (
stack.md): for topics with no subtopics - Folder (
perception/perception.md): for topics that grow subtopics - Folder name = topic, entry note = same name as folder
- Agents infer the branch structure from the real project -- no fixed profiles
The agent starts small (2-4 branches) and grows the tree only when justified. Hooks stay thin -- they detect changes and trigger updates, not rebuild the ontology.
Commands
| Command | What it does |
|---|---|
init |
Set up a project (zero-arg, auto-detects everything) |
sync |
Push memory updates + extract git evidence |
doctor |
Validate setup and report health |
update |
Sync project changes into the knowledge tree |
import |
Import repo history into Evidence/ |
ship |
Validate, sync, commit, push |
setup |
Install global Cursor rules and skills |
global-sync |
Import safe local tooling config |
measure-tokens |
Estimate context token savings |
All write commands support --dry-run. Use --json for machine-readable output.
Multi-Tool Support
init detects which tools are present and installs the right bridge files:
| Tool | Bridge file | When installed |
|---|---|---|
| Cursor | .cursor/hooks.json + .cursor/rules/agent-knowledge.mdc |
Always (hooks/rules are inert outside Cursor) |
| Claude | CLAUDE.md |
When .claude/ directory is detected |
| Codex | .codex/AGENTS.md |
When .codex/ directory is detected |
Multiple tools in the same repo work together.
Obsidian
Open ~/agent-os/projects/<slug>/ as an Obsidian vault. The knowledge graph
shows all memory areas, evidence, and dashboards connected through wiki-links.
Enable Graph view in Settings > Core plugins and set
Files and links > Use [[Wikilinks]] to ON for the best experience.
Custom Knowledge Home
export AGENT_KNOWLEDGE_HOME=~/my-knowledge
agent-knowledge init
Platform Support
- macOS and Linux are fully supported.
- Windows is not currently supported. The CLI relies on
bashand POSIX shell scripts for most operations. - Python 3.9+ is required.
Development
git clone <repo-url>
cd agent-knowledge
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
python -m pytest tests/ -q
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 agent_knowledge_cli-0.1.2.tar.gz.
File metadata
- Download URL: agent_knowledge_cli-0.1.2.tar.gz
- Upload date:
- Size: 85.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ecc96825e0064615c4f0dd04223ba61ac417086ac90107dc4a6c350e40a5ee4
|
|
| MD5 |
f3b9464c7ed2241bbc1a28672e6f4c25
|
|
| BLAKE2b-256 |
2833b2b320b7714e6d38110164415f399b7c06ccf5f29a022777bf59ff5f5fef
|
File details
Details for the file agent_knowledge_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: agent_knowledge_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 124.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b589b9cdad081babb4156b48e4ca9728a450b621ef545d361f79dfc8a1e445
|
|
| MD5 |
161c36ab012ba77fc68f44f064c522c7
|
|
| BLAKE2b-256 |
913b9d4d02705a0d3d94c38558ab8d64a52947a5ed23206f48e903cb870c35bb
|