The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Agentcairn listing page.
One durable memory across supported coding agents.
Your Markdown vault is canonical. DuckDB is the replaceable retrieval cache.
Website · PyPI · Obsidian companion · Benchmarks
A cairn marks a trail for whoever comes next. agentcairn does that for coding agents: it captures durable context from the tools you use, stores it as inspectable Markdown with provenance, and recalls only the most relevant pieces when another agent needs them.
The memory is not hidden behind an admin console or a hosted database. The separate agentcairn-obsidian companion reads the same Markdown files as the agents and exposes provenance, currency, importance, supersession, and related: links.
A real agentcairn vault in Obsidian. The list is a view over the files—not a second memory store.
Dogfood snapshot · 2026-07-15. Across 417 local recalls, the maintainer's vault returned context about
262× smallerthan loading the full vault each time—an estimated136.6M tokens of full-vault context avoidedin aggregate. Token counts use approximately four characters per token. This is not billed-token savings, and agentcairn sends no telemetry.
The shortest path is a first-class plugin. It bundles the MCP server, the memory skill, and the host-specific ambient hooks—no separate agentcairn package install. The plugin launches through uvx, so install uv first if uvx --version is not already available.
Claude Code gets per-turn project-scoped recall, session/compaction capture, and the /agentcairn:recall, /agentcairn:remember, /agentcairn:memory, /agentcairn:savings, and /agentcairn:ingest commands.
Codex gets the bundled MCP tools and memory skill, live-verified SessionStart recall, and SessionEnd capture with cairn sweep as the out-of-band backstop.
Already use skills.sh or a find-skills workflow? Install the public setup assistant:
Then ask your agent: Use $agentcairn-setup to preview, install, and verify AgentCairn for this coding agent.
This installs setup guidance only—not the AgentCairn runtime, MCP server, plugin, or hooks. The assistant delegates those changes to AgentCairn's preview-first native installer and verifies the resulting integration. The Claude Code and Codex plugin commands above remain the shortest path.
The default vault is ~/agentcairn and is created on first use. A new empty vault has nothing useful to recall yet, so prove the whole loop explicitly:
remember writes the Markdown note and index entry together, so immediate recall is part of the contract. The first local run may download and warm the configured embedding/reranking models.
| Promise | What it means in practice |
|---|---|
| Markdown is canonical | Notes, frontmatter, and [[wikilinks]] are the durable memory. Edit a fact by hand; the next reconciled read honors it. |
| The index is disposable | DuckDB is a derived cache. Deleting or rebuilding it does not delete the Markdown vault. |
| One vault crosses agents | Supported hosts share the same configured vault instead of building isolated memories per tool. |
| History is non-lossy | Derived notes do not silently erase stored notes; superseded and expired facts remain inspectable and are demoted rather than hidden. |
| Every result has context | Project, validity status, and permalinks travel with recall so an agent can distinguish current local evidence from cross-project history. |
cairn sweep reads supported transcript stores out-of-band as the durable backstop. AgentCairn redacts recognized credentials, deduplicates, importance-gates, and distills before its automated plaintext writes..duckdb index stays outside it. Vault symlinks that escape the configured root are rejected.valid_from, valid_until, and superseded_by keep old evidence visible while making current facts rank first.[[wikilinks]] and optional cairn link neighbors create an Obsidian-native graph without asking an LLM to invent entities.Every host resolves the same configured vault. cairn install previews detected hosts without writing. MCP configuration writes are backup-first and preserve unrelated servers; plugin-host installs delegate to the host's own CLI.
| Host | Integration | Set up with | Ambient memory |
|---|---|---|---|
| Claude Code | Plugin + MCP + skill | cairn install claude-code | ✅ per-turn + SessionStart recall; SessionEnd/PreCompact capture |
| Codex | Plugin + MCP + skill | cairn install codex | ✅ SessionStart recall; SessionEnd capture + sweep |
| Cursor | MCP + skill + ingest | cairn install cursor | ◐ out-of-band sweep |
| OpenCode | Plugin + MCP + ingest | cairn install opencode | ✅ per-turn recall + idle/compact capture |
| Hermes Agent | Native MemoryProvider | integrations/hermes/ | ✅ auto-recall + session-end capture |
| Antigravity | Plugin + ingest | cairn install antigravity --source <dir> | ◐ out-of-band sweep |
| VS Code (Copilot) | MCP server | cairn install vscode | — |
| Claude Desktop | MCP server | cairn install claude-desktop | — |
| Any other MCP host | Portable MCP server | uvx agentcairn | host-dependent |
Codex SessionStart was verified live end-to-end with agentcairn 0.24.2 / plugin 0.1.2. The installed SessionEnd command dispatch and detached sweep pass exact handler probes; cairn sweep remains the out-of-band capture backstop. See the OpenCode integration and Hermes integration for their native lifecycle details.
The plugin is the easiest route, but agentcairn is also a standalone CLI and on-demand MCP server. Standalone installs require Python 3.11+.
Claude Code's auto-memory can seed the shared vault without changing its source files. The command previews only the current repository by default; add --apply to write the redacted notes and refresh the index.
The one-way import reads MEMORY.md and its topic Markdown files—never CLAUDE.md or .claude/rules/. Imported notes retain Claude Code, project, and source-file provenance. When a source changes, the prior version remains inspectable but is superseded; when one disappears, its imported version expires. A small .agentcairn/native-memory/ registry preserves that lifecycle without indexing source content twice. Use --source <dir> for a custom, managed, or session-overridden Claude memory directory, or --no-reindex when batching imports.
Prefer an ephemeral process:
On other operating systems, run cairn sweep from your scheduler of choice.
Settings live in ~/.agentcairn/config.toml; precedence is CLI flag → environment → config file → default.
Local nomic-embed-text-v1.5 embeddings are the default. Voyage, OpenAI-compatible embeddings, and the Anthropic durability judge are opt-in. With a cloud provider enabled, remaining secret-redacted note chunks and queries leave the machine; changing the embedding model re-embeds the vault and may incur real latency or API cost.
The repository ships a revision-pinned, reproducible LongMemEval-S + LoCoMo harness. The default is local nomic-embed-text-v1.5 plus the cross-encoder reranker.
| Dataset / granularity | Metric | BM25 only | Hybrid RRF | Hybrid + reranker |
|---|---|---|---|---|
| LoCoMo · turn | recall@5 | 0.527 | 0.562 | 0.662 |
| LongMemEval-S · session | recall@5 | 0.920 | 0.954 | 0.969 |
| LongMemEval-S · turn | recall@5 | 0.680 | 0.640 | 0.788 |
Context returned at the default k=10 is much smaller than the complete indexed history:
| Dataset | Mean full history | Mean recalled | Reduction |
|---|---|---|---|
| LoCoMo (3 conversations) | 25,646 tokens | 529 tokens | 51.1× |
| LongMemEval-S (full 500) | 136,552 tokens | 2,207 tokens | 64.7× |
Read the numbers honestly:
[[wikilink]] graph. It is designed for real interlinked vaults.Full metrics, embedding sweeps, latency measurements, licenses, commands, and caveats live in benchmarks/README.md.
0600/0700). Because the vault is plaintext and redaction is best-effort, the file mode is effectively its only access control. Shared-GID setups (e.g. two Docker containers on the same group but different UIDs) need group access, so vault_group_writable = true widens new vault notes and directories to 0660/0770. It is opt-in on purpose: on macOS every local user's primary group is staff, so a group-readable default would expose your memories to other accounts on the machine. The knob never widens anything outside the vault — the index, ledgers, lock files, and ~/.agentcairn/config.toml stay private.agentcairn uses uv exclusively for dependency management and tooling.
Run the offline benchmark regression without API keys:
Apache License 2.0 — permissive, with an explicit patent grant. Copyright © 2026 Charles C. Figueiredo.