Checkpoints and thread_id
A checkpointer saves graph state at step boundaries. thread_id tells it which sequence of checkpoints belongs to this conversation or job.1
Tiny example
Section titled “Tiny example”from langgraph.checkpoint.memory import InMemorySaver
graph = builder.compile(checkpointer=InMemorySaver())config = {"configurable": {"thread_id": "tenant-7:case-104"}}
graph.invoke({"messages": [{"role": "user", "content": "Check case 104"}]}, config)snapshot = graph.get_state(config)| Term | Scope | Example |
|---|---|---|
| State | Current data | messages and case status |
| Checkpoint | One saved snapshot | state after policy lookup |
| Thread | Ordered checkpoint history | all work for case 104 |
| Store | Data shared outside one thread | a user’s saved preference |
Failure note
Section titled “Failure note”InMemorySaver loses data when the process stops; use a persistent checkpointer in production. Never let two tenants share a thread_id, and apply retention rules because checkpoint histories grow.
Related
Section titled “Related”Footnotes
Section titled “Footnotes”-
LangChain, Persistence. ↩