cd /news/ai-agents/forked-cozodb-to-give-agents-cogniti… · home topics ai-agents article
[ARTICLE · art-34592] src=news.ycombinator.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Forked CozoDB to give agents cognitive primitives

Developer Shan Rizvi forked the open-source CozoDB into MnesticDB, adding cognitive primitives for AI agents. The new database reduces index build times from 89 seconds to 8 seconds and improves retrieval accuracy, achieving 87% on a pilot of the LongMemEval benchmark. Rizvi is seeking contributors and co-founders for the project.

read2 min views1 publishedJun 20, 2026

CozoDB is an embedded relational-graph-vector database created by Ziyang Hu and the Cozo Project authors. It does Datalog, vector search (HNSW), and full-text search in a single embedded engine and was created with the vision to be the “Hippocampus for AI”. Unfortunately, the project went quiet after December 2024. KuzuDB, another embedded graph database with vector and full-text indexes similar to Cozo, was archived in October 2025.

I decided to continue the vision by using Cozo to build a memory and reasoning substrate with a cognitive ontology inspired by neuroscience. It covers events, epistemic structure, intent, and action, with multi-agent support. An extraction pipeline using an LLM of your choice to extract these from documents and session transcripts, deduplicates them, and detects cross-document contradictions. Everything is versioned and provenanced back to source chunks, with time travel.

But the features we rely on most needed work, so I hard-forked Cozo as MnesticDB under the same MPL-2.0 license, and made improvements.

I reduced index build time from 89s to 8s on a 40,000 chunk corpus with real 384-dimension embeddings without affecting recall by rebuilding the HNSW index flat-and-parallel rather than row-by-row.

I unblocked reads during index rebuilds, which would take more than an hour for a 151,000 index with 1536 dimensions; it now builds off-lock, with a 40,000 vector index building under 6 seconds with 90,000 concurrent reads in one test.

I added reciprocal-rank fusion across semantic (HNSW), keyword (BM25), and graph proximity signals at around 42ms, 4x faster than the three queries running separately.

After switching the default full-text scorer from tf-idf to Okapi BM25, fused recall improved from 0.75 to 0.954 on a 40,000 chunk corpus, on par with DuckDB’s 0.957.

MnesticDB: https://www.mnesticdb.com https://www.github.com/shuruheel/mnestic

Returning to the memory and reasoning substrate, I added support for structured data, allowing users to connect a Postgres database, draft an operational ontology from the schema, and sync rows in as typed graph nodes, with provenance and on-demand live fields, fused into the same graph extracted as the cognitive ontology. This allows an agent to query business tables and knowledge distilled from documents through one interface, with contradictions and history on both.

MindGraph: https://mindgraph.cloud/ https://www.github.com/shuruheel/mindgraph-rs

In a 60-question stratified pilot of LongMemEval, we scored 87% with zero retrieval errors, strong factual recall (100%), and strong temporal reasoning (90%). The misses clustered in preference questions (70%), which I subsequently fixed, but haven’t re-run the benchmark yet. The plan is to eventually run the full 500-question run as the confidence interval is quite wide at the current sample size.

I’ve been building this solo, which is not optimal, so if this piques your interest, please consider becoming a contributor to the MnesticDB project, or a co-founder of MindGraph (the cognitive graph substrate for agents).

Ask me anything here, or email shan@rizvi.nu.

Comments URL: [https://news.ycombinator.com/item?id=48605896](https://news.ycombinator.com/item?id=48605896)

Points: 1

── more in #ai-agents 4 stories · sorted by recency
── more on @cozodb 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/forked-cozodb-to-giv…] indexed:0 read:2min 2026-06-20 ·