langgraph-store-mnestic
A LangGraph BaseStore backed by
mnestic — an embedded graph + vector +
full-text database (a maintained fork of CozoDB). One process, one file, no
server: agent long-term memory with atomic batches and in-engine hybrid
retrieval (BM25 + vector fused with Reciprocal Rank Fusion — a fusion that
Postgres + pgvector, LangGraph's default production store, cannot do in one
system).
mnestic is a maintained fork of CozoDB; it is not the official CozoDB. Original design credit belongs to Ziyang Hu and the Cozo Project Authors.
pip install langgraph-store-mnestic
from langgraph_store_mnestic import MnesticStore
store = MnesticStore(
engine="sqlite", path="memory.db", # or engine="mem" for ephemeral
index={"dims": 1536, "embed": my_embed_fn}, # any LangGraph IndexConfig embed
ttl={"default_ttl": 60 * 24, "refresh_on_read": True}, # optional
)
store.put(("users", "u1"), "pref", {"text": "prefers window seats"})
hits = store.search(("users", "u1"), query="seating preference")
Use it in a graph like any store:
graph = builder.compile(store=store)
What you get
- Atomic
batch()— every write in a batch lands in one engine transaction. Under LangGraph's parallel fan-out this is the difference between correct recall and silently losing reads (a non-atomic prototype lost 36% of concurrent semantic reads; this store's concurrency suite gates on zero). - Hybrid
search(query=...)— BM25 keyword + HNSW vector legs, namespace filter pushed into both index searches, RRF-fused and hydrated in a single engine snapshot. Without anindexconfig the store is BM25-only (keyword search still works, no embeddings needed). - Collision-safe namespaces — any label content stays distinct
(
('a.b',)can never collide with('a', 'b')). - TTL — per-item or
default_ttl(minutes), lazy expiry on every read path, optional refresh-on-read, and astart_ttl_sweeper()background reclaimer. - Sync + async — full
BaseStoresurface;a*methods run the sync engine calls on the default executor.
LangGraph Platform (langgraph.json)
Custom stores are loadable by import path (alpha upstream feature):
# src/agent/store.py
from contextlib import asynccontextmanager
from langgraph_store_mnestic import MnesticStore
@asynccontextmanager
async def generate_store():
store = MnesticStore(engine="sqlite", path="memory.db", index={...})
try:
yield store
finally:
store.close()
{ "store": { "path": "./src/agent/store.py:generate_store" } }
Notes
- Requires Python ≥ 3.10 and
langgraph-checkpoint >= 4.1. - The wheel build of
mnesticshipsmem,sqlite, androcksdbengines (the sdist has no rocksdb). - The text index applies English stemming + stopwords: queries made only of
very common words match nothing on the keyword leg (the vector leg still
answers when an
indexconfig is present). - Filter operators supported in
search(filter=...):$eq,$ne,$gt,$gte,$lt,$lte, withInMemoryStore-parity semantics.
License
Mozilla Public License 2.0.
Metadata
Release files for langgraph-store-mnestic 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langgraph_store_mnestic-0.1.0.tar.gz | 18.7 kB | With provenance | Details for langgraph_store_mnestic-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langgraph_store_mnestic-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langgraph_store_mnestic-0.1.0-py3-none-any.whl |
Total release size: 32.0 kB
Release files / langgraph_store_mnestic-0.1.0.tar.gz
| Download URL | langgraph_store_mnestic-0.1.0.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66b0d970f9844939deea615ea50c26bded24ecf36d35934e3bb1d445579c6459
|
|
BLAKE2b-256 checksum How to use checksums |
8cdee98a4bd40c4eb2c1ac98233b9369da851a8a8082ff7f63d39cba6fe3e3bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / langgraph_store_mnestic-0.1.0-py3-none-any.whl
| Download URL | langgraph_store_mnestic-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9958be245e41a48921a65f0b7bbd4f4b2aa696a727721fe9e63bc37002f8dcda
|
|
BLAKE2b-256 checksum How to use checksums |
079f7d32f0a1e5157e33aa0204d39bf0820f92b0843a8946f4ca51360aa51bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logSecurity for langgraph-store-mnestic 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for langgraph_store_mnestic-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.