Yantrikdb

Memory and knowledge

Cognitive memory database for AI agents, consolidates duplicates, detects contradictions, and fades stale memories via temporal decay, written in Rust (Apache-2.0) as a library, MCP server, or HTTP cluster.

Your AI app calls the Yantrikdb MCP server, which does the memory and knowledge work and sends the result back to the chat.

About Yantrikdb

Yantrikdb is a community MCP server from yantrikos, filed in our directory under memory and knowledge. Cognitive memory database for AI agents, consolidates duplicates, detects contradictions, and fades stale memories via temporal decay, written in Rust (Apache-2.0) as a library, MCP server, or HTTP cluster.

Yantrikdb runs on your own machine: your AI app starts it with the command docker run -i --rm and talks to it over standard input and output.

At a glance

Publisher
yantrikos (community)
Runs
Locally on your machine
Install from
Docker image: ghcr.io/yantrikos/yantrikdb:latest
Written in
Rust
License
Apache-2.0
GitHub stars
182

How to set up Yantrikdb

  1. Have Docker running on the machine that runs your AI app, because Yantrikdb starts as a container.
  2. Check the Yantrikdb README for keys or settings; the registry lists none that Yantrikdb requires.
  3. Add Yantrikdb to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Yantrikdb tools to confirm the connection.
  5. Run one read-only task with Yantrikdb first, and keep your app asking before each tool call until the results look right.

Yantrikdb compared with similar servers

  • Cohort by congchuanling-dot has fewer GitHub stars than Yantrikdb (179 against 182); both are community servers, and both run locally.
  • Engraphis by Coding-Dev-Tools has more GitHub stars than Yantrikdb (184 against 182); both are community servers, and both run locally.
  • Anchormind by JinHo-von-Choi has fewer GitHub stars than Yantrikdb (173 against 182); both are community servers, and both run locally.

Before you connect Yantrikdb

  • Give Yantrikdb its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Yantrikdb tool call until you trust what it does with them.
  • Treat text that Yantrikdb fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Yantrikdb on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Yantrikdb

How marketing and sales teams put Yantrikdb to work, by company size. Pick the size closest to yours and start Yantrikdb on one use case.

Small business

  • A small business can give Yantrikdb its offers, FAQs and tone of voice once, so every draft starts from the same facts.
  • Founders can use Yantrikdb to keep notes from calls and decisions, then ask what was agreed with a customer weeks later.
  • Yantrikdb runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect Yantrikdb to positioning docs and past campaigns, so agents write on message without a long prompt each time.
  • Sales and marketing can share one knowledge base through Yantrikdb, so answers about pricing and features match across teams.
  • Start Yantrikdb on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use Yantrikdb with permissions that follow the source documents, so an agent only recalls what the person asking may see.
  • Large orgs can make Yantrikdb the approved memory layer for agents, with retention rules and a way to delete what shouldn't be kept.
  • Yantrikdb is a community server, so have security review the code and pin a version before Yantrikdb touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Yantrikdb README

From yantrikos/yantrikdb-server on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

YantrikDB

⚠ Correction notice (2026-04-19): Phase 3 benchmark writeups committed earlier today (docs/phase3a/, docs/phase3b/, docs/phase3c/, docs/phase3d/) used a Python simulator for the "structured memory" condition, NOT the actual yantrikdb engine. Rerun with real yantrikdb is in docs/phase3e/. Full audit trail, preliminary corrected numbers, and the exact publication gate for a findings post are in CORRECTIONS.md.

A memory database that forgets, consolidates, and detects contradictions.

Vector databases store memories. They don't manage them. After 10,000 memories, recall quality degrades because there's no consolidation, no forgetting, no conflict resolution. Your AI agent just gets noisier.

YantrikDB is different. It's a cognitive memory engine, embed it, run it as a server, or connect via MCP. It thinks about what it stores.

Shortest path to try it:

pip install yantrikdb-mcp

Add one config block to your MCP client and restart it, full steps in Get started in 60 seconds →.

The bigger picture: YantrikDB is the memory layer being built on the road to YantrikOS, an AI-native operating system where agents are first-class primitives, not apps on top. Memory was the bottleneck, so we're shipping it first.

📄 New paper (May 2026): Skill as Memory, Not Document, measuring three failure modes when agent skill catalogs scale to 5,000 skills. Code + raw CSVs reproducible in benchmarks/skill_recall/.

99.9% token savings vs file-based memory

Memories File-Based (CLAUDE.md) YantrikDB Token Savings Recall 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%

At 500 memories, file-based memory exceeds 32K context. At 5,000, it doesn't fit in any model, not even 200K. YantrikDB stays at ~70 tokens per query. Precision improves with more data, the opposite of context stuffing.

Reproduce: the script lives in yantrikdb-mcp, not this repo -- git clone https://github.com/yantrikos/yantrikdb-mcp && cd yantrikdb-mcp && python benchmarks/bench_token_savings.py

Three things no other database does

1. It forgets
db.record("read the SLA doc by Friday", importance=0.4, half_life=86400)  # 1 day
# 24 hours later, this memory's relevance score has decayed
# 7 days later, recall stops surfacing it unless explicitly queried
2. It consolidates
# 20 similar memories about the same meeting
for note in meeting_notes:
    db.record(note, namespace="standup-2026-04-12")

db.think()
# → {"consolidation_count": 5}  # collapsed 20 fragments into 5 canonical memories
3. It detects contradictions
db.record("Acme is based in Boston.")
db.record("Acme is based in Denver.")   # added later, in another conversation

db.think()
# → {"conflicts_found": 1, ...}
db.get_conflicts()
# → [{"kind": "identity_fact", ...}]

Detection runs over the relations the extractor recognises, here a location relation, single-valued at any moment, not over arbitrary sentences. Two limits are worth knowing before you rely on it:

  • Claims are keyed by subject. "Alice is the CEO of Acme" and "Bob is the CEO of Acme" have different subjects with one value each, so nothing compares. The constraint here is inverse-functional, it lives on the object ("CEO of Acme" admits one filler), and that direction is not modelled.
  • Copular attribute claims are off by default. "The logo is blue" → "The logo is green" needs ThinkConfig.extract_attribute_claims; without it the copular path never runs.

Both are tracked in #95.

Plus: temporal decay with configurable half-life, entity graph with relationship edges, personality derivation from memory patterns, session-aware context surfacing, multi-signal scoring (recency × importance × similarity × graph proximity).

What makes this different

YantrikDB isn't just storage with operations. The engine has a layer that makes agents feel less reactive:

  • Proactive triggers, the system surfaces what needs attention: pending conflicts, decaying important memories, approaching deadlines, patterns across domains. Agents don't have to ask what they should care about. The memory tells them.
  • Derived personality, stable tendencies extracted from memory patterns over time. "This user prefers X, reacts to Y, values Z." Informs default agent behavior across sessions.
  • Procedural memory, strategies that worked before get recorded and reinforced. Agents learn what to do, not just what they know.
  • Temporal awareness, stale surfaces important memories that haven't been touched recently. upcoming surfaces memories with approaching deadlines.

Full cognitive architecture lives in the standalone engine repo. This server repo focuses on deployment, HTTP API, and cluster operations.

Get started in 60 seconds, Claude Code / Cursor / Windsurf

The fastest adoption path. One pip install, one config block, and your agent gets persistent memory that auto-recalls on conversation start, auto-remembers decisions, and flags contradictions, without you prompting it.

pip install yantrikdb-mcp

Add this to your MCP client config, typically ~/.claude.json or .mcp.json in your project for Claude Code, and the equivalent mcp block in settings for Cursor/Windsurf (Claude Code · Cursor · Windsurf):

{
  "mcpServers": {
    "yantrikdb": {
      "command": "yantrikdb-mcp"
    }
  }
}

That's it. No env vars. Uses a local SQLite memory file at ~/.yantrikdb/memory.db. First call auto-initializes the schema. Restart your client, the yantrikdb MCP server will show up with 15 memory tools (see below).

Want a shared memory across machines or teammates? Point at a YantrikDB cluster instead of local SQLite:

{
  "mcpServers": {
    "yantrikdb": {
      "command": "yantrikdb-mcp",
      "env": {
        "YANTRIKDB_SERVER_URL": "http://node1:7438,http://node2:7438",
        "YANTRIKDB_TOKEN": "ydb_your_database_token"
      }
    }
  }
}

Want it over HTTP/SSE instead of stdio? (For IDE integrations that don't support stdio MCP servers.)

{
  "mcpServers": {
    "yantrikdb": {
      "type": "sse",
      "url": "http://your-server:8420/sse",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

Then start: yantrikdb-mcp --transport sse --port 8420.

The 15 MCP tools your agent gets
Tools
Core memory remember · recall · forget · correct
Cognition think (consolidate + conflict-detect) · memory · trigger (proactive insights)
Knowledge graph graph (entities + relations) · category
Conflicts & corrections conflict (list + resolve contradictions)
Time session · temporal (stale/upcoming queries)
Behavior procedure (strategies) · personality (derived traits)
Ops stats (engine health + diagnostics)

Full tool reference and agent-integration patterns: yantrikdb-mcp → · docs (yantrikdb.com/guides/mcp)

Other ways to use it

As a network server (binary API + HA cluster)
docker run -p 7438:7438 ghcr.io/yantrikos/yantrikdb:latest
curl -X POST http://localhost:7438/v1/remember -d '{"text":"hello"}'

Single Rust binary. HTTP + binary wire protocol. 2-voter + 1-witness HA cluster via Docker Compose or Kubernetes. Per-tenant quotas, Prometheus metrics, AES-256-GCM at-rest encryption, runtime deadlock detection. See docker-compose.cluster.yml and k8s manifests.

As an embedded library (Python or Rust)
pip install yantrikdb
# or
cargo add yantrikdb
import yantrikdb
db = yantrikdb.YantrikDB("memory.db", embedding_dim=384)
db.set_embedder(SentenceTransformer("all-MiniLM-L6-v2"))
db.record("Alice leads engineering", importance=0.8)
db.recall("who leads the team?", top_k=3)
db.think()  # consolidate, detect conflicts, derive personality

Performance

The numbers previously published here (1,689 memories, 112ms recall p50, 76 writes/sec) were from an April-2026 snapshot that didn't trace to any benchmark checked into this repo. They've been removed rather than repeated.

The most recent throughput investigation actually in-repo is a 2-core LXC reliability bench from 2026-05-20 (benchmarks/throughput_2core_lxc/results_2026-05-20.md). It found fresh installs wedging permanently after 256 writes over HTTP, and read throughput collapsing under write load. The fix shipped the same day in v0.19.1's ancestor release (then v0.8.18, see CHANGELOG.md):

Behavior, 2-core LXC, fresh install Pre-fix Post-fix (v0.8.18)
Sustained write throughput, HTTP, concurrency 4, pre-computed embeddings locks at 256 writes 381/s
Engine ceiling, direct call (no HTTP), 32 concurrent writers n/a, compactor wasn't spawned 1,115/s

That's the newest throughput data checked into the repo, it hasn't been re-run since (the server is 20+ releases past it now), and the read-collapses-under-write-load issue that same bench documented is still open. See benchmarks/ for raw results, harnesses, and caveats across every run; performance work is ongoing.

Status

v0.20.0, in production use. The embeddable engine has been used in production by the YantrikOS ecosystem since early 2026; the network server runs live on a multi-node Proxmox cluster with multiple tenants.

Since the early alpha line, the server has moved from a raft-lite prototype to openraft-based HA clustering (2-voter + 1-witness), added mounted read-only memory packs (/v1/packs, /v1/pack-context), reached HTTP route parity with the embedded engine (RFC 032), and picked up the engine's claim grounding + temporal validity windows on recalled claims and its more precise entity/relation extraction. As of v0.20.0 it also ships Studio, a built-in admin console at /admin (dashboard, memory browser, query console, conflict review, and cluster ops), embedded in the binary with no separate install. Operational hardening from the original hardening sprint, parking_lot mutexes with runtime deadlock detection, per-handler Prometheus metrics, chaos-tested failover, per-tenant quotas, remains in place and has kept pace release-to-release.

Full per-release detail, including engine-pin changes and test-suite results for each version, is in CHANGELOG.md.

Read the maturity notes: https://yantrikdb.com/server/quickstart/#maturity

The Problem

Current AI memory is:

Store everything → Embed → Retrieve top-k → Inject into context → Hope it helps.

That's not memory. That's a search engine with extra steps.

Real memory is hierarchical, compressed, contextual, self-updating, emotionally weighted, time-aware, and predictive. YantrikDB is built for that.

Why Not Existing Solutions?

Solution What it does What it lacks
Vector DBs (Pinecone, Weaviate) Nearest-neighbor lookup No decay, no causality, no self-organization
Knowledge Graphs (Neo4j) Structured relations Poor for fuzzy memory, not adaptive
Memory Frameworks (LangChain, Mem0) Retrieval wrappers Not a memory architecture, just middleware
File-based (CLAUDE.md, memory files) Dump everything into context O(n) token cost, no relevance filtering
Benchmark: Selective Recall vs. File-Based Memory
Memories File-Based YantrikDB Token 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%

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. Precision improves with more data, the opposite of context stuffing.

Architecture

Design Principles
  • Embedded, not client-server, single file, no server process (like SQLite)
  • Local-first, sync-native, works offline, syncs when connected
  • Cognitive operations, not SQL, record(), recall(), relate(), not SELECT
  • Living system, not passive store, does work between conversations
  • Thread-safe, Send + Sync with internal Mutex/RwLock, safe for concurrent access
Five Indexes, One Engine
┌──────────────────────────────────────────────────────┐
│                   YantrikDB Engine                    │
│                                                      │
│  ┌──────────┬──────────┬──────────┬──────────┐       │
│  │  Vector  │  Graph   │ Temporal │  Decay   │       │
│  │  (HNSW)  │(Entities)│ (Events) │  (Heap)  │       │
│  └──────────┴──────────┴──────────┴──────────┘       │
│  ┌──────────┐                                        │
│  │ Key-Value│  WAL + Replication Log (CRDT)          │
│  └──────────┘                                        │
└──────────────────────────────────────────────────────┘
  1. Vector Index (HNSW), semantic similarity search across memories
  2. Graph Index, entity relationships, profile aggregation, bridge detection
  3. Temporal Index, time-aware queries ("what happened Tuesday", "upcoming deadlines")
  4. Decay Heap, importance scores that degrade over time, like human memory
  5. Key-Value Store, fast facts, session state, scoring weights
Memory Types (Tulving's Taxonomy)
Type What it stores Example
Semantic Facts, knowledge "User is a software engineer at Meta"
Episodic Events with context "Had a rough day at work on Feb 20"
Procedural Strategies, what worked "Deploy with blue-green, not rolling update"

All memories carry importance, valence (emotional tone), domain, source, certainty, and timestamps, used in a multi-signal scoring function that goes far beyond cosine similarity.

Key Capabilities

Relevance-Conditioned Scoring

Not just vector similarity. Every recall combines:

  • Semantic similarity (HNSW), what's topically related
  • Temporal decay, recent memories score higher
  • Importance weighting, critical decisions beat trivia
  • Graph proximity, entity relationships boost connected memories
  • Retrieval feedback, learns from past recall quality

Weights are tuned automatically from usage patterns.

Conflict Detection & Resolution

When memories contradict, YantrikDB doesn't guess, it creates a conflict segment:

"works at Google" (recorded Jan 15) vs. "works at Meta" (recorded Mar 1)
→ Conflict: identity_fact, priority: high, strategy: ask_user

Resolution is conversational: the AI asks naturally, not programmatically.

Semantic Consolidation

After many conversations, memories pile up. think() runs:

  1. Consolidation, merge similar memories, extract patterns
  2. Conflict scan, find contradictions across the knowledge base
  3. Pattern mining, cross-domain discovery ("work stress correlates with health entries")
  4. Trigger evaluation, proactive insights worth surfacing
Proactive Triggers

The engine generates triggers when it detects something worth reaching out about:

  • Memory conflicts needing resolution
  • Approaching deadlines (temporal awareness)
  • Patterns detected across domains
  • High-importance memories about to decay
  • Goal tracking ("how's the marathon training?")

Every trigger is grounded in real memory data, not engagement farming.

Multi-Device Sync (CRDT)

Local-first with append-only replication log:

  • CRDT merging, graph edges, memories, and metadata merge without conflicts
  • Vector indexes rebuild locally, raw memories sync, each device rebuilds HNSW
  • Forget propagation, tombstones ensure forgotten memories stay forgotten
  • Conflict detection, contradictions across devices are flagged for resolution
Sessions & Temporal Awareness
sid = db.session_start("default", "claude-code")
db.record("decided to use PostgreSQL")  # auto-linked to session
db.record("Alice suggested Redis for caching")
db.session_end(sid)
# → computes: memory_count, avg_valence, topics, duration

db.stale(days=14)    # high-importance memories not accessed recently
db.upcoming(days=7)  # memories with approaching deadlines

Full API

Operation Methods
Core record, record_batch, recall, recall_with_response, recall_refine, forget, correct
Knowledge Graph relate, get_edges, search_entities, entity_profile, relationship_depth, link_memory_entity
Cognition think, get_patterns, scan_conflicts, resolve_conflict, derive_personality
Triggers get_pending_triggers, acknowledge_trigger, deliver_trigger, act_on_trigger, dismiss_trigger
Sessions session_start, session_end, session_history, active_session, session_abandon_stale
Temporal stale, upcoming
Procedural record_procedural, surface_procedural, reinforce_procedural
Lifecycle archive, hydrate, decay, evict, list_memories, stats
Sync extract_ops_since, apply_ops, get_peer_watermark, set_peer_watermark
Maintenance rebuild_vec_index, rebuild_graph_index, learned_weights

Technical Decisions

Decision Choice Rationale
Core language Rust Memory safety, no GC, ideal for embedded engines
Architecture Embedded (like SQLite) No server overhead, sub-ms reads, single-tenant
Bindings Python (PyO3), TypeScript Agent/AI layer integration
Storage Single file per user Portable, backupable, no infrastructure
Sync CRDTs + append-only log Conflict-free for most operations, deterministic
Thread safety Mutex/RwLock, Send+Sync Safe concurrent access from multiple threads
Query interface Cognitive operations API Not SQL, designed for how agents think

Ecosystem

Package What Install Source
yantrikdb-mcp MCP server for Claude Code / Cursor / Windsurf, start here pip install yantrikdb-mcp GitHub · PyPI
yantrikdb-client Python client SDK for the HTTP server (typed memory, reflect, character primitives) pip install yantrikdb-client GitHub · PyPI
yantrikdb-server HTTP + wire-protocol server, HA cluster docker run ghcr.io/yantrikos/yantrikdb GitHub
yantrikdb (Rust) Embedded Rust engine cargo add yantrikdb GitHub
yantrikdb (Python) Python bindings via PyO3 pip install yantrikdb GitHub
langchain-yantrikdb LangChain VectorStore + ChatMessageHistory with explainable recall pip install langchain-yantrikdb GitHub · PyPI
yantrikdb-hermes-plugin Memory provider for NousResearch/hermes-agent, with a reproducible recall benchmark pip install yantrikdb-hermes-plugin GitHub · PyPI
yantrik-memory Framework-agnostic Python memory layer, traits, bond evolution, knowledge graph pip install yantrik-memory GitHub · PyPI
openclaw-memory-yantrikdb OpenClaw memory plugin, conflict-aware session briefings, recall with retrieval reasons, auto-capture openclaw plugins install npm:@yantrikos/openclaw-memory-yantrikdb GitHub

Roadmap

Questions about Yantrikdb

What is the Yantrikdb MCP server?

Cognitive memory database for AI agents, consolidates duplicates, detects contradictions, and fades stale memories via temporal decay, written in Rust (Apache-2.0) as a library, MCP server, or HTTP cluster. Yantrikdb is maintained by yantrikos on GitHub at yantrikos/yantrikdb-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Yantrikdb MCP server?

Add Yantrikdb to your AI app's MCP config with the command docker run -i --rm ghcr.io/yantrikos/yantrikdb:latest. In Claude Code, run claude mcp add --transport stdio yantrikdb-server -- docker run -i --rm ghcr.io/yantrikos/yantrikdb:latest. To run Yantrikdb this way you need Docker running.

Does Yantrikdb need an API key?

The registry lists no required keys for Yantrikdb. Check the Yantrikdb README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Yantrikdb an official MCP server?

No. Yantrikdb is a community server maintained by yantrikos. Community servers can be excellent; read the code and the open issues before you give Yantrikdb access to company data.

What license is Yantrikdb under?

Yantrikdb is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Yantrikdb; the service it connects to has its own terms.