Files
nitin 04cc3512f1 Add Redis integration entry (#1777)
* Add Redis integration entry

Adds an integration catalog entry for `adk-redis`
(https://github.com/redis-developer/adk-redis), the Python package
that provides Redis-backed ADK integrations:

- RedisVL-backed search tools (vector, hybrid, range, text, SQL),
  including native FT.HYBRID on Redis 8.4+
- Session and long-term memory services that implement
  BaseSessionService and BaseMemoryService against
  Redis Agent Memory Server
- An McpToolset helper for RedisVL's own MCP server (`rvl mcp`),
  alongside the existing Agent Memory Server MCP helper
- Self-hosted and managed (Redis LangCache) semantic cache providers

Built and previewed with `mkdocs build --strict`; the page renders at
/integrations/redis/ and appears on the catalog grid.

* Minor fixes to Redis integration page

* Use ADK's native McpToolset for the RedisVL MCP integration

Per maintainer guidance on the PR review thread:

- Replace `create_redisvl_mcp_toolset(...)` (a third-party Python
  wrapper that adk-redis shipped briefly but does not ship in the
  released 0.0.5) with ADK's native `McpToolset` plus
  `StdioConnectionParams` + `StdioServerParameters(command="rvl", ...)`.
  Matches the pattern used by every other MCP catalog page
  (cartesia, chroma, mongodb, pinecone, qdrant).
- Add a `!!! note` admonition pointing readers to
  `/tools-custom/mcp-tools/` if they want to connect to the `rvl mcp`
  server from other ADK language SDKs.
- Rename the tab from "MCP toolset" to "RedisVL MCP server" and
  prepend a one-paragraph explanation.
- Update the surface table at the top: split the single "MCP toolsets"
  row into "RedisVL MCP" (native McpToolset against `rvl mcp`) and
  "AMS MCP toolset" (`create_memory_mcp_toolset`).
- Update the "Available tools" table: replace the
  `create_redisvl_mcp_toolset(...)` helper row with a description of
  the `rvl mcp` server's exposed tools and how to wire `McpToolset`
  to them.

Other clean-ups:
  - Drop the `pip install 'adk-redis[mcp-search]'` line; the extra was
    retired from adk-redis 0.0.5 along with the wrapper. Add a
    `pip install 'redisvl[mcp]>=0.18.2'` line for the MCP CLI.
  - Switch sample vectorizer to `redis/langcache-embed-v2`, matching
    the repo's runnable examples and the rest of the adk-redis docs.

Verified with `mkdocs build --strict` locally. The admonition renders;
the link to `/tools-custom/mcp-tools/` resolves.

* Switch Redis catalog icon to the official Red wordmark SVG

The page previously used the Redis org GitHub avatar PNG (460x460,
cube mark). Swap to `Redis_Logo_Red_RGB.svg` from the official Redis
brand kit (sourced via redis/redis-vl-python), matching the logo used
in the adk-redis README hero. SVG is acceptable for catalog assets
(see goodmem.svg precedent).

Note: this asset is a wordmark (viewBox ~500x156), wider than peer
catalog cards which are mostly square. If it renders awkwardly on the
catalog grid, swap back to a square cube-mark variant.

- Add `docs/integrations/assets/redis.svg`.
- Update `catalog_icon` in `redis.md` frontmatter.
- Drop `docs/integrations/assets/redis.png`.

Verified with `mkdocs build --strict`.

* Formatting and minor edits

* fix: remove AMS MCP toolset mentions per reviewer feedback

Remove create_memory_mcp_toolset() references from the overview table
and MCP tools table. This wrapper was removed from adk-redis in v0.0.6
(redis-developer/adk-redis#13). Users should use ADK's native McpToolset
with SseConnectionParams for Agent Memory Server MCP access.

Resolves comments from @koverholt on lines 29 and 239.

* fix: reorder tabs and table to lead with MCP, fix count to four ways

* feat: add AMS MCP server tab and MCP table entry

Add a separate code tab showing how to connect ADK's native McpToolset
to Agent Memory Server's MCP endpoint over SSE, based on the
fitness_coach_mcp example. Also add a corresponding row to the MCP
reference table. Update overview count to five ways.

* fix: rename AMS MCP to Sessions + Memory MCP server

* feat: split Semantic cache tab into self-hosted and LangCache

Add a separate LangCache tab with accurate code snippet using
LangCacheProvider and LangCacheProviderConfig (cache_id, api_key,
server_url). No local vectorizer needed for the managed service.

* refactor: move semantic caching into its own section

Semantic caching is a cross-cutting optimization rather than a core
integration approach. Move the self-hosted (RedisVL) and managed
(LangCache) cache tabs out of 'Use with agent' into a dedicated
'## Semantic caching' section. Drop the cache row from the overview
table, leaving four core approaches.

* fix: add descriptions to Sessions + Memory and Search tools tabs

* fix: semantic search -> hybrid search in Sessions + Memory description

* docs: link to adk-redis mkdocs site in additional resources

Primary docs link now points to redis-developer.github.io/adk-redis/.
The redis.io integration page is kept as a secondary reference.

* Remove redundant MCP table - does not show tools; make approaches wording future proof

* Readd MCP table with tools and options as before

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2026-05-20 16:30:54 -05:00

14 KiB

catalog_title, catalog_description, catalog_icon, catalog_tags
catalog_title catalog_description catalog_icon catalog_tags
Redis Vector, hybrid, and SQL search plus session, memory, and semantic cache for agents /integrations/assets/redis.svg
data
mcp

Redis integration for ADK

Supported in ADKPython

The adk-redis integration connects your ADK agent to Redis, giving it RedisVL-backed search tools over a Redis index, persistent sessions and long-term memory via Redis Agent Memory Server, and semantic caching for LLM responses and tool results. Redis runs as a managed service or self-hosted (Redis 8.4+ with the RediSearch module).

There are several ways to use this integration:

Approach Description
RedisVL MCP Connect ADK's native McpToolset to a running rvl mcp server. Exposes search-records (vector / fulltext / hybrid) and upsert-records with schema-aware filter and return-field hints.
Session + Memory services RedisWorkingMemorySessionService and RedisLongTermMemoryService that implement ADK's BaseSessionService and BaseMemoryService, backed by Agent Memory Server.
Sessions + Memory MCP Connect ADK's native McpToolset to Agent Memory Server's MCP endpoint over SSE. Gives the agent direct tool access to search_long_term_memory, create_long_term_memories, and memory_prompt.
Search tools Five BaseTool subclasses (RedisVectorSearchTool, RedisHybridSearchTool, RedisRangeSearchTool, RedisTextSearchTool, RedisSQLSearchTool) over RedisVL queries against a bound index.

Use cases

  • RAG over your data: Run vector, hybrid, range, BM25 text, or SQL search against a Redis index. Hybrid search uses native FT.HYBRID on Redis 8.4+ and falls back to client-side aggregation elsewhere.
  • Persistent multi-turn agents: Slot the session and memory services into any ADK Runner to retain conversation state, auto-summarize when the context window fills, and promote durable facts to long-term memory.
  • Schema-aware MCP tools: Stand up one Redis index per rvl mcp server and connect any number of agents to it over stdio, sse, or streamable-http. The MCP tool descriptions include filter and return-field hints derived from the index schema.
  • Latency and cost reduction: Wrap an LLM call site with semantic caching so repeat or near-duplicate prompts skip the model.

Prerequisites

Installation

Install the components you need:

pip install 'adk-redis[memory]'      # session + long-term memory services
pip install 'adk-redis[search]'      # RedisVL-backed search tools
pip install 'adk-redis[sql]'         # RedisSQLSearchTool (sql-redis)
pip install 'adk-redis[langcache]'   # managed semantic cache provider
pip install 'adk-redis[all]'         # everything above

# For the RedisVL MCP server (used with ADK's native McpToolset):
pip install 'redisvl[mcp]>=0.18.2'

Use with agent

=== "RedisVL MCP server"

Start the [RedisVL MCP server](https://docs.redisvl.com/en/latest/user_guide/how_to_guides/mcp.html) (`rvl mcp`) pointed
at your Redis index, then connect ADK's native `McpToolset` to it. The
example below uses the stdio transport so no separate server process is
needed; swap in `StreamableHTTPConnectionParams` or `SseConnectionParams` to
connect to a long-running remote server.

```python
from google.adk.agents 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

root_agent = Agent(
    model="gemini-flash-latest",
    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"],
        ),
    ],
)
```

!!! note

    To connect to this MCP server from other ADK languages, see [MCP
    Tools](/tools-custom/mcp-tools/).

=== "Sessions + Memory"

Plug [Agent Memory Server](https://github.com/redis/agent-memory-server)
into any ADK `Runner` via the REST-based session and memory services.
Working memory handles per-session state with auto-summarization;
long-term memory provides cross-session hybrid search.

```python
from google.adk.agents import Agent
from google.adk.runners import Runner

from adk_redis import (
    RedisLongTermMemoryService,
    RedisLongTermMemoryServiceConfig,
    RedisWorkingMemorySessionService,
    RedisWorkingMemorySessionServiceConfig,
)

session_service = RedisWorkingMemorySessionService(
    config=RedisWorkingMemorySessionServiceConfig(
        api_base_url="http://localhost:8000",
    ),
)
memory_service = RedisLongTermMemoryService(
    config=RedisLongTermMemoryServiceConfig(
        api_base_url="http://localhost:8000",
        recency_boost=True,
    ),
)

root_agent = Agent(
    model="gemini-flash-latest",
    name="redis_memory_agent",
    instruction="Use long-term memory to personalize responses.",
)

runner = Runner(
    app_name="redis_memory_app",
    agent=root_agent,
    session_service=session_service,
    memory_service=memory_service,
)
```

=== "Sessions + Memory MCP server"

Connect ADK's native `McpToolset` to
[Agent Memory Server](https://github.com/redis/agent-memory-server)'s
MCP endpoint over SSE. This gives the agent direct tool access to
long-term memory operations without using the REST-based services.

```python
import os

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import SseConnectionParams

MEMORY_MCP_URL = os.getenv("MEMORY_MCP_URL", "http://localhost:9000")

root_agent = Agent(
    model="gemini-flash-latest",
    name="memory_mcp_agent",
    instruction="Use memory tools to personalize responses.",
    tools=[
        McpToolset(
            connection_params=SseConnectionParams(
                url=f"{MEMORY_MCP_URL.rstrip('/')}/sse",
            ),
            tool_filter=[
                "search_long_term_memory",
                "create_long_term_memories",
                "memory_prompt",
            ],
        ),
    ],
)
```

!!! note

    Agent Memory Server exposes its MCP endpoint on a separate port
    from the REST API. See the
    [fitness_coach_mcp example](https://github.com/redis-developer/adk-redis/tree/main/examples/fitness_coach_mcp)
    for a complete working setup with Docker Compose.

=== "Search tools"

Use RedisVL-backed `BaseTool` subclasses to run vector, hybrid, range,
text, or SQL searches against a Redis index. Bind a tool to an existing
index and pass it directly to your agent.

```python
from google.adk.agents import Agent
from redisvl.index import SearchIndex
from redisvl.utils.vectorize import HFTextVectorizer

from adk_redis import RedisVectorQueryConfig, RedisVectorSearchTool

vectorizer = HFTextVectorizer(model="redis/langcache-embed-v2")
index = SearchIndex.from_existing("products", redis_url="redis://localhost:6379")

search_tool = RedisVectorSearchTool(
    index=index,
    vectorizer=vectorizer,
    config=RedisVectorQueryConfig(num_results=5),
    return_fields=["title", "price", "category"],
    name="search_products",
    description="Semantic search over the product catalog.",
)

root_agent = Agent(
    model="gemini-flash-latest",
    name="redis_search_agent",
    instruction="Help users find products using semantic search.",
    tools=[search_tool],
)
```

Semantic caching

Wrap any LLM call site with semantic caching so repeat or near-duplicate prompts skip the model. Choose self-hosted (bring your own Redis and vectorizer) or managed via Redis LangCache.

=== "Semantic cache (self-hosted)"

Use `RedisVLCacheProvider` with a local vectorizer and your own Redis
instance for self-hosted semantic caching.

```python
from google.adk.agents import Agent
from redisvl.utils.vectorize import HFTextVectorizer

from adk_redis import (
    LLMResponseCache,
    RedisVLCacheProvider,
    RedisVLCacheProviderConfig,
    create_llm_cache_callbacks,
)

provider = RedisVLCacheProvider(
    config=RedisVLCacheProviderConfig(
        redis_url="redis://localhost:6379",
        ttl=3600,
        distance_threshold=0.1,
    ),
    vectorizer=HFTextVectorizer(
        model="redis/langcache-embed-v2",
    ),
)

llm_cache = LLMResponseCache(provider=provider)
before_model_cb, after_model_cb = create_llm_cache_callbacks(llm_cache)

root_agent = Agent(
    model="gemini-flash-latest",
    name="cached_agent",
    instruction="You are a helpful assistant with semantic caching enabled.",
    before_model_callback=before_model_cb,
    after_model_callback=after_model_cb,
)
```

=== "Semantic cache (LangCache)"

Use `LangCacheProvider` with [Redis LangCache](https://redis.io/langcache),
a managed semantic caching service. No local vectorizer is needed as
embeddings are handled server-side.

```python
import os

from google.adk.agents import Agent

from adk_redis import (
    LLMResponseCache,
    LangCacheProvider,
    LangCacheProviderConfig,
    create_llm_cache_callbacks,
)

provider = LangCacheProvider(
    config=LangCacheProviderConfig(
        cache_id=os.environ["LANGCACHE_CACHE_ID"],
        api_key=os.environ["LANGCACHE_API_KEY"],
        server_url=os.getenv(
            "LANGCACHE_SERVER_URL",
            "https://aws-us-east-1.langcache.redis.io",
        ),
        ttl=3600,
    ),
)

llm_cache = LLMResponseCache(provider=provider)
before_model_cb, after_model_cb = create_llm_cache_callbacks(llm_cache)

root_agent = Agent(
    model="gemini-flash-latest",
    name="cached_agent",
    instruction="You are a helpful assistant with semantic caching enabled.",
    before_model_callback=before_model_cb,
    after_model_callback=after_model_cb,
)
```

Available tools

Search tools

Tool Description
RedisVectorSearchTool Vector similarity (KNN) search via RedisVL VectorQuery.
RedisHybridSearchTool Vector + BM25 hybrid search. Uses native FT.HYBRID on Redis 8.4+; falls back to client-side aggregation otherwise.
RedisRangeSearchTool Returns all documents within a vector distance threshold.
RedisTextSearchTool BM25 keyword full-text search. No vectorizer required.
RedisSQLSearchTool SQL SELECT against a bound index via redisvl.query.SQLQuery. Supports :name parameter placeholders. Requires adk-redis[sql].

MCP

Source Description
RedisVL MCP server (rvl mcp) Connect ADK's native McpToolset to a running rvl mcp server. The server exposes search-records (vector / fulltext / hybrid, chosen per server via YAML) and upsert-records, with schema-aware filter and return-field hints derived from the index. Supports stdio, sse, and streamable-http; bearer auth on HTTP; suppress writes with --read-only on the server or tool_filter=["search-records"] on the McpToolset.
Sessions + Memory MCP server Connect ADK's native McpToolset to Agent Memory Server's MCP endpoint over SSE. Exposes search_long_term_memory, create_long_term_memories, edit_long_term_memory, delete_long_term_memories, and memory_prompt. Runs on a separate port from the REST API.

Memory tools

Tool Description
MemoryPromptTool Enrich the agent prompt with relevant memories.
SearchMemoryTool Search long-term memories by query.
CreateMemoryTool Store new long-term memories.
UpdateMemoryTool Update an existing memory by ID.
DeleteMemoryTool Delete memories by ID.
GetMemoryTool Fetch a single memory by ID.

Services

Service Description
RedisWorkingMemorySessionService BaseSessionService backed by Agent Memory Server working memory. Auto-summarizes when context window is exceeded.
RedisLongTermMemoryService BaseMemoryService backed by Agent Memory Server long-term memory with recency-boosted semantic search.

Cache providers

Provider Description
RedisVLCacheProvider Self-hosted semantic cache via RedisVL SemanticCache. Bring your own vectorizer.
LangCacheProvider Managed semantic cache via Redis LangCache. Embeddings are handled server-side.

Additional resources