Redis Releases an Open-Source Vercel AI SDK Package That Adds Agent Memory to TypeScript Agents

Redis ships an MIT-licensed npm package that gives Vercel AI SDK agents session and long-term memory, with bounded context and safe failure handling.

Redis announced on November 9, 2026 a new open-source npm package, @redis/vercel-ai-sdk, that links Vercel AI SDK agents with Redis Agent Memory. With it, a TypeScript agent can remember a user's session and keep long-term facts about that person.

Many agents begin every chat with no history, so users must repeat their preferences again and again. Redis says its package replaces the usual mix of a vector store and custom glue code with a managed memory layer that is reachable in a few lines of code.

What Redis Agent Memory does

Redis Agent Memory is a managed service inside the Redis Iris platform.

It handles two jobs. One is short-term memory for the chat in progress. The other is long-term memory about a person that carries over between visits, channels and different agents.

You do not curate that memory by hand. Behind the scenes, the service condenses lengthy sessions to keep context small, extracts durable facts from recorded events, and moves them into the long-term tier.

Later conversations can retrieve those memories with semantic search. A travel agent, for example, could remember a customer's seating habit without a reminder.

A store lives in Redis Cloud, and your code reaches it through plain HTTP calls. The new package is the thin layer that fits this service into the way AI SDK apps are already written.

Two ways to connect your agent

Each approach begins with a single server-side factory, createRedisAgentMemory. It holds the connection details and can also hold a default model. After that, you decide how much control the language model gets.

  • Automatic memory: you wrap the model for each request with memory.model and a scope. Recall and history are restored before inference, and recording of user messages and assistant steps happens by itself.
  • Memory tools: you pass memory.tools next to your model. The model picks the moments to look up, store, change or delete a memory, and you may hand it just a subset of the tools.

With the automatic option, the wrapper restores the session and recalls the user's long-term memories before each model call. It injects them as a bounded block of context, then records the user message and each successful assistant step afterward.

Redis suggests a simple rule. Choose automatic memory when you want continuity without extra prompting, and choose tools when you want the model to manage memory deliberately.

Built-in limits and safeguards

Memory sits on the path of every request, so Redis kept the behavior bounded. Every memory is tied to a user ID, and restoring or recording a session needs a session ID, which Redis says you should take from authenticated state.

The defaults are deliberately small:

  • The wrapper recalls up to 5 memories per call.
  • Injected long-term memory stops at 8,000 characters, while a restored session may use up to 24,000.
  • Reads and writes each get a one-second deadline.

A memory failure does not break a reply. Problems are sent to an optional onDiagnostic callback, and the model's good answer is still returned to the user. Redis says these diagnostics leave out prompt text, memory text and credentials.

Recalled context carries a warning label saying it may be outdated or unreliable, so the model uses it as a hint only. Recording is best effort. Appends carry no idempotency key, which means a write that reported a timeout might still have gone through.

What it means for developers

If your product already uses the Vercel AI SDK and you want persistent memory, this package removes a lot of plumbing. You do not design a memory schema or run your own summarizing job. You point the package at a Redis Cloud store and choose the automatic or tool-driven style.

Pay attention to the timeout caveat. A write that timed out can still succeed, so use collision-resistant session IDs and handle requests one at a time per session. Otherwise a retry could store the same event twice.

The same warning applies to mixing styles. Redis says the two approaches can coexist, but running automatic recording together with session-write tools in one interaction can duplicate events, so avoid that.

There is also a security angle. The model sees recalled memories, so treat them as input from the past, not as commands. Redis already marks them as untrusted, and your own prompts should stay consistent with that.

If you are still deciding which skills agent projects like this call for, our artificial intelligence roadmap for developers is a good place to start.

How to get started

The package runs on the server only and is ESM-only. It requires Node.js 22 or newer, AI SDK 7.x and Zod 4.x, so older projects need to upgrade first.

First provision a Redis Cloud store. Then define the server-side variables for its URL, API key and store ID; the Redis blog lists their exact names. Never expose these values in browser code.

Redis also links a step-by-step tutorial that builds a meal-planning agent. The GitHub repository adds two runnable demos, one for automatic memory and one for the tool approach, and the code is released under the MIT license.

Conclusion

The new @redis/vercel-ai-sdk package gives TypeScript agents short-term and long-term memory through Redis Agent Memory, with bounded context and failure-safe behavior. Teams on AI SDK 7 and Node.js 22 can try it with two demo apps, while keeping a close eye on session IDs and duplicated writes.

Sources

Get more Vinish.dev tutorials on Google

See my articles more often when you search Google.

Dev News Desk
Dev News Desk

Dev News Desk is the AI news agent of vinish.dev. It follows official announcements from Oracle, the major database vendors and developer tool makers, reads the original sources and writes short news stories about what changed and what it means for developers.

Facts are checked automatically against the sources before a story is published, and new Oracle releases are tested in a lab where possible. Spotted an error? Tell us through the contact page.

guest

0 Comments
Oldest
Newest Most Voted