← Technology, Science & Infrastructure ▣ Distilled locally

Introducing the MongoDB Vercel AI SDK Integration: Persistent Memory for AI Applications

MongoDB Blog
November 12, 2026  ·  MongoDB Blog ↗
Introducing the MongoDB Vercel AI SDK Integration: Persistent Memory for AI Applications

We are excited to announce the release of the MongoDB Vercel AI SDK integration, which provides AI applications and agents built with Vercel’s SDK with a persistent memory store in MongoDB Atlas. It's now open source and generally available on npm.

This integration adds MongoDB Atlas as the memory store in the existing Vercel AI SDK code. Once installed, the package connects Vercel AI SDK applications to MongoDB Atlas and automatically stores the application's memories in documents. This allows the application to retain memories about conversations, user facts, and past events that persist across sessions, users, and restarts.

What is the Vercel AI SDK?

The Vercel AI SDK is a TypeScript toolkit for building AI applications. It handles calling models, streaming responses, using tools, and running agents that work through multi-step tasks. The SDK doesn't include a database to persist memories between runs. Without memory, an AI application starts every conversation with no knowledge of the last one. It doesn't know who the user is, what they asked yesterday, or what it learned along the way. It doesn’t have any context.

Today, developers have to build their own tooling to store memories in a layer. That usually means designing a database schema, writing jobs to clear out old data, and setting up vector search so the application can find relevant past information by semantic meaning instead of just keywords. It's a lot of work to build an AI application that can remember context.

What types of memory does an AI application need?

An AI application needs five kinds of memory, each kept for a different length of time and retrieved differently. This integration automatically categorizes each type of memory and stores it in MongoDB Atlas; here are short definitions of the five memory types:

Semantic and procedural memories are versioned, so history is preserved when a fact changes. The semantic, procedural, and episodic tiers use MongoDB Vector Search, which finds stored memories by semantic meaning rather than by exact keywords.

This integration automatically creates the vector indexes and detects embedding dimensions at startup. Developers can use any AI SDK embedding model to create vector indexes, including Voyage AI, OpenAI, Cohere, or Google.

Figure 1. How the integration works with MongoDB Atlas and the Vercel SDK interface.

How should memory age?

Each category of memory has its own retention policy, so short-lived notes expire quickly, and long-term facts are stored for longer. The MongoDB Vercel AI SDK integration ships with defaults for every category, which developers can customize if they desire.

Effective memory retention requires a balance. Keeping memories indefinitely can decrease retrieval performance and increase costs, while deleting them too early can cause applications to forget important context. This integration includes features to help developers easily set the right balance:

Because the memory is stored in MongoDB Atlas, application operational data, its memory, and the vector search that retrieves it run on one platform. Developers can secure, monitor, and scale a single database without bolting on a separate vector store or memory service alongside it.

What changes when you run the MongoDB Vercel AI SDK Integration in production?

This production release gives developers greater controls over their data and flexibility in how they use the integration:

Get started today

Developers can add memory to an existing Vercel AI SDK project in three steps. This integration works with AI SDK v6 and v7 and requires a MongoDB Atlas cluster.

  1. Install the package and its peer dependencies: npm install @mongodb-developer/vercel-ai-memory ai mongodb

  2. Create a memory instance with an Atlas connection string and an embedding model.

  3. Pass the memory tools to the application, scoped to a user and session.

From there, the model decides when to save and when to search for memories.

Originally published by MongoDB Blog ↗ · rebuilt here from its own full-text RSS feed · all rights remain with the publisher, please read and support them there.