
Mnemon Mcp
io.github.nikitacometa由 GitHub 账号 nikitacometa 发布v1.0.1更新于 Oct 24, 2026
Persistent layered memory for AI agents. SQLite FTS5, fact versioning, zero-cloud.
概览
为 AI 助手提供持久化的长期记忆,保存在本地 SQLite 文件中,支持分层记忆、事实版本管理和全文或混合检索。
- 可以做什么
- Mnemon 提供十个 MCP 工具,用于存储、搜索、更新、删除、检查、导出记忆以及运行健康诊断,还支持会话跟踪和知识库导入。记忆分为情景、语义、程序性和资源四个层,更新后的事实以取代链保留而不是直接删除。检索默认使用 SQLite FTS5,配置嵌入提供方后可启用向量和混合模式。资源与提示词可提供统计、近期记忆以及回忆或日志工作流。
- 适用场景
- 当助手需要跨对话记住事实、偏好、规则和过往会话,并且希望这些记忆留在本机时适合使用。它适合本地优先的场景,单个 SQLite 文件比云端记忆服务更容易备份和审查。
- 运行要求
- 作为本地 stdio 进程运行,通过 npm 包 mnemon-mcp 安装,因此需要 Node.js。SQLite 数据库会自动创建在 MNEMON_DB_PATH(默认 ~/.mnemon-mcp/memory.db)。默认全文检索不需要账号或 API 密钥;向量或混合检索需要将 MNEMON_EMBEDDING_PROVIDER 设为 openai 或 ollama,使用 OpenAI 时还需 MNEMON_EMBEDDING_API_KEY。可选的 HTTP 传输使用 MNEMON_AUTH_TOKEN、MNEMON_HOST 和 MNEMON_PORT。
安装
在 SourceWeft 中
- 打开 控制台中的 Mnemon Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mnemon-mcp
[CI] [npm version] [Node.js] [License: MIT]
Persistent layered memory for AI agents. Local-first. Zero-cloud. Single SQLite file.
Landing Page · npm · GitHub
Your AI agent forgets everything after each session. Mnemon fixes that.
It gives any MCP-compatible client — OpenClaw, Claude Code, Cursor, Windsurf, or your own — a structured long-term memory backed by a single SQLite database on your machine. No API keys, no cloud, no telemetry. Just npm install and your agent remembers.
[mnemon-mcp demo — memory_add, memory_search, memory_inspect, memory_update]
Why Layered Memory?
Flat key-value stores treat "what happened yesterday" the same as "never commit without tests." That's wrong — different kinds of knowledge have different lifetimes and access patterns.
Mnemon organizes memories into four layers:
A journal entry from last Tuesday and a coding rule that never changes live in different layers — because they should.
Retrieval Quality
Retrieval is measured against a 50-case golden set on a real 797-memory bilingual (RU/EN) corpus, through the actual MCP server — not a reimplementation. Current numbers (methodology & history):
Hybrid beats both legs individually, which is the whole argument for fusing them: lexical search has the better raw recall, vector search the better ranking, and RRF keeps both instead of averaging them away.
The eval doc tracks the failures too — score drift under corpus growth, the BM25 field-weight bug the eval caught, the two cases where fusion still loses to pure lexical search, and what the golden set does not cover. Numbers you can't audit are marketing; read how these are produced.
Architecture
One SQLite file holds memories, the FTS5 index, and the optional vector index. Writes go through transactions that keep the supersede-chain invariant; reads run the staged retrieval pipeline described under Search.
The full picture — module boundaries, write/read paths, invariants, and known limitations — is in docs/ARCHITECTURE.md. Design decisions are recorded as ADRs: SQLite+FTS5 core, hybrid RRF retrieval, synchronous driver, layered memory model.
Quick Start
Install
Or from source:
Configure Your MCP Client
OpenClaw
Or add to ~/.openclaw/mcp_config.json:
Claude Code
Add to ~/.claude/mcp.json:
Cursor / Windsurf / Other MCP clients
Add to your client's MCP config:
Running from source?
Use the full path to the compiled entry point:
Verify
You should see 10 tools in the response. The database (~/.mnemon-mcp/memory.db) is created automatically on first run.
That's it. Your agent now has persistent memory.
What It Can Do
10 MCP Tools
MCP Resources & Prompts
Resources — live data your agent can read:
Prompts — pre-built workflows:
Search
Four modes, all supporting layer / entity / scope / date / confidence filters:
FTS mode (default without embeddings) — tokenized full-text search with BM25 ranking. Multi-word queries use AND; if too few results, OR supplements with a score penalty. Progressive AND relaxation tries top-3 most specific terms before falling back to full OR.
Hybrid mode (default when embeddings configured) — combines FTS5 + vector search via Reciprocal Rank Fusion. Detects quoted entities in queries (e.g., 'Essentialism') and runs weighted sub-queries for cross-reference retrieval.
Vector mode — pure cosine similarity search over embeddings.
Exact mode — LIKE substring match for precise phrase lookups.
Scores: bm25 × (0.3 + 0.7 × importance) × decay(layer) × recency
Recency boost: 1 / (1 + daysSince / 365) — gently rewards recently created memories without penalizing old ones.
Stemming
Snowball stemmer applied at both index time and query time for English and Russian. This means "running" matches "runs", and "книги" matches "книга". Stop words are filtered from queries to improve precision.
Fact Versioning
Knowledge evolves. Mnemon doesn't delete old facts — it chains them:
Search returns only the latest version. memory_inspect with include_history: true reveals the full chain. memory_delete re-activates the predecessor — nothing is lost.
Vector Search (Optional, BYOK)
Enable semantic similarity search by providing your own embedding API:
This unlocks two additional search modes:
mode: "vector"— pure cosine similarity searchmode: "hybrid"— FTS5 + vector combined via Reciprocal Rank Fusion
Requires sqlite-vec (installed as optional dependency). New memories are embedded on add; existing ones can be backfilled.
Embedding configuration
Importing a Knowledge Base
Got a folder of Markdown files? Import them in bulk:
The config maps glob patterns to memory layers:
Config Fields
HTTP Transport
For remote or multi-client setups:
Binds to 127.0.0.1 by default. Binding to any other host requires MNEMON_AUTH_TOKEN — the server refuses to expose the memory store to the network unauthenticated (override with MNEMON_ALLOW_INSECURE_HTTP=1 on a trusted network). Rate limiting (100 req/min/IP by default), opt-in CORS, 1MB body limit, timing-safe auth, graceful shutdown on SIGTERM.
Configuration Reference
Tool Reference
memory_add — full parameter list
memory_search — full parameter list
memory_update — full parameter list
memory_delete
memory_inspect
memory_export
memory_health
Returns: status (healthy / warning / degraded), per-layer stats, expired entries, orphaned chains, stale/low-confidence counts, cleaned count when cleanup=true.
memory_session_start
Returns: id (session UUID), started_at (ISO 8601).
memory_session_end
Returns: id, ended_at, duration_minutes, memories_count.
memory_session_list
Returns: array of sessions with id, client, project, started_at, ended_at, summary, memories_count.
How It Compares
Extended competitive analysis with sources: docs/COMPETITORS.md.
Development
CI runs build + lint + tests on Node 20 and 22, then smoke-tests the compiled
server over real JSON-RPC (tools/list must match the exact tool set).
Stack: TypeScript 5.9 (strict mode), better-sqlite3, @modelcontextprotocol/sdk, Snowball stemmer, Zod, vitest.
See CONTRIBUTING.md for code guidelines.
Design Principles
- Air-gapped by default — zero telemetry, ever. Out of the box nothing leaves the machine; the only component that talks to the network is the optional embedder, and only to the provider you configure (including a local Ollama).
- Single file — one SQLite database, zero ops, instant backup via file copy.
- Deterministic search — FTS5, not embeddings, is the default. Interpretable, reproducible, no GPU needed.
- Structured over flat — layers encode access patterns; superseding chains encode time.
- Minimal — 4 production dependencies. Works everywhere Node runs.
- Measured, not asserted — retrieval changes are judged against a golden set, regressions included.
License
来源:README.md,提交 4e1a320
工具
0版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分