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

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / citadeldb_google_adk-2.3.0.tar.gz

Download URL citadeldb_google_adk-2.3.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
75c268ae29020a3f1ed813ef8e7e65649c3a5e7a6d18a250cc82a0c6160e783a
BLAKE2b-256 checksum
How to use checksums
fac99c0fbb57be52d03608456412b22b205d4bf6a247ee6c404961ceea19ea59
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 7, 2026.

Transparency log

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

Download URL citadeldb_google_adk-2.3.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a820dd062a3b4d2380c89c55014f977162423ad390b415e4bed99adfa814310
BLAKE2b-256 checksum
How to use checksums
a29d51944d30a62f9099e9fc029023e9c7a54c7a49be5af32510e71bbb4dfd87
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 7, 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

2.4.0

2 release files

This release

2.3.0 This release

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