Base class for creating a graph checkpointer.
Checkpointers allow LangGraph agents to persist their state within and across multiple interactions.
When a checkpointer is configured, you should pass a thread_id in the config when
invoking the graph:
config = {"configurable": {"thread_id": "my-thread"}}
graph.invoke(inputs, config)
The thread_id is the primary key used to store and retrieve checkpoints. Without
it, the checkpointer cannot save state, resume from interrupts, or enable
time-travel debugging.
How you choose thread_id depends on your use case:
thread_id across invocations
to accumulate state (e.g., chat history) within a conversation.BaseCheckpointSaver(
self,
*,
serde: SerializerProtocol | None = None
)Note:
When creating a custom checkpoint saver, consider implementing async versions to avoid blocking the main thread.
| Name | Type |
|---|---|
| serde | SerializerProtocol | None |
Fetch a checkpoint using the given configuration.
Fetch a checkpoint tuple using the given configuration.
List checkpoints that match the given criteria.
Store a checkpoint with its configuration and metadata.
Store intermediate writes linked to a checkpoint.
Delete all checkpoints and writes associated with a specific thread ID.
Delete all checkpoints and writes associated with the given run IDs.
Copy all checkpoints and writes from one thread to another.
Prune checkpoints for the given threads.
Asynchronously fetch a checkpoint using the given configuration.
Asynchronously fetch a checkpoint tuple using the given configuration.
Asynchronously list checkpoints that match the given criteria.
Asynchronously store a checkpoint with its configuration and metadata.
Asynchronously store intermediate writes linked to a checkpoint.
Delete all checkpoints and writes associated with a specific thread ID.
Asynchronously delete all checkpoints and writes for the given run IDs.
Asynchronously copy all checkpoints and writes from one thread to another.
Asynchronously prune checkpoints for the given threads.
Generate the next version ID for a channel.
Default is to use integer versions, incrementing by 1.
If you override, you can use str/int/float versions, as long as they are monotonically increasing.
Return a shallow clone with a derived msgpack allowlist.