{
  "markdown": "# neuromcp — Sovereign Memory for AI agents\n\n**Any model. Your memory. Stays local.**\n\nneuromcp 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.\n\n> **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.\n\n[![npm version](https://img.shields.io/npm/v/neuromcp)](https://www.npmjs.com/package/neuromcp)\n[![npm downloads](https://img.shields.io/npm/dw/neuromcp)](https://www.npmjs.com/package/neuromcp)\n[![license: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue)](./LICENSE)\n[![tests](https://img.shields.io/badge/tests-471%20passing-brightgreen)](./tests)\n\n```bash\nnpx neuromcp-init   # one command: detects your MCP clients, writes configs, sets up the wiki\n```\n\nOr run the bare server without any setup: `npx neuromcp`. Something not\nworking? `npx neuromcp-doctor` diagnoses the daemon, Ollama, embeddings\nand the database in one run.\n\n## Why neuromcp\n\n**The LLM is a commodity. Your memory is the moat.**\nGPT-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.\n\n**Local-first is a design choice, not a limitation.**\nNo 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.\n\n**One install. Every client.**\nClaude 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.\n\n**Real recall, not keyword matching.**\nHybrid 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.\n\n## LongMemEval-S accuracy\n\n| Run | Score | Sample | Config |\n|-----|-------|--------|--------|\n| **v7 (current)** | **96.08%** (98/102) | n=102 | Opus generator + Opus judge, single-model |\n| v6 | 95.10% (97/102) | n=102 | Same as v7, prior hint set |\n\nRepro: `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`\n\n> **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.\n\n## Benchmarks (v0.18.0)\n\n### Oracle split (clean — easy mode)\n\n| Mode | R@5 | R@10 | Hit Rate |\n|------|-----|------|----------|\n| Extracted (hybrid) | 100% | 100% | 100% |\n\nOracle-split LongMemEval isolates the correct memory in a small\ncorpus. Every local MCP memory system claims ~99% here. It measures\n\"does the ranker work on clean inputs\" — nothing more.\n\n### Distractor split (v0.18.0, honest)\n\nSame 30 questions + 1000 random distractor memories drawn from other\nquestions' haystacks. The correct memory now competes against real noise.\n\n| Embedder | Distractors | N | R@5 | R@10 | MRR |\n|----------|-------------|---|-----|------|-----|\n| Ollama `nomic-embed-text` | 0 (oracle) | 30 | 100% | 100% | 100% |\n| Ollama `nomic-embed-text` | 200 | 5 | 100% | 100% | 100% |\n| Ollama `nomic-embed-text` | **500** | **30** | **93.3%** | **93.3%** | **80.3%** |\n| Ollama `nomic-embed-text` | 1000 | 5 | 100% | 100% | 74% |\n\nReproduce: `npx tsx eval/longmemeval-distractor-runner.ts --limit 5 --distractors 1000`\n\n> **Sample sizes.** The 500-distractor row is n=30 (Wilson 95% CI for\n> 28/30 ≈ 78-99% R@5). The 1000-distractor row is n=5 — preliminary,\n> Wilson 95% CI [57%, 100%]. The 1000-distractor n=30 run takes ~36 min\n> on a single Ollama instance; cached-distractor batching is v0.19.0\n> work. Treat 500-distractor numbers as defensible, 1000-distractor as\n> directionally positive but underpowered.\n\n\n> **Head-to-head comparison is explicit v0.19.0 work.** Hindsight (local\n> OSS MCP, ~94.6% LongMemEval claimed) and Mem0/Zep publish their own\n> numbers on their own harnesses. Until we run all of them against the\n> same corpus + embedder, calling any local MCP server \"state of the art\"\n> is marketing, not measurement. neuromcp publishes its numbers with\n> sample-size caveats so you can judge direction; don't read absolute\n> superiority into them yet.\n\nHybrid ranker (BM25 + vector + attention + graph + usefulness prior)\nkeeps R@5 = 100% at 1000:1 distractor:target ratio on the observed\nsample. MRR drops to 74% because the correct memory is sometimes not\nrank-1 but always rank ≤ 5 in what we saw. Earlier v0.18.0 numbers\n(R@5 23%) were from a test FakeEmbedder — fixed in v0.18.1.\n\n**What this benchmark does NOT prove:** end-to-end answer\ncorrectness, long-horizon multi-session reasoning, or superiority\nover commercial cloud systems (Mem0, Zep) on their own benchmarks.\nThose comparisons need their numbers on the same distractor split,\nwhich hasn't been published.\n\n\n## Why\n\nAI agents forget everything between sessions. Existing solutions either store flat key-value pairs (useless for real knowledge) or require cloud infrastructure and API keys.\n\nneuromcp gives you two layers of memory:\n\n1. **MCP Server** — hybrid search (vector + full-text + graph), verbatim recall, memory governance, automatic consolidation, all in a single SQLite file\n2. **Wiki Knowledge Base** — compiled Markdown knowledge that survives crashes, compounds over sessions, and gives your agent project-aware context at every startup\n\nInspired by [Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f), [Mastra's Observational Memory](https://mastra.ai/research/observational-memory), and [Zep's temporal knowledge graphs](https://arxiv.org/abs/2501.13956) — but simpler than all of them. No vector DB, no embeddings pipeline, no cloud. Just Markdown files + Git + hooks.\n\n## Architecture\n\n```\n~/.neuromcp/\n├── memory.db               ← SQLite: hybrid search, MCP tools\n├── wiki/                   ← Compiled knowledge (git-tracked)\n│   ├── index.md            ← Routekaart — LLM reads this FIRST\n│   ├── schema.md           ← Operating rules for the LLM\n│   ├── log.md              ← Append-only changelog\n│   ├── people/             ← User profiles, preferences\n│   ├── projects/           ← Project knowledge (stack, auth, URLs)\n│   ├── systems/            ← Infrastructure (tools, MCP servers)\n│   ├── patterns/           ← Reusable patterns (error fixes, routing)\n│   ├── decisions/          ← Architecture decisions with context\n│   └── skills/             ← Repeatable procedures\n└── raw/sessions/           ← Raw session logs (auto-generated)\n```\n\n### How the wiki works\n\n| When | What happens |\n|------|-------------|\n| **Session start** | Hook injects `index.md` + user profile + auto-detected project page (~1300 tokens) |\n| **During session** | LLM updates wiki pages when learning something persistent |\n| **Every 8 tool calls** | Hook reminds LLM to update the wiki |\n| **Session end** | Hook writes raw session log + git auto-commits all wiki changes |\n| **Crash** | Checkpoint every 5 tool calls to file. Git history for rollback. |\n\n### Self-healing consolidation pipeline (v0.15.0+)\n\nEvery ~4h the launchd agent runs `run-consolidation.sh`, which\norchestrates four steps end-to-end:\n\n1. **`consolidate-sessions.py`** — batches raw sessions per project,\n   asks Claude for a factual summary, and fact-checks it against the\n   raw sources. When the auditor flags specific unsupported claims the\n   consolidator now **auto-strips those lines and re-audits once** — so\n   one speculative sentence no longer kills a whole batch.\n2. **`rescue-rejected.py`** — any batch that still fails is parsed,\n   the unsupported claims are removed, and the cleaned summary is\n   appended to its wiki page. Pure text surgery, no LLM calls.\n3. **`entity-linker.py`** — cross-links every page: a bare-word mention\n   of another registered entity (people/, projects/, systems/) is added\n   to the page's `related:` frontmatter. Makes the wiki act like a\n   graph without a separate graph database.\n4. **`rebuild-index.py`** — regenerates `index.md` and per-category\n   `-index.md` files. Categories over 10 pages are auto-split so the\n   session-start router stays compact as the wiki scales.\n\nThe pipeline is idempotent — safe to re-run at any time.\n\n### What the LLM knows at session start\n\n```\nSchema (operating rules) → How to maintain the wiki\nIndex (knowledge map)    → What knowledge exists\nUser profile             → Who you are, how you work\nProject page             → Current project details (auto-detected from cwd)\nLast session             → What happened last time\n```\n\n## Quick Start\n\n### One command (recommended)\n\n```bash\nnpx neuromcp-init\n```\n\nDetects your installed MCP clients (Claude Desktop, Claude Code, Cursor,\nWindsurf), writes the `neuromcp` entry into each config (with a backup of\nthe original), initializes the wiki + hooks, and checks whether Ollama is\navailable. `--dry-run` previews everything without writing.\n\n### Manual steps (what init does under the hood)\n\n**1. Start the MCP server**\n\n```bash\nnpx neuromcp\n```\n\n**2. Initialize the wiki + hooks** (**required** for closed-loop attribution)\n\n```bash\nnpx neuromcp-init-wiki\n```\n\nThis 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](docs/TOOLS.md), 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.\n\n### Editor Compatibility\n\nneuromcp works with any MCP-compatible editor. Two tiers of integration:\n\n| Feature | Claude Code | Cursor / Windsurf / Cline / Copilot / JetBrains / Zed |\n|---------|-------------|-------------------------------------------------------|\n| MCP tools ([46](docs/TOOLS.md)) | Full | Full |\n| Context at session start | Hooks (automatic) | Rules (LLM-driven, best-effort) |\n| Persist at session end | Hooks (automatic) | Rules (LLM-driven, best-effort) |\n| Wiki reminders | Every 8 tool calls | No |\n| Crash-resilient checkpoints | Yes | No |\n\n**Claude Code** gets the full experience via native hooks — context injection and persistence happen automatically, even if the LLM forgets.\n\n**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.\n\n```bash\n# Auto-detect installed editors\nnpx neuromcp-init-wiki\n\n# Target a specific editor\nnpx neuromcp-init-wiki --editor cursor\n\n# Install rules for all supported editors\nnpx neuromcp-init-wiki --editor all\n```\n\nSupported editors: `cursor`, `windsurf`, `cline`, `copilot` (VS Code), `jetbrains`, `zed`\n\n### Recommended: Add Ollama for real semantic search\n\n```bash\nollama pull nomic-embed-text\n```\n\nneuromcp auto-detects it. No config needed.\n\n## Installation\n\n### Claude Code\n\n```jsonc\n// ~/.claude.json → mcpServers\n{\n  \"neuromcp\": {\n    \"type\": \"stdio\",\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"neuromcp\"]\n  }\n}\n```\n\n### Claude Desktop\n\n```jsonc\n// ~/Library/Application Support/Claude/claude_desktop_config.json\n{\n  \"mcpServers\": {\n    \"neuromcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"neuromcp\"]\n    }\n  }\n}\n```\n\n### Cursor / Windsurf / Cline\n\nSame format — add to your editor's MCP settings. Copy-paste configs for\nevery client live in [`examples/`](examples/).\n\n### Shared daemon (recommended when you run multiple clients)\n\nBy default each client spawns its own `neuromcp` process. One shared\nbackground daemon serves them all instead — one database connection, one\nembedding pipeline, no cold start per client:\n\n```bash\nnpx neuromcp-enable-daemon --port 3200   # macOS launchd agent; verify with: curl -s http://127.0.0.1:3200/health\n```\n\nThen point clients at the daemon:\n\n```jsonc\n// Claude Code (~/.claude.json) — native HTTP transport\n{ \"neuromcp\": { \"type\": \"http\", \"url\": \"http://127.0.0.1:3200/mcp\" } }\n\n// Claude Desktop — stdio-only, bridge via neuromcp-connect.\n// The bridge waits for the daemon on cold boot (plain mcp-remote exits\n// fatally when the client starts before the daemon has bound its port,\n// leaving a permanent \"Server disconnected\").\n{ \"neuromcp\": { \"command\": \"npx\", \"args\": [\"-y\", \"--package=neuromcp\", \"neuromcp-connect\", \"http://127.0.0.1:3200/mcp\"] } }\n```\n\nThe daemon binds loopback only, rejects non-allowlisted `Host` and\n`Origin` headers (DNS-rebinding defense), and is unauthenticated by\ndesign inside that boundary. Uninstall: `npx neuromcp-enable-daemon --uninstall`.\n\n### Platform support\n\n| Component | macOS | Linux | Windows |\n|-----------|-------|-------|---------|\n| MCP server (stdio + HTTP) | ✅ | ✅ (CI) | ⚠️ untested — native deps ship win-x64 prebuilds, reports welcome |\n| Shared daemon autostart (`enable-daemon`) | ✅ launchd | manual systemd | ❌ |\n| Auto-consolidation (`enable-consolidation`) | ✅ launchd | cron snippet | ❌ |\n| Claude Code hooks | ✅ | ✅ | ⚠️ untested |\n\n### Per-project isolation\n\n```jsonc\n// .mcp.json in project root\n{\n  \"mcpServers\": {\n    \"neuromcp\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"neuromcp\"],\n      \"env\": {\n        \"NEUROMCP_DB_PATH\": \".neuromcp/memory.db\",\n        \"NEUROMCP_NAMESPACE\": \"my-project\"\n      }\n    }\n  }\n}\n```\n\n## MCP Surface\n\n**46 tools** across 8 families — the full auto-generated reference with\nevery parameter lives in [`docs/TOOLS.md`](docs/TOOLS.md) (regenerated\nfrom the actual registrations on every change; CI fails when it drifts).\n\n| Family | Tools | Highlights |\n|--------|-------|-----------|\n| Core memory | 11 | `store_memory` (dedup + contradiction detection + surprise scoring), `search_memory` (hybrid RRF + explain metadata), `recall_answer` (extractive cited answers with gap-analysis), `search_all` |\n| Knowledge graph | 6 | `create_entity`, `create_relation`, `query_graph`, `compute_centrality` (PageRank) |\n| Episodes | 10 | `start_episode`/`end_episode`, clustering, `memory_timeline` |\n| Multi-agent | 9 | `register_agent`, `find_expert`, review queues, memory transfer |\n| Verbatim store | 3 | exact-recall FTS on raw text, never summarized or pruned |\n| Wiki | 3 | `wiki_ingest`, `wiki_lint`, `wiki_briefing` |\n| Attribution & usefulness | 3 | `log_retrieval`, `cite_memories` — closes the usefulness-prior loop |\n| Reflection | 1 | `generate_reflection` |\n\n**Picking the right retrieval tool:** `search_memory` returns ranked raw\nmemories; `recall_answer` synthesizes a cited extractive answer (or\nhonestly says `not_in_memory`); `recall_memory` is a plain ID/filter\nlookup with no semantics; `search_all` adds the verbatim store to the\nsweep.\n\n### Resources (13)\n\n| URI | Description |\n|-----|-------------|\n| `memory://stats` | Global statistics |\n| `memory://recent` | Last 20 memories |\n| `memory://namespaces` | All namespaces with counts |\n| `memory://health` | Server health + metrics |\n| `memory://stats/{namespace}` | Per-namespace stats |\n| `memory://recent/{namespace}` | Recent in namespace |\n| `memory://id/{id}` | Single memory by ID |\n| `memory://tag/{tag}` | Memories by tag |\n| `memory://namespace/{ns}` | All in namespace |\n| `memory://consolidation/log` | Recent consolidation entries |\n| `memory://operations` | Active/recent operations |\n\n### Prompts (3)\n\n| Prompt | Description |\n|--------|-------------|\n| `memory_context_for_task` | Search relevant memories and format as LLM context |\n| `review_memory_candidate` | Show proposed memory alongside near-duplicates |\n| `consolidation_dry_run` | Preview consolidation without applying |\n\n## Wiki Knowledge Base\n\nThe wiki is the compiled, human-readable knowledge layer. It replaces the chaos of session logs with structured, interlinked Markdown pages.\n\n### Why a wiki instead of more vector search?\n\n| Traditional RAG | neuromcp Wiki |\n|----------------|---------------|\n| Re-derives answers every query | Knowledge compiled once, refined over time |\n| Chunking artifacts, retrieval noise | Human-readable pages with source citations |\n| Vector DB, embedding pipeline | Plain Markdown + Git |\n| Black box retrieval | Auditable, editable, portable |\n| Knowledge evaporates | Knowledge compounds |\n\n### Wiki page format\n\n```markdown\n---\ntitle: My Project\ntype: project\ncreated: 2026-04-06\nupdated: 2026-04-06\nconfidence: high\nrelated: [other-project, oauth-setup]\n---\n\n# My Project\n\nDescription, stack, auth, deployment details...\n```\n\n### How to use\n\nThe wiki works automatically once hooks are installed. The LLM:\n1. Reads `index.md` at session start to know what knowledge exists\n2. Reads specific pages when relevant to the current task\n3. Updates pages when learning something new\n4. Gets reminded every 8 tool calls if the wiki needs updating\n\nYou can also browse and edit the wiki manually — it's just Markdown files.\n\n### Auto-consolidation (optional)\n\nOnce 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.\n\n```bash\nnpx neuromcp-enable-consolidation\n```\n\n**What it installs:**\n- `~/.neuromcp/scripts/consolidate-sessions.py` — the worker\n- `~/.neuromcp/scripts/run-consolidation.sh` — threshold-guarded runner\n- **macOS**: a launchd agent that fires every 4 hours (`com.neuromcp.consolidate`)\n- **Linux**: prints a cron snippet to add manually\n\n**Requirements:**\n- `python3` ≥ 3.8 on `PATH`\n- the [`claude` CLI](https://claude.com/claude-code) on `PATH`\n\n**Guards built in:**\n- Threshold: skip if fewer than 5 unprocessed sessions\n- Output is extracted from a fenced markdown block; apology/narration text is rejected\n- Ledger (`~/.neuromcp/consolidation-ledger.json`) makes re-runs idempotent\n- Large project backlogs are auto-batched (default 15 sessions per `claude` call; override with `--max-sessions`)\n\n**Uninstall:** `npx neuromcp-enable-consolidation --uninstall`\n\n**Change interval:** `npx neuromcp-enable-consolidation --interval 7200` (every 2 hours)\n\n**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.\n\n**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.\n\n### Auto-retrieve + hybrid indexing\n\nOnce the wiki has content, make it *searchable* so the `UserPromptSubmit` hook can surface relevant pages automatically (no more \"LLM must remember to call `search`\"):\n\n```bash\nnpx neuromcp-index-wiki              # index wiki pages into memories_fts + memories_vec\nnpx neuromcp-index-wiki --rebuild    # wipe wiki entries first, then reindex\nnpx neuromcp-index-wiki --dry-run    # preview what would change\nnpx neuromcp-index-wiki --no-embed   # FTS-only mode (no embedding provider needed)\n\nnpx neuromcp-backfill-embeddings     # embed any memory still missing a vector\n```\n\nThe 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.\n\nAt 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.\n\nThe 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).\n\n**Tuning:**\n\n| Env var | Default | Purpose |\n|---------|---------|---------|\n| `NEUROMCP_BM25_THRESHOLD` | `-1.0` | Stricter (more negative) = fewer weak keyword matches |\n| `NEUROMCP_QUERY_BIN` | auto-detect | Override the `neuromcp-query` binary path |\n| `NEUROMCP_NO_EMBED` | `0` | Set to `1` to force FTS-only indexing |\n| `NEUROMCP_CONTRADICTION_CHECK` | `1` | Set to `0` to skip Haiku supersession judgments |\n| `NEUROMCP_AUDIT_FAIL_OPEN` | `0` | Set to `1` to bypass the consolidator audit on infrastructure failure (default is fail-CLOSED) |\n\n### Known upstream issues\n\n**`memories_vec` does not reclaim space after DELETE** — [sqlite-vec #54](https://github.com/asg017/sqlite-vec/issues/54) / [#265](https://github.com/asg017/sqlite-vec/issues/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.\n\n**`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.\n\n## Memory Governance\n\n**Namespaces** isolate memories by project, agent, or domain.\n\n**Trust levels** (`high`, `medium`, `low`, `unverified`) rank search results and control decay resistance.\n\n**Soft delete** tombstones memories — recoverable for 30 days.\n\n**Content hashing** (SHA-256) deduplicates at write time.\n\n**Lineage tracking** records source, project ID, and agent ID per memory.\n\n## Configuration\n\nAll via environment variables. Defaults work for most setups.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `NEUROMCP_DB_PATH` | `~/.neuromcp/memory.db` | Database file path |\n| `NEUROMCP_EMBEDDING_PROVIDER` | `auto` | `auto`, `onnx`, `ollama`, `openai` |\n| `NEUROMCP_DEFAULT_NAMESPACE` | `default` | Default namespace |\n| `NEUROMCP_AUTO_CONSOLIDATE` | `false` | Enable periodic consolidation |\n| `NEUROMCP_TOMBSTONE_TTL_DAYS` | `30` | Days before permanent sweep |\n| `NEUROMCP_LOG_LEVEL` | `info` | `debug`, `info`, `warn`, `error` |\n\n## What's new\n\nFull history in [CHANGELOG.md](CHANGELOG.md). Recent highlights:\n\n- **v0.27** — security release: CWE-22 path-traversal fix in `wiki_ingest`,\n  MCP-spec `Origin` validation on the daemon, `neuromcp-connect`\n  boot-race-safe Claude Desktop bridge, runtime health-check hook.\n- **v0.26** — `recall_answer` (deterministic extractive answers with\n  citations + gap-analysis, no LLM on the read path), optional local\n  cross-encoder reranker (ships default-off after an honest A/B),\n  recall-quality correctness sweep.\n- **v0.20–0.25** — shared HTTP daemon, session isolation, critic hook,\n  entity dedup canonicalization, distractor benchmark hardening.\n\n### Explain mode\n\nEvery `search_memory` result includes an `explain` field so you can audit\nwhat the system remembers and why it surfaced:\n\n```json\n{\n  \"explain\": {\n    \"source_trust\": { \"level\": \"high\", \"reason\": \"Directly provided by user\" },\n    \"temporal_validity\": { \"currently_valid\": true, \"superseded_by\": null },\n    \"contradictions\": [{ \"memory_id\": \"abc\", \"content_preview\": \"...\", \"resolution\": \"coexist\" }],\n    \"claims\": [{ \"subject\": \"neuromcp\", \"predicate\": \"version\", \"object\": \"0.26.0\" }],\n    \"confidence\": { \"retrieval_score\": 0.016, \"source_trust_score\": 1.0, \"overall\": 0.85 }\n  }\n}\n```\n\nContradiction resolution is three-tier: **supersede** (score > 0.5, old\nmemory invalidated), **coexist** (0.35–0.5, both kept + linked via a\n`contradicts` graph edge), **flag** (0.3–0.35, reported for review).\n\n## Troubleshooting\n\n```bash\nnpx neuromcp-doctor\n```\n\nOne run checks: Node version, native modules actually loadable\n(`better-sqlite3`, `sqlite-vec`), database openable, shared daemon\n`/health`, Ollama reachable + `nomic-embed-text` pulled, ONNX fallback\nmodel present. Exit codes: `0` healthy, `1` degraded (e.g. no Ollama —\nONNX fallback active), `2` broken. Start every bug report with its\noutput.\n\n## Comparison\n\n| Feature | neuromcp | Hindsight | Mem0 | Letta/MemGPT | agentmemory |\n|---------|----------|-----------|------|--------------|-------------|\n| **LongMemEval R@5 (oracle)** | **99.8%** | — | — | — | — |\n| **LongMemEval R@5 (1000 distractors, n=5, Ollama)** | **100%** (preliminary, CI [57%, 100%]) | not published | not published | not published | not published |\n| Search | Hybrid (vector + FTS + RRF + graph) | Vector + rerank | Vector | Vector | Vector |\n| Auto-capture | Deterministic (no LLM cost) | LLM extraction | No | Agent self-edit | Yes |\n| Explain mode | Yes (trust, contradictions, claims) | No | No | No | No |\n| Knowledge graph | Entities, relations, PageRank | Entities + beliefs | No | No | No |\n| Contradiction detection | 3-tier (supersede/coexist/flag) + graph edges | Belief updating | No | No | No |\n| Temporal validity | valid_from/valid_to on memories + relations | Yes | No | No | No |\n| Wiki knowledge base | Compiled Markdown + Git | No | No | Tiered blocks | No |\n| Local-first | SQLite, zero cloud | SQLite | Cloud / Postgres | Server | Local |\n| Embeddings | Built-in ONNX (zero config) + Ollama | External | External API | External | External |\n| Governance | Namespaces, trust levels, soft delete | Namespaces | API keys | Agent-scoped | Cross-agent |\n| Infrastructure | Zero | Zero | Cloud account | Server | Zero |\n| Pricing | Free (AGPL-3.0) | Free (MIT) | Freemium ($23.9M funded) | Free ($10M funded) | Free (Apache-2.0) |\n\n## License\n\n**AGPL-3.0** for the engine in `src/`. **MIT** for `bin/`, `templates/`,\n`scripts/`, `docs/`, and `examples/` (carve-out — see `LICENSE-EXAMPLES`).\n\n### License FAQ\n\n**Can I use neuromcp commercially?** Yes. Running neuromcp as part of your\nown application, on your own infrastructure, is unrestricted. AGPL only\nimposes obligations if you **modify** the engine code AND **distribute** or\n**host** it as a network service.\n\n**Can I install neuromcp from npm in my closed-source product?** Yes. Using\nthe published binary as a dependency does not trigger AGPL contagion.\n\n**What if I host neuromcp as a SaaS?** Then AGPL §13 applies: you must make\nthe source code (including your modifications) available to your users.\nThis is the explicit anti-fork clause we chose for the engine — it stops\nwell-funded competitors from taking the code, putting it behind a login,\nand shipping it as their own product.\n\n**Can I copy a CLI script or template?** Yes. Everything in `bin/`,\n`templates/`, `scripts/`, `docs/`, and `examples/` is dual-licensed\nAGPL-3.0 OR MIT. Pick MIT in your downstream project.\n\n**Need different terms for the engine?** Commercial dual-license is\navailable — contact the maintainer.\n",
  "bytes": 27947,
  "sha": "82d4a60d3bb758c733b08605be574bb99a66157e605ac8974ad0e126aeccd3f2",
  "repo_slug": "adelelo13/neuromcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_adelelo13_neuromcp_c26448d4/readme"
}