YantrikDB + Prime Agent — Persistent Memory in the IPython Kernel
Prime Agent is Prime Intellect’s open-source coding and research harness, built around a persistent IPython kernel where tools, skills, and sub-agents are Python code. Its Continual Harness persists the agent state it owns — system prompts, learned skills, sub-agent definitions — and that is exactly what it should persist. What it does not give you is a queryable memory: facts recalled by meaning rather than phrasing, beliefs revised without contradicting the old copy, memory shared with your other agents.
YantrikDB adds that layer: semantic recall, typed memories, belief revision with history, contradiction detection, procedural learning, and time-travel recall — in a local SQLite file. No telemetry, no external services. And because Prime Agent runs tools as Python, the integration is idiomatic there:
import yantrikdbhits = await yantrikdb.recall(query="past decisions about the deploy")1. Install and start the server
Section titled “1. Install and start the server”Prime Agent’s MCP bridge is HTTP-only (stdio servers are not wired through to the kernel yet), so run yantrikdb-mcp on the streamable-http transport:
pip install yantrikdb-mcp
export YANTRIKDB_API_KEY=$(openssl rand -hex 16)yantrikdb-mcp --transport streamable-http --host 127.0.0.1 --port 8420~10 MB, bundled Rust embedder, no native ML dependencies. The bearer token is required for network transports — the server refuses to run open.
2. Declare the server
Section titled “2. Declare the server”Add to ~/.prime/agent/settings.json (or project .prime/agent/settings.json):
{ "mcpServers": { "yantrikdb": { "type": "http", "url": "http://127.0.0.1:8420/mcp", "bearerTokenEnvVar": "YANTRIKDB_API_KEY" } }}3. Install the skill
Section titled “3. Install the skill”git clone --depth 1 https://github.com/yantrikos/yantrikdb-mcpcp -r yantrikdb-mcp/integrations/prime-agent/yantrikdb ~/.prime/agent/skills/Launch Prime Agent with YANTRIKDB_API_KEY set in the same shell.
4. Verify
Section titled “4. Verify”Ask Prime Agent to run, in its kernel:
import yantrikdbr1 = await yantrikdb.remember(text="deploy window is Friday 6am", importance=0.8)r2 = await yantrikdb.recall(query="when do we deploy")print(r1, r2)The rid returned by remember should appear in the recall results. If
the call raises NotEnabled, the YANTRIKDB_API_KEY variable is not
visible to the Prime Agent process.
What we measured before publishing this
Section titled “What we measured before publishing this”Verified 2026-08-08 with prime-agent 0.7.1 (WSL Ubuntu), yantrikdb-mcp 0.14.0, qwen3.8-max as the driving model, on a fresh database:
- All 20 tools discovered via
await yantrikdb.list_tools(). rememberreturned{"rid": "019fe43b-ee52-70ce-af71-df900b0024d8", "status": "recorded"}.recallon a paraphrased query returned that same rid, semantic score 0.72, with the marker text intact.- The packaged skill passed on the first call of a fresh session, with no setup beyond the env var.
When you don’t need this
Section titled “When you don’t need this”If one Prime Agent install on one machine is your whole setup and its own persistent state files cover what you want carried forward, they are the simpler tool — no server process to run. YantrikDB earns its keep when recall must survive paraphrase, when facts change and history matters, or when several harnesses (Prime Agent, Claude Code, Cursor, Hermes) should share one memory.
- The skill module is named
yantrikdb, the same name as the YantrikDB Python package. Prime Agent’s managed kernel venv does not include the engine package, so there is no collision in a default setup. - The database defaults to
~/.yantrikdb/memory.db; point the server at a different file withYANTRIKDB_DB_PATH. - A PR proposing this skill as a Prime Agent built-in is open at
PrimeIntellect-ai/prime-agent#1036;
until it lands, the
cp -rabove is the install path.