1:1 mentoring with Big Tech AI engineers
LLM & Agentic

Checkpointers, Threads & Store

LangGraph persistence end to end: checkpointers and thread_id for resumable runs, get_state and time travel, PostgresSaver in production, and the Store for memory that outlives a thread.

Last updated

After this section you can

  • Make a graph resumable with a checkpointer and a thread_id, and choose a backend and durability mode
  • Inspect, replay and fork a run with get_state, get_state_history and update_state
  • Keep cross-conversation facts in a store instead of growing one thread forever
36

Checkpointers, Threads & Store

One argument to compile() saves the state after every super-step, keyed by a thread. A second gives the agent memory that outlives the thread. They are different layers, and mixing them up is the usual bug.

Key idea

A checkpointer saves the graph state after every super-step under a thread_id, so a run can resume, be inspected or be replayed. A store keeps facts under a namespace you choose, outside every thread, so the next conversation can read them.

The checkpointer remembers this run; the store remembers this customer
CHECKPOINTER · ONE CHECKPOINT PER SUPER-STEP, PER THREAD thread_id = "cust-42" -1 0 1 2 input start agent tools crash invoke again on cust-42: the run continues after step 2 thread_id = "cust-77" -1 0 another conversation: it cannot see cust-42 STORE · OUTSIDE EVERY THREAD store ("cust-42", "prefs") tone: "terse" plan: "enterprise" read by key or search Checkpointer: the run’s own state, saved so the run can resume, be inspected or be replayed. Store: facts you choose to keep, read by any thread. If it should hold next month, it goes here.

Related

More in LLM & Agentic

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium