Skip to main content

citadeldb-google-adk

A Google ADK BaseMemoryService backed by Citadel. Encrypted at rest, embedded in your process, and deletes that destroy the key, not just the row.

pip install citadeldb-google-adk

Requires citadeldb>=3.0,<4 and google-adk>=2.0,<3.

The semantic example uses local e5-large and needs the KodamaEmbed model files. Any other embedder works through the embedder protocol.

import citadeldb
from google.adk.runners import Runner
from citadeldb_google_adk import CitadelMemoryService

memory = CitadelMemoryService(
    "adk_memory.cdl",
    key="your-passphrase",
    embedder=citadeldb.KodamaEmbedder("/path/to/e5-large", preset="e5-large"),
)

runner = Runner(
    app_name="my_app",
    agent=agent,  # your root agent
    session_service=session_service,  # your session service
    memory_service=memory,
)

Search combines vector similarity, keyword rank, recency, and importance:

await memory.add_session_to_memory(session)  # a Session your Runner already ran

result = await memory.search_memory(
    app_name="my_app", user_id="alice", query="why did the release break?"
)
print(result)

Deletes destroy the key

Every event is sealed under its own key. Erasing destroys those keys, 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.

memory.forget_user("my_app", "alice")  # returns the number erased
memory.forget_session("my_app", "alice", "s-42")

Direct writes

add_memory writes memories without a session:

from google.adk.memory.memory_entry import MemoryEntry
from google.genai import types

entry = MemoryEntry(content=types.Content(parts=[types.Part(text="prefers dark mode")]))
await memory.add_memory(app_name="my_app", user_id="alice", memories=[entry])

add_events_to_memory stores text-bearing events without requiring a whole session. An event with an existing id replaces that event; anonymous events are always appended.

Notes

add_session_to_memory replaces the session's stored text-bearing events. add_events_to_memory adds new ids and replaces existing ids.

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.

embedder= is required. A bring-your-own object exposes dim, metric, model_id, and embed_with_cancel(texts, cancel_token); asymmetric models may also provide embed_queries_with_cancel. Accept None as the cancellation token; otherwise poll cancel_token.check() between bounded batches.

License

Apache-2.0

Metadata

Release files for citadeldb-google-adk 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-google-adk 3.0.0
File Size Uploaded Provenance Actions
citadeldb_google_adk-3.0.0.tar.gz 10.7 kB With provenance Details for citadeldb_google_adk-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / citadeldb_google_adk-3.0.0.tar.gz

Download URL citadeldb_google_adk-3.0.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
049dbf862ad28bababd30a53690b4daeed714fb13a9b8ba7e79984fad143e1bd
BLAKE2b-256 checksum
How to use checksums
02cb7a83c7822e624cec7f9b206231461978e46658c7da3232458c048161c6a3
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_google_adk-3.0.0-py3-none-any.whl

Download URL citadeldb_google_adk-3.0.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26dda04e4fcd87adcbb90bf22c48bd94560515fdc783762e6f967bde5c2e2be2
BLAKE2b-256 checksum
How to use checksums
620571f2e78f5537c8baabc584f61657d0444777650f67a6e2c66f3329cf65c7
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-google-adk 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_google_adk-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