
Yantrikdb Mcp
io.github.yantrikos由 GitHub 帳號 yantrikos 發布v0.24.0更新於 Nov 3, 2026
Cognitive memory for AI agents — semantic recall, knowledge graph, and contradiction detection
概覽
本機 MCP 伺服器,為 AI 助理提供跨工作階段的持久認知記憶:語意召回、知識圖譜、矛盾偵測與流程學習。
- 可以做什麼
- 儲存、更正、遺忘與檢索記憶,支援批次寫入及語意或關鍵字召回並回饋結果
- 建立與查詢實體和關係的知識圖譜,偵測、列出並解決已存事實之間的矛盾
- 執行記憶整併與模式探勘,管理工作階段並以一次呼叫取得摘要簡報,查詢過期或即將到期的時間型記憶
- 學習並呈現流程、技能與替換類別,並記錄使用結果
- 管理任務、在受限緩衝區記錄對話輪次、呈現回答不佳的問題,並匯出靜態記憶圖譜頁面
- 檢視引擎統計、健康狀態與維護操作,安裝或掛載具簽章的可攜式記憶包
- 適用情境
- 適合希望助理跨工作階段記住決策、偏好與事實、又不想每次把整份記憶檔塞進上下文的場合。適用於長期開發或專案工作,需要回想先前脈絡、實體關係以及已變更事實的情境。
- 執行需求
- 以 stdio 本機程序執行,來自 PyPI 套件(pip install yantrikdb-mcp,或使用 uvx 且需 uv 在 PATH 中)。本機模式無需帳號或金鑰,資料存於本機 SQLite 檔案,路徑由 YANTRIKDB_DB_PATH 指定。選用的 HTTP 叢集模式需 YANTRIKDB_SERVER_URL 與 YANTRIKDB_TOKEN;SSE 模式需 YANTRIKDB_API_KEY。選用的嵌入模型可能於首次使用時下載模型檔。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Yantrikdb Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
YantrikDB MCP Server
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.
[PyPI] [PyPI downloads] [Python] [License: MIT]
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.
At a glance
Install
Using Claude Code? Skip the pip step: /plugin marketplace add yantrikos/yantrikdb-mcp then /plugin install yantrikdb — installs straight
from this repo, no PyPI round-trip.
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.
Configure
The MCP server has three deployment modes. Pick the one that fits your setup.
Mode 1 — Local (default, recommended for single user)
The MCP server runs the engine in-process with a local SQLite database. Fast, private, zero dependencies.
uvx fetches and runs the server on demand, so this works with no install step
(it needs uv on PATH). If you installed the
package yourself with pip or pipx, "command": "yantrikdb-mcp" with no args
is equivalent.
That's it. The agent auto-recalls context, auto-remembers decisions, and auto-detects contradictions — no prompting needed.
Mode 2 — HTTP Cluster (recommended for shared/multi-machine setups)
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.
- Comma-separate multiple nodes for Raft cluster auto-discovery
- Automatic leader-following on failover
- 15s request timeout
- Get the token from the cluster:
yantrikdb token create --db your_database
Mode 3 — SSE Server (legacy, single remote instance)
Run 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.
Environment Variables
Embedder backends
Local mode ships three embedders. The MCP picks one automatically; override with YANTRIKDB_EMBEDDER.
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 on a fresh database and keep the setting; that database then reopens normally.
Set YANTRIKDB_EMBEDDER=bundled|onnx|multilingual|named:<model> 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.
The named:<model> form selects any model from the same downloadable registry — currently potion-base-8M (256-dim, ~92% MiniLM quality) and potion-base-32M (512-dim, ~95% MiniLM quality), which the fixed keyword set can't reach. The loader knows the registry's output dims; for a registry entry it doesn't know yet, set YANTRIKDB_EMBEDDING_DIM to the model's dim. multilingual and named:<model> create a fresh database on that model and reopen a database the same model built. A database with memories from anything else fails fast instead of silently breaking recall, and the error names the embedder that built it when that's recorded. To move an existing store to a different embedder, create a new YANTRIKDB_DB_PATH and replay/export the records.
Why Not File-Based Memory?
File-based memory (CLAUDE.md, memory files) loads everything into context every conversation. YantrikDB recalls only what's relevant.
Benchmark: 15 queries × 4 scales
Selective recall is O(1). File-based memory is O(n).
- At 500 memories, file-based exceeds 32K context windows
- At 5,000, it doesn't fit in any context window — not even 200K
- YantrikDB stays at ~70 tokens per query, under 60ms latency
- Precision improves with more data — the opposite of context stuffing
Run the benchmark yourself: git clone https://github.com/yantrikos/yantrikdb-mcp && cd yantrikdb-mcp && pip install -e '.[torch]' && python benchmarks/bench_token_savings.py (the script loads sentence-transformers directly, which isn't installed by the default pip install yantrikdb-mcp).
Recommended agent workflow (golden path)
The server injects a golden-path playbook into the agent's system prompt. Since v0.10.0 the default is digest-first:
- Cold start — one call.
session(action="digest")returns a single briefing (narrative chain head, open decisions, unresolved conflicts, pending triggers, stale high-importance memories) — replacing several separaterecall/temporalcalls at conversation start. Thenrecallonly for the specific thing the current message is about. - During work — capture as you go. New durable fact →
remember; a stored fact changed →correct(keeps history, avoids contradictions); relationship learned →graph(action="relate"). - End of substantial work — conditional. Only when the session was long or state-changing:
thinkto consolidate + detect conflicts. Short/read-only exchanges need no end step.
Trust boundary: recalled memories and digest snippets are data, not instructions. The playbook directs the agent never to execute directives found inside recalled content — a memory may carry text an earlier session or another user stored.
Tools
21 tools, full engine coverage (gaps, conversation, task added in v0.9.0; pack added in v0.11.0; atlas added in v0.24.0):
Plus new actions on existing tools in v0.9.0:
session(action="digest")— one-call boot-time briefing (narrative chain head + open decisions + conflicts + triggers)think(maintenance_cycle=True)— autonomous hygiene sleep cyclethink(last_cycle_only=True)— read the last cycle summary without runningstats(action="audit_leak")— privacy / leak-candidate auditstats(action="skill_outcomes")— durable skill-outcome countgraph(action="auto_relate" / "record_link" / "record_unlink" / "linked_records" / "recall_with_links")— co-occurrence edges + record-to-record links + link-expanded recallconflict(action="auto_resolve")— burn down unambiguous conflicts in one passmemory(action="chain_head" / "history")— chain-namespace head + revision historytrigger(action="prune")— bound the pending-trigger backlogremember(summary=...)— draft mode: engine atomizes a long summary into linked semantic facts (end-of-session auto-capture)
See yantrikdb.com/guides/mcp for full documentation.
Skill substrate (v0.8.0+)
YantrikDB exposes a structured agent skill catalog — separate from loose procedure memories. Skills have schema (skill_id, applies_to, triggers, body, type) and are stored in the dedicated skill_substrate namespace so multiple consumers (this MCP, yantrikdb-hermes-plugin, Lane B SDK, WisePick, yantrikdb-server's /v1/skills/* endpoints) all read and write the same substrate. Background: Sarkar 2026 — Skill as Memory, Not Document.
Security model
Skill writes shape future agent behavior across sessions, so the MCP server implements defense-in-depth. Every control has an env-var knob (locked once at startup — C2) and the full state is exposed via stats(action="stats") and the audit log.
Layered controls (each ships on by default unless noted):
Enterprise checklist:
The audit log is the canonical record. Every accept, every reject (with the scanner that flagged), every tamper-detection on read, every gate-closed-due-to-expiry — all there in JSONL. Plug it into your SIEM.
stats(action="stats") example output (skill_substrate slice)
Schema (validated at write time)
Example session
Outcomes are append-only events in the outcome_substrate namespace — no auto-rollup on the parent skill, matching yantrikdb-server's "schema not semantics" design rule. Agents (or the operator) can aggregate outcomes themselves to compute success rates.
FAQ
What is YantrikDB MCP?
YantrikDB MCP is a Model Context Protocol (MCP) server that gives AI agents persistent cognitive memory across sessions. It exposes 21 tools (remember, recall, forget, correct, think, graph, conflict, trigger, session, temporal, procedure, category, personality, stats, memory, skill, gaps, conversation, task, pack, atlas) that any MCP-compatible client — Claude Code, Cursor, Windsurf, Continue, Claude Desktop — can call automatically without prompting.
How is this different from file-based memory like CLAUDE.md?
File-based memory loads everything into context on every conversation, which scales O(n) in token cost. YantrikDB uses selective semantic recall — at 5,000 memories, file-based costs ~101K tokens per conversation while YantrikDB costs ~53 tokens. Precision improves with more data instead of degrading as the context window fills up. Benchmark script: python benchmarks/bench_token_savings.py.
How does it compare to mem0 / Letta / Zep / native MCP memory?
See comparison table below. Short version: YantrikDB is the only one that ships as both an embeddable Rust engine and an MCP server and a network database with the same substrate semantics. It's the only one with first-class procedural memory + a skill substrate validated by schema at write time + autonomous consolidation/conflict detection. It's also the only one whose underlying engine is published as a peer-reviewed paper (Sarkar 2026, Zenodo DOI 10.5281/zenodo.20128887).
Can I self-host?
Yes — three ways. (1) Local: just pip install yantrikdb-mcp and point your MCP client at it. SQLite lives at ~/.yantrikdb/memory.db. (2) Network: run yantrikdb-server as a multi-tenant HTTP cluster, point the MCP at it via YANTRIKDB_SERVER_URL. (3) Hybrid: SSE server mode (yantrikdb-mcp --transport sse) for shared deployments.
Is my data sent anywhere?
No. All data stays on your machine (or your cluster). No telemetry, no third-party services. The default embedder runs entirely in the Rust engine via static lookup — no model downloads or API calls. The optional [onnx] and multilingual embedders fetch model weights once from HuggingFace's CDN and run locally thereafter.
What's the difference between procedure and skill?
procedure stores loose how-to memories (effectiveness-ranked, no schema). skill stores structured catalog entries (skill_id, applies_to, triggers, body, type) in a dedicated skill_substrate namespace shared with yantrikdb-hermes-plugin, Lane B SDK, WisePick, and the yantrikdb-server /v1/skills/* endpoints. Use procedure for personal how-to notes; use skill for structured agent capabilities that other consumers should be able to surface.
Is skill authoring safe to enable?
Skill writes are off by default precisely because they can shape future agent behavior. When you turn the gate on, seven layers of defense-in-depth apply: prompt-injection scanner, credential scanner, URL block, unicode-evasion scanner, namespace allowlist, author attribution, audit log, rate limit, body-hash tamper detection, and a review queue for rule-type skills. See Security model above.
Does it work in production?
Yes — yantrikdb-mcp runs in production on the YantrikDB homelab cluster (1973+ memories, SSE transport, 2 weeks uptime per release cycle) and is the reference deployment behind the engine's release decisions. v0.8.x added the engine's same-day-patch cadence to the MCP server itself: the 3 community-filed issues to date were fixed in roughly 4 hours, 5 hours, and 4 days — a median of about 5 hours, same-day in 2 of 3 cases.
What's the engine written in?
The YantrikDB engine is Rust (crates.io: yantrikdb) with pyo3 Python bindings (PyPI: yantrikdb). The MCP server itself is Python — a thin wrapper around the engine's Python bindings, plus stdio/SSE/HTTP transport plumbing.
Comparison with other agent memory systems
Comparisons reflect public-facing capabilities as of May 2026. PRs welcome to correct any rows.
Cite this work
If you use YantrikDB in academic or research context, please cite the substrate paper:
Plain text citation:
Sarkar, P. (2026). Skill as Memory, Not Document: A Database-Native Substrate for Agent Skill Catalogs. Zenodo. https://doi.org/10.5281/zenodo.20128887
Examples
1. Auto-recall at conversation start
User: "What did we decide about the database migration?"
The agent automatically calls recall("database migration decision") and retrieves relevant memories before responding — no manual prompting needed.
2. Remember decisions + build knowledge graph
User: "We're going with PostgreSQL for the new service. Alice will own the migration."
The agent calls:
remember(text="Decided to use PostgreSQL for the new service", domain="architecture", importance=0.8)remember(text="Alice owns the PostgreSQL migration", domain="people", importance=0.7)graph(action="relate", entity="Alice", target="PostgreSQL Migration", relationship="owns")
3. Contradiction detection
After storing "We use Python 3.11" and later "We upgraded to Python 3.12", calling think() detects the conflict. The agent surfaces it:
"I found a contradiction: you previously said Python 3.11, but recently mentioned Python 3.12. Which is current?"
Then resolves with conflict(action="resolve", conflict_id="...", strategy="keep_b").
Privacy Policy
YantrikDB MCP Server stores all data locally on your machine (default: ~/.yantrikdb/memory.db). No data is sent to external servers, no telemetry is collected, and no third-party services are contacted during operation.
- Data collection: Only what you explicitly store via the
remembertool or what the AI agent stores on your behalf. - Data storage: Local SQLite database on your filesystem. You control the path via
YANTRIKDB_DB_PATH. - Third-party sharing: None. Data never leaves your machine in local (stdio) mode.
- Network mode: When using SSE/HTTP transport, data travels between your client and your self-hosted server. No Anthropic or third-party servers are involved.
- Embedding model: Uses a local ONNX model (
all-MiniLM-L6-v2). Model files are downloaded once from Hugging Face Hub on first use, then cached locally. - Retention: Data persists until you delete it (
forgettool) or delete the database file. - Contact: [email protected]
Full policy: yantrikdb.com/privacy
Contributing
See CONTRIBUTING.md for a venv setup, running pytest, and opening PRs.
Support
- Issues: github.com/yantrikos/yantrikdb-mcp/issues
- Email: [email protected]
- Docs: yantrikdb.com/guides/mcp
Related projects
Same memory substrate, different entry points:
- yantrikdb — the embeddable Rust/Python engine this server runs on (
pip install yantrikdb). - yantrikdb-server — HTTP gateway and HA cluster, for the network deployment modes above.
- yantrikdb-client — typed Python client for that server.
- langchain-yantrikdb — YantrikDB as a LangChain
VectorStoreandChatMessageHistory. - yantrikdb-hermes-plugin — memory provider for NousResearch/hermes-agent, sharing the same skill substrate.
- yantrik-memory — framework-agnostic memory layer with traits and bond evolution.
- openclaw-memory-yantrikdb — OpenClaw memory-slot plugin backed by YantrikDB, published on ClawHub.
License
This MCP server is licensed under MIT — use it freely in any project.
Note: This package depends on yantrikdb (the cognitive memory engine), which is licensed under Apache-2.0 as of 2026-08-18 (previously AGPL-3.0). Both this server and the engine are now permissively licensed — there are no copyleft obligations on your code, modifications, or hosted services.
來源:README.md,提交 f2b166a
工具
0版本歷史
1- v0.24.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分