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

Route your crews' memory through Citadel in one call at startup:

from citadeldb_crewai import use_citadel

use_citadel("crew_memory.cdl", key="your-passphrase")

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")
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")

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, and no text is re-embedded. 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. Set dim to your embedding model's width. The default is 1536, the width of OpenAI's text-embedding-3-small; CrewAI's own default embedder is text-embedding-3-large, so an unconfigured crew needs dim=3072. A region is pinned to its width when it is created, so a different width needs a new file:

use_citadel("crew_memory_3072.cdl", key="your-passphrase", dim=3072)

A record saved without an embedding is still stored and still comes back through get_record, list_records, and every delete filter. It is given a deterministic placeholder vector so the region accepts it, which is not in the crew's space: it can be returned by search, but its rank is meaningless.

License

Apache-2.0

Release files for citadeldb-crewai 2.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 2.0.0
File Size Uploaded
citadeldb_crewai-2.0.0.tar.gz 12.1 kB Details

Built distribution (wheel)

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

Total release size: 20.4 kB

Release files / citadeldb_crewai-2.0.0.tar.gz

Download URL citadeldb_crewai-2.0.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
13e3f0d0195c17923d9a5040d21bea143b2cc7f186eca3d01796c02a574561d3
BLAKE2b-256 checksum
How to use checksums
271beadbb347f2aee6ea6e2359e4730dbdc123bdc4bc5385420fe4d0f9ad4cb3
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 19, 2026.

Transparency log

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

Download URL citadeldb_crewai-2.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58e60bc4797ca9bbc47f05dc48a7fdc24d898b5f006c1c1776592f445e743832
BLAKE2b-256 checksum
How to use checksums
01d2261c2c01eed64c74d4df19b1555b7166e62bd5272fcfc90440fd9ffd1448
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 19, 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

2.2.0

2 release files

2.1.0

2 release files

This release

2.0.0 This release

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