Vinayak Dubey

Checkpointing state in LangGraph

15 September 2026

LangGraph can save the state of a graph after each step. This is called checkpointing, and it is the simplest way to get resumable runs without building your own storage layer.

The basic setup

You give the graph a checkpointer when you compile it, and a thread id when you run it. The thread id identifies one run.

from langgraph.checkpoint.memory import MemorySaver

checkpointer = MemorySaver()
graph = builder.compile(checkpointer=checkpointer)

config = {"configurable": {"thread_id": "run-42"}}
result = graph.invoke({"question": "..."}, config=config)

MemorySaver keeps everything in process memory, so it is only for local work. In production you use a checkpointer backed by a database, so a different process can pick up the same thread.

What goes in the state

The state is saved at every step, so it pays to keep it small and plain.

  • Store identifiers and results, not large raw documents.
  • Keep values serializable. Avoid open connections, clients and file handles.
  • Put the bulky data in a separate store and keep a reference in the state.

Resuming

If you call the graph again with the same thread id, it continues from the latest checkpoint. You can also inspect the saved state of a thread, which is very useful when you are debugging a run that went wrong.

One caution

A checkpoint is saved after a node finishes. If a node makes an external call and the process dies before the checkpoint is written, that node runs again on resume. This is why the tool calls inside nodes should be safe to repeat. I cover that in the next post.