Regardless of the checkpointer backend, LangSmith always requires PostgreSQL for threads, runs, assistants, crons, and the memory store. The checkpointer backend only controls where checkpoint data is stored.
Available backends
| Backend | Storage | Configuration | Use case |
|---|---|---|---|
default | PostgreSQL | None (built-in) | Standard deployments |
mongo | MongoDB | langgraph.json or LS_DEFAULT_CHECKPOINTER_BACKEND env var | Teams with existing MongoDB infrastructure |
custom | User-provided | langgraph.json | Custom storage backends (see custom checkpointer) |
Set up MongoDB checkpointing
Requires Agent Server v0.7.64 or later.
Prerequisites
- A MongoDB replica set (standalone
mongodis not supported). This can be a self-managed replica set, amongosrouter, or a managed service like MongoDB Atlas. - A connection URI that includes the database name in the path (e.g.,
/langgraph).
Select the backend
Set the backend to"mongo" using one of these methods:
In langgraph.json (app-level—bundled with your application code):
langgraph.json. If langgraph.json includes a backend value, it takes precedence.
Provide the MongoDB URI
Set theLS_MONGODB_URI environment variable at deploy time:
Connection URI requirements
The URI must:- Point to a replica set member or
mongosrouter - Include the target database name in the path
Deploy by environment
- Standalone (Kubernetes)
- Standalone (Docker)
- Cloud
The langgraph-cloud Helm chart (v0.2.6+) has built-in MongoDB support. Enable it in your values file:Bundled MongoDB (development and testing):The chart deploys a single-node MongoDB replica set and automatically configures the server to use it.External MongoDB (production):Or reference an existing Kubernetes secret:The secret must contain a
mongodb_connection_url key.Default (PostgreSQL)
PostgreSQL is the default checkpointer backend. No configuration is needed. To use a custom PostgreSQL instance, set thePOSTGRES_URI_CUSTOM environment variable.
Custom checkpointer
To use a storage backend other than PostgreSQL or MongoDB, implement a custom BaseCheckpointSaver. See Add custom checkpointer for details.Related
- Configure TTLs for checkpoint and store item expiration
- Persistence concepts in LangGraph
- Data plane architecture
- Environment variables reference
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

