Redis 三项功能降低 AI 应用成本:LangCache、Agent Memory 与 Flex
Redis 这篇讲了三个省钱套路:语义缓存命中就不调 LLM,长期记忆缩短 prompt,Flex 把冷数据挪到 SSD。做 AI 应用想降本的话可以直接照抄。
Redis 通过三个产品降低 AI 应用的运行成本。LangCache 提供语义缓存,将请求向量化后与历史请求比对,命中即直接返回已存答案,避免重复调用 LLM。Agent Memory 在后台提取对话事实并嵌入存储为长期记忆,应用检索相关上下文,无需把完整历史塞进 prompt。Redis Flex 把低频访问数据从 RAM 自动迁移到 SSD,访问模式变化时动态调整,应用仍使用同一套 Redis API。
Redis is cutting down the cost of running AI applications:
1. Semantic caching — Reuses generated answers from previous requests as long as they are sufficiently similar
2. Persistent memory — Retrieves relevant conversation context instead of requiring the full history in every prompt
3. Storage tiering — Moves less-used data from RAM to SSD
Here is how each of these works:
SEMANTIC CACHING - Using Redis LangCache
• Your app sends a request to Redis • Redis embeds it • It then compares it with previous embedded requests • If it finds a match, it returns the stored answer • If there's no match, Redis calls the LLM
PERSISTENT MEMORY - Using Redis Agent Memory
• Your app sends a request to Redis • Redis extracts facts about the conversation in the background • It embeds those facts and stores them as long-term memory • Your app can now search that memory for relevant context
STORAGE TIERING - Using Redis Flex
• Redis keeps frequently accessed data in RAM • It automatically moves less-used data to SSD • When your app requests data, Redis brings it back into RAM • Redis adjusts where to store data as access patterns change • Your app keeps using the same Redis API
Basically, your applications will make fewer repeated calls to the model, use smaller prompts, and need less RAM to do the same.
Here is more information about this: https://t.co/uKjrSTy4YL
Thanks to the @Redisinc team for partnering with me on this post.