Skip to content

Shared, local-first memory for coding agents

One memory across your coding agents. Plain Markdown under your control.

agentcairn captures durable context across Claude Code, Codex, Cursor, OpenCode, and more into an Obsidian-compatible vault. A rebuildable DuckDB index gives fast hybrid recall; hand-edit a fact and the agents honor it.

$ claude plugin marketplace add ccf/agentcairn $ claude plugin install agentcairn@agentcairn

Swipe to view the full commands →

The contract

The files are canonical. The index is replaceable.

Some memory systems center a managed database; other local-first tools also use editable files. agentcairn's contract is specific: your Markdown vault is canonical, DuckDB is a disposable retrieval cache, and every supported coding agent shares the same memory.

It is purpose-built for coding workflows: ambient multi-harness capture, project and harness provenance, secret-aware ingestion, temporal supersession, and reproducible retrieval benchmarks.

Six differentiators

Plain Markdown is the source of truth

Human-readable files with frontmatter and [[wikilinks]]. Edit them by hand or open them as an Obsidian vault; the index honors your edits.

The index is disposable

DuckDB is a rebuildable cache. cairn reindex restores it from the canonical Markdown without deleting the vault.

History stays inspectable

Derived notes do not silently erase stored notes. Superseded and expired facts remain visible in the vault.

Secret-aware automated writes

Recognized credentials are redacted before automated body, title, or tag writes. Unknown patterns and hand edits remain your responsibility.

A free, deterministic graph

Your [[wikilinks]] are the graph — no LLM extraction, no hallucinated entities.

Daemonless, zero external DB

One embedded DuckDB does vector + BM25 + graph. No server, no Neo4j/Postgres/Qdrant.

How it works

Capture uses host hooks and native lifecycles where available, plus out-of-band transcript sweeps, then redacts → dedups → importance-gates → distills into the vault. Retrieval fuses BM25 + vectors with RRF, with an optional cross-encoder reranker. The disposable index reconciles before the first MCP read, and remember writes through immediately; the server exposes remember · recall · search · build_context · recent.

Agent sessions are captured into a canonical Markdown vault, indexed in a rebuildable DuckDB cache, and returned as cited MCP context.
01Capture

Agent sessions

hooks + sweep
02Keep

Markdown vault

redacted + inspectable
03Index

DuckDB cache

hybrid + rebuildable
04Recall

MCP context

cited + project-aware

New in v0.25

Claude learned it once. Bring it to every supported agent.

Import Claude Code’s auto-memory into the shared Markdown vault without changing Claude’s source files. Preview the current repository first; apply only when the plan looks right.

uvx --from agentcairn cairn import claude-memory # preview uvx --from agentcairn cairn import claude-memory --apply # import + index

Swipe to view the full command →

See exactly what is imported and how history is preserved

Survives uninstall

Delete the index. Reindex. Everything's back.

The index is a cache. The proof is destructive: remove it, rebuild it, lose nothing — because the truth was never in the database.

  1. rm -f /tmp/cairn-rebuild-demo.duckdb
    demo index deleted.
  2. cairn reindex ~/vault --index /tmp/cairn-rebuild-demo.duckdb
    rebuilding from Markdown… 128 notes indexed.
  3. cairn recall "auth fix" --index /tmp/cairn-rebuild-demo.duckdb
    restored — 0 facts lost. The vault was the truth.

Benchmarks measured

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 the README.

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.

Quickstart

# Claude Code plugin (recommended)
claude plugin marketplace add ccf/agentcairn
claude plugin install agentcairn@agentcairn

# Codex plugin
codex plugin marketplace add ccf/agentcairn
codex plugin add agentcairn@agentcairn

# ...or use it directly — standalone CLI + MCP server
uv tool install agentcairn          # installs the cairn + agentcairn commands
uvx agentcairn                      # ...or run the MCP server ephemerally
cairn install cursor                # wire the server into another host
cairn recall "how did we fix auth?"  # hybrid recall
cairn savings                       # context recall has saved you
cairn doctor                        # health-check the index

Use it in any MCP host

First-class in Claude Code, Codex, OpenCode, Hermes, and Antigravity. Portable everywhere else.

Claude Code, Codex, and Antigravity get a first-class plugin — a bundled MCP server, a memory skill, and (on Claude Code and Codex) ambient session hooks (recall at session start, capture at session end). Antigravity has no plugin hooks, so capture runs out-of-band via cairn sweep. Every other MCP host gets the same recall/search/remember tools via the portable server; cairn install wires it in non-destructively (your other servers are preserved, the original backed up to <config>.bak). Hermes Agent gets a native agentcairn MemoryProvider, and the agentcairn-obsidian plugin lets you read and navigate that memory inside Obsidian. Every host resolves the same configured vault (default ~/agentcairn).

Swipe to compare every host →

Supported coding-agent hosts, integration level, setup command, and ambient memory support
hostsupportset up withambient
Claude CodePlugincairn install claude-code
CodexPlugincairn install codex
CursorMCP server + skill + ingestcairn install cursor
OpenCodePlugin + MCP + ingestcairn install opencode
Hermes AgentMemoryProvider plugin (Python 3.12+)see the Hermes guide
AntigravityPlugin + ingestcairn install antigravity --source <plugin dir>
VS Code (Copilot)MCP servercairn install vscode
Claude DesktopMCP servercairn install claude-desktop
cairn install                 # detect installed agents + preview (writes nothing)
cairn install codex           # install the Codex plugin (shells to `codex plugin …`)
cairn install cursor          # write MCP config for an MCP host
cairn install --all           # configure every detected agent

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 <plugin dir>`; 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, but the current agentcairn package requires a Hermes environment running Python 3.12 or newer; see the Hermes guide.

Because the vault is plain Markdown, you can read what every agent remembers in Obsidian: the agentcairn-obsidian plugin (on the community store) adds a vault-native Memory view — a filterable list with provenance and currency, plus a d3-force memory graph of related: links, colored by project and sized by importance.

agentcairn Memory view in Obsidian: a memory graph with nodes colored by project, connected by related links, with a legend and a provenance panel.
The agentcairn-obsidian Memory view — your agents' memory as a navigable graph, colored by project.

Trust & security

Plaintext by design

readable Markdown, not encrypted storage

Secret-aware writes

recognized credentials redacted before automated writes

Local by default

stdio MCP; no required daemon or external database

No product telemetry

cloud embedders and judges are explicit opt-ins