Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

yantrikdb

Latest version: v0.25.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
PyPI package Publisher: org:yantrikos
79 Stars
26 Forks
6 Versions
4.8K Downloads
Rust Repo language

Scan summary

yantrikdb was last scanned on 29 Nov 2026 at version 0.25.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 6 versions; the latest 2 were published within 2 days (28 and 29 Nov 2026).
  • Findings: No rules fired in version 0.25.0.
  • Downloads: 4,811 downloads.

Versions

6 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.25.0 LATEST 29 Nov 2026 No rules fired
0.24.0 28 Nov 2026 No rules fired
0.23.6 22 Nov 2026 No rules fired
0.23.5 21 Nov 2026 Not shown
0.23.4 28 Oct 2026 Not shown

No rules fired in 0.25.0

Findings

Findings for v0.25.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.25.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

YantrikDB — A Cognitive Memory Engine for Persistent AI Systems

Your agent starts every session as a stranger. Bolting a vector store onto it doesn't fix that: nothing is ever forgotten, near-duplicate memories pile up, and two contradictory facts come back ranked side by side with no signal that they disagree.

YantrikDB is the engine that manages memories instead of just storing them — temporal decay, autonomous consolidation, contradiction detection, and a knowledge graph, in an embeddable Rust library with Python bindings.

PyPI PyPI downloads Crates.io Crates.io downloads License: Apache 2.0

Want a server instead of a library? yantrikdb-server wraps this engine with an HTTP API, a live demo, and multi-node HA — same decay, consolidation, and contradiction detection, reachable over REST instead of an import.

Get Started in 60 Seconds

For AI agents (MCP — works with Claude, Cursor, Windsurf, Copilot)
pip install yantrikdb-mcp

Add to your MCP client config:

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

That's it. The agent auto-recalls context, auto-remembers decisions, and auto-detects contradictions — no prompting needed. See yantrikdb-mcp for full docs.

As a Python library
pip install yantrikdb

record_text() / recall_text() work out of the box — no sentence-transformers install, no ONNX runtime. Just one pip install.

Never open the store with a second SQLite library in the same process. The engine bundles its own SQLite; sqlite3.connect() on the same file from the same process (for a helper UPDATE, a raw INSERT into claims, your own scan) corrupts the store silently: POSIX locks are per process, so that connection's unlock releases the engine's and the two writers interleave WAL commits. Use the engine API (correct(), ingest_claim(), attach_claims(), think()) or a separate process; sequential use after close() is fine. On Linux the engine detects the second instance and refuses to write from then until it is reopened (ForeignSqliteInstance, stats()["foreign_sqlite_*"]), and on every platform a commit that did not come through the engine queues an integrity check. A failed check refuses writes with IntegrityCheckFailed until a later integrity_check() returns "ok" (no reopen needed; stats()["integrity_tainted"]); see CONCURRENCY.md Rule 9.

A new file-backed store opens on potion-base-8M (256-dim), fetched once (~28 MB, SHA-256 pinned, cached under your user cache dir) and self-hosted from yantrikos/yantrikdb-models — no HuggingFace dependency. If it cannot be fetched (offline), the store is created on the bundled potion-base-2M (64-dim, ~7 MB, no download ever) and a warning is logged. An existing database always reopens at the dimension it already holds, so upgrading the library never strands your data.

import yantrikdb

# New store: potion-base-8M @ 256 dims (downloads once).
# Existing store: reopened at whatever dimension it already has.
db = yantrikdb.YantrikDB.with_default("memory.db")

db.record("Alice is the engineering lead", importance=0.8, domain="people")
db.record("Project deadline is March 30", importance=0.9, domain="work")
db.record("User prefers dark mode", importance=0.6, domain="preference")

results = db.recall("who leads the team?", top_k=3)
# → [{"text": "Alice is the engineering lead", "score": 1.0}, ...]

db.relate("Alice", "Engineering", "leads")
db.get_edges("Alice")

db.think()  # consolidate, detect conflicts, mine patterns

db.close()
Why the default is the 256-dim model

The embedder choice is measured on real agent memory, not a leaderboard. Public benchmarks rank on Wikipedia-shaped text; agent memory is dense operational notes with heavy internal vocabulary and near-duplicate records that supersede one another, and it ranks the models differently.

Measured on 5,035 real production memories with 12 questions whose correct record was pinned by id, retrieved through the engine's own recall() (not raw cosine — the engine's hybrid lexical lanes and composite scoring are part of what you actually get):

Embedder Dim MRR Correct record absent from the top 100
potion-base-2M (bundled fallback) 64 0.120 4 of 12
potion-base-8M (default) 256 0.312 1 of 12

The miss rate is the reason, not the MRR. Under the smaller model a third of real questions had no correct answer anywhere in the first hundred results — which to a user is indistinguishable from the memory not being there at all.

Two honest caveats. Twelve probes is a small set, enough to separate 0.120 from 0.312 but not to rank models a few points apart. And the gain is corpus-specific: on conversational-paraphrase benchmarks the two models are indistinguishable at every k from 2 to 80. Expect the benefit on dense, vocabulary-heavy stores; do not assume it transfers.

Other embedder options
# Larger still — 512-dim, ~121 MB, downloads on first call.
db = yantrikdb.YantrikDB("memory.db", embedding_dim=512)
db.set_embedder_named("potion-base-32M")

# Bring your own (sentence-transformers, fastembed, custom object).
from sentence_transformers import SentenceTransformer
db = yantrikdb.YantrikDB("memory.db", embedding_dim=384)
db.set_embedder(SentenceTransformer("all-MiniLM-L6-v2"))

# Force the bundled model — no download, works fully offline.
db = yantrikdb.YantrikDB("memory.db", embedding_dim=64)
Path Dim Size on disk Install network
with_default on a new store 256 ~28 MB (cached) first run only
Bundled fallback (embedding_dim=64) 64 ~7 MB (bundled) none, ever
set_embedder_named("potion-base-32M") 512 ~121 MB (cached) first call only
set_embedder(MiniLM) 384 ~80 MB sentence-transformers' own download

A store's dimension is fixed when it is created. Switching models later means re-embedding — db.reembed("potion-base-8M") does it in place, preserving graph edges, consolidation state and conflict metadata.

As a Rust crate
[dependencies]
yantrikdb = "0.23"

# NOTE: the crate defaults differ from the pip package on purpose.
# `embedder-download` is OFF here, so a default cargo build has NO
# network code path at all and `with_default()` uses the bundled
# 64-dim potion-base-2M. The Python wheel enables it, so pip users get
# the 256-dim potion-base-8M default described above.
#
# To get that default (and set_embedder_named) in Rust, opt in:
# yantrikdb = { version = "0.23", features = ["embedder-download"] }
#
# Why not on by default: it pulls ureq + sha2 + dirs + tar + flate2
# into every build of an embedded database. See the measured retrieval
# difference above and decide for your deployment.

# Slim build (no bundled embedder, no network code path):
# yantrikdb = { version = "0.23", default-features = false }

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.

Evidence (reproducible)

Every claim here points at a runnable harness — not a static number. Each is gated in CI (.github/workflows/benchmark.yml) so a regression fails the build.

  • Recall doesn't degrade as the corpus grows, and stays fast. python -m yantrikdb.eval.benchmark holds a fixed signal corpus while adding distractors and measures recall + latency at each scale. Sample run: recall@k 0.938 → 0.929 as memories grow 7×, with p95 recall latency under 3 ms. regression_check() is the CI gate.
  • The knowledge graph earns its keep on connected data. python -m yantrikdb.eval.graph_lift measures recall with entity-expansion ON vs OFF. Verdict on the connected corpus: +2.5% recall, +1.7% MRR — graph expansion helps where memories are actually linked.
  • Apples-to-apples vs other memory systems. python -m yantrikdb.eval.competitors scores YantrikDB, mem0, Zep, and Letta on the same corpus, same queries, same metrics, no per-system tuning. (Competitors run once their libraries are installed; results are not pre-tuned.)

These run dependency-free on the bundled embedder, so anyone can reproduce them with one command.

LongMemEval-S — retrieval, scored mechanically

LongMemEval asks a question against a haystack of ~48 chat sessions per user, most of them near-identical distractors, and names the sessions that actually hold the evidence. This measures retrieval only — no answerer, no LLM judge, so there is nothing to disagree about. A query counts as all@k only if every gold session is in the top k (queries average 1.7 golds, so missing one scores zero).

top k at least one gold every gold
5 96.0% 85.0%
10 98.5% 92.9%
20 99.6% 98.3%
40 99.6% 98.7%

479 of 500 queries scored, 0 errors. k=40 is the shipped default, and it is load-bearing rather than generous: a paired 400-query BEAM run measured k=40 → k=20 costing 3.4 rubric points across 8 of 10 categories.

The whole curve is published rather than the best row, because "recall@5" is not a well-defined quantity without saying what pool it was selected from — retrieving 40 and keeping the best 5 documents scores 85.0%, while retrieving 5 directly scores 72.9%, on the same queries with the same metric.

Reproduce: python lme_recall_multik.py 500 24 (one retrieval per query at k=40, every prefix scored).

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
Decoupled Write Path (v0.6.6+)

The vector index is structured as a two-tier LSM: a small mutable delta and an immutable HNSW cold tier swapped atomically via ArcSwap. Foreground writes only touch the delta (brief lock, O(1) push); HNSW work amortizes on a dedicated compactor thread. This is what eliminated the production wedge where sustained writes starved readers — see CONCURRENCY.md and docs/decoupled_write_path_rfc.md.

flowchart LR
    subgraph CLIENT["Caller"]
        C1["record / record_with_rid"]
        C2["recall / recall_with_seq"]
    end

    subgraph FG["Foreground — P1, brief locks only"]
        F1["assign_seq<br/>vec_seq.fetch_add<br/>(or fetch_max for cluster seq)"]
        F2["DeltaIndex.append<br/>brief RwLock&lt;Vec&gt; push"]
        F3["bump_visible_seq<br/>DashMap + AtomicU64<br/>(lock-free)"]
        F4["log_op → SQLite WAL"]
    end

    subgraph IDX["DeltaIndex (per engine)"]
        D1[("delta<br/>RwLock&lt;Vec&lt;DeltaEntry&gt;&gt;<br/>cap = delta_max (256)")]
        D2[("cold<br/>ArcSwap&lt;HnswIndex&gt;<br/>lock-free read")]
    end

    subgraph BG["Background — P3, dedicated threads"]
        B1["Compactor (1s tick)<br/>fires when delta past half-cap<br/>OR oldest entry > max_dirty_age"]
        B2["Materializer pool<br/>N = cores / 2<br/>drains pending oplog ops"]
    end

    subgraph STORE["SQLite (WAL mode, single file)"]
        S1["memories"]
        S2["oplog"]
        S3["entity_edges, sessions, ..."]
    end

    C1 --> F1
    F1 --> F2
    F2 --> D1
    F1 --> F3
    F1 --> F4
    F4 --> S2

    C2 -.->|"optional<br/>wait_for_visible_seq"| F3
    C2 --> D1
    C2 --> D2

    B1 -->|"seal + clone + ArcSwap.store"| D1
    B1 --> D2
    B2 --> S2
    B2 --> S1
    B2 --> S3

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases yantrikdb

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229