Agent Cairn
Stores and queries project memories as a graph in Neo4j, enabling persistent shared memory across AI coding agent sessions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agent Cairngive me a briefing on this project's conventions and gotchas"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Cairn
Shared, persistent project memory for AI coding agents.
A cairn is a stack of stones that earlier hikers leave so the next one knows the way. Agent Cairn does that for agents: one records what it learned, the next one picks up the trail.
An AI agent that opens your project cold has to read files, guess conventions and ask you to explain things you have explained before, and it does that again on every new session, machine and account. Agent Cairn gives agents a shared memory stored in Neo4j: what the project is, how it is built, the traps that cost time, the decisions made and why. Any agent connecting through MCP starts from a compact, token-budgeted briefing instead of re-reading the repository.

How it works
Claude Code ──MCP over HTTP + token──► Agent Cairn server ──bolt──► Neo4j
(any machine, hooks + CLI (Docker) (graph)
any account) │
dashboard at /ui/Agents write the memories. Through MCP tools (
cairn_remember,cairn_checkpoint) an agent records what it learns. The server never calls an LLM: no API key, no per-token cost, and it works with any MCP-capable agent.Briefings instead of crawling.
cairn_briefingassembles the most important memories for a project within a token budget: overview, conventions, gotchas, open threads, recent checkpoints, decisions.Memories know when they are stale. Each memory records the commit and files it was written about. If those files have changed, the briefing flags it.
History is kept. A changed fact supersedes the old one rather than overwriting it, so concurrent agents cannot clobber each other and the reasoning trail survives.
One memory per project, across machines. A project is identified by an explicit id or by its (normalized, hashed) git remote, so every clone resolves to the same memory.
You can see everything. A built-in dashboard shows every request as it happens, the memory graph, and lets you manage access.
Related MCP server: DecisionsSearch
Quick start
You need Docker. Everything below runs on your own machine or server.
1. Start the server and a Neo4j to go with it
git clone https://github.com/itsmemac/agentcairn.git && cd agentcairn
cp .env.example .env # set NEO4J_PASSWORD
docker compose --profile with-neo4j up -d
docker compose logs cairn # the first start prints a one-time setup codeAlready running Neo4j? Set NEO4J_URI in .env and run docker compose up -d cairn instead.
2. Create your admin account. Open http://localhost:8787/ui/, enter the setup code from the log, choose a username and password.
3. Connect an agent. In the dashboard, create a token (Access → Create token). Then, once per machine:
claude mcp add cairn --scope user -e CAIRN_URL=http://localhost:8787 -e CAIRN_TOKEN=<token> -- npx -y agentcairn mcpThat is the whole install. It works in every folder: the project comes from the folder's git remote (or its .cairn.json), so there is nothing to configure per repository. Start Claude Code in a project and ask it to call cairn_status. The first cairn_briefing of an empty project returns instructions that walk the agent through recording what it learns about the repository.
4. Optional: hooks and an explicit project id. The cairn CLI (npx -y agentcairn) links a folder to a project and installs Claude Code hooks that inject the briefing at session start and remind the agent to checkpoint. See Using it with Claude Code.
The CLI is on npm as
agentcairn. Run it withnpx -y agentcairn <command>, ornpm install -g agentcairnto get thecairncommand.
The dashboard
|
|
Graph: the project at the root, its areas, and the memories under each. Nodes glow when an agent reads or writes them. | Projects: every memory with its kind, area, importance, author and commit. |

Live: every request with its payload, latency and the memories it touched; throughput, per-tool latency, clients online.
Projects and Graph: browse, search and explore memories; follow supersede chains.
Query: a read-only Cypher console.
Access: create and revoke tokens, copy ready-made connection commands.
System: server and Neo4j health, graph size, security and capture settings.
Dark and light themes, phone-friendly. Request payloads are kept in memory only (the last 2,000) and Authorization headers are never recorded.
What agents get
Tool | Purpose |
| Start here: a budgeted briefing, or onboarding instructions for an empty project |
| Search memories by text, kind and area |
| Record a decision, convention, gotcha, overview, open thread or glossary term |
| Record a finished goal, its decisions, and what is next |
| List the areas memories are filed under |
| Delete a memory that was wrong |
| Health check: connection, project, counts |
Documentation
Self-hosting: Docker, TLS, upgrades, backups, troubleshooting
Unraid: running it on an Unraid server
Using it with Claude Code: connecting, project identity, hooks
Configuration: every setting and file
Architecture: data model, briefings, staleness, security model
Repository layout
Package | What it is |
Schema, memories, briefings, project identity, accounts and graph queries on Neo4j | |
The MCP server (HTTP, plus a local stdio mode), the JSON API and the dashboard | |
The |
Development
npm install
cp .env.example .env # point NEO4J_URI at a throwaway Neo4j (see CONTRIBUTING.md)
npm test # builds, then runs every package's testsThe integration tests run against a real Neo4j, so use a disposable instance. See CONTRIBUTING.md.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared project memory for AI coding agents: decisions, lessons, risks and tasks in one graph.
Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with persistent, graph-connected memory across projects, enabling cross-project context retrieval via synaptic connections and hybrid search.6 npm8MIT
- AlicenseBqualityBmaintenanceProvides persistent hybrid memory (Neo4j + Qdrant) for AI agents, enabling durable recall of decisions, business rules, and code patterns across sessions, plus autonomous CI/CD error investigation.471MIT
- AlicenseNot gradedqualityDmaintenanceProvides coding agents with persistent graph-backed memory, storing decisions, reasons, and contradictions across sessions so conversations pick up where they left off.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceGives AI coding agents persistent, branch-aware memory and a dependency-tracked task graph by storing decisions, lessons, and tasks as plain JSON and Markdown committed directly into the repository. Agents can record and fuzzy-search past decisions, dump instant project context, and create, claim, complete, and query tasks whose completion automatically unblocks downstream work.MIT

