{"slug": "show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary", "title": "Show HN: Mimir – local-first encrypted memory for AI agents (single Rust binary)", "summary": "Perseus Computing LLC released Mimir, a local-first, encrypted memory engine for AI agents as a single Rust binary with zero dependencies. The open-source tool provides persistent memory across sessions via the Model Context Protocol, supporting 46 tools and AES-256-GCM encryption, and works with clients like Claude Desktop and Cursor. Mimir aims to differentiate from competitors like Mem0 and Letta by being fully offline, MCP-native, and dependency-free.", "body_md": "Persistent Memory for AI Agents — MCP-Native. Local-First. Zero Dependencies.\n\nMimir is a single Rust binary that gives AI agents durable memory across sessions.\n**One binary. One file. No Docker. No Postgres. No cloud.** Just persistent memory\nthat works with any MCP host.\n\n```\ncurl -sSf https://raw.githubusercontent.com/Perseus-Computing-LLC/mimir/main/scripts/install.sh | sh\n```\n\nThat's it. Mimir is installed to `~/.local/bin/mimir`\n\n. Start it:\n\n```\nmimir serve --db ~/.mimir/data/mimir.db\n```\n\nmacOS note.On Apple Silicon, an unsigned binary is killed on launch (`Killed: 9`\n\n, no output) by the OS binary policy — even with no quarantine attribute. The installer ad-hoc code-signs Mimir for you. If you build or copy the binary yourself (`cargo build --release && cp target/release/mimir ~/.cargo/bin/`\n\n), sign it once after each rebuild:\n\n```\ncodesign --sign - \"$(command -v mimir)\"\n```\n\nConnect any MCP host (Claude Desktop, Cursor, Hermes Agent, Perseus, etc.):\n\n```\n{\n  \"mcpServers\": {\n    \"mimir\": {\n      \"command\": \"mimir\",\n      \"args\": [\"serve\", \"--db\", \"~/.mimir/data/mimir.db\"]\n    }\n  }\n}\n# Start Mimir\nmimir serve --db memory.db &\nsleep 1\n\n# Remember a fact (via MCP JSON-RPC on stdio)\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"mimir_remember\",\"arguments\":{\"category\":\"demo\",\"key\":\"hello\",\"body_json\":\"{\\\"text\\\":\\\"Hello from Mimir!\\\"}\"}}}' | mimir serve --db memory.db\n\n# Search for it\necho '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"mimir_recall\",\"arguments\":{\"query\":\"Hello\"}}}' | mimir serve --db memory.db\n```\n\nMimir is a standard MCP **stdio** server — the same `mimir serve`\n\ncommand works\neverywhere. Run `mimir doctor`\n\nto validate your install and print this matrix locally.\n\n| Client | Status | Config |\n|---|---|---|\n| Claude Desktop | ✅ | `claude_desktop_config.json` |\n| Claude Code / Hermes | ✅ | `.mcp.json` / `config.yaml` |\n| Cursor | ✅ | `.cursor/mcp.json` |\n| Windsurf | ✅ | `mcp_config.json` |\n| VS Code + Continue.dev | ✅ | `config.json` |\n| Zed | ✅ | `settings.json` |\n| Codex CLI | ✅ | `~/.codex/config.toml` |\n\nCopy-paste config snippets for each: ** docs/clients/**.\n\nMimir is the **only** memory engine that is simultaneously MCP-native,\nlocal-first, zero-dependency, AND agent-first.\n\n| Mimir | Mem0 | Letta | Zep | |\n|---|---|---|---|---|\nDeployment |\nSingle binary (~8MB) | Cloud + self-host | Docker/Postgres | Docker/Postgres |\nDependencies |\nNone (SQLite embedded) | Python + vector DB | Postgres + Python | Postgres + Go |\nMCP-Native |\n✅ 46 tools | ❌ Not MCP-native | ❌ Not MCP-native | ❌ Not MCP-native |\nOffline/Local |\n✅ Fully local | Cloud-dependent | Docker needed | Docker needed |\nEncryption |\nAES-256-GCM ✅ | ❌ | ❌ | ❌ |\nHybrid Search |\nBM25 + Dense + RRF | Vector only | Vector only | Vector + Graph |\nEntity Lifecycle |\nDecay + Promote + Archive | ❌ | ❌ | ❌ |\nEntity Graph |\nLink + Traverse | ❌ | ❌ | ✅ |\nJournal Audit Trail |\n✅ Immutable | ❌ | ❌ | ❌ |\nState Management |\n✅ Key-value + TTL | ❌ | ❌ | ❌ |\nMCP Tools |\n46 | 5 | 8 | 0 |\nGitHub Stars |\n~20 | ~55K | ~15K | ~3K |\nLicense |\nMIT | Apache 2.0 | Apache 2.0 | Apache 2.0 |\n\n[Full comparison: Mimir vs Mem0 →](/Perseus-Computing-LLC/mimir/blob/main/docs/comparison/mimir-vs-mem0.md)\n[vs Letta →](/Perseus-Computing-LLC/mimir/blob/main/docs/comparison/mimir-vs-letta.md)\n[vs Zep →](/Perseus-Computing-LLC/mimir/blob/main/docs/comparison/mimir-vs-zep.md)\n\nMimir handles production workloads on modest hardware:\n\n| Metric | Result |\n|---|---|\n100K entity insert |\n1.01s (98,732 entities/s) |\nFTS5 recall (10 results) |\n0.022s |\nDecay tick (100K entities) |\n1.317s (batched, transactional) |\nMemory (100K entities) |\n~85MB RSS |\nDB file size (100K) |\n~45MB (with FTS5 index) |\n\nRun it yourself: `cargo test stress_100k --release -- --ignored --nocapture`\n\nReady-to-use adapters that make Mimir the default memory backend for popular AI agent frameworks:\n\n| Framework | Integration | Type |\n|---|---|---|\nLangGraph |\n\n`MimirStore`\n\n`BaseStore`\n\nimplementation**CrewAI**`MimirMemoryTool`\n\n**AutoGen**`MimirMemory`\n\n`Memory`\n\nimplementationEach adapter:\n\n- Connects via MCP stdio subprocess (persistent session)\n- Maps the framework's memory interface to Mimir tools\n- Comes with a README quickstart (5 minutes to working)\n- Has passing tests with mocked MCP transport\n\nAny MCP-compatible framework works with Mimir directly. See\n[Awesome Mimir](/Perseus-Computing-LLC/mimir/blob/main/awesome-mimir.md) for the full list.\n\n| Tool | Description |\n|---|---|\n`mimir_remember` |\nStore/update entity. Idempotent by (category, key); a content change snapshots the prior version into history. |\n`mimir_recall` |\nSearch with FTS5/dense/hybrid modes, filters, stemming expansion. |\n`mimir_recall_layer` |\nRecall from a specific biomimetic layer (world, episodic, semantic). |\n`mimir_recall_when` |\nProactive just-in-time recall: surface entities whose `recall_when` triggers match. |\n`mimir_get_entity` |\nFetch one entity by ID with full `body_json` . |\n`mimir_as_of` |\nBi-temporal time-travel: the version of a fact (category + key) that was live at a past instant. |\n`mimir_history` |\nList every superseded version of a fact (category + key), newest first — the full version trail (companion to `mimir_as_of` ). |\n`mimir_forget` |\nSoft-delete (archived=1). |\n\n| Tool | Description |\n|---|---|\n`mimir_ask` |\nRAG: recall context, query LLM, return grounded answer with sources. |\n`mimir_embed` |\nGenerate dense vectors via the bundled model, Ollama, or OpenAI-compatible endpoint. |\n`mimir_semantic_search` |\nDense-only semantic search shortcut — find entities by meaning, ranked purely by embedding similarity (no keyword fallback). |\n`mimir_context` |\nPre-formatted markdown block for session injection. |\n`mimir_ingest` |\nTrigger connector syncs (GitHub, file watcher). |\n`mimir_ingest_file` |\nLocally extract a document's text (plaintext/markdown always; DOCX/PDF with the `multimodal` feature) and store it as a recallable entity. |\n`mimir_extract` |\nLocal, deterministic, rule-based knowledge extraction (facts / preferences / temporal events / episodes) from text or a stored entity. Read-only. |\n\n| Tool | Description |\n|---|---|\n`mimir_link` |\nCreate typed relationship links between entities. |\n`mimir_unlink` |\nRemove entity links. |\n`mimir_traverse` |\nWalk entity link graph up to configurable depth. |\n\n| Tool | Description |\n|---|---|\n`mimir_journal` |\nAppend structured event with actor attribution. |\n`mimir_timeline` |\nQuery journal by time range with filters. |\n\n| Tool | Description |\n|---|---|\n`mimir_state_set` |\nSet key-value state with optional TTL. |\n`mimir_state_get` |\nGet state value. Returns null if expired. |\n`mimir_state_delete` |\nDelete state entry. |\n`mimir_state_list` |\nList state keys, optionally filtered by prefix. |\n\n| Tool | Description |\n|---|---|\n`mimir_decay` |\nRecalculate Ebbinghaus decay scores (batched 1000-entity transactions). |\n`mimir_prune` |\nBulk archive by category, decay threshold, or age. |\n`mimir_purge` |\nPermanently delete archived entities + VACUUM. Destructive. |\n`mimir_cohere` |\nAutonomous coherence grooming pass — promote, decay, link, archive. |\n`mimir_autocohere` |\nFull atomic grooming: cohere → decay → compact in one pass (supports dry-run). |\n`mimir_compact` |\nArchive entities below decay threshold. |\n`mimir_reindex` |\nRebuild FTS5 search index from entities table. |\n\n| Tool | Description |\n|---|---|\n`mimir_score` |\nAssign quality score (0.0-1.0). |\n`mimir_conflicts` |\nDetect conflicting entities via trigram similarity; opt-in `resolve=true` invalidates the lower-certainty side into history (reversible, dry-run by default). |\n`mimir_correct` |\nStructured correction capture for learning from errors. |\n`mimir_supersede` |\nMark a new fact as superseding an old one (sets the old entity to `deprecated` ). |\n\n| Tool | Description |\n|---|---|\n`mimir_vault_export` |\nExport entities to .md files with YAML frontmatter. |\n`mimir_vault_import` |\nImport from .md vault directory (idempotent). |\n`mimir_federate` |\nCopy entities between workspaces. |\n`mimir_share` |\nShare one entity (by category + key) into another workspace, preserving content. |\n`mimir_workspace_list` |\nList all distinct entity categories. |\n\n| Tool | Description |\n|---|---|\n`mimir_stats` |\nFull DB statistics across all tables. |\n`mimir_health` |\nServer and DB health check. |\n`mimir_bench` |\nPerformance benchmark tracking. |\n`mimir_maintenance` |\nDB maintenance: dedup, orphan detection, VACUUM, FTS5 reindex (supports dry-run). |\n`mimir_synthesize` |\nLLM session synthesis — extract lessons from transcripts. |\n`mimir_migrate` |\nMigrate v0.1.x DB to current schema. |\n\n```\n# Server\nmimir serve --db /data/mimir.db\nmimir serve --web --port 8767 --encryption-key ~/.mimir/secret.key\nmimir serve --llm-endpoint http://localhost:11434/api/generate --llm-model llama3\nmimir serve --transport sse --port 8787 --mcp-token my-secret-token\n\n# Maintenance (operate directly on DB, no server needed)\nmimir stats          --db /data/mimir.db\nmimir forget         --db /data/mimir.db --category decision --key stale-choice --reason \"superseded\"\nmimir prune          --db /data/mimir.db --category junk --min-decay 0.1 --dry-run\nmimir purge          --db /data/mimir.db --dry-run\nmimir decay          --db /data/mimir.db\nmimir reindex        --db /data/mimir.db\nmimir vault-export   --db /data/mimir.db --vault-dir ./export/\nmimir vault-import   --db /data/mimir.db --vault-dir ./export/\nmimir obsidian-sync  ~/obsidian-vault/Mimir/          # one-shot export to an Obsidian vault\nmimir obsidian-sync  ~/obsidian-vault/Mimir/ --watch  # continuous sync on every memory change\n\n# Key management\nmimir keygen --key-file ~/.mimir/secret.key\n```\n\n| Flag | Description |\n|---|---|\n`--db` |\nSQLite database path (default: `~/.mimir/data/mimir.db` ) |\n`--web` |\nStart web dashboard |\n`--port` |\nDashboard port (default: 8767) |\n`--web-bind` |\nDashboard bind address (default: 127.0.0.1) |\n`--transport` |\nMCP transport: `stdio` (default), `sse` , or `http` |\n`--mcp-token` |\nBearer token for SSE/HTTP transport auth |\n`--encryption-key` |\nAES-256-GCM key file path |\n`--llm-endpoint` |\nLLM API endpoint for `mimir_ask` and embeddings |\n`--llm-model` |\nLLM model name (default: llama3) |\n`--llm-api-key` |\nAPI key for LLM endpoints (OpenAI, Azure, etc.) |\n`--embedding-endpoint` |\nOpenAI-compatible embedding endpoint |\n`--connectors-config` |\nPath to connectors.yaml |\n\nMimir is your AI agent's long-term memory — and it doubles as **your** second\nbrain. Every entity your agent remembers exports to a plain Markdown note with\nYAML frontmatter, so your AI's memory becomes a navigable personal knowledge\nbase inside the tools you already use: **Obsidian, Logseq, or Notion.**\n\n```\n# Export your entire memory to an Obsidian vault as linked Markdown notes\nmimir obsidian-sync ~/obsidian-vault/Mimir/\n\n# Keep it live — re-export automatically on every memory change\nmimir obsidian-sync ~/obsidian-vault/Mimir/ --watch\n```\n\nOpen the vault in Obsidian and you get a graph of your agent's knowledge.\n\n**WikiLink backlinks.** When one entity links to another (via `mimir_link`\n\nor a\n`depends_on`\n\n/ `implements`\n\n/ `references`\n\nrelationship), the exported note gets\na `## Links`\n\nsection with `[[WikiLink]]`\n\nbacklinks that resolve natively in\nObsidian's graph view:\n\n```\n---\nid: cli-de8dfb8364b6\ncategory: architecture\nkey: api\ntype: insight\ndecay_score: 0.5000\n---\n\n{\"content\":\"axum service\"}\n\n## Links\n\n- [[cli-99756b494c7d|database]] (depends_on)\n```\n\nLinks resolve **by entity id** (notes are written as `<id>.md`\n\n) so they never\nbreak, and Obsidian shows the human-readable `key`\n\nas the link label. Open the\ngraph view and your agent's architecture, decisions, and insights become a\nclickable knowledge map.\n\n** --watch** polls Mimir's cheap, deterministic state digest on an interval and\nre-exports only when memory actually changes. It naturally catches every\n\n`mimir_remember`\n\nwrite with no filesystem-watcher dependency and no coupling to\nthe server. Tune the interval with `MIMIR_SYNC_INTERVAL_SECS`\n\n(default: 2s).| Tool | How |\n|---|---|\nObsidian |\n`mimir obsidian-sync <vault>` — WikiLinks resolve in the graph view out of the box. |\nLogseq |\nPoint `obsidian-sync` at your Logseq graph directory. Logseq reads the same `[[WikiLink]]` syntax and Markdown frontmatter. |\nNotion |\nRun `mimir vault-export` , then use Notion's Import → Markdown & CSV to pull the notes in. |\n\nUnlike cloud-only \"second brain\" tools, Mimir runs **100% local**, is written in\n**Rust**, encrypts at rest with **AES-256-GCM**, and applies **decay scoring** so\nstale memories fade — your knowledge base stays yours and stays fresh.\n\n**Bundled, in-process embeddings**— a quantized all-MiniLM-L6-v2 model (384-dim) is compiled into the binary, so dense/semantic search works with** zero config and zero network**: no Ollama, no API key, no model download. This is the default build (`bundled-embeddings`\n\nfeature).**Auto-embed on write (#271)**—`mimir_remember`\n\nembeds each new (or content-changed) entity**synchronously** as it is written, using the bundled model. Single-entity embedding is deterministic and LRU-cached, so it is cheap and adds no background tasks. Embedding failures are non-fatal (logged to stderr); the write always succeeds.**Hybrid is the default recall mode (#271)**—`mimir_recall(query=...)`\n\nwith no`mode`\n\nflag automatically selects**hybrid**(dense + keyword fused via RRF) whenever embeddings exist, and transparently falls back to** fts5**keyword search when none do. No manual`mimir_embed`\n\nstep, no flags to remember.— a one-tool shortcut for pure dense, meaning-based search (no keyword fallback) when you just want \"find things like this\".`mimir_semantic_search(query, limit)`\n\n**Optional alternate embedder**— to use** Ollama**or any OpenAI-compatible`/v1/embeddings`\n\nendpoint instead of the bundled model, set`--llm-endpoint`\n\n(and`--embedding-endpoint`\n\n/`--llm-api-key`\n\nas needed). This is entirely optional; the bundled model is used by default.- Build a lean binary without bundled embeddings via\n`cargo build --no-default-features`\n\n— recall then defaults to keyword search unless a remote embedder is configured.\n\n**FTS5 keyword search** with LIKE fallback and Porter stemming expansion**Dense vector search** via cosine similarity on stored embeddings**Reciprocal Rank Fusion (RRF)**— combine keyword + vector results** Query expansion**— automatic stemming variants for broader recall\n\nMimir models memory using three biomimetic layers, inspired by human memory pathways:\n\n**World (Core):** Slow-decaying, global facts about the environment.**Episodic (Buffer):** Fast-decaying, session-specific interaction history.**Semantic (Working):** Medium-decaying, general knowledge and learned concepts.\n\nYou can interact with these layers directly using the `mimir_recall_layer`\n\ntool or by specifying the `layer`\n\nparameter in `mimir_remember`\n\n.\n\n**Ebbinghaus decay**— memories naturally fade unless retrieved (refresh on access)** Layer promotion**— buffer → working → core based on access frequency** Automatic archival**— stale entities archive; purge to permanently delete + VACUUM** Always-on entities**— pin critical memories for unconditional session injection\n\n— natural language Q&A over stored memories via any LLM (Ollama, OpenAI, etc.)`mimir_ask`\n\n— generate and store dense vectors via Ollama or OpenAI-compatible`mimir_embed`\n\n`/v1/embeddings`\n\n- Supports single-entity and batch-category embedding\n\n**AES-256-GCM** transparent encryption for entity`body_json`\n\n- Opt-in via\n`--encryption-key`\n\nflag `mimir keygen`\n\nsubcommand for key generation- FTS5 index stays plaintext for search\n\n- Built-in Axum HTTP server (\n`mimir serve --web --port 8767`\n\n) - Dark-themed dashboard with search, entity table, vis.js graph, timeline\n- Default bind:\n`127.0.0.1`\n\n(use`--web-bind 0.0.0.0`\n\nto expose) - Separate SQLite connection in WAL mode for concurrent reads\n\n**GitHub issues connector**— ingest issues/PRs by repo, rate-limit aware** File watcher**— scan directories for`.md`\n\n/`.txt`\n\n/`.json`\n\nfiles with content-hash dedup- YAML-based connector config via\n`--connectors-config`\n\n**stdio**(default) — zero-config, works with any MCP host** SSE**— Server-Sent Events for HTTP-based MCP clients** HTTP**— REST-style MCP endpoint** Bearer token auth**— for SSE/HTTP transports\n\nMimir is the default memory backend for [Perseus](https://perseus.observer):\n\n```\nmimir:\n  enabled: true\n  transport: \"stdio\"\n  command: [\"mimir\", \"serve\", \"--db\", \"~/.mimir/data/mimir.db\"]\n  timeout_s: 30.0\n  merge_strategy: \"local_first\"\n  fallback_to_local: true\n  context_categories: [\"decision\", \"architecture\", \"convention\"]\n  context_limit: 10\n```\n\nMimir is built for government deployment from the ground up.\n\n| Capability | Status |\n|---|---|\nLicense |\nMIT — no copyleft, no GPL/AGPL |\nSBOM |\n|\n\n**Air-gapped****Encryption at rest****Audit trail****Supply chain****For federal buyers:** See [docs/federal-buyers.md](/Perseus-Computing-LLC/mimir/blob/main/docs/federal-buyers.md) for\nprocurement information, compliance status, and deployment models (air-gapped,\non-premises, classified environments).\n\nPerseus Computing LLC is a US-owned small business. SAM.gov registration in progress. NAICS: 541715, 541511, 541512.\n\nMimir is a **local-first MCP server** — it runs entirely on your machine.\n\n**No data collection.** Mimir does not collect, transmit, or phone home any user data, usage statistics, or telemetry.- All data remains in your local SQLite database file.\n\n- All memory entities, journal entries, and state are stored locally in a SQLite database at the path you specify via\n`--db`\n\n. - Optional\n**AES-256-GCM encryption at rest** is available — when enabled, entity bodies are encrypted before storage. - No data is shared with Perseus Computing LLC or any third party.\n\n**None.** Mimir is fully air-gapped by default. No API calls, no cloud services, no external network requests.- The optional dense vector embeddings feature uses a locally-compiled model — no external embedding API is called.\n\n- You control retention: entities can be soft-deleted (\n`mimir_forget`\n\n), archived (via decay/compact), or permanently purged (`mimir_purge`\n\n). - No automatic off-machine backup is performed.\n\n**Email:**[privacy@perseus.observer](mailto:privacy@perseus.observer)** GitHub:**[Perseus-Computing-LLC/mimir](https://github.com/Perseus-Computing-LLC/mimir)\n\nMIT — see [LICENSE](/Perseus-Computing-LLC/mimir/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary", "canonical_source": "https://github.com/Perseus-Computing-LLC/mimir", "published_at": "2026-06-30 21:29:21+00:00", "updated_at": "2026-06-30 21:50:31.509056+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-infrastructure", "developer-tools", "ai-products"], "entities": ["Perseus Computing LLC", "Mimir", "Claude Desktop", "Cursor", "Hermes Agent", "Mem0", "Letta", "Zep"], "alternates": {"html": "https://wpnews.pro/news/show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary", "markdown": "https://wpnews.pro/news/show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary.md", "text": "https://wpnews.pro/news/show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary.txt", "jsonld": "https://wpnews.pro/news/show-hn-mimir-local-first-encrypted-memory-for-ai-agents-single-rust-binary.jsonld"}}