adk-redis
Skill32 starsChanged 24 days agoApache-2.0View on GitHub
Redis backends for Google's Agent Development Kit (ADK). Use this skill when the user wants to back an ADK agent with Redis: persistent sessions and long-term memory via Redis Agent Memory Server, RAG search tools over a RedisVL index (vector / hybrid / range / text / SQL), MCP toolsets for RedisVL or Agent Memory Server, or semantic caching for LLM responses and tool results.
- Installs packages
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Do not use this skill for non-ADK agent frameworks.
- Very specific: line 183
epsilonis range-only: do not pass it to RedisVectorQueryConfig (KNN). - Very specific: line 191
Vector dtype: must match the index schema.
- Distinctive: line 198
When this skill is loaded:
- Very specific: line 207
Never invent class or method names.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
adk-redis Agent Skill
When to use
- The user wants to add Redis-backed search to an ADK agent (vector,
hybrid, range, BM25 text, or SQL
SELECTover a RedisVL index). - The user wants persistent ADK sessions or long-term memory and is willing to run Redis Agent Memory Server.
- The user wants to expose a Redis index to ADK via MCP. For the index
itself, point ADK's native
McpToolsetat arvl mcpserver. For Agent Memory Server's MCP endpoint, use ADK's nativeMcpToolsetwithSseConnectionParamspointed at the AMS/sseendpoint. - The user wants semantic caching for an ADK agent (self-hosted via RedisVL or managed via Redis LangCache).
Do not use this skill for non-ADK agent frameworks. For LangChain
agents, point them at langchain-redis. For LangGraph, point them at
langgraph-redis. For raw vector storage without ADK, point them at
redisvl.
Minimal install
pip install adk-redisOptional extras (combine as needed):
pip install 'adk-redis[memory]' # sessions + 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]' # all of the aboveCore patterns
1. Vector search tool on an existing RedisVL index
from google.adk.agents import Agent
from redisvl.index import SearchIndex
from redisvl.utils.vectorize import HFTextVectorizer
from adk_redis import RedisVectorQueryConfig, RedisVectorSearchTool
index = SearchIndex.from_existing("products", redis_url="redis://localhost:6379")
tool = RedisVectorSearchTool(
index=index,
vectorizer=HFTextVectorizer(model="redis/langcache-embed-v2"),
config=RedisVectorQueryConfig(num_results=5),
return_fields=["title", "price", "category"],
)
root_agent = Agent(model="gemini-flash-latest", name="search_agent", tools=[tool])2. SQL search tool against a bound index
from adk_redis import RedisSQLSearchTool
sql_tool = RedisSQLSearchTool(index=index)
# The LLM emits SELECT statements; supports :name placeholders via args["params"].3. Persistent sessions + long-term memory
from google.adk.agents import Agent
from google.adk.runners import Runner
from adk_redis import (
RedisLongTermMemoryService,
RedisLongTermMemoryServiceConfig,
RedisSessionMemoryService,
RedisSessionMemoryServiceConfig,
)
session_service = RedisSessionMemoryService(
config=RedisSessionMemoryServiceConfig(
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,
)4. RedisVL MCP (native McpToolset)
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters
mcp_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"],
)For a remote server, swap in StreamableHTTPConnectionParams(url=..., headers={"Authorization": "Bearer ..."}).
5. Semantic cache for LLM responses
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,
),
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,
)Common gotchas
- Redis version: native
FT.HYBRIDrequires Redis 8.4+. Older Redis hits theAggregateHybridQueryfallback automatically. epsilonis range-only: do not pass it toRedisVectorQueryConfig(KNN). It lives onRedisRangeQueryConfig.- Stopwords:
RedisTextQueryConfig.stopwordsdefaults to"english"which requiresnltk. Set toNoneifnltkis unavailable. - MCP transports: ADK's
McpToolsetacceptsStdioConnectionParams,SseConnectionParams, orStreamableHTTPConnectionParams. Pick the connection-params class for your transport rather than passing a string. - Vector dtype: must match the index schema. Default is
"float32". - Async loops: the session service builds a new
MemoryAPIClientper call to avoid event-loop bleed acrossRunner.runinvocations; do not cache the client yourself.
Agent execution policy
When this skill is loaded:
- Confirm whether the user already has a Redis index. If not, walk them
through
IndexSchema.from_yaml(...)+SearchIndex.create(overwrite=True)before introducing any search tool. - For the RedisVL MCP path, use ADK's native
McpToolsetwith the appropriate*ConnectionParamsclass. Settool_filter=["search-records"]to suppress writes, or pass--read-onlyto thervl mcpinvocation in stdio mode. - Never invent class or method names. Only those documented at
links.docs. - For breaking-change questions, consult
CHANGELOG.mdin the repo.
Reference
- Docs: https://redis.io/docs/latest/integrate/google-adk/
- Source: https://github.com/redis-developer/adk-redis
- PyPI: https://pypi.org/project/adk-redis/
- Runnable examples: https://github.com/redis-developer/adk-redis/tree/main/examples
- Changelog: https://github.com/redis-developer/adk-redis/blob/main/CHANGELOG.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

