Persisting Graph State (Checkpoints)
Save state to Postgres or SQLite so a long-running agent can be paused, resumed, and audited.
Why Persist State?
Long-running agents need to:
- Pause and resume hours later
- Recover from crashes mid-execution
- Support human-in-the-loop (wait for approval)
- Replay a run for debugging
LangGraph checkpointers persist the state at every node boundary.
In-Memory Checkpointer
For dev/testing:
from langgraph.checkpoint.memory import MemorySaver
checkpointer = MemorySaver()
app = graph.compile(checkpointer=checkpointer)All lessons in this course
- Why Graphs Beat Flat Chains
- Nodes, Edges and State
- Conditional Routing and Branching
- Persisting Graph State (Checkpoints)