Give your AI coding agent a knowledge graph that compounds.
Entities, relationships, signals. All local. Zero config.
pip install xarc-brain
claude plugin marketplace add X-Arc-ai/brain-plugin
claude plugin install brain@x-arcThen in any project:
cd your-project
brain init --yesThat's it. Your agent maintains the graph automatically.
Every conversation follows a cognitive loop:
- Scan -- query the graph for context before responding
- Respond -- with full awareness of entities, relationships, and history
- Write -- capture new information back to the graph
This loop is enforced by hooks that fire automatically. You don't need to remember to use the brain. It's architecturally guaranteed.
| Skill | Purpose |
|---|---|
/brain-init |
Initialize brain for the current project |
/brain-dream |
Run maintenance: hygiene checks, signals, conversation replay |
| Hook | When | What |
|---|---|---|
| Brain reminder | Before each prompt | Reminds Claude to scan the graph for context |
| Write validation | Before brain write |
Validates required edges (goals need people, blockers need targets) |
| Cognitive loop check | On session end | Blocks if brain was never queried or dual-write was missed |
| Auto-dream | On session end | Triggers brain dream if >24h since last run |
The plugin includes instructions that teach Claude the cognitive loop:
- Scan before responding (topology map)
- Assess which nodes are relevant
- Dive into key nodes (deep context)
- Dual-write after responding (file + graph)
Brain stores entities (projects, people, goals, tasks, blockers, decisions, events), relationships between them (who owns what, what blocks what, what depends on what), and temporal signals (what's stale, what's stuck, what just shipped).
This is the actual brain of CCL, the AI agent that built this tool. 320 nodes, 975 edges, 6 months of compounding memory across multiple companies, projects, and people.
Your agent builds this over time. Every conversation adds to the graph.
pip install 'xarc-brain[embeddings]'
# Set OPENAI_API_KEY in your environment
brain embed backfill
brain search-semantic "authentication flow"pip install xarc-memory
# brain init and brain dream will index past Claude Code conversationsyour-project/
.brain/ Brain data (add to .gitignore)
db/ Kuzu embedded graph database
exports/ Visualization data
viz/ Cytoscape.js graph visualization
config.json Type tiers, custom settings
CLAUDE.md Brain instructions (auto-installed)
- Kuzu -- embedded graph database, no server
- Rich -- terminal formatting
- Click -- CLI framework
- Cytoscape.js -- graph visualization (bundled offline)
~3,500 lines of Python. Fully auditable. No magic.
Nothing leaves your machine. No cloud services. No telemetry. The only
optional external call is OpenAI for semantic search embeddings, and that's
opt-in via pip install 'xarc-brain[embeddings]'.
This project was built by CCL, an AI agent deployed on X-Arc's CCX platform. CCL manages operations, builds tools, and ships code across multiple projects. Brain started as CCL's internal memory system. After 6 months of daily use (320 nodes, 975 edges, 5 signal types, 7 hygiene checks running nightly), CCL packaged and open-sourced it.
X-Arc deploys AI agents that ship real work. Manage it like a hire. It works like ten.
