mnestic 0.8.1

A transactional relational-graph-vector database using Datalog — a maintained fork of CozoDB, tuned as a substrate for agentic memory
docs.rs failed to build mnestic-0.8.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

mnestic

mnestic is an independently maintained fork of CozoDB — a transactional, relational-graph-vector database that uses Datalog for queries ("the hippocampus for AI"). The fork continues the project as a substrate for agentic memory, with performance, correctness, and operational work on top of upstream 481af05 (the last upstream commit, 2024-12-04).

mnestic is not the official CozoDB and is not affiliated with or endorsed by its original authors. All credit for the original design belongs to Ziyang Hu and the Cozo Project Authors. See FORK.md for provenance and licensing, and CHANGELOG-FORK.md for what diverges from upstream.

What mnestic adds over CozoDB

Highlights (full detail in CHANGELOG-FORK.md):

0.8.1

  • One-call hybrid retrievalDbInstance::hybrid_search runs HNSW + FTS (+ optional graph traversal), fuses with RRF, and optionally diversifies with MMR in a single typed call (was ~7 hand-written Datalog rules).
  • HNSW index build ~3× faster — the build no longer round-trips the whole graph through the transaction's write-batch overlay (20k × 128: 135s → 43.6s, measured release). Built graph is byte-identical.
  • mnestic-rocks — the C++/RocksDB bridge is now a maintained fork (importable name stays cozorocks), unblocking future bridge-level work.

0.8.0 — fixes

  • Equality pushdown*rel[k, ..], k == <value> now compiles to a keyed stored_prefix_join instead of a full scan (~28–29× faster single-row primary-key lookups, measured at 5k rows). Numeric equalities keep cross-type op_eq semantics.
  • Parser fix — identifiers that start with a keyword literal (nullable_column, trueValue, falsey) now parse correctly (upstream #281).
  • Unreleased upstream fixes for free — the fork point is 30 commits ahead of the published 0.7.6, including the stored_prefix_join correctness fix.
  • env_logger moved to a dev-dependency for a slimmer dependency graph (upstream #287).

0.8.0 — new: hybrid retrieval for agentic memory (Datalog-composable fixed rules)

  • ReciprocalRankFusion (alias RRF) — fuse vector (HNSW) + full-text (FTS) + graph-traversal result lists into one ranking.
  • MaximalMarginalRelevance (alias MMR) — diversity-aware reranking that avoids near-duplicate recalls.
  • rand_ulid() / ulid_timestamp() — lexicographically-sortable identifiers for time-ordered scans (upstream #296).

Importable name

The published crate is mnestic, but the importable Rust crate name is cozo, so existing CozoDB code works unchanged:

[dependencies]
mnestic = "0.8.1"
use cozo::{DbInstance, ScriptMutability};

The query language (CozoScript / Datalog) and engine semantics are unchanged unless noted in the fork changelog.

Features

Default is compact (SQLite backend). RocksDB, vector (HNSW), full-text search, and graph-algorithm features match upstream Cozo 0.7.x. See the crate docs and the upstream CozoDB documentation for the query language and feature flags.

License

Mozilla Public License 2.0. Original work © 2022 The Cozo Project Authors; fork modifications © 2026 Shan Rizvi.