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>=2.2,<3 and google-adk>=2.0,<3.

The semantic example uses a local e5-large model. CandleEmbedder requires a Candle source build and model setup; the default wheel accepts a bring-your-own semantic embedder instead.

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

memory = CitadelMemoryService(
    "adk_memory.cdl",
    key="your-passphrase",
    embedder=citadeldb.CandleEmbedder("/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

Release files for citadeldb-google-adk 2.6.1

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 2.6.1
File Size Uploaded
citadeldb_google_adk-2.6.1.tar.gz 10.8 kB Details

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / citadeldb_google_adk-2.6.1.tar.gz

Download URL citadeldb_google_adk-2.6.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
508b2835cc4b82dd22469880d132e93ce5b1ebac60dbd2ded2bc84b556312311
BLAKE2b-256 checksum
How to use checksums
d3f0d741826be3dff3ef4acb7c86f49fe02a1c163fc4a7a1a7d834fa377f9703
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 25, 2026.

Transparency log

Release files / citadeldb_google_adk-2.6.1-py3-none-any.whl

Download URL citadeldb_google_adk-2.6.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b71c0650bde7267c3fb90d737077c41c483cb0d94f0f5fc4370fc8b329ac363
BLAKE2b-256 checksum
How to use checksums
424d9f92ca32c1f3ec3cf33bf222b63fb2bedd44ace353b20942ee236984250a
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.6.1 This release

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

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