⚠ 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 . Full audit trail, preliminary
corrected numbers, and the exact publication gate for a findings post
are in .
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.
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.
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.
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.
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):
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:
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):
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. 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.
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
Vector Index (HNSW) — semantic similarity search across memories
Graph Index — entity relationships, profile aggregation, bridge detection
Temporal Index — time-aware queries ("what happened Tuesday", "upcoming deadlines")
Decay Heap — importance scores that degrade over time, like human memory
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
A measurement paper on what happens when LLM agent skill catalogs scale. On a 5,000-skill corpus:
Token cost: full-catalog disclosure consumes 919,200 tokens (exceeds Claude 3.7's 200K window). YantrikDB's indexed top-K disclosure: 369 tokens, constant in catalog size. The honest ratio against an indexed filesystem baseline is 1.49× — an ablation pinpoints the entire gap as YAML frontmatter overhead.
Latency: p50 = 87.3 ms, p95 = 106.3 ms at 5,000-skill scale, single-node.
Invalid-skill admission: YantrikDB rejects 70/70 adversarially-malformed skills (0%) at write time; a document-only baseline admits 68/70 (97%).
Three failure modes for filesystem-shaped skill catalogs (token burn, slowdown, invalid-skill admission). One unifying framing: skill catalogs for autonomous learning aren't documents; they're memory.
U.S. Patent Application 19/573,392 (March 2026): "Cognitive Memory Database System with Relevance-Conditioned Scoring and Autonomous Knowledge Management"
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 c
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.
ตรวจสอบล่าสุดเมื่อ 2026-11-15 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.