GoodMem for Google ADK
Give your ADK agent memory across conversations. GoodMem stores and indexes messages and documents; the agent retrieves relevant passages when it needs them.
Choose tools when the agent should decide what to remember, or the plugin when you want automatic conversation capture and context retrieval.
Install
pip install goodmem-adk
You need a GoodMem server, an API key, and an existing
embedder. Set GOODMEM_BASE_URL and GOODMEM_API_KEY; optionally select an
embedder with GOODMEM_EMBEDDER_ID. Your agent can use any ADK-supported model.
Give your agent memory tools
This example uses Cohere through ADK's LiteLLM adapter. Install litellm>=1.84
and set COHERE_API_KEY separately from your GoodMem credentials.
from google.adk.agents import LlmAgent
from google.adk.apps import App
from google.adk.models.lite_llm import LiteLlm
from goodmem_adk import GoodmemFetchTool, GoodmemSaveTool
root_agent = LlmAgent(
name="assistant",
model=LiteLlm(model="cohere_chat/command-a-03-2025"),
instruction=(
"Save facts when asked to remember them. Before answering questions "
"about saved facts, call goodmem_fetch, even in a fresh conversation. "
"Check tool results and report errors honestly."
),
tools=[GoodmemSaveTool(), GoodmemFetchTool()],
)
app = App(name="memory_agent", root_agent=root_agent)
Save this as memory_agent/agent.py, then run adk run memory_agent.
Ask it to remember a fact, start a fresh session with the same user ID, and ask
for that fact. Complete examples include both integration paths.
Automatic memory
Instead of adding memory tools, attach the plugin to your app:
from google.adk.agents import LlmAgent
from google.adk.apps import App
from google.adk.models.lite_llm import LiteLlm
from goodmem_adk import GoodmemPlugin
root_agent = LlmAgent(
name="assistant",
model=LiteLlm(model="cohere_chat/command-a-03-2025"),
instruction="Answer using relevant memory context.",
)
app = App(
name="memory_agent",
root_agent=root_agent,
plugins=[GoodmemPlugin()],
)
The plugin saves visible user and model messages, uploads inline attachments, and supplies relevant context before model calls.
Scopes and results
Defaults are adk_tool_{user_id} for tools and adk_chat_{user_id} for the
plugin. Set the same space_id or space_name on both to share memory. Explicit
scopes are shared by everyone using that configuration; defaults separate users,
not applications. Explicit arguments override environment scope settings.
Writes return accepted IDs and processing states. Indexing happens asynchronously;
empty searches are never retried automatically. Failed attachments are reported
alongside accepted writes. Automatic persistence failures raise an error containing
those IDs. Fetch results preserve distinct chunks, source metadata, statuses,
and a partial flag when retrieval may be incomplete.
For connection pooling or custom TLS, pass a caller-owned AsyncGoodmem as
client=. Otherwise each operation creates and closes its own asynchronous SDK.
See the 0.2 migration notes and validation guide.
Release files for goodmem-adk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| goodmem_adk-0.2.0.tar.gz | 40.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| goodmem_adk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.2 kB
Release files / goodmem_adk-0.2.0.tar.gz
| Download URL | goodmem_adk-0.2.0.tar.gz |
|---|---|
| Size | 40.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49173ba725cb6ad8a7e2c15e5c2f5c6604f18d272b2feb6249a4b313af5ddcd7
|
|
BLAKE2b-256 checksum How to use checksums |
c49b36426db6a47184cd8f3dac097562ead625fcc8f1985c03fab55531a8d449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / goodmem_adk-0.2.0-py3-none-any.whl
| Download URL | goodmem_adk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3022998d3252d94864a1a3a959fc9ac9607b7ed63ebc943c00c8ab690c4ea48
|
|
BLAKE2b-256 checksum How to use checksums |
ca6cd205d3eefa46f61c2915148592bb32f8ea6d3fd6ab1c74b535122521dbd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|