0Pricing
AI Agents · Lesson

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

  1. Why Graphs Beat Flat Chains
  2. Nodes, Edges and State
  3. Conditional Routing and Branching
  4. Persisting Graph State (Checkpoints)
← Back to AI Agents