惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
Google Online Security Blog
Google Online Security Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
T
Threat Research - Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
Lohrmann on Cybersecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
Schneier on Security
Schneier on Security
S
Schneier on Security
T
Tor Project blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
The Hacker News
The Hacker News
Hacker News - Newest:
Hacker News - Newest: "LLM"
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
S
Security @ Cisco Blogs
PCI Perspectives
PCI Perspectives
Spread Privacy
Spread Privacy
W
WeLiveSecurity
SecWiki News
SecWiki News
A
About on SuperTechFans
H
Help Net Security
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
爱范儿
爱范儿
S
Securelist
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
月光博客
月光博客
Jina AI
Jina AI
博客园 - 叶小钗
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Recent Announcements
Recent Announcements
S
Secure Thoughts
The Cloudflare Blog
美团技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Redis

Real-Time Fraud Detection: Latency, Features & Scale Context window in AI: why every token is a budget decision Connecting to Redis Cloud with AWS PrivateLink vs. VPC peering | Redis Redis Data Integration in Redis Cloud is now GA in AWS | Redis Why AI Misses Business Context & How Teams Fix It AI Reasoning Explained: Why Context Matters Semantic Layer vs Context Layer: Key Differences Redis array data type: How it works and when to use it Context Graphs vs. Vector Search: When RAG Falls Short What’s new in two – May 2026 edition Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more Redis 8.8: New array data structure & open source features How Conflict-free Replicated Data Types power active-active database replication Context Orchestration: What It Is & How It Works Context Compaction for AI Agents: A Complete Guide Prompt Bloat: Causes, Costs & Fixes for LLM Apps Agentic Retrieval Techniques: A Complete Guide Single-shot reliable consumers with XREADGROUP CLAIM in Redis 8.4 | Redis Long-Horizon AI Agents: Memory & State Infrastructure What is a context engine? What Is a Context Layer? AI Agent Infrastructure Context Retrieval for AI Agents: What It Is & Why It Matters Context Poisoning: How Bad Data Breaks Agent Reasoning Context is all you need: Introducing Redis Iris | Redis Context Engineering for AI: What It Is & How to Build It Dynamic endpoints: Migrate databases without changing your endpoint | Redis AI Shopping Assistants: How They Work & What to Build Endless Aisle Retail: Infrastructure & Real-Time Data LLM Speed Benchmarks: Metrics & Infrastructure Guide Context Pruning: Cut LLM Tokens Without Losing Quality What’s new in two – April 2026 edition Agentic AI Architecture: 5 Patterns Explained AI Agent vs Chatbot: Key Differences Explained Advantages of Building a Vector Search Solution API Latency in LLM Apps: Causes & How to Fix It Security advisory: [CVE‑2026‑23479] [CVE‑2026‑25243] [CVE-2026-25588] [CVE‑2026‑25589] [CVE-2026-23631] | Redis Edge Computing Latency: Causes & How to Reduce It AI Agents vs Workflows: When to Use Each Streaming LLM Responses: Make Your AI App Feel Fast Active-Active vs Active-Passive Database Architecture Prefill vs Decode: LLM Inference Phases Explained Long-Term Memory Architectures for AI Agents Time to First Byte Test: Tools, Causes & Fixes Speculative decoding: how it works & when to use it P95 Latency: What It Is & Why It Matters Why Multi-Agent LLM Systems Fail & How to Fix Them AI Human in the Loop: Production Oversight Patterns Native OpenTelemetry metrics for Redis client libraries | Redis Client-side geographic failover for Redis Active-Active | Redis Use Redis with SQL | Redis Introducing Redis Feature Form Startup Spotlight: Neuron Systems API Throttling: Algorithms, Patterns & Mistakes Agentic AI Examples Across 6 Industries Best Chunking Strategies for RAG Pipelines Agentic AI Guardrails: Controls That Work Redis joins AWS at GDC to support the next generation of gaming | Redis Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | Redis Real-Time Dispatch System: A Complete Guide P99 Latency: What It Means & How to Fix It Tokenization in LLMs: What AI App Devs Need to Know TTFT Meaning: What is Time to First Token? Atomic slot migration with Redis 8.4 Hybrid search benefits: Why your RAG system needs both keyword & vector search What’s new in two: March 2026 edition Vector embedding generators: How they work & how to use them Throughput-optimizing Redis for L2 KV Cache Reuse What is a data pipeline? Building AI agent pipelines that don't forget, fail, or fall apart Redis achieves Google Cloud Ready, Distributed Cloud status ahead of Google Cloud Next ‘26 | Redis Real-time network monitoring: what your data platform needs to keep up AI agent API: How agents connect to the real world What is multicloud infrastructure? A guide for 2026 What is a transaction monitoring system & how does it work? Why your AI agent fails in production & how tracing helps AI agent benchmarks: Where they fall short & why your infrastructure matters What is a JSON database (and when should you use one)? Introducing the Redis Partner Network: A new foundation for real-time innovation How real-time customer segmentation works in retail Payment orchestration & vault architecture in retail Agentic systems vs. GenAI: when generation isn't enough What is fuzzy matching? Semantic caching & routing: two powerful patterns for vector classification Redis alternatives: Why there are no exact substitutes Connect to Azure Managed Redis with Redis Insight 3.2.0 How to tame the thundering herd problem Redis to Manage Storage Replication | Redis How hierarchical navigable small world (HNSW) algorithms can improve search | Redis How leading financial institutions use Redis to drive growth | Redis What’s new in two: May 2025 | Redis Introducing Model Context Protocol (MCP) for Redis | Redis Redis vs. Elasticsearch: What’s faster for GenAI & vector search? | Redis Build fast, production-worthy AI apps with Spring AI and Redis | Redis Azure Managed Redis is GA today | Redis Redis then & now: Adapting with developers through every era | Redis Supercharge Your AI with OpenShift AI and Redis: Unleash speed and scalability | Redis What’s new in two: April 2025 | Redis Redis 8 is now GA, loaded with new features and more than 30 performance improvements | Redis What is a data strategy? 6 key components explained Data replication explained: types, examples & use cases
Build Google ADK Agents with persistent, real-time memory on Redis | Redis
Redis · 2026-04-16 · via Redis

Build Google ADK Agents with persistent, real-time memory on Redis

Google’s Agent Development Kit (ADK) delivers clean abstractions for building AI agents. It defines interfaces for memory, sessions, tools, and callbacks. But the default implementations store everything in process memory, which means the state disappears on restart and there is no path from prototype to production without replacing the storage layer.

We built adk-redis to be that storage layer. It is a Python package that implements ADK’s BaseMemoryService, BaseSessionService, and tool interfaces using Redis, giving agents persistent two-tier memory, semantic search for RAG, and response caching, all without requiring changes to agent logic. The package connects to Redis Agent Memory for long-term memory extraction and to RedisVL, the vector library that provides a Python client for vector similarity, hybrid search, and semantic caching on top of Redis, for all retrieval and caching operations. Together, these let agents built with ADK move from a local demo to a deployed system by swapping a few service configurations.

For teams already running Redis, this means first-class ADK integration on top of infrastructure you already operate and understand. And for teams that want to avoid tying their agent stack to a single cloud provider, adk-redis provides an alternative that runs anywhere Redis runs, whether that is Docker on a laptop, a managed Redis service on any cloud, or bare-metal servers in your own data center.

Let’s walk through the different parts of adk-redis.

Agent memory: how agents remember

Agent memory operates at two timescales. During a conversation, the agent needs fast access to the full dialogue context. Across conversations, it needs to retain and retrieve facts from potentially thousands of past interactions. These are different problems: session context is linear, append-heavy, and bounded by the context window; long-term memory is associative, read-heavy, and grows without bound.

adk-redis separates them into two tiers, backed by the Redis Agent Memory for session management and memory extraction, and RedisVL for search and caching.

Working memory (RedisWorkingMemorySessionService) handles the current conversation. Every message is stored in the Redis Agent Memory. When the conversation grows long enough to approach the model’s context limit, older messages are automatically summarized, compressing them while preserving recent exchanges in full. This avoids the hard tradeoff between truncating context and blowing through token limits.

Long-term memory (RedisLongTermMemoryService) is where persistent intelligence lives. After each conversation, Redis Agent Memory extracts structured information:

  • “The user prefers window seats.”
  • “The user is vegetarian.”
  • “The user visited Kansas last March.”

These facts are embedded as vectors and stored in Redis, searchable across all past sessions.

These two tiers work together. Working memory keeps the current session fast and focused. Long-term memory ensures the agent remembers what matters across sessions. A recency-boosting system ensures that recent preferences outweigh outdated ones. If a user said “I love Italian food” three years ago but “I’ve been getting into Japanese cuisine” last week, the recent preference surfaces first or the memories might be updated to show progression.

Wire both tiers to an ADK Runner, and memory management becomes automatic. Messages flow into working memory as the conversation happens. Background extraction pushes facts into long-term memory. In subsequent sessions, relevant memories are retrieved before the agent responds.

Three ways to connect agents to memory

One of the more interesting design decisions in adk-redis is that it offers three distinct integration patterns, each with different tradeoffs.

1. Framework-managed services (simplest)

Framework-managed services are the simplest approach. You configure the session and memory services, pass them to the Runner, and the framework handles everything automatically. Memory extraction happens in the background. Search happens before each agent turn. The agent code never directly touches memory. Best for apps where memory should be invisible infrastructure.

2. LLM-controlled REST tools (most control)

LLM-controlled REST tools give the agent explicit control. Instead of relying on the framework, the LLM calls tools like SearchMemoryTool, CreateMemoryTool, and DeleteMemoryTool directly, deciding when to search, what to store, and what to update. This requires more prompt engineering, but it gives the agent genuine autonomy over its own memory.

3. MCP tools (most portable)

MCP (Model Context Protocol) tools use a standardized protocol layer. You point ADK’s McpToolset at RedisAgent Memory’s SSE endpoint, and tool discovery happens automatically. This is the most portable approach. Swap memory backends without changing agent code.

An effective configuration is often a hybrid: the framework services handle session persistence and automatic extraction, while tools give the LLM explicit CRUD control on top. The travel agent example in the repo demonstrates this hybrid approach.

Search tools for RAG

Memory covers what the agent knows from past conversations. But agents also need access to external knowledge such as product catalogs, documentation, knowledge bases. adk-redis provides four search tools that wrap RedisVL (the Redis vector library) into ADK-compatible tools the LLM can call directly.

adk-redis provides four search tools wrapping RedisVL query types:

ToolQuery typeWhen to use
RedisVectorSearchToolKNN vector similarityConceptual, semantic queries
RedisHybridSearchToolVector & full-text keyword searchQueries mixing concepts with specific terms
RedisTextSearchToolFull-text keyword searchExact terms, error messages, IDs
RedisRangeSearchToolDistance thresholdExhaustive retrieval within a radius

Each tool is self-describing. The LLM reads the tool’s name and description to decide when to use it. You can wire multiple search tools into a single agent, as shown in this example, each covering a different retrieval strategy, and let the LLM choose the right one for each query.

Semantic caching

LLM API calls are slow and expensive. If your agent handles support queries, many incoming questions will be semantically similar. “How do I reset my password?” and “I need to change my password” should produce the same response. There is no reason to pay for two LLM calls.

adk-redis provides semantic caching at two levels. LLM response caching intercepts model calls through ADK’s callback system, checking whether a semantically similar prompt already exists in Redis. Tool result caching does the same for tool executions. If your agent calls an external API with the same arguments repeatedly, the cached result is returned instead.

Both levels work through ADK’s callback system, meaning you enable caching without touching your agent’s core logic.

Two cache providers are available: RedisVLCacheProvider (local embeddings, you manage the Redis instance) and LangCacheProvider (managed service from Redis LangCache, server-side embeddings, no local vectorizer needed).

Checkout the semantic cache and Redis LangCache examples in the repo.

Get started

adk-redis is open source and available on GitHub. Install it with:

The repository includes a setup script that spins up Redis and Redis Agent Memory , detailed docs covering every deployment option, and complete examples—from a minimal two-tier memory agent to a full travel agent with web search, semantic caching, and multi-user support.

For a more guided introduction, the car dealership agent tutorial walks through building AutoEmporium end-to-end using ADK's SequentialAgent, adk-redis session and long-term memory services, and Docker Compose against Redis Cloud.

The library docs cover the full surface area, MCP integration, all search modalities, and caching variants, so you can adapt any of these patterns to your own stack.

If you run into issues or want to contribute, open an issue or pull a request on the repo. We’d love to see what you build.