
mneme
io.github.TheGoatPsy由 GitHub 帳號 TheGoatPsy 發布v3.5.0更新於 Oct 24, 2026
Vault-native, accountable memory for Claude Code and MCP clients. Markdown is ground truth.
概覽
面向 Claude Code 與 MCP 客戶端的地端記憶伺服器:把工作階段記錄成純 Markdown 檔案,讓助理檢索、召回並預載上下文。
- 可以做什麼
- 檢索與召回記憶:以 FTS5 BM25 搜尋,支援日期、記憶類型與範圍篩選,並依工作階段或日期範圍取回文件
- 寫入與提議記憶:以原子方式附加或取代 vault 檔案中的 Markdown 段落,並把去識別化後的編輯提議排入佇列等待人工核准
- 彙整與時間軸:依 vault 目錄歸類某主題的比對結果,並依時間順序列出某主題的相關引用
- 預載上下文:從近期工作階段與相關比對建立受 token 預算限制的預檢上下文包,支援依工作階段去重
- 檢視連續性狀態:列出上下文連續性引擎的檢查點,並載入其中依顯著度排序的工作集項目
- 回報安裝健康狀態:索引結構與時間、語系設定、文件數量與暫存深度
- 適用情境
- 適合跨多個工作階段與助理協作、希望過去的決策、限制與更動過的檔案以自己擁有、可 grep、可版控的檔案形式留存的人。最適合 Claude Code、Codex 或 Antigravity 使用者以取得自動工作階段擷取;其他 MCP 客戶端只能使用工具本身。
- 執行需求
- 以地端程序執行,可透過 npx 使用 npm 套件,或以 pipx 安裝 Python 外掛;lite 設定需要 Node.js 與 Python。需要一個地端 Markdown vault 目錄。未宣告驗證、環境變數或標頭。選用的 full 設定需要 Docker 與 Neo4j 進行圖譜增強。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mneme,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[mneme — vault-native memory for Claude Code]
mneme Record
Vault-native memory for Claude Code. Markdown is ground truth.
[mneme-core on PyPI] [mneme-cc-plugin on PyPI] [mneme-mcp-server on npm] [CI] [Apache-2.0] [Python versions] [DOI]
Every session starts from zero. You re-explain the same architecture, the same constraints, the same decision you already settled yesterday, and the tools that promise to fix it mostly store your conversation history in opaque SQLite blobs and call an LLM every time you finish a session. The record of your own work ends up somewhere you cannot read, cannot grep, and cannot take with you.
mneme records what happened in each Claude Code session as plain markdown files in a directory you own (the vault) and indexes them with SQLite FTS5. The next session opens with a preflight block — today's headings, a git status summary, and the five most recently modified session documents — and the agent queries the index on demand through mneme_search.
Here is the file the Stop hook writes. The frontmatter, heading, and summary shape come from packages/mneme-cc-plugin/src/mneme_cc_plugin/hooks/stop.py and packages/mneme-core/src/mneme_core/distill/templates/summary-en.md; the contents below are illustrative.
That installs the plugin and registers the lifecycle hooks; mneme doctor verifies the result, and profiles and per-client installs are under Three-Tier Install. Claude Code registers six hook events; Codex and Antigravity map four. Any other MCP client (Kimi, Qwen, Cline, Cursor) gets the ten MCP tools through the open adapter, with no lifecycle hooks and no automatic capture.
- What it stores is a file you can open. When a session has actually changed something in the vault, the Stop hook appends a timestamped
## HH:MM sessionblock tovault/sessions/YYYY-MM-DD.mdwithtype: sessionfrontmatter, written atomically under a cross-process lock;mneme index rebuildreconstructs the FTS5 index over every markdown file in the vault, so the database is derived state you can delete. - Closing a session costs nothing and takes 2 ms. "No LLM call on the critical path" is enforced in CI rather than promised in prose.
tools/spec_verify.pyparses all six lifecycle hook modules and fails the build on any import of seven network-capable roots (anthropic,openai,requests,httpx,urllib.request,urllib3,aiohttp), andpackages/mneme-cc-plugin/tests/integration/test_c3_no_network.pyre-checks the full transitive import closure of the three hot-path hooks at runtime, where a static scan cannot see. The Stop-hook proxy benchmark measures 2 ms at p95 over 100 sessions against a 1000 ms ceiling:benchmarks/latency/p95_guard.pyenforces that ceiling inside the same path-scoped benchmark workflow described below, andpackages/mneme-cc-plugin/tests/unit/test_stop_performance.pyre-checks it over 100 real Stop calls on every CI run, which carries no path filter. - Search quality cannot silently degrade. A pull request that drops production-FTS5 nDCG@5 more than 0.02 below the locked baseline (0.8006, reported as 0.801), drops Recall@10 more than 0.05 below 1.00, or fails the out-of-vocabulary negative probe fails the build —
benchmarks/retrieval/regression_guard.py, run by.github/workflows/bench.ymlon every pull request and every push tomainthat touchespackages/mneme-core,packages/mneme-mcp,benchmarks/, or the workflow file itself.
Scope and limits
Those numbers come from the in-repo benchmark suite, seeded with MNEME_BENCH_SEED=42. Benchmark A uses a 500-document corpus. Benchmark E uses its default 300-document, 30-query fixture. Reproduce with make bench-all. Both figures above — the 0.801 and the 2 ms — carry the note that governs every figure in this README:
Note: All figures below are deterministic regression anchors computed on a seeded synthetic corpus; they are not real-world quality measurements (see ADR-012).
Retrieval claims follow the reachable path. The production mneme_search path is FTS5 BM25. The Python core contains an experimental feature-hashed lexical-vector backend and an RRF fusion protocol used by unit tests and synthetic benchmarks, but that backend is not wired into the MCP server or installer. Full-profile summarize and timeline can add gated local Graphiti and Neo4j fields. A true semantic embedding backend remains roadmap.
Privacy and network. Inline <private> tag redaction at staging write with SHA256 audit log. Zero outbound network calls except opted-in compression LLM and optional local Neo4j. Compression happens in the background, opt-in, with a cost cap.
Temporal reasoning. The deterministic claim lifecycle (valid-from/to, supersedes, as-of queries, contradiction detection, temporal blame provenance time-travel) is built in on every profile — pure SQLite, no extra dependency. Graphiti export and LLM claim extraction remain optional and never run on the Stop or critical path.
Context Continuity Engine (opt-in). Checkpoints are plain markdown in the vault, zero-LLM, default off.
Obsidian is fully optional. A vault is simply a plain directory of markdown files. mneme requires no specific editor, no external application, and no Obsidian installation. You can work with your vault using grep, git, VS Code, or any text editor. The term "vault" is borrowed convention for a self-contained markdown directory, not a dependency on any particular tool. Because the vault is plain markdown, a user who already uses Obsidian can point it at the same directory and get rendered notes, backlinks, and graph-view navigation over the wikilinks mneme writes. The two tools coexist cleanly: mneme stores all derived state (indexes, staging, audit logs) inside a .mneme directory that Obsidian ignores as a dot folder, and mneme's indexer excludes the .obsidian settings folder from indexing, so neither tool disturbs the other. Obsidian is a convenient viewer and navigator for vault content. It is not part of mneme's capture, indexing, or retrieval path, and it must not be treated as an installation prerequisite.
The full shipped / gated / roadmap ledger is in Implementation Status; the capabilities mneme does not ship at all are listed under What 2.0 Does Not Ship Yet.
Status: 4.1.0 public release. Package, plugin, runtime, citation, and documentation version sources are kept in lockstep by tools/version_bump.py (18 sources including this line, verified in CI), so no single declared version can drift. Upgrading from an earlier line: docs/UPGRADING.md.
Tools
The MCP server registers ten tools. Every client that speaks MCP gets all ten; lifecycle hooks
and automatic capture are a separate layer that only Claude Code, Codex, and Antigravity provide.
The authoritative list is packages/mneme-mcp/src/tool_registry.ts.
How mneme compares
Memory tools in the Claude Code and agent ecosystem make different trade-offs. The table below compares architectural capabilities across the dimensions mneme commits to, and it deliberately includes the rows where another tool leads. These cells describe design properties that are publicly verifiable from each tool's documentation. They are not a benchmarked ranking. For mneme's own reproducible numbers see Reproducible Numbers; for per-tool detail and an honest "where mneme is not the best fit" list see docs/COMPETITIVE.md.
Legend: ✓ built in · gated shipped, needs an opt-in dependency or flag · ~ partial · — not available · n/a the dimension does not apply.
The 3.0 line closed the former gap rows on mneme's own terms. Team memory is self-hosted (any git remote, redaction-before-share, optional age end-to-end encryption) with a loopback-only web console rather than a vendor cloud. Autonomy is policy-graduated: the agent applies operator-allowed low-risk edit classes on its own, every change is journalled for one-command rollback and chained into a tamper-evident HMAC audit log, and durable categories always keep a human in the loop. The default-on session summary is deterministic and zero-LLM — no key, no cost, no latency — with LLM compression as the opt-in richer layer. Localized presets ship for English and Turkish today (claude-mem still leads on raw language count, hence the honest ~). Where a hosted product is genuinely the better fit, docs/COMPETITIVE.md says so.
Implementation Status
An honest, at-a-glance map of what is shipped today versus what is gated behind optional infrastructure or still on the roadmap. Shipped means present in the default install path and covered by CI. Gated means implemented but inactive until you provide the optional dependency or flag. Roadmap means designed (often with a seam or protocol already in place) but not yet packaged.
Reproducible Numbers
These come from the in-repo benchmark suite, seeded with MNEME_BENCH_SEED=42. Benchmark A uses a 500-document corpus. Benchmark E uses its default 300-document, 30-query fixture. Reproduce with make bench-all.
Note: All figures below are deterministic regression anchors computed on a seeded synthetic corpus; they are not real-world quality measurements (see ADR-012).
CI regression guards lock the path-scoped benchmark surface. Pull requests touching benchmarked code run the benchmark workflow. Any run that drops production FTS5 Benchmark A nDCG@5 by more than 0.02 or breaches the 1000 ms Stop hook p95 fails the build. The BoW RRF condition is reported only as a lexical-surrogate ablation.
Three-Tier Install
Upgrade in place without losing data.
Verify a healthy install.
Using mneme with Codex
mneme is Claude-Code-native by origin. Because its retrieval core (mneme-core), its MCP server (mneme-mcp), and its vault contract are client-neutral, mneme also runs inside the OpenAI Codex CLI as an additive layer, with no loss of fidelity.
Codex gets the same ten MCP tools, the same two skills, and the same vault. Four of mneme's six registered Claude Code hook events map to native Codex lifecycle events (SessionStart, PostToolUse, Stop, PreCompact), and SessionEnd folds into Stop. UserPromptSubmit has no Codex mapping. See docs/CODEX.md for the full coverage table and ADR-014 in docs/ARCHITECTURE.md for the multi-client design.
Using mneme with Antigravity
Antigravity (Google's agentic IDE) uses the Gemini-CLI extension model, and mneme ships a native extension for it.
This installs the mneme extension into ~/.gemini/extensions/, wiring the same ten MCP tools, the same two skills, a GEMINI.md rules file, and lifecycle hooks (SessionStart, PostToolUse, Stop, PreCompact) that map to the same mneme hook <event> core path Claude Code and Codex use. Because Antigravity exposes a Stop hook, session capture has full native parity.
Other MCP clients (open adapter)
Any MCP-capable client (Kimi, Qwen, Cline, Cursor, and others) can use mneme through the open adapter. This is the non-native tier: the ten MCP tools are available for the model to call, but there are no lifecycle hooks and no automatic capture.
mneme merges only its own server entry and leaves every other server in the config untouched. See docs/INTEGRATIONS.md for the client-tiering details and examples/ for a config snippet and a portable AGENTS.md template.
What 2.0 Ships
- 10 MCP tools:
mneme_search,mneme_recall,mneme_write,mneme_prime,mneme_summarize,mneme_timeline,mneme_propose,mneme_health,mneme_checkpoint_list,mneme_working_set_load. Default search is FTS5.mneme_healthreports the installation's own state — index schema and age, the locale profile the index carries, document count, staging depth — with a remedy attached to every warning. Full-profile summarize and timeline can add KG fields when the local graph is active.mneme_checkpoint_listandmneme_working_set_loadsupport the Context Continuity Engine (CCE): list available working-set checkpoints and load a checkpoint's salience-ranked items for JIT context re-injection. - 5 Claude Code hooks:
PostToolUse,SessionStart,Stop,PreCompact,SessionEnd. - 3 slash commands:
/mneme:prime,/mneme:recall,/mneme:migrate. - 2 skills:
mneme-prime,mneme-search. - 7-benchmark suite (
make bench-all): retrieval quality (A), Stop/retrieve latency (B), adaptive-context cost (C), claude-mem migration (D), head-to-head adapter (E), LongMemEval (F), CCE compaction-recall (G). - One-command migration:
mneme-migrate migrate-from-claude-memwith tri-state archive flag, idempotent re-run, and a per-run hash-checked rollback manifest. - Adaptive Context Layer:
distill.shell_compress,distill.injection_dedup,distill.adaptive_topk,distill.compressed_format, plusmneme auditfor token reports andmneme audit-logfor redaction audit entries. - Pattern memory:
mneme patterns {store, search, list, show, delete}writing vault-markdown Signal/Action/Outcome documents. - Trajectory recorder:
mneme trajectory {start, step, end, show, list}capturing per-session decision trails undervault/trajectories/. - Background AI compression (opt-in, default off):
mneme compress {enable, disable, status, dry-run, run}with monthly cost cap ledger.
The 2.0 advanced line
Eight modules extend mneme's core for specialized workloads. All are gated or shipped as separate packages. All ship with redaction-before-store, provenance on every record, and confidence labels on every extracted claim. None runs on the Stop or critical path.
- Project graph (mneme-graph): tree-sitter extraction for Python, JavaScript, and TypeScript; community detection; PR-impact analysis; entity canonicalization.
- Code memory (mneme-code): AGENTS.md procedural parsing, test-output to failure memory, fix-trajectory capture.
- Domain modes: clinical and security-review modes block external extraction and artifact upload at config layer. A user config can never weaken a built-in privacy mode or disable redaction.
- Agent security: capability firewall, data-flow taint tracking, human-approval gate for durable edits, poisoned-vault benchmark.
- Read-only console: self-contained, offline, injection-safe HTML audit report requiring no server.
- Experimental feature-hashed lexical-vector retrieval: a Python-core backend and RRF seam used by tests and synthetic benchmarks. It is not connected to the installer or production MCP search path.
- Temporal extraction + Graphiti export: rule-based claim extraction, valid-from/to lifecycle, supersedes links, and export to a local Graphiti instance. LLM extraction is optional and never on the critical path. Live Neo4j writes are gated on the full Docker + Neo4j profile.
- Connectors (Obsidian local + GitHub injected-transport): opt-in, default off. Redaction runs before every ingest. Revoke by disabling in config.
What 2.0 Does Not Ship Yet
A credible "best in market" claim requires honest scope acknowledgment.
- No packaged semantic embedding backend, and no installed dense-retrieval user path. The feature-hashed lexical-vector implementation remains an experimental Python API.
- No dense or KG leg inside
mneme_search. MCP search is FTS5. KG enrichment is gated to summarize and timeline when local full-profile graph state is active. - No cloud SaaS option. mneme is local-first by architectural conviction.
- No web-based knowledge graph visual explorer. Planned.
- No multi-user team features with merge-conflict resolution, per-user ACL, or team dashboards. Read-only shared vaults via git remote work today. Full team support is roadmap.
See docs/COMPETITIVE.md for the full landscape and which tools may suit those needs better.
Documentation
docs/ARCHITECTURE.md: design philosophy and the 16 Architecture Decision Records (ADR-001 through ADR-016, with ADR-006 superseded by ADR-015).docs/CONSTRAINTS.md: six sacred constraints and how to verify each.docs/VAULT.md: vault contract, frontmatter specification, atomic write pattern.docs/HOOKS.md: hook integration guide, timing budgets, fail-soft contract.docs/MCP.md: tool API reference with JSON schemas and example calls.docs/RELEASE.md: GitHub tag, release, and metadata checklist.docs/COOKBOOK.md: ten worked recipes with full Claude Code transcripts.docs/MIGRATION-FROM-CLAUDE-MEM.md: one-command migration with tri-state archive and hash-checked rollback walkthrough.docs/BENCHMARKS.md: methodology and the locked baseline numbers.docs/COMPETITIVE.md: living landscape document (monthly refresh).docs/PRIVACY.md: outbound network call audit and telemetry policy (zero by default).docs/GOVERNANCE.md: maintenance model, release authority, succession.
License
Apache License 2.0. See LICENSE and NOTICE. Releases up to and including the 2.x line were published under MIT and remain so.
Acknowledgments
Maintained by Onour Impram (@OnourImpram). The Adaptive Context Layer and the pattern and trajectory primitives draw conceptually from token-compression and agent-DB patterns proven in production internal tooling. The architecture is mneme-native, the lineage is operator experience.
來源:README.md,提交 0c7cb45
工具
0版本歷史
1- v3.5.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分