Skip to content
Open
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
64 changes: 50 additions & 14 deletions content/integrate/google-adk/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,33 @@ 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.
- **Memory backends** power the session and long-term memory services. Pick one per service with a `backend` field:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Memory backends** power the session and long-term memory services. Pick one per service with a `backend` field:
[Redis Agent Memory]({{< relref "/develop/ai/context-engine/agent-memory" >}}) handles working memory (sessions), long-term memory (extracted facts), auto-summarization, and memory search.

- **[Redis Agent Memory](https://redis.io/agent-memory/)** (`redis-agent-memory`, the default) is the Agent Memory service. Use this 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **[Redis Agent Memory](https://redis.io/agent-memory/)** (`redis-agent-memory`, the default) is the Agent Memory service. Use this 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.
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.

- **[Agent Memory Server](https://github.com/redis/agent-memory-server)** (`opensource-agent-memory`) is the open source memory server, now deprecated. It is documented for existing deployments and currently remains the only backend offering auto-summarization, extraction strategies, recency-boosted search, and an MCP endpoint.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **[Agent Memory Server](https://github.com/redis/agent-memory-server)** (`opensource-agent-memory`) is the open source memory server, now deprecated. It is documented for existing deployments and currently remains the only backend offering auto-summarization, extraction strategies, recency-boosted search, and an MCP 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{< note >}}
Agent Memory Server** (opensource-agent-memory) is now deprecated.
{{< /note >}}

See [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) for the feature-by-feature comparison of the two memory backends.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) for the feature-by-feature comparison of the two memory backends.


## 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 memory backend**, for the session and memory services:
- A **[Redis Agent Memory](https://redis.io/agent-memory/)** store, on Redis Cloud or self-managed, which gives you a Data Plane endpoint, an API key, and a store ID, or
- An **Agent Memory Server** (deprecated)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- An **Agent Memory Server** (deprecated)


### Redis Agent Memory

This is the default backend and the recommended one. 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]({{< 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.

### Agent Memory Server (deprecated)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Agent Memory Server (deprecated)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this whole section , or if we really think we need to keep it for some reason, let's just put it in a separate section at the end or something and point to it because it makes the onboarding instructions really confusing.


```bash
# Start Redis
Expand All @@ -53,10 +70,14 @@ On Linux, `host.docker.internal` does not resolve by default. Use
`REDIS_URL` at the Docker bridge gateway (typically
`redis://172.17.0.1:6379`).

Remember to set `backend="opensource-agent-memory"` on each service config when
you use Agent Memory Server. Otherwise the services speak the Data Plane API
and will not reach your local container.

## 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 +96,10 @@ pip install adk-redis[all]
pip install 'redisvl[mcp]>=0.18.2'
```

The `memory` extra requires `redis-agent-memory>=0.2.0` for the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `memory` extra requires `redis-agent-memory>=0.2.0` for the
The `memory` requires `redis-agent-memory>=0.2.0` for the

`redis-agent-memory` backend and `agent-memory-client>=0.14.0` for the
deprecated `opensource-agent-memory` backend.

## Quick start

Wire up Redis Agent Memory in a few lines:
Expand All @@ -84,23 +109,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 @@ -123,15 +154,20 @@ runner = Runner(
)
```

To run against the deprecated Agent Memory Server instead, set

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here just move this to a separate section for the deprecated content

`backend="opensource-agent-memory"`, point `api_base_url` at the server (for
example `http://localhost:8088`), and drop `api_key` and `store_id` unless your
server requires them.

## Capabilities

| 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, self-managed, or the deprecated Agent Memory Server, via framework services, REST tools, or MCP | [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** | Ten complete examples covering all capabilities | [Examples]({{< relref "/integrate/google-adk/examples" >}}) |

## More info

Expand Down
49 changes: 32 additions & 17 deletions content/integrate/google-adk/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,100 +11,115 @@ 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: Ten 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 focuses on a specific capability.

## 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, or a deprecated [Agent Memory Server](https://github.com/redis/agent-memory-server)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **A memory backend** (for memory examples): a [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) store on Redis Cloud or self-managed, or a deprecated [Agent Memory Server](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

Each memory example is written against a specific backend, noted below. The
examples that use auto-summarization, extraction strategies, recency-boosted

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
examples that use auto-summarization, extraction strategies, recency-boosted

search, or MCP require the Agent Memory Server backend.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
search, or MCP require the Agent Memory Server backend.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully we can update the examples to reflect the default AMS? If not, let's remove or move them to separate area and point to it for folks who might have used it.


## `managed_memory_quickstart`

**Backend:** `redis-agent-memory` &middot; **Run:** `python main.py`

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. Intentionally avoids Agent Memory Server only features.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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. Intentionally avoids Agent Memory Server only features.
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/managed_memory_quickstart)

## `simple_redis_memory`

**Capability:** Redis Agent Memory (framework-managed)
**Backend:** `opensource-agent-memory` (Agent Memory Server) &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.
Minimal starting point for the Agent Memory Server backend. Wires up `RedisSessionMemoryService` and `RedisLongTermMemoryService` with a basic conversational agent, including auto-summarization and extraction. No search tools, no caching: just memory.

[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
**Backend:** `opensource-agent-memory` (Agent Memory Server) &middot; **Run:** `python main.py`

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)

## `travel_agent_memory_tools`

**Capability:** REST memory tools (LLM-controlled)
**Backend:** `opensource-agent-memory` (Agent Memory Server), 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 this example to `redis-agent-memory`.

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

## `fitness_coach_mcp`

**Capability:** MCP memory tools
**Backend:** `opensource-agent-memory` (Agent Memory Server) only &middot; **Run:** `adk web .`

Demonstrates MCP-based memory integration. The agent connects to the Agent Memory Server via SSE and manages semantic and episodic memories for workout tracking.
Demonstrates MCP-based memory integration. The agent connects to the Agent Memory Server's SSE endpoint with ADK's native `McpToolset` and manages semantic and episodic memories for workout tracking. `redis-agent-memory` has no MCP endpoint, so this example runs on Agent Memory Server only.

[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
```
Expand Down
Loading
Loading