Persistence: Never Lose State
Checkpointers save state after every super-step. InMemorySaver for dev, PostgresSaver for prod.
Quick Reference
- →Checkpointers auto-save state after every super-step — no manual save calls needed
- →InMemorySaver: in-memory, dev only — state is lost on restart
- →PostgresSaver / AsyncPostgresSaver: production-grade, persistent across restarts
- →SqliteSaver: lightweight alternative for single-server deployments
- →Enable with graph.compile(checkpointer=saver) — one line to add persistence
How Checkpointing Works
Checkpoints save after every super-step — crash and resume from where you left off
LangGraph automatically saves a complete snapshot of the graph's state after every super-step. There is no manual save call, no flush, no commit -- the checkpointer handles it transparently. When a node finishes and updates state, the checkpointer serializes the entire state object (all keys, all values) and writes it to the configured backend. Each snapshot is tagged with a unique checkpoint_id and linked to its parent via parent_config, forming a chain of states you can traverse forward and backward. This is the foundation that makes threads, time travel, human-in-the-loop, and durable execution possible. Without a checkpointer, none of those features work.