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. Read it in your application and pass it as base_url. |
GOODMEM_API_KEY | API key used to authenticate requests. Read it in your application and pass it as api_key. |
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. Read it in your application and pass it as embedder_id; the embedder must exist. |
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. |
GoodmemPlugin, GoodmemSaveTool, and GoodmemFetchTool do not read GOODMEM_BASE_URL,
GOODMEM_API_KEY, or GOODMEM_EMBEDDER_ID themselves. Always pass base_url and api_key
to their constructors, and pass embedder_id when you want to pin an embedder. The examples
use os.getenv(...) to bridge those environment variables into constructor arguments.
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. This package does not expose a TLS-verification bypass. For a local
installation started with TLS disabled, use http://localhost:8080. If your local server uses a
private or self-signed CA, add that CA to your system or Python trust store. Keep certificate
verification enabled for any deployed server.
Learn more
Package metadata and the README are available on the PyPI package page.