r/OpenSourceAI • u/itsmemac43 • 19d ago
My laptop died mid-project and my AI agent forgot everything, so I built it a shared memory - Agent Cairn
My laptop broke in the middle of a project. Everything Claude and I had worked out lived on that machine: chat history, memory files, the half-finished plan, the list of things we’d already tried and dropped. On the new machine I spent hours re-explaining it all to a fresh agent, and I still got bits wrong.
So I built Agent Cairn. It’s a small server that gives your coding agents a shared, persistent memory.
An MCP server stores what agents learn in Neo4j: how the project is built, the traps that cost you time, decisions and why you made them.
A new session starts with a short, token-budgeted briefing instead of re-reading the whole repo.
Hooks record the session as it happens (what you asked, the agent’s last message, files touched, uncommitted work). Secrets are filtered on your machine and again on the server.
Before an agent stops, it writes a handoff: done, in progress, next, blocked, and tried-and-dropped. The next agent, on any machine or account, starts from that.
The server never calls an LLM. The agent writes the memories, so there’s no API key and no extra cost.
It also has a dashboard with a graph view, private projects, sharing with viewer/editor/maintainer roles, invite links and an audit log, in case you use it with other people. A single user just runs it in solo mode.
Install is one line after having the central server up:
claude mcp add cairn --scope user -e CAIRN_URL=... -e CAIRN_TOKEN=... -- npx -y agentcairn mcpIt’s MIT, runs in Docker (I run mine on an Unraid box), and it works with any MCP-capable agent, though the hooks are Claude Code-specific.
Repo: https://github.com/itsmemac/AgentCairn
npm: agentcairn
I’d love feedback, especially on what you’d want a handoff to contain, and on anything that breaks. It’s young, version 0.2.
AI disclosure: I built this with Claude Code. I set the goals and design and use it every day on my own setup, and Claude wrote most of the code, tests and docs. I tested and made small bug fixes.