BaseCheckpointSaver(
self,
*,
serde: SerializerProtocol | None = None
)| Name | Type |
|---|---|
| serde | SerializerProtocol | None |
Note:
When creating a custom checkpoint saver, consider implementing async versions to avoid blocking the main thread.
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.