Google ADK
Add persistent memory to Google ADK agents via a per-turn plugin or explicit agent-driven save and fetch tools.
Overview
GoodMem is a memory layer for AI agents that handles embedding, vector search, reranking, and
LLM-powered answering server-side. The Google ADK integration adds persistent memory to your
agents in two ways: a GoodmemPlugin that implicitly saves and recalls memory on every
agent–user turn through ADK callbacks, and GoodmemSaveTool / GoodmemFetchTool that let the
agent explicitly decide when to store or retrieve memories.
Google publishes official setup documentation for this integration at adk.dev/integrations/goodmem.
Installation
pip install goodmem-adkThe pip package is goodmem-adk; the import name is goodmem_adk.
Configuration
| Variable | Description |
|---|---|
GOODMEM_BASE_URL | Base URL of your GoodMem server (no /v1 suffix), e.g. https://your-goodmem-server.example.com. |
GOODMEM_API_KEY | API key used to authenticate requests. |
GOOGLE_API_KEY | Google API key for the Gemini model (and for auto-creating a gemini-embedding-001 embedder when none exists). |
GOODMEM_EMBEDDER_ID | Optional. Embedder used when creating a space; must exist if set. |
GOODMEM_SPACE_ID | Optional. Existing space to use; must exist if set. |
GOODMEM_SPACE_NAME | Optional. Space looked up by name and auto-created if missing. |
The GoodmemPlugin, GoodmemSaveTool, and GoodmemFetchTool also accept base_url and
api_key constructor arguments if you prefer to configure them in code instead of the
environment.
Quick start
import os
from google.adk.agents import LlmAgent
from google.adk.apps import App
from goodmem_adk import GoodmemPlugin
plugin = GoodmemPlugin(
base_url=os.getenv("GOODMEM_BASE_URL"),
api_key=os.getenv("GOODMEM_API_KEY"),
top_k=5,
)
agent = LlmAgent(
name="memory_agent",
model="gemini-flash-latest",
instruction="You are a helpful assistant with persistent memory.",
)
app = App(name="GoodmemPluginDemo", root_agent=agent, plugins=[plugin])Local development. The example above uses a TLS-verified production URL. If you are running
GoodMem locally with a self-signed certificate, use https://localhost:8080 and disable TLS
verification with the client's verify-SSL option (see the Configuration table above). Keep TLS
verification enabled for any deployed server.
Learn more
The full README, examples, and API reference are available on the PyPI package page.