Memory, self-tuning caching, and retrieval for your AI agents
Durable memory with scoped, ranked recall; multi-tier caching that answers repeat work in under a millisecond; typed retrieval over your own data.
One SDK, observable at every layer, deployed anywhere you run Valkey.
Install the unified SDK:
Memory, caching, and retrieval in one install - one import root for the whole stack.
npm install @betterdb/ai iovalkey
One SDK, four capabilities
Memory, semantic caching, exact-match caching, and typed retrieval - bundled behind a single install and a single connection.
Install everything, or pull in just the piece you need - the individual @betterdb/* packages ship on their own too.
Measured, not asserted
Recall barely drops as the haystack grows 10× on the same benchmark the category is measured by, while lookups stay sub-millisecond on infrastructure you control.
- ~93%
- holds from the small split (~98%) to LongMemEval-M — a ~10× larger haystack, 500 questions, ~475 sessions each — with hybrid rerank
- 0.7ms
- semantic-cache hit latency, roughly 100× faster than a hosted cache
- Anywhere
- run it on a Valkey you already operate, or let us provision a managed one — open core, built on open-source Valkey, no lock-in
Recall at scale
p50 cache lookup
deploy on any Valkey
Retrieval measured on the public LongMemEval-M split (k=10, hybrid rerank, text-embedding-3-small); cache latency from our Upstash comparison. Read the benchmarks →
The cache tunes itself
The agent reads live cache metrics, proposes a config change with its reasoning, and a human approves it. No other Valkey or Redis cache library does this.
The cache library polls its config key in Valkey and swaps the policy atomically - no restart, no redeploy. See the full closed-loop example
Dive into the details
Everything the SDK does - open a section when you want it, out of the way when you don't.
Add memory and caching to your agents
Install the SDK and get agent memory, semantic caching, and retrieval in one library. Self-host on a Valkey you already run — or let us provision a managed Valkey with the search module, no setup required.