mnemon-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mnemon-mcpremember that I prefer coffee over tea"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mnemon-mcp
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.
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:
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.
Related MCP server: persistent-kb-mcp
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):
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.
Architecture
flowchart LR
C["MCP client<br/>Claude Code · Cursor · …"] -- "stdio / HTTP" --> T["10 tools · 4 resources · 3 prompts"]
T --> R["retrieval pipeline<br/>FTS5 · vector · RRF fusion"]
T --> M["memories + supersede chains"]
I["KB import pipeline<br/>markdown → memories"] --> M
M -- triggers --> F["FTS5 index (stemmed EN+RU)"]
R --> F
R --> V["sqlite-vec (optional, BYOK)"]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
npm install -g mnemon-mcpOr from source:
git clone https://github.com/nikitacometa/mnemon-memory-mcp.git
cd mnemon-memory-mcp && npm install && npm run buildConfigure Your MCP Client
openclaw mcp register mnemon-mcp --command="mnemon-mcp"Or add to ~/.openclaw/mcp_config.json:
{
"mnemon-mcp": {
"command": "mnemon-mcp"
}
}Add to ~/.claude/mcp.json:
{
"mcpServers": {
"mnemon-mcp": {
"command": "mnemon-mcp"
}
}
}Add to your client's MCP config:
{
"mcpServers": {
"mnemon-mcp": {
"command": "mnemon-mcp"
}
}
}Use the full path to the compiled entry point:
{
"mnemon-mcp": {
"command": "node",
"args": ["/absolute/path/to/mnemon-mcp/dist/index.js"]
}
}Verify
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | mnemon-mcpYou 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
Tool | What it does |
| Store a memory with layer, entity, confidence, importance, and optional TTL |
| Full-text or exact search with filters by layer, entity, date, scope, confidence |
| Update in-place or create a versioned replacement (superseding chain) |
| Delete a memory; re-activates its predecessor if any |
| Get layer statistics or trace a single memory's version history |
| Export to JSON, Markdown, or Claude-md format with filters |
| Run diagnostics: expired entries, orphaned chains, stale memories; optionally GC |
| Start an agent session — returns session ID for grouping memories |
| End a session with optional summary; returns duration and memory count |
| List sessions with filters by client, project, or active status |
MCP Resources & Prompts
Resources — live data your agent can read:
URI | Returns |
| Aggregate stats per layer |
| Memories created/updated in last 24h |
| All active memories in a layer |
| All active memories about an entity |
Prompts — pre-built workflows:
Prompt | Purpose |
| "Tell me everything you know about X" |
| Load relevant context before starting a task |
| Create a structured journal entry |
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:
v1: "Team uses React 17" → superseded_by: v2
v2: "Team uses React 19" → supersedes: v1 (active)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:
# OpenAI
MNEMON_EMBEDDING_PROVIDER=openai MNEMON_EMBEDDING_API_KEY=sk-... mnemon-mcp
# Ollama (local, free)
MNEMON_EMBEDDING_PROVIDER=ollama mnemon-mcpThis 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.
Variable | Default | Description |
| — |
|
| — | API key (required for OpenAI) |
|
| Model name |
|
| Vector dimensions |
|
| Ollama endpoint |
Importing a Knowledge Base
Got a folder of Markdown files? Import them in bulk:
cp config.example.json ~/.mnemon-mcp/config.json # edit this first
npm run import:kb -- --kb-path /path/to/your/kb # incremental (skips unchanged files)The config maps glob patterns to memory layers:
{
"owner_name": "your-name",
"extra_stop_words": [],
"mappings": [
{
"glob": "journal/*.md",
"layer": "episodic",
"entity_type": "user",
"entity_name": "$owner",
"importance": 0.6,
"split": "h2"
},
{
"glob": "people/*.md",
"layer": "semantic",
"entity_type": "person",
"entity_name": "from-heading",
"importance": 0.8,
"split": "h3"
}
]
}Config Fields
Field | Type | Description |
| string | Your name — used for |
| string[] | Words to filter from FTS queries (e.g., your name forms) |
| string | File pattern to match |
| string | Target memory layer |
| string |
|
| string | Literal name, |
| string |
|
| number | 0.0–1.0, affects search ranking |
| number | 0.0–1.0, filterable in search |
| string | Optional namespace |
HTTP Transport
For remote or multi-client setups:
MNEMON_AUTH_TOKEN=your-secret MNEMON_HOST=0.0.0.0 MNEMON_PORT=3000 npm run start:httpEndpoint | Description |
| MCP JSON-RPC (Bearer auth if token set) |
|
|
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
Variable | Default | Description |
|
| Database path |
|
| Knowledge base root for import |
|
| Import config path |
| — | Bearer token for HTTP transport |
|
| HTTP transport bind address |
|
| HTTP transport port |
| — | CORS |
|
| Max requests per minute per IP (0 = off) |
Tool Reference
Parameter | Type | Required | Description |
| string | Yes | Memory text (max 100K chars) |
| string | Yes |
|
| string | No | Short title (max 500 chars) |
| string | No |
|
| string | No | Entity name for filtering |
| number | No | 0.0–1.0 (default 0.8) |
| number | No | 0.0–1.0 (default 0.5) |
| string | No | Namespace (default |
| string | No | Source file path — triggers auto-supersede of matching entries |
| number | No | Auto-expire after N days |
| string | No | Temporal fact window (ISO 8601) |
Parameter | Type | Required | Description |
| string | Yes | Search text |
| string | No |
|
| string[] | No | Filter by layers |
| string | No | Filter by entity (supports aliases) |
| string | No | Filter by scope |
| string | No | Date range (ISO 8601) |
| string | No | Temporal fact filter — facts valid at this date |
| number | No | Minimum confidence |
| number | No | Minimum importance |
| number | No | Max results (default 10, max 100) |
| number | No | Pagination offset |
Parameter | Type | Required | Description |
| string | Yes | Memory ID |
| string | No | New content |
| string | No | New title |
| number | No | New confidence |
| number | No | New importance |
| boolean | No |
|
| string | No | Content for superseding entry |
Parameter | Type | Required | Description |
| string | Yes | Memory ID. Re-activates predecessor if part of a superseding chain |
Parameter | Type | Required | Description |
| string | No | Memory ID (omit for aggregate stats) |
| string | No | Filter stats by layer |
| string | No | Filter stats by entity |
| boolean | No | Show superseding chain |
Parameter | Type | Required | Description |
| string | Yes |
|
| string[] | No | Filter by layers |
| string | No | Filter by scope |
| string | No | Date range |
| number | No | Max entries (default all, max 10K) |
Parameter | Type | Required | Description |
| boolean | No |
|
Returns: status (healthy / warning / degraded), per-layer stats, expired entries, orphaned chains, stale/low-confidence counts, cleaned count when cleanup=true.
Parameter | Type | Required | Description |
| string | Yes | Client identifier (e.g. |
| string | No | Project scope for this session |
| object | No | Additional session metadata |
Returns: id (session UUID), started_at (ISO 8601).
Parameter | Type | Required | Description |
| string | Yes | Session ID to end |
| string | No | Summary of what was accomplished (max 10K chars) |
Returns: id, ended_at, duration_minutes, memories_count.
Parameter | Type | Required | Description |
| number | No | Max sessions (default 20, max 100) |
| string | No | Filter by client |
| string | No | Filter by project |
| boolean | No | Only return sessions that haven't ended (default false) |
Returns: array of sessions with id, client, project, started_at, ended_at, summary, memories_count.
How It Compares
mnemon-mcp | mem0 | basic-memory | Engram | Anthropic KG | |
Architecture | SQLite FTS5 + vector | Cloud API + Qdrant | Markdown + vector | SQLite FTS5 | JSON file |
Memory structure | 4 typed layers | Flat | Flat | Flat + sessions | Graph |
Search | FTS5 + hybrid RRF | Semantic | Hybrid | FTS5 | Exact |
Fact versioning | Superseding chains | Partial | No | No | No |
Stemming | EN + RU (Snowball) | EN only | EN only | None | None |
Embeddings | BYOK (OpenAI / Ollama) | Built-in | FastEmbed | None | None |
Dependencies | 0 required | Qdrant, Neo4j | Python 3.12 | Go binary | None |
Cloud required | No | Yes | No | No | No |
Cost | Free | $19–249/mo | Free | Free | Free |
Setup |
| Docker + API keys | pip + deps | Go install | Built-in |
License | MIT | Apache 2.0 | AGPL | MIT | MIT |
Extended competitive analysis with sources: docs/COMPETITORS.md.
Development
npm run dev # run via tsx (no build step)
npm run build # TypeScript → dist/
npm run lint # eslint (flat config)
npm test # vitest — unit + integration + MCP dispatch + HTTP transport + hybrid RRF
npm run bench # performance benchmarks
npm run db:backup # backup databaseCI 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA local-first MCP memory server providing persistent, searchable memory for AI agents, powered by SQLite.51Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA local-first MCP server providing persistent, searchable knowledge base via SQLite, enabling AI agents to save and recall facts across sessions without cloud dependencies.MIT
- AlicenseNot gradedqualityDmaintenanceA local-first long-term memory system for AI coding agents, exposed as an MCP server.131MIT
- AlicenseAqualityCmaintenancePersistent memory MCP server for AI agents, using SQLite with hybrid keyword and semantic search for long-term memory storage.5Do What The F*ck You Want To Public
Related MCP Connectors
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
Cloud-hosted MCP server for durable AI memory
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikitacometa/mnemon-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server