---
title: "Introducing the MongoDB Vercel AI SDK Integration: Persistent Memory for AI Applications"
description: "The MongoDB Vercel AI SDK integration provides AI applications built with Vercel’s SDK with a persistent memory store in MongoDB Atlas that retains conversations, user facts, and past events across sessions. It is now open source, licensed under Apache 2.0, and generally available on npm for AI SDK versions 6 and 7. The integration automatically categorizes five types of memory—session, semantic, procedural, episodic, and scratchpad—each with a different retention policy, where semantic and procedural memories are versioned and scratchpad notes expire after an hour. Semantic, procedural, and episodic memories use MongoDB Vector Search, which the integration auto-configures by creating vector indexes and detecting embedding dimensions at startup. For production, developers can enforce reliable session history, isolate data per customer using filter fields such as tenant_id, and customize collection and index names."
---

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

[MongoDB](https://yomu.fyi/company/mongodb) · Nov 4, 2026

**Type:** Announcement

## Summary

The MongoDB Vercel AI SDK integration provides AI applications built with Vercel’s SDK with a persistent memory store in MongoDB Atlas that retains conversations, user facts, and past events across sessions. It is now open source, licensed under Apache 2.0, and generally available on npm for AI SDK versions 6 and 7. The integration automatically categorizes five types of memory—session, semantic, procedural, episodic, and scratchpad—each with a different retention policy, where semantic and procedural memories are versioned and scratchpad notes expire after an hour. Semantic, procedural, and episodic memories use MongoDB Vector Search, which the integration auto-configures by creating vector indexes and detecting embedding dimensions at startup. For production, developers can enforce reliable session history, isolate data per customer using filter fields such as tenant\_id, and customize collection and index names.

## Context

Before this integration, developers had to build their own tooling to add persistent memory to AI applications built with the Vercel AI SDK, including designing a database schema, writing jobs to clear out old data, and setting up vector search so the application could find relevant past information by semantic meaning. Without memory, an AI application starts every conversation with no knowledge of the last one and no context about the user or past interactions.

## Approach / What changed

The MongoDB Vercel AI SDK integration package adds MongoDB Atlas as the memory store in existing Vercel AI SDK applications. It automatically categorizes five memory types (session, semantic, procedural, episodic, scratchpad) with default retention policies, creates vector indexes and detects embedding dimensions at startup, and provides production features like reliable session history hooks, per-customer data isolation via filter fields, and customizable collection and index names.

## Takeaways

- The integration ships with five pre-defined memory categories (session, semantic, procedural, episodic, scratchpad), each with default retention policies that developers can customize.
- Semantic, procedural, and episodic memories are retrieved via MongoDB Vector Search, with vector indexes auto-created and embedding dimensions detected at startup.
- For production, developers can enforce reliable session history using AI SDK hooks, isolate customer data with filter fields like tenant\_id, and rename collections to match existing schemas.

## FAQ

### What memory types does the integration support?

The integration supports five memory types: session (conversations per session), semantic (facts about entities and preferences), procedural (workflows and instructions), episodic (key events, kept for one year by default), and scratchpad (temporary notes expiring after one hour).

### How does memory retention work?

Each memory category has default retention policies, and developers can choose retention modes (none, ttl, ttl+importance, or dynamic). The model can also delete memories via memory\_forget, with removal within about 60 seconds.

### What production features does the integration offer?

Developers can enforce reliable session history using AI SDK hooks, isolate data per customer with filter fields like tenant\_id, rename collections and indexes, and turn off indexing for unused categories.

**Tags:** [Memory](https://yomu.fyi/topic/memory), [MongoDB](https://yomu.fyi/topic/mongodb), [Vector Search](https://yomu.fyi/topic/vector-search), [Vercel AI SDK](https://yomu.fyi/topic/vercel-ai-sdk)

- Source: [MongoDB](https://www.mongodb.com/company/blog/product-release-announcements/introducing-mongodb-vercel-ai-sdk-integration-persistent-memory-applications)
- Source URL: https://www.mongodb.com/company/blog/product-release-announcements/introducing-mongodb-vercel-ai-sdk-integration-persistent-memory-applications
- Ingested by Yomu: 2026-11-05T15:00:18.267Z

[Read original post](https://www.mongodb.com/company/blog/product-release-announcements/introducing-mongodb-vercel-ai-sdk-integration-persistent-memory-applications)
