Skip to main content
Short-term memory lets your agent remember previous interactions within a single thread or conversation. This guide shows how to use MongoDB Atlas as the persistent checkpointer backend. MongoDB stores conversation state as documents in a collection, so threads can resume across process restarts and deployments.
Need to remember information across conversations? Use long-term memory with MongoDB Atlas to store and recall data across different threads and sessions.

Setup

Installation

Credentials

Set your Atlas connection string:
If you want automated tracing of your model calls, set your LangSmith API key:

Usage

Create a MongoClient, construct MongoDBSaver, and call setup() once so indexes exist. There is no MongoDBSaver.fromConnString helper.

Next steps