Skip to main content

citadeldb-llamaindex

A LlamaIndex vector store backed by Citadel. Encrypted at rest, embedded in your process, and deletes that destroy the key, not just the row.

pip install citadeldb-llamaindex

Requires citadeldb>=2.2,<3 and llama-index-core>=0.13.1,<0.15. The example also requires pip install llama-index-embeddings-openai and OPENAI_API_KEY; document and query text are sent to the embedding provider.

from llama_index.core import Document, StorageContext, VectorStoreIndex
from llama_index.embeddings.openai import OpenAIEmbedding
from citadeldb_llamaindex import CitadelVectorStore

embed_model = OpenAIEmbedding(model="text-embedding-3-small")
store = CitadelVectorStore(
    "corpus.cdl",
    key="your-passphrase",
    embed_model=embed_model,
    dim=1536,
)
documents = [Document(
    id_="doc-42",
    text="the deployment failed because the disk was full",
    metadata={"year": 2026},
)]

index = VectorStoreIndex.from_documents(
    documents,
    storage_context=StorageContext.from_defaults(vector_store=store),
    embed_model=embed_model,
)

index.as_retriever(similarity_top_k=1).retrieve("why did the release break?")

dim must match your embedding model: 1536 for OpenAI text-embedding-3-small, 3072 for text-embedding-3-large, 1024 for e5-large. Models exposing model_id, model_name, or model record that identity automatically, in that order. For a custom model without any of those attributes, pass a stable model_id= explicitly; Citadel refuses to guess from the Python class name.

Deletes destroy the key

Every node is sealed under its own key. Deleting destroys that key and removes the row. Pre-erasure backups or snapshots containing keys, and exported plaintext, are outside that erasure.

index.delete_ref_doc("doc-42")  # every node from that document
store.forget_document("doc-42")  # the same, returning a count for the record
store.clear()  # the whole corpus

Filters

Metadata filters, node_ids, and doc_ids restrict candidates before final top-k selection.

String equality under a top-level AND is passed to Citadel as a payload filter. Other predicates filter ranked candidates; the search window expands until similarity_top_k matches survive or the region is exhausted.

from llama_index.core.vector_stores.types import (
    FilterOperator,
    MetadataFilter,
    MetadataFilters,
)

index.as_retriever(
    filters=MetadataFilters(
        filters=[
            MetadataFilter(key="year", value=2026, operator=FilterOperator.EQ),
        ]
    )
).retrieve("...")

Leaf operators use LlamaIndex's filter evaluator. The adapter handles AND, OR, and NOT, including NOT on versions whose evaluator does not implement it.

Notes

Supplied vectors are stored as-is; nodes without a vector use the required embed_model. Pass the same model to the index and store.

The node is stored whole, minus its text, which is kept once as the atom's searchable content and restored on read. Metadata, relationships and node type all round-trip.

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.

License

Apache-2.0

Release files for citadeldb-llamaindex 2.5.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-llamaindex 2.5.0
File Size Uploaded
citadeldb_llamaindex-2.5.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for citadeldb-llamaindex 2.5.0
File Interpreter ABI Platform
citadeldb_llamaindex-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / citadeldb_llamaindex-2.5.0.tar.gz

Download URL citadeldb_llamaindex-2.5.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
56fcd2f9c3a4811fb6f854577aedabf97cd84629d7d1374e065fc8866360292e
BLAKE2b-256 checksum
How to use checksums
12ca6d2fae1674130f5a70bdaf36ee00b92589c78600735a95517ca12390a5b3
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 13, 2026.

Transparency log

Release files / citadeldb_llamaindex-2.5.0-py3-none-any.whl

Download URL citadeldb_llamaindex-2.5.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
598f7436da4d16acbfdbdf9e425129e63f9f3675c02f44b8d5e1007939b9b784
BLAKE2b-256 checksum
How to use checksums
ddedca41b282b6c7b0d9bf00adaa27600bf3f8e2aaaf37b4fe245bc800de5362
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 13, 2026.

Transparency log

Release history Release notifications | RSS feed

2.6.1

2 release files

2.6.0

2 release files

This release

2.5.0 This release

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

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