Skip to main content

citadeldb-langgraph

A LangGraph BaseStore backed by Citadel. Encrypted at rest, embedded in your process, and deletes that destroy the key, not just the row.

pip install citadeldb-langgraph

Requires citadeldb>=2.2,<3, langgraph>=0.2.32,<2, and langgraph-checkpoint>=2.0.19,<5.

This example uses local e5-large and requires the Candle source build and model setup. The default wheel accepts a bring-your-own semantic embedder instead; it does not include CandleEmbedder.

import citadeldb
from citadeldb_langgraph import CitadelStore

store = CitadelStore(
    "memory.cdl",
    key="your-passphrase",
    embedder=citadeldb.CandleEmbedder("/path/to/e5-large", preset="e5-large"),
)

store.put(("users", "alice"), "profile", {"city": "Berlin", "pet": "Mochi"})
print(store.get(("users", "alice"), "profile").value)
# {'city': 'Berlin', 'pet': 'Mochi'}

Pass it to a graph the same way as any other store:

graph = builder.compile(store=store)  # `builder` is your StateGraph

search runs Citadel's hybrid recall: vector distance, keyword rank and recency, fused into one score.

Results are returned in recall order. Ranked SearchItem.score values preserve Citadel's query-specific relevance. Queryless results and unindexed fallback rows have no score.

store.put(
    ("notes",), "n1", {"text": "the deployment failed because the disk was full"}
)
store.put(("notes",), "n2", {"text": "lunch plans for friday"})

for item in store.search(("notes",), query="why did the release break?", limit=1):
    print(item.key, item.value)

index=False omits a value from ranked semantic recall, though it can still appear when filling the requested window. index=[...] restricts searchable text to those JSON paths. Citadel concatenates the selected strings into one vector per value; unlike LangGraph's reference store, it does not embed each selected string separately and max-pool their scores.

Deletes destroy the key

Every value is sealed under its own key. Deleting destroys that key, so the bytes on disk stay unreadable. A backup taken before the delete carries its own copy of the wrapped key and is out of scope.

store.delete(("users", "alice"), "profile")

forget_namespace erases non-expired values in a namespace subtree:

store.forget_namespace(("users", "alice"))  # returns the number of values erased

TTL

store.put(("session",), "token", {"v": 1}, ttl=60.0)  # minutes
store.get(("session",), "token", refresh_ttl=True)  # extends the lifetime

A refresh preserves both created_at and updated_at. Expiration hides a value from reads; it does not erase its key. Expired values are not included in forget_namespace. Core Memory.evict(region, EvictionPolicy.expired()) erases expired, non-immutable atoms across the region, not just one namespace.

Notes

Citadel is embedded and one process owns the file. A path already open on this thread, under the same passphrase, is shared, so this can sit on the same database as another Citadel adapter; construct them on the same thread.

embedder= is required. A bring-your-own object exposes dim, metric, model_id, and embed_with_cancel(texts, cancel_token); embed_queries_with_cancel is optional. Accept None as the token and poll cancel_token.check() between bounded batches when present.

A region is pinned to its embedder's width and model id when created. Changing model means re-embedding from the stored text. Memory.reembed_region preserves atom ids and authored edges, and rebuilds managed similarity edges.

License

Apache-2.0

Release files for citadeldb-langgraph 2.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for citadeldb-langgraph 2.6.1
File Size Uploaded
citadeldb_langgraph-2.6.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for citadeldb-langgraph 2.6.1
File Interpreter ABI Platform
citadeldb_langgraph-2.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / citadeldb_langgraph-2.6.1.tar.gz

Download URL citadeldb_langgraph-2.6.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e5240cd2efcd6de55edff720f6568559c16577ece71f604c68474d4dca6601e1
BLAKE2b-256 checksum
How to use checksums
064e5826ed38fe375e8eda40f2cb00071d804e0ecfb9d184bcb8ae4d30f7452d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release files / citadeldb_langgraph-2.6.1-py3-none-any.whl

Download URL citadeldb_langgraph-2.6.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d484dc4567076772caa34adb00f9d31e3c2454c692befdb15c4e69161f16084
BLAKE2b-256 checksum
How to use checksums
9ac2cce0ec77b95f8def9fc060817785d513f38ec1c98d860da30911bb1aa090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.6.1 This release

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.15.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page