Redis with Google Agent Development Kit (ADK)
Build AI agents with persistent memory, semantic search, and caching using Redis and Google ADK.
Google Agent Development Kit (ADK) provides clean abstractions for building AI agents: interfaces for memory, sessions, tools, and callbacks. adk-redis implements these interfaces using Redis, giving agents persistent two-tier memory, semantic search for RAG, and response caching without requiring changes to agent logic.
Architecture
adk-redis connects several backend systems to the ADK framework:
- Redis Agent Memory handles working memory (sessions), long-term memory (extracted facts), auto-summarization, and memory search. Use the default
redis-agent-memoryfor new work. It runs either on Redis Cloud or self-managed on your own Kubernetes cluster; both share one Data Plane API, so you pick a deployment by pointingapi_base_urlat the right endpoint. - RedisVL (Redis Vector Library) powers the search tools and local semantic cache provider.
- LangCache provides managed semantic caching with server-side embeddings.
Note:
Agent Memory Server
(opensource-agent-memory) is now deprecated. If you have an existing
deployment, see
Agent Memory Server (deprecated),
which also covers migrating to Redis Agent Memory.Prerequisites
- Redis 8.4+ with vector search support, for the search tools and the local semantic cache
- A Redis Agent Memory store, for the session and memory services, which gives you a Data Plane endpoint, an API key, and a store ID
Provision a store, then pass its Data Plane endpoint, API key, and store ID to the services.
- On Redis Cloud, there is nothing to run. See Create an Agent Memory service.
- To run it yourself, see Self-managed Agent Memory for deployment, configuration, and operations on your own Kubernetes cluster.
Both use backend="redis-agent-memory". Only api_base_url differs.
Installation
# Memory and session services (both backends)
pip install adk-redis[memory]
# Search tools via RedisVL
pip install adk-redis[search]
# SQL-style search tool (sql-redis)
pip install adk-redis[sql]
# Managed semantic caching via LangCache
pip install adk-redis[langcache]
# Everything
pip install adk-redis[all]
# For the RedisVL MCP server (used with ADK's native McpToolset)
pip install 'redisvl[mcp]>=0.18.2'
The memory extra requires redis-agent-memory>=0.2.0.
Quick start
Wire up Redis Agent Memory in a few lines:
from google.adk import Agent
from google.adk.agents.callback_context import CallbackContext
from google.adk.runners import Runner
from adk_redis.sessions import (
RedisSessionMemoryService,
RedisSessionMemoryServiceConfig,
)
from adk_redis.memory import (
RedisLongTermMemoryService,
RedisLongTermMemoryServiceConfig,
)
session_service = RedisSessionMemoryService(
config=RedisSessionMemoryServiceConfig(
backend="redis-agent-memory",
api_base_url="https://your-endpoint.redis.io",
api_key="your-api-key",
store_id="your-store-id",
default_namespace="my_app",
)
)
memory_service = RedisLongTermMemoryService(
config=RedisLongTermMemoryServiceConfig(
backend="redis-agent-memory",
api_base_url="https://your-endpoint.redis.io",
api_key="your-api-key",
store_id="your-store-id",
default_namespace="my_app",
)
)
async def after_agent(callback_context: CallbackContext):
await callback_context.add_session_to_memory()
agent = Agent(
name="my_agent",
model="gemini-2.5-flash",
instruction="You are a helpful assistant with long-term memory.",
after_agent_callback=after_agent,
)
runner = Runner(
agent=agent,
app_name="my_app",
session_service=session_service,
memory_service=memory_service,
)
Capabilities
| Capability | Description | Page |
|---|---|---|
| Redis Agent Memory | Session and long-term memory on Redis Cloud or self-managed, via framework services or REST tools | Redis Agent Memory |
| Integration patterns | Framework-managed, LLM-controlled REST, and MCP tools | Integration patterns |
| Search tools | Vector, hybrid, text, range, and SQL search via RedisVL, plus the rvl mcp server over McpToolset |
Search tools |
| Semantic caching | LLM response and tool result caching, with stable entry IDs and targeted invalidation | Semantic caching |
| Examples | Complete examples covering all capabilities | Examples |
| Agent Memory Server (deprecated) | Reference for the deprecated opensource-agent-memory backend, and how to migrate off it |
Agent Memory Server (deprecated) |