Skip to content
Local-first · open source · plain Markdown

One memory trail across your connected coding agents.

AgentCairn keeps durable context in Markdown you can inspect, edit, and carry between Claude Code, Codex, Cursor, OpenCode, and other MCP hosts. A rebuildable local index gives each connected agent fast, cited recall from the same vault.

No hosted account · no external database · Apache-2.0

One durable fact, followed across agents
  1. Claude Code · remember

    “Staging deploys use blue-green.”

    ↳ written and indexed

  2. memories/staging-deploys-use-blue-green-5b9d7c60.mdcanonical excerpt
    ---
    type: memory
    permalink: staging-deploys-use-blue-green-5b9d7c60
    source: memory://agent/remember
    project: checkout-service
    harness: mcp
    ---
    
    - [context] Staging deploys use blue-green. #remembered
  3. Codex · recall

    Use the blue-green deployment strategy.

    ↳ staging-deploys-use-blue-green-5b9d7c60 · current · checkout-service

DuckDB index: derived locally · safe to delete and rebuild

The contract

The files are canonical. The index is replaceable.

Every durable fact lives in an ordinary Markdown file. Open it in your editor or Obsidian, correct it by hand, sync it however you choose, and the next reconciled read honors the change.

DuckDB is only the fast retrieval layer. Delete it and rebuild it from the vault without sacrificing the memory trail your agents share.

AgentCairn's Memory view in Obsidian showing Markdown memories with project, harness, date, importance, and supersession metadata.
A real AgentCairn vault in Obsidian. The list is a view over the files—not a second memory store.
  1. Keep

    Readable files

    Notes, frontmatter, and [[wikilinks]] remain the durable record.

  2. Rebuild

    Disposable index

    BM25, vectors, graph signals, and reranking can be regenerated from Markdown.

  3. Recall

    Cited context

    Project, currency, and a permalink travel with each retrieved memory.

Try the failure mode that matters.

Delete the index. The memory stays.

This illustrative sequence removes the derived cache, rebuilds it from Markdown, and recalls the same fact. The valuable part was never trapped in the database.

Illustrative disposable-index sequence

  1. rm -f /tmp/cairn-demo.duckdb
    demo index deleted.
  2. cairn reindex ~/vault --index /tmp/cairn-demo.duckdb
    rebuilding from Markdown… 128 notes indexed.
  3. cairn recall "auth fix" --index /tmp/cairn-demo.duckdb
    same fact recalled from the rebuilt index. The vault was the truth.

Choose your agent. Get one exact path.

Every route uses the same Markdown vault, but each host has different integration boundaries. Start with the recommended setup for the agent in front of you.

Choose an AgentCairn installation route

Install the first-class Claude Code plugin

The plugin bundles the MCP server, memory skill, ambient recall and capture hooks, and AgentCairn slash commands.

uvx --from agentcairn cairn install claude-code

Swipe to view the full command →

Before you run it
uvx and the Claude Code CLI
What happens next
Restart Claude Code completely after installation.
Success check
In a fresh session, confirm that remember, recall, search, build_context, and recent are available—then remember a fact and recall it.
Bring Claude Code's existing auto-memory too

Install the first-class Codex plugin

The plugin bundles the MCP server, memory skill, verified SessionStart recall, SessionEnd capture, and the sweep backstop.

uvx --from agentcairn cairn install codex

Swipe to view the full command →

Before you run it
uvx and the Codex CLI
What happens next
Restart Codex completely after installation.
Success check
In a fresh session, confirm that remember, recall, search, build_context, and recent are available—then remember a fact and recall it.
Read the complete Codex integration notes

Connect another coding agent

Pick a host to get its exact setup path. AgentCairn preserves unrelated MCP servers and backs up supported configuration files before writing.

uvx --from agentcairn cairn install cursor

Swipe to view the full command →

Before you run it
uvx and Cursor
What it adds
MCP tools plus the AgentCairn memory skill. Transcript capture is out-of-band.
Finish and verify
Restart Cursor. Start a new chat and confirm the five AgentCairn memory tools and skill are available.
Compare integration and ambient-memory support

Install the CLI and MCP server directly

Use AgentCairn from your shell, run the MCP server on demand, or wire it into a host manually.

uv tool install agentcairn cairn init ~/agentcairn cairn reindex ~/agentcairn cairn doctor --vault ~/agentcairn

Swipe to view the full command →

Before you run it
uv and Python 3.11+
What happens next
No restart is required. The first reindex may download and warm the configured local embedding and reranking models.
Success check
Run cairn --version; after initializing and indexing the vault, cairn doctor should report status: OK.
See standalone ingestion and maintenance commands

Measured retrieval, explained plainly.

The benchmark harness and raw results are public. The useful conclusion is simpler: hybrid retrieval finds more relevant memory while returning a small fraction of the full history.

Open full benchmark tables, metric definitions, and caveats

Recall@5 is the fraction of all answer-bearing turns retrieved in the first five results, macro-averaged across queries.MRR rewards placing the first matching turn closer to the top.

Retrieval — LoCoMo

Swipe to see every metric →

armr@5r@10MRR
BM25 only0.5270.6040.459
vector only0.5360.6370.433
hybrid (RRF)0.5620.6480.477
hybrid + reranker0.6620.7350.608

LoCoMo retrieval, turn-level macro-avg, FastEmbed nomic-embed-text-v1.5 (the default).

Retrieval — LongMemEval-S

Swipe to see every metric →

armsession r@5session MRRturn r@5
BM25 only0.9200.9180.680
vector only0.9360.9160.507
hybrid (RRF)0.9540.9380.640
hybrid + reranker0.9690.9630.788

LongMemEval-S, full 500-instance set. Full turn r@10/MRR in benchmarks/README.md.

Context efficiency

Swipe to see every metric →

datasethaystackrecalledreduction
LoCoMo25,646 tok529 tok51.1×
LongMemEval-S136,552 tok2,207 tok64.7×

Context the default config recalls vs the full history. Estimate (~4 chars/tok).

  • No single headline number — these are relative ablation signals.
  • graph-boost is inert on chat corpora (no native wikilink graph); it's for real vaults.
  • QA-accuracy numbers use an Anthropic judge, not GPT-4o — not comparable to published leaderboards.
Read full metrics, sweeps, latency, commands, licenses, and caveats

One vault, different levels of automation.

Every supported host resolves the same configured Markdown vault. What varies is how much of the host lifecycle AgentCairn can automate: some recall and capture ambiently, some capture out-of-band, and MCP-only hosts expose explicit memory tools.

AgentCairn automation levels by host

Ambient

Recall and capture follow the host lifecycle.
  • Claude Code
  • Codex
  • OpenCode
  • Hermes Agent

Sweep-backed

Tools are available; transcript capture runs out-of-band.
  • Cursor
  • Antigravity

Explicit MCP

The same memory tools, invoked when you choose.
  • VS Code (Copilot)
  • Claude Desktop
  • Gemini CLI
Compare every host, integration, and setup command

Swipe to compare every host →

Supported coding-agent hosts, integration level, setup command, and ambient memory support
hostsupportset up withambient
Claude CodePlugincairn install claude-codefull
CodexPlugincairn install codexfull
CursorMCP server + skill + ingestcairn install cursorsweep
OpenCodePlugin + MCP + ingestcairn install opencodefull
Hermes AgentMemoryProvider plugin (Python 3.11+)see the Hermes guidefull
AntigravityPlugin + ingestcairn install antigravity --source /path/to/agentcairn/pluginsweep
VS Code (Copilot)MCP servercairn install vscodeexplicit
Claude DesktopMCP servercairn install claude-desktopexplicit
Gemini CLIMCP servercairn install geminiexplicit

Plugin hosts (Claude Code, Codex, Antigravity) install via the host's own CLI — the MCP server is bundled in the plugin. MCP configuration is merged using each host's native schema, non-destructively, idempotently, and backup-first. Ambient recall-at-start + capture-at-end is fully wired on Claude Code and Codex; Codex SessionStart recall is verified live, and capture also runs out-of-band via `cairn sweep`. Antigravity has no recognized plugin hooks — capture runs out-of-band via `cairn sweep` (◐). `agy plugin install` takes a local directory (not a git repo), so install with `cairn install antigravity --source /path/to/agentcairn/plugin` after replacing that path with your checkout's plugin directory; it also removes any stale mcp_config.json entry. Cursor has no plugin hooks either — `cairn sweep` ingests sessions out-of-band from Cursor's global `state.vscdb` SQLite store (`cursorDiskKV` user bubbles); Cursor remains an MCP host (not a plugin host), but `cairn install cursor` also installs the `using-agentcairn-memory` skill to `~/.cursor/skills/` alongside writing `~/.cursor/mcp.json`. Hermes gets in-process recall and capture through its native MemoryProvider lifecycle in the standard managed Python 3.11 environment; see the Hermes guide.

Leave a trail your next agent can follow.

Start with the agent you use now. The same readable vault will be there when you open the next one.

Install for Claude Code

uvx --from agentcairn cairn install claude-code
  • Plaintext by designreadable Markdown, not encrypted storage
  • Secret-aware writesrecognized patterns redacted; review unknown patterns and hand edits
  • Local by defaultstdio MCP; no required daemon or external database
  • Cloud only by opt-inenabled cloud features may send redacted text or queries off-device