What problem does it solve?
It provides a production-ready way to persist and retrieve conversational memory for TanStack AI agents using a plain Redis instance, without requiring a vector database or dedicated index infrastructure.
Core Features & Use Cases
- Flexible Client Setup: Connect with ioredis directly or wrap a node-redis v4+ client using the fromNodeRedis helper.
- Scoped Storage Model: Records are indexed by tenantId, userId, and threadId with escaped scope values, keeping multi-tenant memory cleanly separated.
- Client-Side Ranking: Recall scores records with lexical matching, optional cosine similarity, recency, and importance signals, configurable via topK, minScore, kinds, and embedder options.
- Use Case: A support chatbot serving multiple customers can store per-thread memories in Redis and recall the most relevant facts at the start of each conversation using memoryMiddleware.
Quick Start
Set up the Redis memory adapter by passing an ioredis client to redis() from @tanstack/ai-memory/redis and wiring it into memoryMiddleware with your scope.