Show HN: Agent-cache – 面向 Valkey 和 Redis 的多层 LLM/工具/会话缓存
5 分•作者: kaliades•4 个月前
为 AI 智能体打造的多层精确匹配缓存,支持 Valkey 或 Redis。通过单一连接缓存 LLM 响应、工具结果和会话状态。提供 LangChain、LangGraph 和 Vercel AI SDK 的框架适配器。内置 OpenTelemetry 和 Prometheus。无需额外模块 - 适用于原生的 Valkey 7+ 和 Redis 6.2+。<p>昨天发布了 v0.1.0 版本,今天发布了支持集群模式的 v0.2.0 版本。即将推出流式传输支持。<p>现有的方案要么限制你只能使用单层缓存(LangChain = 仅 LLM,LangGraph = 仅状态),要么只能使用单一框架。而这个方案解决了这两个问题。<p>npm: <a href="https://www.npmjs.com/package/@betterdb/agent-cache" rel="nofollow">https://www.npmjs.com/package/@betterdb/agent-cache</a>
文档: <a href="https://docs.betterdb.com/packages/agent-cache.html" rel="nofollow">https://docs.betterdb.com/packages/agent-cache.html</a>
示例: <a href="https://valkeyforai.com/cookbooks/betterdb/" rel="nofollow">https://valkeyforai.com/cookbooks/betterdb/</a>
GitHub: <a href="https://github.com/BetterDB-inc/monitor/tree/master/packages/agent-cache" rel="nofollow">https://github.com/BetterDB-inc/monitor/tree/master/packages...</a><p>欢迎提问。
查看原文
Multi-tier exact-match cache for AI agents backed by Valkey or Redis. LLM responses, tool results, and session state behind one connection. Framework adapters for LangChain, LangGraph, and Vercel AI SDK. OpenTelemetry and Prometheus built in. No modules required - works on vanilla Valkey 7+ and Redis 6.2+.<p>Shipped v0.1.0 yesterday, v0.2.0 today with cluster mode. Streaming support coming next.<p>Existing options locked you into one tier (LangChain = LLM only, LangGraph = state only) or one framework. This solves both.<p>npm: <a href="https://www.npmjs.com/package/@betterdb/agent-cache" rel="nofollow">https://www.npmjs.com/package/@betterdb/agent-cache</a>
Docs: <a href="https://docs.betterdb.com/packages/agent-cache.html" rel="nofollow">https://docs.betterdb.com/packages/agent-cache.html</a>
Examples: <a href="https://valkeyforai.com/cookbooks/betterdb/" rel="nofollow">https://valkeyforai.com/cookbooks/betterdb/</a>
GitHub: <a href="https://github.com/BetterDB-inc/monitor/tree/master/packages/agent-cache" rel="nofollow">https://github.com/BetterDB-inc/monitor/tree/master/packages...</a><p>Happy to answer questions.