cd /news/ai-agents/introducing-the-mongodb-vercel-ai-sd… · home › topics › ai-agents › article
[ARTICLE · art-165310] src=pub.towardsai.net ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

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

MongoDB released an open-source, generally available integration that adds MongoDB Atlas as a persistent memory store for applications built with the Vercel AI SDK, published on npm as @mongodb-developer/vercel-ai-memory. The package works with AI SDK v6 and v7, requires a MongoDB Atlas cluster, automatically creates vector indexes and detects embedding dimensions at startup, and supports embedding models from Voyage AI, OpenAI, Cohere or Google. MongoDB said the integration stores five memory types with per-category retention policies and versioned semantic and procedural memories, so developers avoid building their own schema, cleanup jobs and vector search layer.

read3 min views3 publishedNov 6, 2026

MongoDB is excited to announce the release of its 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.

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.

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.

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.

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

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.

const mongodbMemory = createMongoDBMemory({  uri: process.env.MONGODB_URI!,  embedder: openai.embedding('text-embedding-3-small'),})const agent = new ToolLoopAgent({  model: openai('gpt-4.1'),  tools: mongodbMemory({ userId: 'alice', sessionId: 'sess-001' }),})

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

Start with the Vercel AI SDK memory documentation. For more details, see the following resources:

Introducing the MongoDB Vercel AI SDK Integration: Persistent Memory for AI Applications was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

── more in #ai-agents 4 stories · sorted by recency
── more on @mongodb 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/introducing-the-mong…] indexed:0 read:3min 2026-11-06 · —