Skip to main content
When deploying agents to LangSmith, the server provides a built-in Postgres-backed checkpointer that handles state persistence across graph runs. You can replace this with your own BaseCheckpointSaver implementation to use a different storage backend. You provide a path to an async context manager that yields a BaseCheckpointSaver instance, and the server manages its lifecycle automatically.
Custom checkpointers are in alpha. This feature may experience breaking changes in minor version updates.
To use MongoDB instead of PostgreSQL for checkpoint storage, see Configure checkpointer backend. This page is for implementing a fully custom storage backend.

Define the checkpointer

Starting from an existing LangSmith application, create a file that defines an async context manager yielding your custom checkpointer. If you are beginning a new project, you can create an app from a template using the CLI.
The async context manager pattern lets the server open and close the database connection at the right points in the application lifecycle:

Test against the conformance suite

Most open source checkpointer implementations do not yet implement all the operations required by Agent Server. Before configuring your checkpointer, validate it against the conformance test suite to ensure compatibility. Install the package:
Register your checkpointer and run validation:
The suite auto-detects which extended capabilities your checkpointer implements and runs the appropriate tests. You can also run it as a pytest test:
To view the full list of base and extended operations that the suite validates, refer to the capabilities section.

Configure langgraph.json

Add the checkpointer key to your langgraph.json configuration file. The path points to the async context manager you defined earlier.

Start server

Test the server out locally:
The server logs will confirm that your custom checkpointer is active.

Capabilities

The server checks your checkpointer for base (required) and extended (optional) capabilities at startup. If an extended capability is missing, the server either uses a fallback or disables the corresponding feature.

Base capabilities (required)

Extended capabilities (optional)

Deploying

You can deploy this app as-is to LangSmith or to your self-hosted platform.

Next steps