
Neuromcp
io.github.AdelElo13由 GitHub 账号 AdelElo13 发布v0.30.2更新于 Oct 27, 2026
Semantic memory for AI agents with hybrid search, knowledge graph, and consolidation
概览
本地优先的 AI 智能体语义记忆服务器:用 SQLite 存储、检索和整合记忆,并提供知识图谱与 Markdown 知识库。
- 可以做什么
- 存储、检索与召回记忆,采用向量、全文与图谱混合排序,并可给出带引用的抽取式回答
- 创建和查询实体与关系的知识图谱,并计算中心度
- 把工作划分为情节(episode),维护逐字精确召回库,并生成反思
- 提供多智能体功能:注册智能体、查找专家、评审队列与记忆转移
- 维护 Markdown 知识库,支持导入、检查与简报,并记录检索归因与有用性
- 以 MCP 资源与提示词暴露记忆统计、最近条目与健康状态
- 适用场景
- 适合希望助手跨会话、跨模型记住对话、决策与偏好,且数据全部留在本机的场景。也适合需要可浏览、由 Git 跟踪的知识库而非云端记忆服务的项目。
- 运行要求
- 通过 npx 以 stdio 本地进程运行(需要 Node.js,原生 SQLite 绑定要求启用安装脚本)。语义检索可选安装 Ollama 及 nomic-embed-text 或 bge-m3 等嵌入模型,否则使用首次使用时下载的 ONNX 模型。通过 NEUROMCP_DB_PATH、NEUROMCP_EMBEDDING_PROVIDER 等 NEUROMCP_ 环境变量配置。无需 API 密钥或账号。
安装
在 SourceWeft 中
- 打开 控制台中的 Neuromcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
neuromcp — Sovereign Memory for AI agents
Any model. Your memory. Stays local.
neuromcp is the first Sovereign Memory layer for AI: an open-source MCP server that gives Claude, GPT, Gemini, and Ollama persistent, searchable memory — stored entirely on your machine. No API keys. No cloud sync. No subscription required to remember who you are.
Sovereign Memory = data that you own outright, lives on hardware you control, and is portable across every model you use. Cloud memory products own your data; Sovereign Memory means you do.
[npm version] [npm downloads] [license: AGPL-3.0] [CI]
Or run the bare server without any setup: npx neuromcp. Something not
working? npx neuromcp-doctor diagnoses the daemon, Ollama, embeddings
and the database in one run.
The built-in memory browser: the most-connected entities in a namespace
and the relations between them, as a force-directed graph you can drag,
zoom and click — served from localhost, never from a cloud. See
Memory browser & Obsidian.
Why neuromcp
The LLM is a commodity. Your memory is the moat. GPT-5, Claude 4, Gemini — they all converge. The model you use next year will differ. The memory of every conversation, decision, and preference you build is yours. neuromcp keeps that layer on your machine and makes it portable across any MCP-compatible client.
Local-first is a design choice, not a limitation. No telemetry. No data leaves your laptop. No vendor has a copy of your conversations. Audit every line of code that touches your memory. SQLite + local embeddings; everything fits on one disk.
One install. Every client. Claude Desktop, Cursor, Windsurf, Codex CLI, Continue, LibreChat, Open WebUI — neuromcp speaks MCP, so it works wherever MCP is supported. Switch models tomorrow; your memory follows.
Real recall, not keyword matching. Hybrid retrieval combines vector search (nomic-embed-text, 768-dim), BM25 full-text, graph links, and a learned usefulness prior. At 500 distractors on LongMemEval, R@5 holds at 93.3%. Your context window gets the right memory, not just the most recent.
LongMemEval-S accuracy
Repro: OMB_ANSWER_LLM=claude OMB_ANSWER_MODEL=opus OMB_JUDGE_LLM=claude OMB_JUDGE_MODEL=opus uv run omb run --dataset longmemeval -s s -m neuromcp -c "single-session-user,single-session-assistant,multi-session,temporal-reasoning,knowledge-update,single-session-preference" --query-limit 17
Sample size honesty. n=102 (17 per category × 6 categories). Wilson 95% CI for 98/102 ≈ 90.5–98.7%. Full 500q run with the same config is the next milestone before any "top-tier" claim.
Benchmarks (v0.18.0)
Oracle split (clean — easy mode)
Oracle-split LongMemEval isolates the correct memory in a small corpus. Every local MCP memory system claims ~99% here. It measures "does the ranker work on clean inputs" — nothing more.
Distractor split (v0.18.0, honest)
Same 30 questions + 1000 random distractor memories drawn from other questions' haystacks. The correct memory now competes against real noise.
Reproduce: npx tsx eval/longmemeval-distractor-runner.ts --limit 5 --distractors 1000
Sample sizes. The 500-distractor row is n=30 (Wilson 95% CI for 28/30 ≈ 78-99% R@5). The 1000-distractor row is n=5 — preliminary, Wilson 95% CI [57%, 100%]. The 1000-distractor n=30 run takes ~36 min on a single Ollama instance; cached-distractor batching is v0.19.0 work. Treat 500-distractor numbers as defensible, 1000-distractor as directionally positive but underpowered.
Head-to-head comparison is explicit v0.19.0 work. Hindsight (local OSS MCP, ~94.6% LongMemEval claimed) and Mem0/Zep publish their own numbers on their own harnesses. Until we run all of them against the same corpus + embedder, calling any local MCP server "state of the art" is marketing, not measurement. neuromcp publishes its numbers with sample-size caveats so you can judge direction; don't read absolute superiority into them yet.
Hybrid ranker (BM25 + vector + attention + graph + usefulness prior) keeps R@5 = 100% at 1000:1 distractor:target ratio on the observed sample. MRR drops to 74% because the correct memory is sometimes not rank-1 but always rank ≤ 5 in what we saw. Earlier v0.18.0 numbers (R@5 23%) were from a test FakeEmbedder — fixed in v0.18.1.
What this benchmark does NOT prove: end-to-end answer correctness, long-horizon multi-session reasoning, or superiority over commercial cloud systems (Mem0, Zep) on their own benchmarks. Those comparisons need their numbers on the same distractor split, which hasn't been published.
Why
AI agents forget everything between sessions. Existing solutions either store flat key-value pairs (useless for real knowledge) or require cloud infrastructure and API keys.
neuromcp gives you two layers of memory:
- MCP Server — hybrid search (vector + full-text + graph), verbatim recall, memory governance, automatic consolidation, all in a single SQLite file
- Wiki Knowledge Base — compiled Markdown knowledge that survives crashes, compounds over sessions, and gives your agent project-aware context at every startup
Inspired by Karpathy's LLM Wiki, Mastra's Observational Memory, and Zep's temporal knowledge graphs — but simpler than all of them. No vector DB, no embeddings pipeline, no cloud. Just Markdown files + Git + hooks.
Architecture
How the wiki works
Self-healing consolidation pipeline (v0.15.0+)
Every ~4h the launchd agent runs run-consolidation.sh, which
orchestrates four steps end-to-end:
consolidate-sessions.py— batches raw sessions per project, asks Claude for a factual summary, and fact-checks it against the raw sources. When the auditor flags specific unsupported claims the consolidator now auto-strips those lines and re-audits once — so one speculative sentence no longer kills a whole batch.rescue-rejected.py— any batch that still fails is parsed, the unsupported claims are removed, and the cleaned summary is appended to its wiki page. Pure text surgery, no LLM calls.entity-linker.py— cross-links every page: a bare-word mention of another registered entity (people/, projects/, systems/) is added to the page'srelated:frontmatter. Makes the wiki act like a graph without a separate graph database.rebuild-index.py— regeneratesindex.mdand per-category-index.mdfiles. Categories over 10 pages are auto-split so the session-start router stays compact as the wiki scales.
The pipeline is idempotent — safe to re-run at any time.
What the LLM knows at session start
Quick Start
One command (recommended)
Detects your installed MCP clients (Claude Desktop, Claude Code, Cursor,
Windsurf), writes the neuromcp entry into each config (with a backup of
the original), initializes the wiki + hooks, and checks whether Ollama is
available. --dry-run previews everything without writing.
For GUI clients (Claude Desktop, Codex Desktop) install permanently
first: npm install -g neuromcp && neuromcp-init. Only a permanent
install lets init write the absolute node + script paths those clients
need — from the bare-npx cache (garbage-collected) it deliberately
falls back to a PATH-dependent npx entry, which GUI clients usually
cannot resolve.
Manual steps (what init does under the hood)
1. Start the MCP server
2. Initialize the wiki + hooks (required for closed-loop attribution)
This creates the wiki structure, installs hooks (Claude Code) and rules (other editors), and configures everything automatically. Without this step, npx neuromcp still runs as a plain MCP server with 46 tools, but the critic hook that closes the attribution loop is not installed — retrieval works but usefulness scores never accumulate. Safe to run multiple times — won't overwrite existing config.
Editor Compatibility
neuromcp works with any MCP-compatible editor. Two tiers of integration:
Claude Code gets the full experience via native hooks — context injection and persistence happen automatically, even if the LLM forgets.
Other editors get rules files that instruct the LLM to call neuromcp tools at session start/end. This depends on LLM compliance — it works well in practice but is not guaranteed like hooks.
Supported editors: cursor, windsurf, cline, copilot (VS Code), jetbrains, zed
Recommended: Add Ollama for real semantic search
neuromcp auto-detects it. No config needed.
Non-English memories: use a multilingual embedder
nomic-embed-text is English-centric. On a real Dutch memory store (2,402
memories, 40 paraphrased Dutch queries, 15 off-topic queries) it found the
right memory in the top 5 only 2.5% of the time, and off-topic queries scored
higher than true matches. bge-m3 (multilingual, 1024-dim) on the same data:
To switch an existing install:
Run the reembed with NEUROMCP_EMBEDDING_MODEL=bge-m3 set. After that every
client on the default auto setting follows the model the index was built
with, so nothing else needs configuring. With bge-m3, search_memory also
applies a calibrated relevance floor (0.45) so off-topic queries return
nothing instead of noise; keyword (FTS) and knowledge-graph hits always pass.
Keep NEUROMCP_RERANKER=none for non-English memories: the bundled
cross-encoder (ms-marco-MiniLM-L-6-v2) is English-only and dropped MRR on
the Dutch benchmark above from 0.46 to 0.18.
Upgrading
neuromcp-init-wiki copies the Claude Code hooks once; until 0.30.0 it never
touched them again, so hook fixes did not reach existing installs. Re-running
it now updates every hook that is an unmodified older neuromcp version (a
backup is kept next to each one), migrates old .js hooks to .cjs (leaving a
forwarding stub at the old path) and leaves hooks you edited alone — it lists
them, and --update-hooks replaces those too. neuromcp-doctor check reports
outdated hooks.
Installation
The reliable way is npm install -g neuromcp && neuromcp-init — it
writes the entry below into every detected client config (with a backup
first). Run init from the permanent install, not via bare npx: from the
npx cache it deliberately falls back to a PATH-dependent entry that GUI
clients usually cannot resolve. The manual form is:
Claude Code
npx is fine here because Claude Code runs from your terminal and
inherits your PATH.
Claude Desktop / Codex Desktop / any GUI client
GUI apps are started by the window manager, not by a login shell, so
they inherit a minimal PATH that usually has neither node nor npx
(nvm, fnm, Volta and Homebrew all install outside /usr/bin). Use
absolute paths — this is exactly what neuromcp-init writes since 0.29.3:
Find your own two paths with:
(bin/neuromcp.mjs keeps its #!/usr/bin/env node shebang, so running it
straight from a terminal still works.)
Cursor / Windsurf / Cline
Same format — add to your editor's MCP settings. Copy-paste configs for
every client live in examples/.
Shared daemon (recommended when you run multiple clients)
By default each client spawns its own neuromcp process. One shared
background daemon serves them all instead — one database connection, one
embedding pipeline, no cold start per client:
Then point clients at the daemon:
The daemon binds loopback only, rejects non-allowlisted Host and
Origin headers (DNS-rebinding defense), and is unauthenticated by
design inside that boundary. Uninstall: npx neuromcp-enable-daemon --uninstall.
Platform support
Per-project isolation
Memory browser & Obsidian
Memory you cannot see is memory you cannot trust. neuromcp ships two ways to look at what your agents actually know — both local, both read-only.
Built-in web view
When the shared daemon
is running, open http://127.0.0.1:<port>/ui (default port 3200):
- Graph — the top entities in a namespace and the relations between them, as a force-directed canvas. Drag nodes, scroll to zoom, click a node to list the memories linked to it (current memories only; superseded ones are hidden unless you ask for them).
- Timeline — type a topic and see how the facts about it evolved over time, including which memory superseded which.
The UI is a single page with no external assets (strict CSP, no CDN), and
it is only served on loopback: bind the daemon to a non-loopback host and
the /ui and /api/* routes are disabled entirely.
Obsidian graph of the wiki
The wiki (~/.neuromcp/wiki) is plain Markdown, so it opens directly as an
Obsidian vault. Obsidian draws its graph from
[[wikilinks]] while neuromcp keeps relationships in frontmatter, so run
the bridge once (idempotent, --dry-run supported):
neuromcp-init-wiki also seeds a minimal wiki/.obsidian/ (colour groups
per page type, no plugins) — only if none exists; an existing vault
setup is never touched. Details: docs/OBSIDIAN.md.
MCP Surface
46 tools across 8 families — the full auto-generated reference with
every parameter lives in docs/TOOLS.md (regenerated
from the actual registrations on every change; CI fails when it drifts).
Picking the right retrieval tool: search_memory returns ranked raw
memories; recall_answer synthesizes a cited extractive answer (or
honestly says not_in_memory); recall_memory is a plain ID/filter
lookup with no semantics; search_all adds the verbatim store to the
sweep.
Resources (13)
Prompts (3)
Wiki Knowledge Base
The wiki is the compiled, human-readable knowledge layer. It replaces the chaos of session logs with structured, interlinked Markdown pages.
Why a wiki instead of more vector search?
Wiki page format
How to use
The wiki works automatically once hooks are installed. The LLM:
- Reads
index.mdat session start to know what knowledge exists - Reads specific pages when relevant to the current task
- Updates pages when learning something new
- Gets reminded every 8 tool calls if the wiki needs updating
You can also browse and edit the wiki manually — it's just Markdown files.
Auto-consolidation (optional)
Once you accumulate raw session logs, the wiki can be kept fresh automatically. A scheduled job reads unprocessed sessions, groups them per project (by detecting $HOME/projects/<name> paths in the session content), and uses the claude CLI to synthesise a ## [date] entry into the right wiki page.
What it installs:
~/.neuromcp/scripts/consolidate-sessions.py— the worker~/.neuromcp/scripts/run-consolidation.sh— threshold-guarded runner- macOS: a launchd agent that fires every 4 hours (
com.neuromcp.consolidate) - Linux: prints a cron snippet to add manually
Requirements:
python3≥ 3.8 onPATH- the
claudeCLI onPATH
Guards built in:
- Threshold: skip if fewer than 5 unprocessed sessions
- Output is extracted from a fenced markdown block; apology/narration text is rejected
- Ledger (
~/.neuromcp/consolidation-ledger.json) makes re-runs idempotent - Large project backlogs are auto-batched (default 15 sessions per
claudecall; override with--max-sessions)
Uninstall: npx neuromcp-enable-consolidation --uninstall
Change interval: npx neuromcp-enable-consolidation --interval 7200 (every 2 hours)
Hallucination guard (eval-loop). Every consolidator output goes through a second Haiku audit before the wiki is touched. If any factual claim in the generated summary is not traceable to the raw sessions, the chunk goes to ~/.neuromcp/review-queue/ instead of the wiki. No hallucinated claims leak through.
Atomic facts with temporal supersession. After a summary is approved, it is also distilled into short standalone facts and stored as category='fact' rows with valid_from=today. When a new fact is Jaccard-similar to an existing one in the same project, Haiku decides whether NEW supersedes OLD — if yes, the old row gets superseded_by_id and valid_to set. Retrieval defaults to current facts only (superseded_by_id IS NULL), so outdated conclusions never resurface.
Auto-retrieve + hybrid indexing
Once the wiki has content, make it searchable so the UserPromptSubmit hook can surface relevant pages automatically (no more "LLM must remember to call search"):
The indexer splits each page on ## section headers and stores every section as a deduplicated memory (source='wiki', category='wiki'). Each section is both written to the FTS5 index and embedded via the configured provider (Ollama → OpenAI → ONNX) so vector search works too.
At prompt time the neuromcp-auto-retrieve.js hook calls neuromcp-query, which runs FTS5 BM25 and sqlite-vec cosine search in parallel and fuses the rankings via Reciprocal Rank Fusion (k=60). The top-3 merged results are injected as <neuromcp-recall> context.
The hook is installed automatically by neuromcp-init-wiki and registered under UserPromptSubmit in Claude Code's settings.json. Re-run the indexer after large wiki updates (or schedule it — it's idempotent).
Tuning:
Known upstream issues
memories_vec does not reclaim space after DELETE — sqlite-vec #54 / #265. When you re-index after editing wiki sections, the old vector rows are marked deleted but their storage stays. The database file grows monotonically until you run npx neuromcp-index-wiki --rebuild, which drops and re-creates the vector rows. Run a rebuild every few weeks if you edit the wiki heavily.
claude CLI streaming hangs from non-TTY subprocesses on macOS — if you script interactions with claude -p from another process (e.g. scheduled jobs), pipe it through script -q /dev/null to allocate a pseudo-TTY. Without that the stdout buffer never flushes. We work around this inside the consolidator where needed.
Memory Governance
Namespaces isolate memories by project, agent, or domain.
Trust levels (high, medium, low, unverified) rank search results and control decay resistance.
Soft delete tombstones memories — recoverable for 30 days.
Content hashing (SHA-256) deduplicates at write time.
Lineage tracking records source, project ID, and agent ID per memory.
Configuration
All via environment variables. Defaults work for most setups.
What's new
Full history in CHANGELOG.md. Recent highlights:
- v0.29 — current-validity everywhere: superseded memories are hidden
from every read path by default (
include_superseded/valid_atto opt in); built-in web memory browser with force-directed graph + timeline; Obsidian bridge and non-destructive vault seed; cold-boot race fix (daemon binds its port at process start);neuromcp-doctorandneuromcp-connectfind the daemon on its configured port; switching embedding provider no longer bricks an existing database (neuromcp-reembed, degraded mode); npm releases via Trusted Publishing (no tokens); graph overview no longer polluted by the system's own contradiction plumbing. - v0.28 —
neuromcp-initone-command setup (detects clients, writes configs with backups);neuromcp-doctorrebuilt as real triage; auto-generateddocs/TOOLS.md+docs/BENCHMARK.md;examples/client configs; store-time namespace pushdown; entity prefix-merge now needs evidence. - v0.27 — security release: CWE-22 path-traversal fix in
wiki_ingest, MCP-specOriginvalidation on the daemon,neuromcp-connectboot-race-safe Claude Desktop bridge, runtime health-check hook. - v0.26 —
recall_answer(deterministic extractive answers with citations + gap-analysis, no LLM on the read path), optional local cross-encoder reranker (ships default-off after an honest A/B), recall-quality correctness sweep. - v0.20–0.25 — shared HTTP daemon, session isolation, critic hook, entity dedup canonicalization, distractor benchmark hardening.
Explain mode
Every search_memory result includes an explain field so you can audit
what the system remembers and why it surfaced:
Contradiction resolution is three-tier, and the two tiers that touch the
graph require claim-level evidence — same subject, mutually-exclusive
predicate (is, uses, runs, … see src/config/predicate-classes.json),
different object: supersede (evidence + heuristic score > 0.5: old
memory invalidated), coexist (evidence + score in (0.3, 0.5]: both
kept, linked via a contradicts graph edge), flag (heuristic signal only — numeric
difference, negation words — reported in the store_memory result for
review, never materialised in the graph). Keyword heuristics alone can
never invalidate a memory or assert a contradiction: a false one is a
hallucination vector for every LLM downstream.
Troubleshooting
One run checks: Node version, native modules actually loadable
(better-sqlite3, sqlite-vec), database openable, shared daemon
/health, Ollama reachable + nomic-embed-text pulled, ONNX fallback
model present, and whether the vector index in your database still
matches a provider this machine can reach. Exit codes: 0 healthy, 1
degraded (e.g. no Ollama — ONNX fallback active), 2 broken. Start every
bug report with its output.
"Embedding dimension mismatch" / vector search is off
The vector index is a vec0 table with a fixed width: 384 for the
ONNX fallback, 768 for Ollama's nomic-embed-text. If the provider
changes (you installed Ollama after running on the fallback, or Ollama
was down and the auto cascade dropped to ONNX), the new provider cannot
write into the old index.
Since 0.29.3 this no longer stops the server. It:
- prefers the provider that matches the existing index,
- retries a briefly-unavailable provider with backoff,
- and otherwise starts in degraded mode — full-text search keeps
working, vector search is disabled, and new memories are stored
without embeddings and queued for
backfill_embeddings. Nothing is deleted and the index is never rebuilt behind your back.
neuromcp-doctor check names the state. To get vector search back, pick one:
Stop every client before --apply. Rollback is a file move back.
Installing without Xcode / with install scripts disabled
better-sqlite3 fetches its prebuilt binary from its install script.
With npm install --ignore-scripts (or a hardened .npmrc, or pnpm's
build allowlist) the package installs but has no native binding and
nothing works. npm 11's own default is ignore-scripts=false, so a plain
install is fine:
If you already installed with scripts off, reinstall as above (a bare
npm rebuild in a global prefix does not reliably produce the binding).
The ~33 MB ONNX fallback model no longer depends on the postinstall at
all: it is downloaded lazily on first use into ~/.neuromcp/models
(user-writable even when the package lives in a root-owned global
prefix). Fetch it ahead of time with npx neuromcp-download-model, or
forbid the download entirely with NEUROMCP_DISABLE_MODEL_DOWNLOAD=1.
Comparison
License
AGPL-3.0 for the engine in src/. MIT for bin/, templates/,
scripts/, docs/, and examples/ (carve-out — see LICENSE-EXAMPLES).
License FAQ
Can I use neuromcp commercially? Yes. Running neuromcp as part of your own application, on your own infrastructure, is unrestricted. AGPL only imposes obligations if you modify the engine code AND distribute or host it as a network service.
Can I install neuromcp from npm in my closed-source product? Yes. Using the published binary as a dependency does not trigger AGPL contagion.
What if I host neuromcp as a SaaS? Then AGPL §13 applies: you must make the source code (including your modifications) available to your users. This is the explicit anti-fork clause we chose for the engine — it stops well-funded competitors from taking the code, putting it behind a login, and shipping it as their own product.
Can I copy a CLI script or template? Yes. Everything in bin/,
templates/, scripts/, docs/, and examples/ is dual-licensed
AGPL-3.0 OR MIT. Pick MIT in your downstream project.
Need different terms for the engine? Commercial dual-license is available — contact the maintainer.
来源:README.md,提交 3c9a254
工具
0版本历史
3- v0.30.2最新Oct 15, 2026
- v0.30.1Oct 14, 2026
- v0.29.5Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。