adk-redis examples

Complete examples for every adk-redis capability.

The adk-redis repository 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.

Prerequisites

All examples require:

  • Python 3.10+
  • Redis 8.4+: docker run -d --name redis -p 6379:6379 redis:8.4-alpine
  • A memory backend (for memory examples): a Redis Agent Memory store on Redis Cloud or self-managed.
  • API keys: Most examples need a GOOGLE_API_KEY for Gemini

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.

View on GitHub

travel_agent_memory_tools

Backend: redis-agent-memory, 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. Set REDIS_MEMORY_BACKEND to switch backends.

View on GitHub

redis_search_tools

Capability: Vector, text, and range search · Run: adk web .

Three in-process RedisVL search tools plugged into a single agent with a product catalog dataset.

View on GitHub

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

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

semantic_cache

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

langcache_cache

Capability: Managed semantic caching (LangCache) · Run: python main.py

Uses the managed LangCache service for semantic caching with server-side embeddings. No local vectorizer required.

View on GitHub

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.

pip install adk-redis[all]
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). For a redis-agent-memory starting point, use managed_memory_quickstart above.

More info

RATE THIS PAGE
Back to top ↑