跪拜 Guibai
← All articles
Backend

Redis Becomes the Real-Time Data Spine for AI Agents

By 苏三说技术 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Teams already running Redis can add vector search, Agent memory, and LLM caching without standing up a separate vector database or context store. That collapses infrastructure sprawl and lets a single in-memory system handle both transactional and AI workloads at sub-millisecond latency.

Summary

Redis is no longer just a cache. By 2026, the database has added vector similarity search with hybrid filtering, a native Vector Sets data type in Redis 8, and LangCache, a managed semantic cache that cuts LLM token costs by up to 70% while delivering 15x faster responses on cache hits. The headline release is Redis Iris, a purpose-built context engine for AI Agents that layers short-term and long-term memory, real-time data integration, and retrieval across external sources so Agents maintain state across sessions and workflows.

Performance numbers back the shift: 66,000 vector insertions per second, 200ms median latency on billion-scale vector search, and up to 92% memory savings on JSON vector storage in Redis 8.8. For Java teams, the stack plugs directly into Spring AI and RedisVL without introducing a separate vector database.

The trade-off is that at extreme scale — tens of billions of vectors — a dedicated vector DB may still outperform Redis’s search layer, and keeping all vectors in memory carries a cost premium over disk-backed alternatives.

Takeaways
Redis Query Engine supports vector indexes on Hash and JSON fields with FLAT, HNSW, and SVS-VAMANA algorithms, plus cosine, Euclidean, and inner-product distance metrics.
Hybrid queries combine vector similarity with traditional field filters — for example, restricting a KNN search to documents in a specific category.
Redis 8 introduces Vector Sets, a native data type operated via VADD and VSIM commands, distinct from index-on-JSON/Hash approaches.
Redis 8.8 adds floating-point precision controls that cut vector memory usage by up to 92%.
LangCache, a fully managed semantic cache, stores LLM response embeddings and matches incoming queries by similarity, achieving up to 70% cost reduction and 15x response improvement on hits.
Redis Iris is a five-tool context engine for AI Agents: Context Retriever, Agent Memory (dual-layer short/long-term), Data Integration, LangCache, and Redis Search.
Agent Memory uses a two-tier design — short-term memory for current session state and long-term memory for cross-session facts and preferences.
Benchmarks show 66,000 vector inserts/sec, 200ms median latency on billion-scale search, and 83% higher Streams throughput.
Java integration works through Spring AI’s RedisVectorStore and the official RedisVL for Java client.
Redis Stack is deprecated; RediSearch capabilities are now built into Redis 8, requiring migration work for older deployments.
Conclusions

Redis’s AI push is not a bolt-on feature set but a deliberate repositioning of the entire database as the real-time memory layer for Agents — a claim backed by the Iris release explicitly targeting the “context gap” that causes Agent failures.

The 92% memory reduction in Redis 8.8 changes the cost calculus for teams that previously ruled out in-memory vector storage at scale, making Redis competitive with disk-based vector DBs on infrastructure spend.

Semantic caching at the database level, rather than in application code, shifts the caching decision closer to the data and offloads deduplication logic that teams otherwise build ad hoc around LLM calls.

Redis’s hybrid query — vector search plus traditional filtering — addresses a real production pain point that pure vector databases often handle awkwardly through post-filtering or separate metadata stores.

Concepts & terms
Vector Sets
A native Redis 8 data type for storing vectors directly, operated with VADD and VSIM commands, without requiring an index to be built on Hash or JSON structures.
LangCache
Redis’s fully managed semantic caching layer that stores LLM response embeddings and matches new queries by vector similarity rather than exact string match, reducing redundant model calls.
Redis Iris
A context engine for AI Agents comprising five tools — Context Retriever, Agent Memory, Data Integration, LangCache, and Search — that sits between an Agent and the data it needs across sessions and systems.
Agent Memory (dual-layer)
Redis Iris’s two-tier memory architecture: short-term memory holds current-session conversation and state, while long-term memory persists user preferences, facts, and knowledge graphs across sessions.
Hybrid query (vector + filter)
A Redis vector search capability that combines KNN similarity search with traditional field-level filters (e.g., category, date range) in a single query, avoiding post-retrieval filtering.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗