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>=3.0,<4 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

Metadata

Release files for citadeldb-crewai 3.0.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 3.0.0
File Size Uploaded Provenance Actions
citadeldb_crewai-3.0.0.tar.gz 14.1 kB With provenance Details for citadeldb_crewai-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.7 kB

Release files / citadeldb_crewai-3.0.0.tar.gz

Download URL citadeldb_crewai-3.0.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
caac4caf59d65c168d79a3986fc46020cdcd6592c88b5e2130eb830767b61bc6
BLAKE2b-256 checksum
How to use checksums
57bc1275a1a237a26f99569f7ddc4e83c9840aace7e71ad9897bb1a149b14a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

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

Download URL citadeldb_crewai-3.0.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
905d0155b120f30e63365bb41c485a7de7af5366803ae3005fb1f24d1050f3a1
BLAKE2b-256 checksum
How to use checksums
882cb7eab4960c02a60f75f799407e76efa8fe2a34f7480cd04f6292cfc6c97c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Security for citadeldb-crewai 3.0.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for citadeldb_crewai-3.0.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 Nov 28, 2026.

Transparency log

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

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