MemoryPilot MCP server
Commit Nov 13, 2026Gives AI clients persistent local long-term memory with hybrid semantic search, auto-classification and compressed context recall.
Also known as Soflutionltd/MemoryPilot
- Stars
- 18
- Tools
- 8
- Downloads, 30 days
- —
- Latest version
- 4.13.0
- Last commit
- Nov 13, 2026
- License
- —
What is MemoryPilot MCP?
MemoryPilot gives AI clients persistent local long-term memory with hybrid semantic search, auto-classification and compressed context recall. It exposes 8 tools, such as add_memory, add_memories, add_transcript.
Summary generated from the project's README
About MemoryPilot MCP server
Providing AI coding assistants with persistent, searchable long-term memory is the primary function of MemoryPilot. It allows tools like Claude Desktop, Cursor, and VS Code to retain project awareness and semantic understanding across different sessions. By running as a single Rust binary with zero runtime dependencies, it operates locally to ensure data remains on your machine without requiring external API calls for memory storage.
The system utilizes a sophisticated hybrid search mechanism combining BM25 and jina-embeddings-v5 with cross-encoder reranking to achieve high retrieval accuracy. It manages information through a temporal knowledge graph and GraphRAG, which helps the AI understand relationships and timelines. To optimize performance, the server uses AAAK compression to reduce token consumption by 5 to 10 times when loading context into an LLM.
Developers can rely on automated maintenance features like auto-classification, auto-compaction, and self-healing database structures. The server handles various complex tasks such as agent persona disambiguation and topic tunnels, making it suitable for maintaining deep context in multilingual environments covering over 100 languages.
What you can do with it
- 1Reducing LLM token costsAn AI client can use compressed context to save significant amounts of tokens during long conversations.
- 2Maintaining project awarenessDevelopers can give their coding assistants a way to remember specific project details between different sessions.
- 3Organizing complex knowledge basesThe server automatically categorizes new information with specific importance and expiration settings.
Written from the project's README. Every use case is checked against a quote from it.
MemoryPilot MCP tools 8
Detected from the READMEadd_memoryadd_memoriesadd_transcriptingest_sessionget_memoryupdate_memorydelete_memorylist_memories
| add_memory | — | |
| add_memories | — | |
| add_transcript | — | |
| ingest_session | — | |
| get_memory | — | |
| update_memory | — | |
| delete_memory | — | |
| list_memories | — |
Configuration
MEMORYPILOT_CROSS_RERANKMEMORYPILOT_CROSS_RERANK_WEIGHT
| Name | Description | |
|---|---|---|
| MEMORYPILOT_CROSS_RERANK | — | |
| MEMORYPILOT_CROSS_RERANK_WEIGHT | — |
Automated checks
Ran Nov 12, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearPass
- Package name not close to a popular packageNot checked
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubWhy
AI coding assistants forget everything between sessions. MemoryPilot gives them persistent, searchable memory with project awareness, semantic understanding, and automatic knowledge organization. Built-in AAAK compression and memory capsules reduce token consumption by 5-10x when loading context. Every memory is auto-classified with the right importance, kind, and TTL on insert. The database compacts itself automatically — zero maintenance.
Benchmarks
LongMemEval-S (ICLR 2025) — Academic Standard
Evaluated on the 470 answerable questions of LongMemEval-S (ICLR 2025; the 30 abstention questions are left out, as the official retrieval protocol does). Turn-level index, ~50 sessions per haystack.
What the score measures. R@5 here is session-level recall_any@5: a question counts as a hit when at least one of the top 5 retrieved turns belongs to one of its gold sessions. It is a retrieval metric, not answer accuracy, and a question that needs several sessions counts as a hit as soon as one of them is found (300 of the 470 questions have more than one gold session). For scale: a plain BM25 over turns, with no embeddings, scores about 93% on the same metric and 74% on recall_all@5. These figures were measured with v4.2 (multilingual-e5-small); the current default model has only been measured on a 100-question slice (see v4.6 below).
Retrieval scores (same metric family, setups differ)
| System | R@5 (recall_any, session level) | Notes | Source |
|---|---|---|---|
| MemoryPilot v4.2 (adaptive rerank) | 99.1% | 470 questions, ~900 ms/query on an M-series Mac | This repo, --benchmark-longmemeval |
| MemoryPilot v4.2 (rerank off) | 98.7% | 470 questions, ~28 ms/query with MEMORYPILOT_CROSS_RERANK=off |
This repo, --benchmark-longmemeval |
| MemPalace v3.3.3 (hybrid) | 98.4% | 450 held-out questions after tuning on 50; 96.6% raw on 500 | MemPalace v3.3.3 release notes |
| agentmemory v0.9 | 95.2% | 500 questions (abstention included), all-MiniLM | github.com/rohitg00/agentmemory benchmark/LONGMEMEVAL.md |
| mcp-memory-service v10.34.0 | 80.4% | labelled R@5; hit definition not stated | v10.34.0 release notes |
Answer accuracy (a different metric: an LLM reads the retrieved context and a judge grades the answer)
| System | QA accuracy | Setup | Source |
|---|---|---|---|
| Mem0 (cloud) | 94.4% | Mem0's own suite, top-200 retrieval | mem0.ai blog |
| Zep / Graphiti | 63.8% / 71.2% | gpt-4o-mini / gpt-4o as reader, GPT-4o judge | arXiv 2501.13956, Table 2 |
| MemoryPilot | not measured | an end-to-end QA run is planned |
All figures are published by their own authors, none was reproduced independently, and the two tables cannot be compared with each other. On session-level recall MemoryPilot posts the highest published local score, by a margin smaller than the gap between this metric and a plain BM25 baseline. The protocol to settle a comparison: same 470 questions, same hardware, every system run by the same script, reporting
recall_any@5,recall_all@5, turn-level evidence recall and end-to-end QA accuracy with a fixed reader and judge.
Detailed view — MemoryPilot vs MemPalace (closest local competitor)
| Metric | MemoryPilot v4.2 (rerank off) | MemoryPilot v4.2 (adaptive rerank) | MemPalace v3.3.3 | Delta vs MemPalace |
|---|---|---|---|---|
| R@5 | 98.7% | 99.1% | 96.6% raw / 98.4% hybrid | +2.5% vs raw / +0.7% vs hybrid |
| R@10 | 99.6% | 99.4% | ~97%¹ | +2.6% vs raw |
| NDCG@10 | 95.1% | 96.0% | Not published | MemoryPilot publishes |
| MRR | 93.6% | 94.9% | Not published | MemoryPilot publishes |
| Avg search latency | ~28 ms (MEMORYPILOT_CROSS_RERANK=off) |
~900 ms (the default) | N/A | search call only, models warm |
¹ Validated with the full 470-question evaluation set (after dropping the 30 abstention questions) in two modes: hybrid retrieval with the rerank off (BM25 + cosine RRF,
MEMORYPILOT_CROSS_RERANK=off, ~28 ms/query) and the default adaptive cross-encoder rerank (MEMORYPILOT_CROSS_RERANK=adaptive, jina-v2-multilingual, fusion weight 0.45, ~900 ms/query, suitable for benchmarks and high-stakes recall). Latencies cover the search call only, with models loaded; MemPalace's figures come from a different question split.
By Category (470 questions, adaptive rerank)
| Category | R@5 | R@10 | MRR |
|---|---|---|---|
| single-session-user (64) | 100% | 100% | 96.6% |
| single-session-assistant (56) | 100% | 100% | 98.8% |
| multi-session (121) | 100% | 100% | 95.7% |
| knowledge-update (72) | 100% | 100% | 98.2% |
| temporal-reasoning (127) | 97.6% | 98.4% | 93.3% |
| single-session-preference (30) | 96.7% | 96.7% | 75.9% |
French / Multilingual Benchmark — --benchmark-fr
To complement the English-only LongMemEval, MemoryPilot ships its own deterministic French benchmark covering 109 memories and 109 paraphrased queries across infra, mobile, web, security, and ML domains. The queries are intentionally distant from the indexed wording so they actually exercise the semantic lane.
| Mode | R@5 | R@10 | MRR | Avg latency |
|---|---|---|---|---|
| Default fast (BM25 + jina RRF) | 92.7% | 99.1% | 74.4% | ~100 ms |
| Adaptive cross-encoder rerank, mmarco (v4.10) | 99.1% | 99.1% | 97.4% | ~210 ms (Apple Silicon) |
| Adaptive cross-encoder rerank, jina-reranker-v2 (default since v4.11) | 100% | 100% | 98.0% | ~436 ms (2-vCPU Linux VM) |
v4.5 fixed a ranking bug that had capped this benchmark at R@5 ≈ 70% since v4.0: knowledge-graph neighbours were injected at a hard-coded score (0.1) above every genuine RRF hit (max 2/41 ≈ 0.049), so they occupied the cross-encoder window and pushed real matches past limit. Neighbours now enter below the weakest genuine candidate and only the cross-encoder can promote them.
v4.5.0 also closes two write-path stability bugs surfaced by that work: the episodic rollup embedded every hourly bucket on each pass (before checking whether the episode already existed) and did so synchronously inside add_memory, then panicked on multi-byte French text; it now runs on its own thread with a cheap existence check first. And auto-compaction held a Mutex across run_gc/compact_to_capsules, whose merged rows re-enter add_memory — a deadlock hidden until the rollup stopped panicking ahead of it.
Run-to-run variance is bounded to ±1 pp on R@5 / R@10 thanks to deterministic memory ids, deterministic id-based RRF tie-break, synchronous ANN warm-up, and explicit cross-encoder pre-warm before the first query. This is the metric to watch for any French / multilingual regression.
v4.6 — beyond single-fact retrieval
v4.6.0 targets the LongMemEval categories a top-k retriever alone cannot win: multi-session aggregation, temporal reasoning, knowledge updates and abstention. Everything stays local and rule-based or int8 ONNX. Measured on LongMemEval-S@100 (64 single-session + 36 multi-session, plus the 7 abstention questions of that slice) against v4.5.0, same machine, cross-encoder adaptive:
| Metric | v4.5.0 | v4.6.0 |
|---|---|---|
| R@5 / R@10 | 99% / 100% | 100% / 100% |
| MRR / nDCG@10 | 96.3% / 97.2% | 96.5% / 97.3% |
| Multi-session gold coverage@10 | 93.6% | 94.5% |
| Multi-session questions with all gold sessions in top-10 | 30/36 | 32/36 |
| False abstention on answerable questions | — | 4% |
Extractive answer (search_memory … answer=true), contains-gold |
— | 48% (72% single-session; counting questions are out of reach for span extraction) |
--benchmark-fr is unchanged within noise (R@1 96.3%, R@5 99.1%, MRR 97.6%).
- MMR diversity (
src/diversity.rs) — the finalists plus the RRF ranks just below them are re-ordered by maximal marginal relevance over their stored vectors (λ = 0.4, redundancy floor 0.55). The top hit never moves, so MRR is untouched; a second, distinct source can displace a restatement of the first.MEMORYPILOT_MMR=0disables it. - Temporal grounding (
src/temporal.rs) — explicit dates in a memory (2026-09-01,12 septembre 2026,September 12,hier…) becomedateentities at ingest; a temporal phrase in the query (last week,il y a deux semaines,en mars,last Tuesday) becomes a day window that boosts dated candidates inside it (×1.25) and mildly demotes dated candidates far outside (×0.85). Undated memories are neutral, so a mis-parsed window costs at most the boost.MEMORYPILOT_TEMPORAL=0disables it. - Contextual embeddings — transcript chunks and other context-poor kinds are embedded with a
[date · project]prefix while the stored content and its hash are left untouched. - Superseding — the daily consolidation pass links a memory to a newer, near-identical restatement with a changed value (cosine ≥ 0.86, lexical overlap 0.55–0.95, ≥ 1 h apart) and the old one is demoted (−0.35) at search time. Both stay retrievable;
consolidate_memories(apply=true)reports the links made. - Calibrated confidence — every search returns
confidence: { top_cosine, peak, cross_score, margin, level, abstain }. On LongMemEval the abstention haystacks are built from the same user's other sessions and no cheap signal separates them from answerable questions (top-1 cosine p50 0.46 vs 0.54, cross-encoder logits overlap fully), so the hardabstainis deliberately conservative (cosine < 0.35, 4% false abstention) andlevelcarries the graded signal.MEMORYPILOT_ABSTAIN_COSINEmoves the floor. - Extractive reader (
src/reader.rs, opt-in) —search_memorywithanswer: truerunsdeepset/roberta-base-squad2(int8 ONNX, 125 MB, English, loaded on demand through the idle pool) over the top-5 passages and returns the literal span or nothing. ~480 ms per question on CPU. It is a benchmarking instrument and a shortcut for literal lookups, not a language model: it abstained on 5/7 LongMemEval abstention questions where the retriever could not.--benchmark-longmemeval --readerreports SQuAD-style EM / F1 / contains.
Search Quality — Real-World (500 memories, 30 scenarios)
| Metric | MemoryPilot v4.2 | MemPalace v3.1 (raw) | Quantum Memory Graph |
|---|---|---|---|
| R@5 | 100% | 96.6% | 93.4% |
| R@10 | 100% | N/A | 93.4% |
| NDCG@10 | 95.6% | 88.9% | 90.8% |
| Cluster Coherence | 96.7% | N/A | N/A |
| Multilingual | 100+ languages (validated FR R@5 99.1%) | English only | English only |
| AAAK Compression | 5-10x (no recall loss) | 30x (recall drops to 84.2%) | N/A |
| Avg Search Latency | ~28 ms rerank off / ~410 ms adaptive (default) | N/A | ~80 ms |
| Install size | 35 MB binary + ~530 MB of models downloaded on first run | ~500 MB (Python+ChromaDB) | 1.5 GB |
| Dependencies | none at runtime (single binary, ONNX bundled; models fetched from Hugging Face once) | Python + ChromaDB + SQLite | Python + ONNX |
vs the best memory servers on the market:
| Feature | MemoryPilot v4.7 | MemPalace v3.3.3 | agentmemory v0.9 | Mem0 | Zep / Graphiti |
|---|---|---|---|---|---|
| LongMemEval | 99.1% R@5 (v4.2, recall_any) | 98.4% R@5 (held-out split) | 95.2% R@5 | 94.4% QA accuracy (not comparable) | 63.8% QA accuracy (not comparable) |
| LongMemEval MRR | 94.9% | not published | 88.2% | not published | not published |
| Search | Hybrid BM25 + jina-embeddings-v5-nano RRF (768-dim, int8) + adaptive jina-reranker-v2 cross-encoder | ChromaDB cosine (all-MiniLM-L6-v2) | BM25 + vector + graph (RRF) | Vector search (cloud API) | Temporal KG traversal + vector |
| Embeddings | jina-embeddings-v5-text-nano-retrieval (100+ languages, 8k context, local ONNX) | all-MiniLM-L6-v2 (English only) | all-MiniLM-L6-v2 (English only) | OpenAI API calls (external) | OpenAI / cloud LLM extraction |
| Multilingual | 100+ languages native (FR, EN, ES, DE, JA, ZH...) | English only | English only | Depends on API | Depends on LLM backend |
| Knowledge Graph | Temporal triples with validity + confidence | Temporal triples (SQLite) | Knowledge graph (no validity window) | Basic graph (no temporal) | Temporal KG (Graphiti, core feature) |
| GraphRAG | Auto entity extraction + graph traversal + combinatorial reranker | No | Partial (graph search lane) | No | Yes (LLM-based extraction) |
| Cross-encoder rerank | jina-v2-multilingual (adaptive, ~250 ms) | No | No | No | No |
| Query-aware ranking | Preference/temporal/role/update/technical intent boosts | Hybrid v4 keyword + temporal boosts | RRF fusion only | Depends on API | Graph-distance scoring |
| Corpus origin detection | AI transcript/codebase/notes/platform detection | v3.3.4 prep | No | No | No |
| Agent/persona disambiguation | Agents are separate from real people | v3.3.4 prep | Hooks-based session scoping | No | Partial (entity nodes) |
| Topic tunnels | Cross-project topic links via KG | v3.3.4 prep | No | No | No |
| Code-aware chunking | Tree-sitter Rust/Python/TS/TSX/JS + Svelte script extraction | Tree-sitter code chunking | No | No | No |
| Chunked RAG | Transcript auto-chunking + auto-distillation (8 types) | Conversation chunking by exchange | Session replay + JSONL import | No | LLM-based summarisation |
| Compression | AAAK + Memory Capsules (5-10x token savings) | AAAK dialect (experimental, regresses recall to 84.2%) | 4-tier consolidation + decay | No | No |
| Auto-Classification | Zero-shot kind/importance/TTL on insert | No | Pattern-based via hooks | No | LLM-classified entities |
| Auto-Compaction | GC triggers automatically at 500+ memories | No | Lifecycle decay + auto-forget | No | Manual |
| Memory Capsules | Compress old memories into dense summaries | No | Tier-based consolidation | No | No |
| Memory Pinning | Pin critical memories — always in recall, GC-proof | No | No | No | No |
| Graph Traversal | Find related memories via KG (depth 1-3) | No | Yes (graph lane) | No | Native (Cypher / Neo4j) |
| Bulk Operations | Delete by kind/project/tag/age with safety guards | No | Governance delete API | No | Manual |
| Health Dashboard | Memory distribution, stale count, orphans, DB size | No | Real-time web viewer (port 3113) | No | No |
| Dedup Detection | Jaccard similarity scan for near-duplicates | No | Not documented | No | LLM-based reconciliation |
| Person detection | Auto-detects team members from text | No | No | No | LLM-extracted entities |
| Self-Healing | Background auto-linting loop | No | No | No | No |
| Garbage collection | Heuristic merge + scoring + orphan cleanup | No | Lifecycle + decay | Basic TTL | No automatic GC |
| Project brain | Yes, with team members (<1500 tokens) | No | Session summary on demand | No | No |
| File watcher | Context boost from recent edits | No | Filesystem connector (@agentmemory/fs-watcher) |
No | No |
| Deduplication | Content hash (exact) + Jaccard 85% (fuzzy) | Basic hash | Confidence scoring | Embedding similarity | LLM-based merge |
| HTTP API | Multi-threaded REST server (optional) | No | REST + MCP + leases + signals | Cloud hosted | REST + GraphQL |
| Memory types | 13 types, importance 1-5 | Wings/Rooms hierarchy | Tier-based (working / short / long / archival) | 1 type | Episodic / semantic |
| MCP tools | 41 tools | 29 tools | 65 tools | N/A | Limited MCP server |
| Hooks / event capture | SessionStart auto-recall + Stop auto-ingest for Cursor, Claude Code and Codex (incremental, distilled, agent narration filtered, secrets redacted) + file watcher | No | 12 named hooks (Claude Code, Cursor, Codex, Copilot CLI…) | No | No |
| Privacy | 100% local, zero API calls | 100% local | 100% local (SQLite) | Cloud dependent | Cloud or self-host (LLM required) |
| Language | Rust (single binary, zero deps) | Python (pip install) | TypeScript / Node (npm install) | SaaS | Python + Neo4j |
| Startup | 1-2 ms (open_at) / synchronous warm via open_at_warm |
~5 ms | Node boot + iii-engine init | N/A (cloud) | Heavy (Neo4j boot) |
| Binary | 35 MB single binary | Python + ChromaDB (~500 MB installed) | Node runtime + iii-engine deps | SaaS | Python + Neo4j (~1.5 GB) |
| Storage | SQLite WAL + FTS5 + 16-conn read pool | ChromaDB | SQLite + iii-engine | Cloud DB | Neo4j + Postgres |
| Concurrency | EmbedPool (4) + RerankPool (1, tunable) + 16 read conns + debounced cleanup | Single-threaded | Node event loop | Single-threaded | Neo4j-bound |
| External LLM dependency | None | None | None (local embeddings) | OpenAI required | LLM required for ingestion |
| GitHub stars (Sept 2026) | nascent | nascent | ~28.9k | 53k | — |
The 9 Pillars
1. Hybrid Search (BM25 + jina RRF)
Every memory gets a 768-dimension transformer embedding on insert via ONNX Runtime (jina-embeddings-v5-text-nano-retrieval, int8, local inference — 100+ languages including French, English, Spanish, German, Japanese, Chinese — no API calls, no external services; the model is fetched from its Hugging Face repository on first run, licence CC-BY-NC-4.0). Queries and documents use the model's asymmetric Query: / Document: prefixes. The int8 weights are memory-mapped, so the embedder costs ~250 MB resident, most of it reclaimable file-backed pages. Search runs both BM25 full-text and cosine similarity in parallel, then merges results with Reciprocal Rank Fusion.
Results are boosted by importance weighting, knowledge graph link density, file watcher context, and penalized for expired knowledge triples.
Ephemeral working memory is available in the same MCP through remember_working, recall_working, and clear_working. It keeps fast session scratchpad context in RAM, capped to 256 items, without polluting SQLite or durable recall.
Performance optimizations:
- Lazy embedding:
add_memoryreturns instantly, embeddings computed in background thread - Two-tier query embedding cache (LRU 256 + write-through SQLite): repeated queries skip ONNX inference
- Read connection pool (16 connections): concurrent vector searches don't block writes, sized for HTTP server workloads
- EmbedPool (4 sessions, env-tunable): parallel embeddings without serialization on a single ONNX mutex
- RerankPool (1 session, env-tunable to 2): parallel cross-encoder rerank under multi-client load
- Content hashing (FNV-1a): backfill skips unchanged memories
- Synchronous warm-up entrypoint
open_at_warm: hydrates the ANN index in RAM before returning, eliminating cold-start tail (p95 search latency 3939 ms → 229 ms in the 4-client concurrency bench)
2. Temporal Knowledge Graph
A full knowledge graph with temporal validity. Facts have valid_from / valid_to dates and confidence scores. When facts become outdated, they are invalidated rather than deleted — giving the AI a timeline of how knowledge evolved.
Entities (technologies, files, components, people) are automatically extracted from memory content and linked bidirectionally. Search results from memories with all-expired triples are penalized.
5 dedicated KG tools: kg_add, kg_invalidate, kg_query, kg_timeline, kg_stats
3. GraphRAG
Every memory is automatically analyzed for entities: technologies, file paths, components, projects, and people. Entities are stored in a dedicated table. Memories sharing entities are auto-linked with inferred relationship types (resolves, implements, depends_on, deprecates...).
When searching, MemoryPilot traverses the knowledge graph from the top matches to pull in related context — e.g., finding the architecture decision that led to a specific bug fix. A combinatorial reranker then selects the best cluster of connected memories rather than independent top-K results, producing cohesive context (94% cluster coherence). Tuned RRF fusion (k=40), exact term coverage boost, smart FTS tokenization, query-time KG expansion, temporal recency, and importance tiebreakers push NDCG@10 to 94% with perfect R@5/R@10.
MemoryPilot MCP questions
What tools does MemoryPilot MCP provide?
It exposes 8 tools, including add_memory, add_memories, add_transcript, ingest_session, get_memory.
What does MemoryPilot do for AI assistants?
It gives AI clients persistent, searchable memory with project awareness and semantic understanding so context survives between sessions.
Does MemoryPilot require an internet connection or external API calls?
No, it runs as a single binary with zero runtime dependencies and zero API calls.
How much does MemoryPilot reduce token usage?
Built-in AAAK compression and memory capsules cut token consumption by 5-10x when loading context.
How does MemoryPilot search memories?
It uses hybrid search combining BM25 with jina embeddings via reciprocal rank fusion plus cross-encoder reranking.
Which AI clients can install MemoryPilot?
It offers one-liner installs for Cursor, Claude Desktop, VS Code, Windsurf, Claude Code, Codex and ChatGPT.