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

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

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / citadeldb_google_adk-2.4.0.tar.gz

Download URL citadeldb_google_adk-2.4.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a58d0b416856927eb4ed946d26bb144b1a4cffd50b5d58378923ae025e7f9445
BLAKE2b-256 checksum
How to use checksums
90a67c0ef75a1adf8e5a34793da7e7dbe9d280389a19be5081f4db3eacfd5891
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 11, 2026.

Transparency log

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

Download URL citadeldb_google_adk-2.4.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d4edeb4ca3213a3320cc009806ff525aef6c5e1d46e747282d04c26c93a971e
BLAKE2b-256 checksum
How to use checksums
4710f76e0280ff95caeb1f67d06061bdc6bfd95c2ed5fa8130089ead683471d4
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 11, 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

This release

2.4.0 This release

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