Redis adds managed memory to agents built with Vercel AI SDK

Redis has released an open-source package that adds Redis Agent Memory to agents built with Vercel's AI SDK. The integration is designed to help agents retain session context and user preferences across conversations.
- Redis released the open-source @redis/vercel-ai-sdk package.
- The package adds short-term session memory and long-term user memories.
- Developers can use automatic memory or model-directed memory tools.
- The package requires Node.js 22+, AI SDK 7.x and Zod 4.x.
- Redis provides demos for both integration methods under an MIT license.
A memory layer for AI agents
The package, named @redis/vercel-ai-sdk, connects Vercel AI SDK agents to Redis Agent Memory, a managed memory layer that is part of Redis Iris. Redis says the service combines short-term memory for the current session with long-term memories that follow a user across sessions, channels and agents.
Instead of requiring developers to manually curate memories, the system works in the background. It summarizes long sessions to keep context compact, extracts durable memories from recorded events and promotes those memories to long-term storage. Later, a conversation can retrieve them through semantic search. Redis gives the example of an agent remembering that a user prefers aisle seats.
Developers provision a store in Redis Cloud and communicate with it over HTTP. The new package provides the AI SDK layer for that connection.
Two ways to add memory
The integration is built around a server-side factory called createRedisAgentMemory(...), which stores the connection and an optional default model. Developers can then choose between automatic memory and model-directed tools.
With the automatic-memory option, the developer wraps the model for each request. Before inference, the wrapper restores the session and recalls the user's long-term memories, injecting them as a bounded context block. After the response, it records the user's message and each successful assistant step.
The second option returns an ordinary AI SDK tool map. The model can use those tools to search, save, update or forget memories, while developers decide which tools to expose. Session recording can be managed by the agent or by optional lifecycle hooks.
Redis recommends automatic memory for continuity without extra prompting, and tools when memory management should be explicit and model-directed. The two approaches can coexist, but Redis warns that enabling automatic recording and session-write tools for the same interaction may duplicate events.
Designed for bounded, fault-tolerant requests
Redis says memory is kept bounded because it runs on the hot path of every request. Memories are tied to a userId, while session restoration and recording require a sessionId. By default, the wrapper recalls up to 5 memories, limits long-term context to 8,000 characters and restored session context to 24,000 characters, and uses one-second read and write deadlines.
Memory failures do not replace a successful model response. They are reported through an optional onDiagnostic callback, and Redis says diagnostic data does not include prompt, memory or credential text. Retrieved context is marked as untrusted and possibly stale, so the model should treat it as a hint rather than ground truth.
The server-side package is ESM-only and requires Node.js 22+, AI SDK 7.x and Zod 4.x. Developers also need a Redis Cloud store and the AGENT_MEMORY_URL, AGENT_MEMORY_API_KEY and AGENT_MEMORY_STORE_ID environment variables. The MIT-licensed GitHub repository includes runnable demos for both integration methods, giving teams a direct way to test persistent memory in their Vercel AI SDK agents.

