Skip to main content

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.2.0

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-crewai 2.2.0
File Size Uploaded
citadeldb_crewai-2.2.0.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for citadeldb-crewai 2.2.0
File Interpreter ABI Platform
citadeldb_crewai-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / citadeldb_crewai-2.2.0.tar.gz

Download URL citadeldb_crewai-2.2.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ed3ecfcf6769de465389c4c5c7f34170306d5c52929100c33003cc5b30f13f60
BLAKE2b-256 checksum
How to use checksums
f187f35c869ce7ad5e3598bbddb7d84c30df99d330d879daa85a14689b3029fd
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 3, 2026.

Transparency log

Release files / citadeldb_crewai-2.2.0-py3-none-any.whl

Download URL citadeldb_crewai-2.2.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5aa9f4f8e59e6130e451a04fa58bf66714d0ccb28655c4decf734f8f27ef86af
BLAKE2b-256 checksum
How to use checksums
6c2defb1b3b2c7ed05f36abf8d98344926dab82f40a51697868a338e2d7b4242
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 3, 2026.

Transparency log

Release history Release notifications | RSS feed

2.6.1

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

This release

2.2.0 This release

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