-
Notifications
You must be signed in to change notification settings - Fork 347
docs(google-adk): bring ADK docs to parity with adk-redis 0.0.9 #3746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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: | ||||||
| - **[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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - **[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. | ||||||
|
|
||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. {{< note >}} |
||||||
| See [Redis Agent Memory]({{< relref "/integrate/google-adk/redis-agent-memory" >}}) for the feature-by-feature comparison of the two memory backends. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## 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) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ### 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) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||||
|
|
@@ -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 | ||||||
|
|
@@ -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 | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `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: | ||||||
|
|
@@ -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", | ||||||
| ) | ||||||
| ) | ||||||
|
|
@@ -123,15 +154,20 @@ runner = Runner( | |||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
| To run against the deprecated Agent Memory Server instead, set | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - **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 | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| search, or MCP require the Agent Memory Server backend. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` · **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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| [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) · **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) · **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 · **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 · **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 · **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 · **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` · **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) · **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) · **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 | ||||||
| ``` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.