AI coding agents normally start every session with amnesia—re-diagnosing previous bugs, re-discovering project conventions, and repeating expensive investigation work.
Cairn solves this by equipping agents with a local, zero-config semantic graph and strict verification engine. It captures questions, solutions, evidence, and dependencies directly as you work.
- Semantic Memory Graph: Local vector embeddings (
sqlite-vec) for fast context retrieval. - Pre-Edit Research Gate: Requires agents to search prior knowledge and decompose tasks before altering code.
- Execution & Plan Verification: Interactive task checklists with verifiable completion gates.
- 100% Local & Private: Embedded SQLite storage on your machine. Zero cloud accounts, zero telemetry leakage, zero API keys required.
- Universal Host Support: Native hooks and MCP protocols for GitHub Copilot CLI, Claude Code, and OpenAI-compatible proxies.
macOS / Linux / WSL2:
curl -fsSL https://raw.githubusercontent.com/czearing/cairn/main/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/czearing/cairn/main/scripts/install.ps1 | iexThe installer configures Bun (if needed), registers Cairn's MCP tools with your agent hosts, downloads the local embedding model, and verifies memory recall.
cairn doctorLaunch the local interactive visualizer:
cairn uiOpens a high-performance graph viewer at http://localhost:3737.
Cairn exposes standardized MCP tools directly to agent runtimes:
| Tool | Purpose |
|---|---|
brain_search |
Performs semantic search across prior discoveries and related graph questions. |
brain_create |
Declares an atomic question node linked into the knowledge graph. |
brain_mutate |
Answers a question node with citation-backed evidence or updates links. |
brain_delete |
Removes a specific node and detaches its graph edges. |
plan |
Declares structured task items and tracks verified completion in real time. |
cairn doctor # Verify host registrations, SQLite vector engine, and dependencies
cairn verify # Execute an end-to-end embedding and recall smoke test
cairn ui # Start the local knowledge graph visualizer (localhost:3737)
cairn compact # Reclaim fragmented SQLite storage and optimize vector indexes
cairn pref # Manage global agent workflow preferences
cairn proxy # Launch OpenAI-compatible proxy (localhost:11435/v1) for legacy tools
cairn update # Pull latest updates and re-build local binaries
cairn uninstall # Cleanly remove hooks and MCP registrations (preserves local database)prompts/ # Concise, high-density workflow prompts and turn reminders
src/core/ # SQLite engine, vector embeddings, graph lifecycle, and telemetry
src/mcp/ # MCP server implementation and tool dispatch
src/hosts/ # Host integrations for GitHub Copilot CLI and Claude Code
src/ui/ # Interactive graph visualization dashboard
MIT © czearing
Settings are environment variables. CAIRN_DB_PATH sets where the database lives and
CAIRN_EMBED_PROVIDER swaps the embedding model for a hosted one.
See CONTRIBUTING.md. Tests run with bun test from the repo root.
MIT licensed.