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 citadeldb>=2.2,<3 and crewai>=1.14.7,<2.
Provide a cancellation-aware embedder for the same model CrewAI uses. The
Python semantic-embedder example shows
the required protocol. In the examples below, my_embeddings is your application
module exporting that configured embedder; it is not part of this package.
Route CrewAI's default memory backend through Citadel at startup:
from citadeldb_crewai import use_citadel
from my_embeddings import embedder
use_citadel("crew_memory.cdl", key="your-passphrase", embedder=embedder)
Enable memory on the crew:
from crewai import Crew
crew = Crew(agents=[...], tasks=[...], memory=True)
use_citadel handles CrewAI's default storage, storage="lancedb", and
storage="citadel". Other backend names and LanceDB paths are left unchanged.
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))
Direct use
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,
)
]
)
embed_query = getattr(embedder, "embed_queries_with_cancel", embedder.embed_with_cancel)
query_embedding = embed_query(["Why did the release break?"], None)[0]
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
MemoryRecord.importance is retained in the record. Backend search returns
vector similarity; CrewAI applies its composite
scoring, including importance, after the storage call.
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.
Supplied vectors are stored as-is. Records without a vector are embedded by the configured model. An update without a supplied vector preserves the stored vector when the text is unchanged.
The embedder must expose dim, metric, and model_id, plus
embed_with_cancel(list[str], cancel_token) -> list[list[float]]; asymmetric models may
also provide embed_queries_with_cancel. Accept None as the token; otherwise poll
cancel_token.check() between bounded batches. Pass the same model to CrewAI and Citadel so supplied
and generated vectors share one space.
A cosine metric is required. Regions persist the model identity and dimension;
switching models requires re-embedding or a new region.
License
Apache-2.0
Release files for citadeldb-crewai 2.6.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.6.0.tar.gz | 14.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| citadeldb_crewai-2.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.8 kB
Release files / citadeldb_crewai-2.6.0.tar.gz
| Download URL | citadeldb_crewai-2.6.0.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f555c3df7bcb2da975ea36156ff59450634f6099d80d3a965d65ca50d49ccc51
|
|
BLAKE2b-256 checksum How to use checksums |
5975f7a2439ad91baea7e79168d77e09c6706b41d4b6133645185aec211b273c
|
| 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 24, 2026.
Transparency logRelease files / citadeldb_crewai-2.6.0-py3-none-any.whl
| Download URL | citadeldb_crewai-2.6.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
868e03526c785c73bb221580b50e8f817765115890e48f05f3e8d877e8ed5972
|
|
BLAKE2b-256 checksum How to use checksums |
f162614afa4b999aefafb83c50a92789568ae6869a5c9fae18654d402cbdecbf
|
| 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 24, 2026.
Transparency log