Persistent layered memory for AI agents. SQLite FTS5, fact versioning, zero-cloud.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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:
| Layer | What it stores | How it's accessed | Lifetime |
|---|---|---|---|
| Episodic | Events, sessions, journal entries | By date or period | Decays (30-day half-life) |
| Semantic | Facts, preferences, relationships | By topic or entity | Stable |
| Procedural | Rules, workflows, conventions | Loaded at startup | Rarely changes |
| Resource | Reference material, book notes | On demand | Decays slowly (90 days) |
A journal entry from last Tuesday and a coding rule that never changes live in different layers β because they should.
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):
| Metric | FTS-only | Vector-only | Hybrid (RRF) |
|---|---|---|---|
| Composite score | 88.9 | 89.2 | 91.7 |
| Recall@5 | 0.907 | 0.898 | 0.919 |
| MRR | 0.817 | 0.832 | 0.878 |
| nDCG@5 | 0.816 | 0.828 | 0.869 |
| Negative precision | 1.000 | 1.000 | 1.000 |
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.
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.
Or from source:
Or add to ~/.openclaw/mcp_config.json:
Add to ~/.claude/mcp.json:
Add to your client's MCP config:
Use the full path to the compiled entry point:
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.
| Tool | What it does |
|---|---|
memory_add | Store a memory with layer, entity, confidence, importance, and optional TTL |
memory_search | Full-text or exact search with filters by layer, entity, date, scope, confidence |
memory_update | Update in-place or create a versioned replacement (superseding chain) |
memory_delete | Delete a memory; re-activates its predecessor if any |
memory_inspect | Get layer statistics or trace a single memory's version history |
memory_export | Export to JSON, Markdown, or Claude-md format with filters |
memory_health | Run diagnostics: expired entries, orphaned chains, stale memories; optionally GC |
memory_session_start | Start an agent session β returns session ID for grouping memories |
memory_session_end | End a session with optional summary; returns duration and memory count |
memory_session_list | List sessions with filters by client, project, or active status |
Resources β live data your agent can read:
| URI | Returns |
|---|---|
memory://stats | Aggregate stats per layer |
memory://recent | Memories created/updated in last 24h |
memory://layer/{layer} | All active memories in a layer |
memory://entity/{name} | All active memories about an entity |
Prompts β pre-built workflows:
| Prompt | Purpose |
|---|---|
recall | "Tell me everything you know about X" |
context-load | Load relevant context before starting a task |
journal | Create a structured journal entry |
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.
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.
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.
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 FusionRequires sqlite-vec (installed as optional dependency). New memories are embedded on add; existing ones can be backfilled.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mnemon-mcp)<a href="https://allmcps.com/mcp/mnemon-mcp"><img src="https://allmcps.com/api/badge/mnemon-mcp?style=directory" alt="Mnemon MCP on AllMCPs" /></a>