Cognitive memory for AI agents β semantic recall, knowledge graph, and contradiction detection
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.
YantrikDB β Cognitive memory for AI agents. Persistent semantic recall, knowledge graph, contradiction detection, and procedural learning. Ships as embeddable engine, network database, or MCP server.
Works with Claude Code, Cursor, Windsurf, Hermes Agent, Prime Agent, and any MCP-compatible client. Ships a portable Agent Skills skill β skills/persistent-memory β that teaches any compliant harness the memory golden path.
Website: yantrikdb.com Β· Docs: yantrikdb.com/guides/mcp Β· GitHub: yantrikos/yantrikdb-mcp Β· Paper: Skill as Memory, Not Document

Every value on screen is the server's own answer over MCP β driver: docs/demo/demo.py, recorded with docs/demo/demo.tape.
| What it is | An MCP server that gives any MCP-compatible AI agent persistent, structured, queryable memory across sessions |
| Install | pip install yantrikdb-mcp |
| Works with | Claude Code, Cursor, Windsurf, Continue, Claude Desktop, Hermes Agent, Prime Agent, any MCP client |
| Storage | Local SQLite at ~/.yantrikdb/memory.db (or any path; or HTTP cluster) |
| Embedder | Bundled 64-dim Rust embedder (default), 384-dim ONNX MiniLM ([onnx] extra), 256-dim multilingual (101 languages) |
| Tools | 19 β remember, recall, forget, correct, think, memory, graph, conflict, trigger, session, temporal, procedure, category, personality, stats, skill, gaps, conversation, task |
| License | MIT (engine: Apache-2.0) |
| Privacy | All data on your machine. No telemetry. No external services. |
Upgrading from v0.5.x? Your existing database stays at 384 dim β install the
[onnx]extra to keep using it transparently. New installs default to the lean bundled embedder. v0.7.0+ pins the engine migration fix automatically. See Embedder backends below.
The MCP server has three deployment modes. Pick the one that fits your setup.
The MCP server runs the engine in-process with a local SQLite database. Fast, private, zero dependencies.
That's it. The agent auto-recalls context, auto-remembers decisions, and auto-detects contradictions β no prompting needed.
Forward all tool calls to a YantrikDB HTTP cluster instead of using an embedded engine. The MCP server is a thin stateless client β all memories live on the cluster, accessible from any machine.
Benefits: shared memory across machines, high availability, no local embedder download, no local database.
yantrikdb token create --db your_databaseRun the MCP server itself as a long-running SSE server with its own embedded database. Clients connect via HTTP streaming.
Supports sse and streamable-http transports. Note: SSE connections can drop on idle β Mode 2 (HTTP Cluster) is more reliable for shared deployments.
| Variable | Used in Mode | Default | Description |
|---|---|---|---|
YANTRIKDB_SERVER_URL | Cluster | (unset β local mode) | Comma-separated cluster node URLs |
YANTRIKDB_TOKEN | Cluster | (none) | Bearer token for the cluster database |
YANTRIKDB_DB_PATH | Local | ~/.yantrikdb/memory.db | Database file path |
YANTRIKDB_EMBEDDER | Local | auto | Backend selector: auto | bundled | onnx | multilingual |
YANTRIKDB_EMBEDDING_MODEL | Local | all-MiniLM-L6-v2 | ONNX model name (only used when YANTRIKDB_EMBEDDER=onnx) |
YANTRIKDB_SKILLS_WRITE_ENABLED | All | false | Set true to allow agents to author skills via skill(action="define") (see Skill substrate below) |
YANTRIKDB_OUTCOMES_WRITE_ENABLED | All | true | Outcome tracking via skill(action="outcome"). Defaults on so the feedback loop works out of the box; set false to lock the outcome substrate. Added in v0.8.1 per #8 |
YANTRIKDB_API_KEY | SSE server | (none) | Bearer token when serving SSE/HTTP |
Local mode ships three embedders. The MCP picks one automatically; override with YANTRIKDB_EMBEDDER.
| Backend | Dim | Cold start | Install size | Language coverage | When it's used |
|---|---|---|---|---|---|
bundled (engine default) | 64 | ~80 ms | ~10 MB | English-only | New / empty databases (auto-selected) |
onnx (MiniLM-L6-v2) | 384 | ~2 s | ~150 MB | English (higher recall) | Existing pre-v0.6 databases (auto-selected), or when set explicitly |
multilingual (potion-multilingual-128M) | 256 | ~2 s + ~460 MB download on first use | ~10 MB pip + ~500 MB model cache | 101 languages (BGE-M3 tokenizer) | Opt-in only via YANTRIKDB_EMBEDDER=multilingual |
auto (default) reads the SQLite file at YANTRIKDB_DB_PATH and picks onnx if it already contains memories β preserving recall quality on upgrades β and bundled otherwise. Multilingual is never auto-selected because its 256-dim vectors are incompatible with existing bundled (64-dim) or ONNX (384-dim) databases; opt-in only on fresh databases.
Set YANTRIKDB_EMBEDDER=bundled|onnx|multilingual to override. If you set YANTRIKDB_EMBEDDER=onnx (or auto-detection picks it) without installing the extras, the server fails fast with an install hint:
For the multilingual backend, the engine downloads potion-multilingual-128M (~460 MB tarball) from github.com/yantrikos/yantrikdb-models on first use. The download is SHA-256 verified, extracted into the engine's cache dir, and reused on subsequent starts. No extra Python deps required β the model runs entirely inside the Rust engine.
File-based memory (CLAUDE.md, memory files) loads everything into context every conversation. YantrikDB recalls only what's relevant.
| Memories | File-Based | YantrikDB | Savings | Precision |
|---|---|---|---|---|
| 100 | 1,770 tokens | 69 tokens | 96% | 66% |
| 500 | 9,807 tokens | 72 tokens | 99.3% | 77% |
| 1,000 | 19,988 tokens | 72 tokens | 99.6% | 84% |
| 5,000 | 101,739 tokens | 53 tokens | 99.9% | 88% |
Selective recall is O(1). File-based memory is O(n).
Run the benchmark yourself: python benchmarks/bench_token_savings.py
The server injects a golden-path playbook into the agent's system prompt. Since v0.10.0 the default is digest-first:
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/yantrikdb-mcp)<a href="https://allmcps.com/mcp/yantrikdb-mcp"><img src="https://allmcps.com/api/badge/yantrikdb-mcp?style=directory" alt="Yantrikdb MCP on AllMCPs" /></a>