YantrikDB adds persistent memory for AI agents

YantrikDB is a new memory engine for AI agents that ships with a small default embedder and an MCP server. Its creator says it can recall context, remember decisions, and detect contradictions without extra model downloads or sentence-transformers.

YantrikDB adds persistent memory for AI agents

YantrikDB is a new persistent memory engine for AI agents, and its creator says it is designed to do more than store chat history. The project was posted on Hacker News as “Show HN: YantrikDB - persistent memory for AI agents,” with package installs for both Python and an MCP server.

According to the project post, the MCP server can be added to an agent configuration with a single entry after installing yantrikdb-mcp. The author says that once connected, the agent can auto-recall context, remember decisions, and detect contradictions without extra prompting.

⚡ New to this?

This matters because “memory” is one of the hardest parts of building useful AI agents. If an agent cannot remember decisions, preferences, and past conflicts, it often behaves like a stateless chatbot with a search layer on top. An MCP server is a standard way for agents to talk to tools, and here it is being used to give models persistent memory outside the prompt.

🦞 OpenClaw angle

If you are building self-hosted agents, test whether your current memory layer is just retrieval glued onto a vector store. Compare it against an embedded system that tracks decisions, conflicts, and timestamps, not only similarity search. If you expose memory through MCP, keep the local single-file store as the source of truth and make your agent call recall and conflict checks before writing new conclusions into prompts.

The Python package is installed with pip install yantrikdb. The default setup includes a bundled embedder called potion-base-2M, which the author says is about 7 MB and derived from BGE-base-en-v1.5. With that default, record_text() and recall_text() work immediately, without installing sentence-transformers, downloading a model on first run, or using ONNX Runtime.

In the example shown, a user creates a local database with YantrikDB.with_default("memory.db") and records facts such as “Alice is the engineering lead,” “Project deadline is March 30,” and “User prefers dark mode.” A recall query like “who leads the team?” then returns the most relevant memory. The post also shows relationship handling with relate() and get_edges(), plus a think() call that consolidates memory and checks for conflicts.

The author describes YantrikDB as an embedded engine rather than a client-server database. It stores data in a single file, works locally first, and syncs when connected. The post says it is thread-safe and uses internal locking so it can be accessed concurrently.

For users who want larger models, the project offers three upgrade paths. One is a bundled variant that downloads on first use and caches locally, with a potion-base-8M option listed at about 28 MB and a potion-base-32M option at about 121 MB. Another lets users bring their own embedder, including sentence-transformers, fastembed, or a custom model. A slim build is also available for deployments that do not want any bundled embedder.

The post includes a comparison table that argues YantrikDB uses far fewer tokens than dumping memories into a file or context window. It says file-based memory can exceed 32K context windows at around 500 memories, while YantrikDB stays near 70 tokens per query. The author says precision improves as more data is added, instead of getting worse as context fills up.

YantrikDB’s memory model includes semantic, episodic, and procedural memories. The post says each memory can carry importance, valence, domain, source, certainty, and timestamps, and that recall combines semantic similarity, time decay, importance, graph proximity, and retrieval feedback.

When contradictions appear, the engine creates a conflict segment rather than guessing. The example in the post contrasts “works at Google” and “works at Meta,” then marks the issue as a high-priority identity conflict and suggests asking the user. A think() step is also described as doing consolidation, conflict scanning, pattern mining, and trigger evaluation.

The project also supports sync and multi-node use. The post says yantrikdb-server wraps the engine with openraft for leader-elected replication, and that the system keeps a single monotonic sequence so reads can respect write order across nodes. The author says the project is AGPL-3.0, while the MCP server is MIT-licensed.

Source: HN Show HN ↗

More from OpenClaw News