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
17 changes: 14 additions & 3 deletions content/integrate/google-adk/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ docker run -d --name redis -p 6379:6379 redis:8.4-alpine
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.0-flash \
-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
```

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`).

## Installation

```bash
Expand All @@ -57,11 +62,17 @@ 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'
```

## Quick start
Expand Down Expand Up @@ -118,9 +129,9 @@ runner = Runner(
|------------|-------------|------|
| **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" >}}) |
| **Integration patterns** | Framework-managed, LLM-controlled REST, and MCP tools | [Integration patterns]({{< relref "/integrate/google-adk/integration-patterns" >}}) |
| **Search tools** | Vector, hybrid, text, and range search via RedisVL | [Search tools]({{< relref "/integrate/google-adk/search-tools" >}}) |
| **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** | Seven complete examples covering all capabilities | [Examples]({{< relref "/integrate/google-adk/examples" >}}) |
| **Examples** | Nine complete examples covering all capabilities | [Examples]({{< relref "/integrate/google-adk/examples" >}}) |

## More info

Expand Down
22 changes: 19 additions & 3 deletions content/integrate/google-adk/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ categories:
description: Complete examples for every adk-redis capability.
group: ai
stack: true
summary: Seven runnable examples covering Redis Agent Memory, search tools, semantic
summary: Nine 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 seven complete examples. Each focuses on a specific capability.
The [adk-redis repository](https://github.com/redis-developer/adk-redis/tree/main/examples) includes nine complete examples. Each focuses on a specific capability.

## Prerequisites

Expand Down Expand Up @@ -64,10 +64,26 @@ Demonstrates MCP-based memory integration. The agent connects to the Agent Memor

**Capability:** Vector, hybrid, text, and range search

All four RedisVL [search tools]({{< relref "/integrate/google-adk/search-tools" >}}) plugged into a single agent with a product catalog dataset.
Four 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

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`

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)
Expand Down
2 changes: 1 addition & 1 deletion content/integrate/google-adk/redis-agent-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ session_service = RedisWorkingMemorySessionService(
config=RedisWorkingMemorySessionServiceConfig(
api_base_url="http://localhost:8088",
default_namespace="my_app",
model_name="gemini-2.0-flash",
model_name="gemini-2.5-flash",
context_window_max=8000,
)
)
Expand Down
83 changes: 80 additions & 3 deletions content/integrate/google-adk/search-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories:
- oss
- rs
- rc
description: Vector, hybrid, text, and range search tools for Google ADK agents.
description: Vector, hybrid, text, range, and SQL search tools for Google ADK agents, plus the RedisVL MCP server.
group: ai
stack: true
summary: Add retrieval-augmented generation (RAG) to ADK agents using RedisVL-powered
Expand All @@ -17,7 +17,7 @@ type: integration
weight: 3
---

adk-redis provides four search tools that wrap [RedisVL]({{< relref "/develop/ai/redisvl" >}}) query types into ADK-compatible tools. The LLM sees each tool as a callable function with a `query` parameter and gets back structured results.
adk-redis provides five in-process search tools that wrap [RedisVL]({{< relref "/develop/ai/redisvl" >}}) query types into ADK-compatible tools. The LLM sees each tool as a callable function and gets back structured results. For multi-agent or polyglot deployments, the same RedisVL index can also be served over MCP via the `rvl mcp` server and consumed with ADK's native `McpToolset` (see the [RedisVL MCP server](#redisvl-mcp-server) section below).

## Overview

Expand All @@ -27,6 +27,7 @@ adk-redis provides four search tools that wrap [RedisVL]({{< relref "/develop/ai
| `RedisHybridSearchTool` | Vector + BM25 | Queries with specific terms + concepts |
| `RedisTextSearchTool` | BM25 keyword | Exact terms, error messages, IDs |
| `RedisRangeSearchTool` | Distance threshold | Exhaustive retrieval within a radius |
| `RedisSQLSearchTool` | SQL `SELECT` | Structured filters (`WHERE`, `BETWEEN`, parameterized) |

## Vector search

Expand Down Expand Up @@ -106,6 +107,80 @@ range_tool = RedisRangeSearchTool(
)
```

## SQL search

`RedisSQLSearchTool` wraps `redisvl.query.SQLQuery`. The LLM emits a SQL `SELECT` statement (with optional `:name` parameter placeholders) and the tool translates it into the right `FT.SEARCH` or `FT.AGGREGATE` call. Best for structured filters: tag equality, numeric ranges, multi-predicate `WHERE` clauses. Requires `pip install 'adk-redis[sql]'`.

```python
from adk_redis import RedisSQLSearchTool

sql_tool = RedisSQLSearchTool(
index=index,
name="catalog_sql_search",
description=(
"Run a SQL SELECT against the product catalog. "
"Use :name placeholders for values."
),
)
```

The LLM might emit a call like:

```sql
SELECT title, brand, price
FROM products
WHERE category = 'electronics' AND price < :max_price
```

with `params={"max_price": 100}`. See the [redis_sql_search example](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_sql_search) for a runnable demo.

## RedisVL MCP server

The five tools above run in-process against a Python `SearchIndex`. To serve one Redis index to multiple agents (Python, JS, Claude Desktop), or to put server-side guardrails like `--read-only` and bearer auth between the agent and the index, run RedisVL's MCP server (`rvl mcp`) and connect ADK's native `McpToolset` to it.

```python
from google.adk import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters

agent = Agent(
model="gemini-2.5-flash",
name="redis_mcp_agent",
instruction="Use the search-records tool to answer questions.",
tools=[
McpToolset(
connection_params=StdioConnectionParams(
server_params=StdioServerParameters(
command="rvl",
args=[
"mcp",
"--config",
"/path/to/mcp_config.yaml",
"--read-only",
],
),
timeout=30,
),
tool_filter=["search-records"],
),
],
)
```

The server is configured per index via a YAML file and exposes two tools: `search-records` (vector / fulltext / hybrid, chosen at server start, with schema-aware filter and return-field hints) and `upsert-records` (suppress with `--read-only`). Supports `stdio`, `sse`, and `streamable-http` transports; bearer auth on HTTP.

Install the CLI with `pip install 'redisvl[mcp]>=0.18.2'`. For a runnable demo, see the [redisvl_mcp_search example](https://github.com/redis-developer/adk-redis/tree/main/examples/redisvl_mcp_search).

### When to choose in-process vs MCP

| Path | Use when |
|------|----------|
| In-process tools (above) | Single Python agent, fast onboarding, complex Python-side `FilterExpression` composition. |
| MCP server | Multi-agent or polyglot deployments, server-side ops gates, schema-aware tool descriptions. |

Range and SQL search have no MCP equivalent today; use the in-process tools for either.

## Multi-tool agent

Wire multiple search tools into a single agent and let the LLM choose the right one:
Expand All @@ -129,5 +204,7 @@ The `name` and `description` on each tool matter: the LLM reads them to decide w

## More info

- [redis_search_tools example](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_search_tools): All four search tools with a product catalog
- [redis_search_tools example](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_search_tools): vector, text, and range tools with a product catalog
- [redis_sql_search example](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_sql_search): SQL `SELECT` against a bound index
- [redisvl_mcp_search example](https://github.com/redis-developer/adk-redis/tree/main/examples/redisvl_mcp_search): same corpus served via `rvl mcp` + ADK `McpToolset`
- [RedisVL documentation]({{< relref "/develop/ai/redisvl" >}})
4 changes: 2 additions & 2 deletions content/integrate/google-adk/semantic-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ provider = RedisVLCacheProvider(
ttl=3600,
distance_threshold=0.1,
),
vectorizer=HFTextVectorizer(model="redis/langcache-embed-v1"),
vectorizer=HFTextVectorizer(model="redis/langcache-embed-v2"),
)
```

Expand Down Expand Up @@ -89,7 +89,7 @@ before_cb, after_cb = create_llm_cache_callbacks(llm_cache)

agent = Agent(
name="cached_agent",
model="gemini-2.0-flash",
model="gemini-2.5-flash",
instruction="You are a helpful assistant.",
before_model_callback=before_cb,
after_model_callback=after_cb,
Expand Down
Loading