Skip to main content

Embedded graph + vector + full-text database with Datalog — a maintained fork of CozoDB, tuned as a substrate for agentic memory.

Project description

mnestic (Python)

Embedded graph + vector + full-text database with Datalog queries — a maintained fork of CozoDB, tuned as a substrate for agentic memory. This package is the in-process Python binding (no server required).

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 the fork repository for provenance and licensing.

pip install mnestic
from mnestic import CozoDbPy

db = CozoDbPy("mem", "", "{}")  # engines: "mem", "sqlite" (file path), "rocksdb" (dir path)
db.run_script("?[x] <- [[1],[2],[3]]", {}, False)

# One-call hybrid retrieval (HNSW + full-text fused with Reciprocal Rank Fusion),
# over a relation that has an HNSW index and an FTS index:
hits = db.hybrid_search({
    "relation": "docs",
    "vector_index": "vec", "query_vector": [0.1, 0.9], "vector_k": 5,
    "fts_index": "fts", "query_text": "vector search", "fts_k": 5,
})
# -> {"headers": ["id", "score"], "rows": [["d3", 0.033], ...], "next": None}

# Pass "detailed": True for per-leg contributions — one row per (item, leg)
# with the within-leg rank the fusion used and the leg's raw score:
# headers ["id","score","list_id","leg_rank","leg_score"]

The "rocksdb" persistent backend now ships in the published wheel — CozoDbPy("rocksdb", "./my.db", "{}") works straight from pip install mnestic. The source distribution stays SQLite/compact-only, so the persistent engine is wheel-only.

run_script takes an optional timeout= — a per-query wall-clock budget in seconds; on expiry the query raises an eval::timeout error. db.set_default_query_timeout(secs) sets a Db-wide default and db.default_query_timeout() reads it back; the effective budget for a query is the minimum of that default and any per-call timeout.

For idiomatic LangChain / LlamaIndex usage, install the integration packages (langchain-mnestic, llama-index-vector-stores-mnestic).

The query language (CozoScript / Datalog) and engine semantics follow CozoDB; see the upstream documentation and the fork changelog.

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mnestic-0.10.5.tar.gz (560.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mnestic-0.10.5-cp37-abi3-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.7+Windows x86-64

mnestic-0.10.5-cp37-abi3-manylinux_2_28_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ x86-64

mnestic-0.10.5-cp37-abi3-manylinux_2_28_aarch64.whl (12.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

mnestic-0.10.5-cp37-abi3-macosx_11_0_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.7+macOS 11.0+ x86-64

mnestic-0.10.5-cp37-abi3-macosx_11_0_arm64.whl (10.4 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

File details

Details for the file mnestic-0.10.5.tar.gz.

File metadata

  • Download URL: mnestic-0.10.5.tar.gz
  • Upload date:
  • Size: 560.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mnestic-0.10.5.tar.gz
Algorithm Hash digest
SHA256 be6ed6b4c2ea72912b2d6a7e31cbfd3806a2c10e61f08227d52480dbe506df4f
MD5 8c1233fc889a4b5fd5ab9f83578a6566
BLAKE2b-256 8ab4d7d66626fc381f2960177fc126fb3ad3271ca7e5c3c3cf02c16b42c577ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5.tar.gz:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnestic-0.10.5-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: mnestic-0.10.5-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mnestic-0.10.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 067e7de3b9cc8303ddc7aba4084dd505b119c7ae6471b3f98c261cddcd6d6fa0
MD5 6b2e9a987d2a88edbed53d0742bdc7f9
BLAKE2b-256 ac3fef15bf02b11333a073dcd3595c82ca2718f2d10a31316b1d279f28d0bebf

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5-cp37-abi3-win_amd64.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnestic-0.10.5-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mnestic-0.10.5-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03ff0b03d1a528b9ee734d8a4db22bf9cb6b831e567167536f95df2b0a3db48c
MD5 8658709b0e3233fa5fd3498df4660a63
BLAKE2b-256 96aa5db1367f4a0520f88927040c1798703b8cd0e297b710e10c638ffb362015

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5-cp37-abi3-manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnestic-0.10.5-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mnestic-0.10.5-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2133d21ed6b70504983ae406b2bde0585f4dd821a4d4771346ae570f11fca7ec
MD5 b2dad726d9cdc76b7f706b97c5a51b00
BLAKE2b-256 eef0449878e1b9197a050ac61ffcfaf48ee0328d9c8c8d0c2f37b170082aa11c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5-cp37-abi3-manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnestic-0.10.5-cp37-abi3-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for mnestic-0.10.5-cp37-abi3-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fad0ed06afeb48b06eb1c49f45bf395d5f6731988cb1295bbff2334aa0dd11be
MD5 a6dbc4fba6086c264c02a884e2cebd0c
BLAKE2b-256 7876ab42f1b67e54e1297680a5b398f8b44393f40a74362186ae5c292a4fa9b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5-cp37-abi3-macosx_11_0_x86_64.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnestic-0.10.5-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mnestic-0.10.5-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e29fce7d041cda2bf6fd8e1598f335925b9c39777795512672f218bfec7b4b7
MD5 c24efcaf59dc6ae3cb7396b3a4f7439a
BLAKE2b-256 18eacc44ec397e946731337ab2c8cfd11c75957dff14c87c902e75315eb45718

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnestic-0.10.5-cp37-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page