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.6.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.6.0
File Size Uploaded
citadeldb_llamaindex-2.6.0.tar.gz 13.5 kB Details

Built distribution (wheel)

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

Total release size: 21.9 kB

Release files / citadeldb_llamaindex-2.6.0.tar.gz

Download URL citadeldb_llamaindex-2.6.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
862ba29840eef7830141e17a08c9e421ffc1b98e859568220b6f1b50a8286ee5
BLAKE2b-256 checksum
How to use checksums
8b5d2befc83662a4a40784e3015eff4164fe1ff6e48e8c10210e79e1c9a7fbbc
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

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

Download URL citadeldb_llamaindex-2.6.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab80db5e7130aa44e71d243bd469d2eda13acff693085163f25a0566ad53f12e
BLAKE2b-256 checksum
How to use checksums
80bfaed40a7784e9b58dde0e7f9c619e91181750a1ecf0582f57a237fe1cca4c
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

Release history Release notifications | RSS feed

2.6.1

2 release files

This release

2.6.0 This release

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

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