citadeldb-crewai
CrewAI memory backed by Citadel. Encrypted at rest, embedded in your process, and deletes that destroy the record's key, not just its row.
pip install citadeldb-crewai
Requires crewai>=1.14.7,<2. CrewAI 1.14.7 is the first stable release with
both the storage-backend protocol and the storage-factory hook used by this adapter.
Route your crews' memory through Citadel in one call at startup:
from citadeldb_crewai import use_citadel
embedder = MyEmbedder() # see the embedder contract below
use_citadel("crew_memory.cdl", key="your-passphrase", embedder=embedder)
Crews then work unchanged:
from crewai import Crew
crew = Crew(agents=[...], tasks=[...], memory=True)
A crew naming a backend Citadel does not claim keeps it, so this will not displace a
deliberate storage="qdrant-edge" or a LanceDB path. "lancedb" is CrewAI's default spec
and is claimed, so a crew naming it explicitly still routes here. Crews may also name
Citadel outright once use_citadel has run:
Memory(storage="citadel").
To route one crew instead of the whole process, hand the backend over directly and skip the startup call:
from crewai import Crew
from crewai.memory.unified_memory import Memory
from citadeldb_crewai import CitadelBackend
backend = CitadelBackend("crew_memory.cdl", key="your-passphrase", embedder=embedder)
crew = Crew(agents=[...], tasks=[...], memory=Memory(storage=backend))
Or drive the backend directly
from citadeldb_crewai import CitadelBackend
from crewai.memory.storage.backend import MemoryRecord
backend = CitadelBackend("crew_memory.cdl", key="your-passphrase", embedder=embedder)
backend.save(
[
MemoryRecord(
content="the deploy failed because the disk was full",
scope="/team/ops",
categories=["incident"],
metadata={"env": "prod"},
importance=0.9,
)
]
)
query_embedding = [0.0] * 1536 # whatever your crew embedded the query with
hits = backend.search(query_embedding, scope_prefix="/team", limit=5)
for record, score in hits:
print(f"{score:.3f} {record.content}")
Deletes destroy the key
Every record 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.
from datetime import datetime, timedelta, timezone
cutoff = datetime.now(timezone.utc) - timedelta(days=30)
backend.delete(record_ids=["abc123"]) # one record
backend.delete(scope_prefix="/team/ops", categories=["incident"])
backend.delete(scope_prefix="/team", older_than=cutoff)
backend.reset("/users/alice") # a whole subtree
reset on a per-user scope destroys the key of every record in that subtree.
Importance is a real ranking signal
MemoryRecord.importance maps onto Citadel's native atom score, so it survives as something
recall ranks by rather than as metadata the store carries and ignores.
Notes
CrewAI embeds queries itself and hands the backend a vector, so search runs vector recall
plus the scope, category, and metadata predicates the protocol defines.
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.
Your crew's own embeddings are stored as-is, so recall runs in the same vector space the crew
queries with. A record that arrives without a vector is embedded by the required model instead
of receiving a placeholder. A record read back carries no embedding, which is what
Memory.update() saves after editing a field, so an update that leaves the content alone keeps
the stored vector rather than replacing it.
The embedder must expose dim, metric, and model_id, plus
embed(list[str]) -> list[list[float]]; embed_queries is optional. Pass the same model (or a
thin adapter over it) to CrewAI and Citadel so supplied and generated vectors share one space.
A cosine metric is required because CrewAI's storage contract exposes normalized similarity
scores; L2 and inner-product distances have no equivalent bounded score without inventing a
model-specific calibration.
A region is pinned to that model identity and width, so switching models requires an explicit
re-embed or a new region.
A missing embedder= is an error; the adapter never substitutes a mock model.
License
Apache-2.0
Release files for citadeldb-crewai 2.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 | |
|---|---|---|---|
| citadeldb_crewai-2.1.0.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| citadeldb_crewai-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / citadeldb_crewai-2.1.0.tar.gz
| Download URL | citadeldb_crewai-2.1.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3dc8b2a45cc8162318122269178fdb79cbd1189f2aeaefc3efea99272469fabb
|
|
BLAKE2b-256 checksum How to use checksums |
e7f1e9bbdff931c9a8e83fc725ef1830472ceffabe12ae473303ab5fa1e7d52c
|
| 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 Aug 30, 2026.
Transparency logRelease files / citadeldb_crewai-2.1.0-py3-none-any.whl
| Download URL | citadeldb_crewai-2.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c938624a06261c51a879b226d120f788b4dc7ebaa4f802d195d0519fcd024ee0
|
|
BLAKE2b-256 checksum How to use checksums |
035cf6d52369728f8c116b514b8b1ee40c94a3cd5b20162632a4bdddb53dc5a2
|
| 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 Aug 30, 2026.
Transparency log