Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 36 additions & 32 deletions content/integrate/google-adk/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,36 @@ weight: 30

## Architecture

adk-redis connects three backend systems to the ADK framework:
adk-redis connects several backend systems to the ADK framework:

- **[Redis Agent Memory Server](https://github.com/redis/agent-memory-server)** handles working memory (sessions), long-term memory (extracted facts), auto-summarization, and memory search.
- **[Redis Agent Memory]({{< relref "/develop/ai/context-engine/agent-memory" >}})** handles working memory (sessions), long-term memory (extracted facts), auto-summarization, and memory search. Use the default `redis-agent-memory` for new work. It runs either on [Redis Cloud]({{< relref "/operate/rc/context-engine/agent-memory" >}}) or [self-managed]({{< relref "/develop/ai/context-engine/agent-memory/self-managed" >}}) on your own Kubernetes cluster; both share one Data Plane API, so you pick a deployment by pointing `api_base_url` at the right endpoint.
- **[RedisVL]({{< relref "/develop/ai/redisvl" >}})** (Redis Vector Library) powers the search tools and local semantic cache provider.
- **[LangCache](https://redis.io/langcache/)** provides managed semantic caching with server-side embeddings.

Comment thread
mich-elle-luna marked this conversation as resolved.
{{< note >}}
[Agent Memory Server](https://github.com/redis/agent-memory-server)
(`opensource-agent-memory`) is now deprecated. If you have an existing
deployment, see
[Agent Memory Server (deprecated)]({{< relref "/integrate/google-adk/agent-memory-server" >}}),
which also covers migrating to Redis Agent Memory.
{{< /note >}}

## Prerequisites

- **Redis 8.4+** with vector search support
- **Agent Memory Server** for memory and session services
- **Redis 8.4+** with vector search support, for the search tools and the local semantic cache
- **A [Redis Agent Memory]({{< relref "/develop/ai/context-engine/agent-memory" >}}) store**, for the session and memory services, which gives you a Data Plane endpoint, an API key, and a store ID

```bash
# Start Redis
docker run -d --name redis -p 6379:6379 redis:8.4-alpine

# Start Agent Memory Server
docker run -d --name agent-memory-server -p 8088:8088 \
-e REDIS_URL=redis://host.docker.internal:6379 \
-e GEMINI_API_KEY=your-key \
-e GENERATION_MODEL=gemini/gemini-2.5-flash \
-e EMBEDDING_MODEL=gemini/text-embedding-004 \
redislabs/agent-memory-server:latest \
agent-memory api --host 0.0.0.0 --port 8088 --task-backend=asyncio
```
Provision a store, then pass its Data Plane endpoint, API key, and store ID to the services.

On Linux, `host.docker.internal` does not resolve by default. Use
`--network=host` plus `REDIS_URL=redis://127.0.0.1:6379`, or point
`REDIS_URL` at the Docker bridge gateway (typically
`redis://172.17.0.1:6379`).
- On **Redis Cloud**, there is nothing to run. See [Create an Agent Memory service]({{< relref "/operate/rc/context-engine/agent-memory/create-service" >}}).
- To run it **yourself**, see [Self-managed Agent Memory]({{< relref "/develop/ai/context-engine/agent-memory/self-managed" >}}) for deployment, configuration, and operations on your own Kubernetes cluster.

Both use `backend="redis-agent-memory"`. Only `api_base_url` differs.

## Installation

```bash
# Memory and session services (requires Agent Memory Server)
# Memory and session services (both backends)
pip install adk-redis[memory]

# Search tools via RedisVL
Expand All @@ -75,6 +71,8 @@ pip install adk-redis[all]
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:
Expand All @@ -84,23 +82,29 @@ from google.adk import Agent
from google.adk.agents.callback_context import CallbackContext
from google.adk.runners import Runner
from adk_redis.sessions import (
RedisWorkingMemorySessionService,
RedisWorkingMemorySessionServiceConfig,
RedisSessionMemoryService,
RedisSessionMemoryServiceConfig,
)
from adk_redis.memory import (
RedisLongTermMemoryService,
RedisLongTermMemoryServiceConfig,
)

session_service = RedisWorkingMemorySessionService(
config=RedisWorkingMemorySessionServiceConfig(
api_base_url="http://localhost:8088",
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(
api_base_url="http://localhost:8088",
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",
)
)
Expand All @@ -127,17 +131,17 @@ runner = Runner(

| Capability | Description | Page |
|------------|-------------|------|
| **Redis Agent Memory** | Working and long-term memory via framework services, REST tools, or MCP | [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) |
| **Redis Agent Memory** | Session and long-term memory on Redis Cloud or self-managed, via framework services or REST tools | [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) |
| **Integration patterns** | Framework-managed, LLM-controlled REST, and MCP tools | [Integration patterns]({{< relref "/integrate/google-adk/integration-patterns" >}}) |
| **Search tools** | Vector, hybrid, text, range, and SQL search via RedisVL, plus the `rvl mcp` server over `McpToolset` | [Search tools]({{< relref "/integrate/google-adk/search-tools" >}}) |
| **Semantic caching** | LLM response and tool result caching | [Semantic caching]({{< relref "/integrate/google-adk/semantic-caching" >}}) |
| **Examples** | Nine complete examples covering all capabilities | [Examples]({{< relref "/integrate/google-adk/examples" >}}) |
| **Semantic caching** | LLM response and tool result caching, with stable entry IDs and targeted invalidation | [Semantic caching]({{< relref "/integrate/google-adk/semantic-caching" >}}) |
| **Examples** | Complete examples covering all capabilities | [Examples]({{< relref "/integrate/google-adk/examples" >}}) |
| **Agent Memory Server** (deprecated) | Reference for the deprecated `opensource-agent-memory` backend, and how to migrate off it | [Agent Memory Server (deprecated)]({{< relref "/integrate/google-adk/agent-memory-server" >}}) |

## More info

- [adk-redis on GitHub](https://github.com/redis-developer/adk-redis)
- [adk-redis on PyPI](https://pypi.org/project/adk-redis/)
- [Car dealership tutorial](https://redis.io/tutorials/build-a-car-dealership-agent-with-google-adk-and-redis-agent-memory/)
- [Redis Agent Memory Server](https://github.com/redis/agent-memory-server)
- [RedisVL documentation]({{< relref "/develop/ai/redisvl" >}})
- [Google ADK documentation](https://google.github.io/adk-docs/)
124 changes: 124 additions & 0 deletions content/integrate/google-adk/agent-memory-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
LinkTitle: Agent Memory Server (deprecated)
Title: Agent Memory Server (deprecated)
alwaysopen: false
categories:
- docs
- integrate
- oss
- rs
- rc
description: Deprecated. The opensource-agent-memory backend is no longer maintained.
Migrate existing deployments to Redis Agent Memory.
group: ai
stack: true
summary: Deprecated backend. How to migrate an existing Agent Memory Server deployment
to Redis Agent Memory.
type: integration
weight: 6
---

{{< warning >}}
**Deprecated. Do not use for new work.**

The `opensource-agent-memory` backend and the
[Agent Memory Server](https://github.com/redis/agent-memory-server) it targets
are deprecated and are not maintained going forward. Its capabilities are not
being carried forward, and support for it will be removed from adk-redis.

New agents should use
[Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}})
with `backend="redis-agent-memory"`, on
[Redis Cloud]({{< relref "/operate/rc/context-engine/agent-memory" >}}) or
[self-managed]({{< relref "/develop/ai/context-engine/agent-memory/self-managed" >}})
on your own Kubernetes cluster.

This page exists only to help existing deployments migrate.
{{< /warning >}}

## What it was

Agent Memory Server is a separate open source memory server, documented in
[its own repository](https://github.com/redis/agent-memory-server). It is not
Redis Agent Memory and does not speak the
[Agent Memory Data Plane API]({{< relref "/develop/ai/context-engine/agent-memory/api-reference" >}}).
adk-redis reached it with `backend="opensource-agent-memory"`, an
`api_base_url` pointing at the server, and the `agent-memory-client>=0.14.0`
dependency.

A handful of capabilities existed only on this backend: auto-summarization,
extraction strategies, recency-boosted search, and an MCP endpoint. They are
configured through `model_name`, `context_window_max`, `extraction_strategy`,
`extraction_strategy_config`, and `recency_boost`, none of which have any effect
with `redis-agent-memory`. See the
[Agent Memory Server repository](https://github.com/redis/agent-memory-server)
for the server's own setup and reference material.

{{< note >}}
Running Agent Memory yourself never required this backend. Self-managed Agent
Memory is supported and maintained, and uses `backend="redis-agent-memory"` just
like Redis Cloud. You choose a deployment with `api_base_url`, not with
`backend`.
{{< /note >}}

## Migrate to Redis Agent Memory

1. Provision a Redis Agent Memory store, on
[Redis Cloud]({{< relref "/operate/rc/context-engine/agent-memory/create-service" >}})
or [self-managed]({{< relref "/develop/ai/context-engine/agent-memory/self-managed" >}}).
Either gives you a Data Plane endpoint, an API key, and a store ID.
2. Change `backend` from `opensource-agent-memory` to `redis-agent-memory` on
every service and tool config, or drop the field, since it is the default.
3. Point `api_base_url` at the Data Plane endpoint, and add `api_key` and
`store_id`.
4. Remove the backend-only settings listed above. They are silently inert on
`redis-agent-memory`.
5. Replace any MCP memory wiring with the
[REST memory tools]({{< relref "/integrate/google-adk/redis-agent-memory#rest-tools" >}}),
which work the same way on both backends.
6. Drop `agent-memory-client` from your dependencies. The `memory` extra
requires `redis-agent-memory>=0.2.0`.

```python
# Before: deprecated backend
config = RedisSessionMemoryServiceConfig(
backend="opensource-agent-memory",
api_base_url="http://localhost:8088",
default_namespace="my_app",
model_name="gemini-2.5-flash",
context_window_max=8000,
)

# After: Redis Agent Memory, on Redis Cloud or self-managed
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",
)
```

Changing configuration does not copy existing memories. Plan for a
re-extraction window, or run both backends while long-term memory repopulates.

## Examples still on this backend

Three examples in the adk-redis repository have not yet moved:
[simple_redis_memory](https://github.com/redis-developer/adk-redis/tree/main/examples/simple_redis_memory),
[travel_agent_memory_hybrid](https://github.com/redis-developer/adk-redis/tree/main/examples/travel_agent_memory_hybrid),
and
[fitness_coach_mcp](https://github.com/redis-developer/adk-redis/tree/main/examples/fitness_coach_mcp)
(which uses the MCP endpoint this backend alone provides).

For a supported starting point, use
[managed_memory_quickstart]({{< relref "/integrate/google-adk/examples#managed_memory_quickstart" >}}).
[travel_agent_memory_tools](https://github.com/redis-developer/adk-redis/tree/main/examples/travel_agent_memory_tools)
switches backends with `REDIS_MEMORY_BACKEND`, so it already runs on
`redis-agent-memory`.

## More info

- [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}): the supported backend
- [Self-managed Agent Memory]({{< relref "/develop/ai/context-engine/agent-memory/self-managed" >}}): run Agent Memory on your own Kubernetes cluster
- [Agent Memory Server on GitHub](https://github.com/redis/agent-memory-server): the deprecated server's own documentation
59 changes: 27 additions & 32 deletions content/integrate/google-adk/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,104 +11,99 @@ categories:
description: Complete examples for every adk-redis capability.
group: ai
stack: true
summary: Nine runnable examples covering Redis Agent Memory, search tools, semantic
summary: Runnable examples covering Redis Agent Memory, search tools, semantic
caching, and MCP integration.
type: integration
weight: 5
---

The [adk-redis repository](https://github.com/redis-developer/adk-redis/tree/main/examples) includes nine complete examples. Each focuses on a specific capability.
The [adk-redis repository](https://github.com/redis-developer/adk-redis/tree/main/examples) includes ten complete examples, each focused on a specific capability. The seven below run on supported backends; the remaining three are listed under [Deprecated backend examples](#deprecated-backend-examples).

## Prerequisites

All examples require:

- **Python 3.10+**
- **Redis 8.4+**: `docker run -d --name redis -p 6379:6379 redis:8.4-alpine`
- **Agent Memory Server** (for memory examples): See [setup instructions](https://github.com/redis/agent-memory-server)
- **A memory backend** (for memory examples): a [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) store on Redis Cloud or self-managed.
- **API keys**: Most examples need a `GOOGLE_API_KEY` for Gemini

## `simple_redis_memory`
## `managed_memory_quickstart`

**Capability:** Redis Agent Memory (framework-managed)
**Backend:** `redis-agent-memory` &middot; **Run:** `python main.py`

Minimal starting point. Wires up `RedisWorkingMemorySessionService` and `RedisLongTermMemoryService` with a basic conversational agent. No search tools, no caching: just memory.
The smallest memory example, and the counterpart to `simple_redis_memory`. Uses `redis-agent-memory`, so there is no Agent Memory Server and no Docker to set up. Wires `RedisSessionMemoryService` and `RedisLongTermMemoryService` to an agent with ADK's built-in `preload_memory` and `load_memory` tools.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/simple_redis_memory)

## `travel_agent_memory_hybrid`

**Capability:** Redis Agent Memory + REST tools + web search + planning

The most complete example. Combines framework-managed memory services with LLM-controlled memory tools, web search, itinerary planning, and calendar export. Demonstrates the [hybrid integration pattern]({{< relref "/integrate/google-adk/integration-patterns#hybrid-approach" >}}).

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/travel_agent_memory_hybrid)
[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/managed_memory_quickstart)

## `travel_agent_memory_tools`

**Capability:** REST memory tools (LLM-controlled)
**Backend:** `redis-agent-memory`, switchable &middot; **Run:** `adk web .`

Uses REST-based memory tools exclusively, without framework-managed services. The LLM has full control over when to search, create, update, and delete memories.
Uses REST-based memory tools exclusively, without framework-managed services. The LLM has full control over when to search, create, update, and delete memories. Set `REDIS_MEMORY_BACKEND` to switch backends.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/travel_agent_memory_tools)

## `fitness_coach_mcp`

**Capability:** MCP memory tools

Demonstrates MCP-based memory integration. The agent connects to the Agent Memory Server via SSE and manages semantic and episodic memories for workout tracking.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/fitness_coach_mcp)

## `redis_search_tools`

**Capability:** Vector, hybrid, text, and range search
**Capability:** Vector, text, and range search &middot; **Run:** `adk web .`

Four in-process RedisVL [search tools]({{< relref "/integrate/google-adk/search-tools" >}}) plugged into a single agent with a product catalog dataset.
Three in-process RedisVL [search tools]({{< relref "/integrate/google-adk/search-tools" >}}) plugged into a single agent with a product catalog dataset.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_search_tools)

## `redis_sql_search`

**Capability:** SQL `SELECT` search
**Capability:** SQL `SELECT` search &middot; **Run:** `adk web .`

A 10-product catalog with the `RedisSQLSearchTool`. The agent emits parameterized SQL (`WHERE category = 'electronics' AND price < :max_price`) to answer structured catalog questions. Requires `pip install 'adk-redis[sql]'`.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_sql_search)

## `redisvl_mcp_search`

**Capability:** RedisVL MCP server via ADK's `McpToolset`
**Capability:** RedisVL MCP server via ADK's `McpToolset` &middot; **Run:** `adk web .`

The MCP counterpart of `redis_search_tools`. A `rvl mcp` server hosts a knowledge-base index in hybrid (vector + BM25) mode and the agent connects via ADK's native `McpToolset`. No adk-redis wrapper involved; the standard `McpToolset` + `StdioConnectionParams` pattern is used.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/redisvl_mcp_search)

## `semantic_cache`

**Capability:** Local semantic caching (RedisVL)
**Capability:** Local semantic caching (RedisVL) &middot; **Run:** `python main.py`

Demonstrates LLM response caching and tool result caching using the `RedisVLCacheProvider` with local embeddings and ADK callbacks.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/semantic_cache)

## `langcache_cache`

**Capability:** Managed semantic caching (LangCache)
**Capability:** Managed semantic caching (LangCache) &middot; **Run:** `python main.py`

Uses the managed [LangCache]({{< relref "/integrate/google-adk/semantic-caching" >}}) service for semantic caching with server-side embeddings. No local vectorizer required.

[View on GitHub](https://github.com/redis-developer/adk-redis/tree/main/examples/langcache_cache)

## Running an example

Examples marked `python main.py` run as scripts. Examples marked `adk web .`
run in the ADK developer UI from inside the example directory.

```bash
pip install adk-redis[all]
cd examples/simple_redis_memory
cd examples/managed_memory_quickstart
export GOOGLE_API_KEY=your-key
python main.py
```

## Deprecated backend examples

Three examples are written against the deprecated `opensource-agent-memory`
backend: `simple_redis_memory`, `travel_agent_memory_hybrid`, and
`fitness_coach_mcp`. They are listed under
[Agent Memory Server (deprecated)]({{< relref "/integrate/google-adk/agent-memory-server#examples-still-on-this-backend" >}}).
For a `redis-agent-memory` starting point, use `managed_memory_quickstart` above.

## More info

- [Car dealership tutorial](https://redis.io/tutorials/build-a-car-dealership-agent-with-google-adk-and-redis-agent-memory/): Full walkthrough building an agent from scratch
Expand Down
Loading
Loading