Choose a LangGraph checkpointer and store for each kind of data
Separate thread state from cross-thread data, then decide and check each persistence type.
Prerequisites and input · Engineering checks · 1. Inventory the data to keep
At a glance
LangGraph persistence comes in two parts: a checkpointer saves the graph state of one thread, and a store saves application-defined data outside the graph state. Put an item on the wrong side and it is either lost when the thread changes or needlessly stored in checkpoints. This decision sheet helps you judge item by item which one to use and check each configuration separately, using only the supplied persistence documentation.
Runtime and applicability
- Article type
- Engineering practice
- Verified
- Applies to
- LangGraph Choose a LangGraph checkpointer and store for each kind of data
Execution locations and responsibilities
- LangGraph graph runtime and application host Use the workflow below to distinguish responsibilities of the caller, runtime, and external actions.
Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.
When to use
- The documentation defines the two as complementary systems. A checkpointer saves the graph state of a single thread as checkpoints, for short-term, thread-scoped memory, including conversation continuity, human-in-the-loop workflows, time travel, and fault tolerance. A store saves key-value application data outside the graph state, for long-term, cross-thread memory such as user preferences, facts, and shared knowledge. Access differs too: a checkpointer locates state through
thread_idin the graph config, while a store is read and written as items from nodes or application code.
When not to use
- The supplied documentation gives no list of durable store backends and mentions only
InMemoryStore, so this walkthrough cannot name a production store implementation; it can only mark the item pending and stop production configuration. - This sheet only divides thread state from cross-thread data and gives no specific cleanup command; the documentation merely suggests periodic pruning and states no common retention-policy syntax.
- With Agent Server the server handles persistence, so whether the backend choices and the
thread_idlength limit apply there has to be confirmed separately.
Prerequisites and input
- You have listed the data the application must keep and can say who produces and who reads each item.
- You know what a thread means in your application, such as one conversation or one task, and can supply a
thread_idfor it. - You know whether the graph runs in your own deployment or is hosted by Agent Server, because the configuration steps differ between the two.
Engineering checks
Data ownership: within a thread or across threads — The documentation defines the two as complementary systems. A checkpointer saves the graph state of a single thread as checkpoints, for short-term, thread-scoped memory, including conversation continuity, human-in-the-loop workflows, time travel, and fault tolerance. A store saves key-value application data outside the graph state, for long-term, cross-thread memory such as user preferences, facts, and shared knowledge. Access differs too: a checkpointer locates state through thread_id in the graph config, while a store is read and written as items from nodes or application code.
Where to configure: compile time and hosted setups — The documentation quickstart creates InMemorySaver and InMemoryStore objects and attaches both with builder.compile(checkpointer=checkpointer, store=store), then passes thread_id in the config at call time. You can use either one alone, and most applications can use both. The documentation also says that with Agent Server you do not need to implement or configure checkpointers or stores manually, because the server handles the persistence infrastructure; manual attachment therefore belongs only to the self-deployed branch.
Durability and operating risks — InMemorySaver and MemorySaver keep checkpoints in RAM, so everything is lost when the process restarts; the documentation lists PostgresSaver (with async support) and the local file-based SqliteSaver for development as persistent options. With PostgresSaver or AsyncPostgresSaver, keep thread_id under 255 characters, and use a UUID or hash if you need deterministic IDs. The documentation shows only InMemoryStore as a store example and lists no durable store implementation. Long conversations accumulate checkpoints, which can raise latency and storage cost, so prune periodically or set a retention policy. Subgraphs manage their own checkpoint namespace, so a parent graph may not see a subgraph's state changes, and data that must cross graph boundaries can go into a store.
1. Inventory the data to keep
Where: the application design notes and the graph state definition. Input: candidate thread state and cross-thread persistent information. Action: for each item write down its content, the node that produces it, who reads it, whether it is still needed after switching threads, and whether it must survive a restart. Completion check: every item has a producer, a reader, and a conclusion on whether it crosses threads and must survive restarts. Stop condition: if you cannot tell whether an item must cross threads, confirm with the requester instead of defaulting it to either side.
2. Assign each item to a checkpointer or a store
Where: the decision sheet. Input: the step-one inventory. Action: content needed for conversation continuity, human intervention, time travel, or fault tolerance goes to the checkpointer; user preferences, facts, and shared knowledge go to the store; for data that serves both needs, record each use separately. Completion check: every item lands on a clear side with a stated reason. Stop condition: when a single structure must both replay with the thread and be read by other threads, split it in two rather than let one place carry both meanings.
3. Decide the deployment branch and choose a checkpointer backend
Where: the graph runtime environment. Input: the deployment mode and whether data must survive restarts. Action: first decide between your own deployment and Agent Server. Agent Server branch: record that the server handles persistence and that you do not configure it manually, confirm separately whether the backend choices and the thread_id length limit apply, then continue with the application-side checks in step five. Self-deployed branch: limit InMemorySaver to cases that do not need restart survival, and when survival is needed choose between PostgresSaver and the development-oriented SqliteSaver according to the environment. Completion check: the branch, the chosen backend or the hosting note, and the expected post-restart behavior are written down. Stop condition: stop if a self-deployed production environment still points at an in-memory saver.
4. Record the store durability decision
Where: the store column of the decision sheet. Input: the items assigned to the store in step two and their restart-survival requirements. Action: write down the durability requirement, the intended store implementation, and an owner. The supplied documentation shows only InMemoryStore, so if a production store must survive restarts and the material cannot support a specific implementation, mark that item as awaiting an implementation source. Completion check: every store item has a durability requirement, an implementation, and an owner, or an explicit pending mark. Stop condition: if production needs a durable store and the implementation is unknown, stop production configuration until a source is obtained; on the Agent Server branch, record that the server manages it.
5. Configure and name threads
Where: the graph compile and invoke code, or the application-side calls to Agent Server. Input: the chosen checkpointer, store, and thread naming rule. Action: on the self-deployed branch, attach the decided parts with compile(checkpointer=..., store=...); on the Agent Server branch, do not attach manually and only check the application-side thread and data conventions. On both branches fix the rule that produces thread_id, and keep it under 255 characters when using PostgresSaver. Completion check: the length and source of the ID in the call config are recorded. Stop condition: if the ID is built from uncontrolled long text, switch to a UUID or hash first.
6. Check the two kinds of persistence separately
Where: the runtime and the application code. Input: the configured graph. Action: for the checkpointer, call again with the same thread_id and observe whether state continues, then observe again after a process restart; for the store, write an item in one thread and read it in another, and restart and read again if step four required survival. Completion check: each observation is recorded, with expected results kept apart from actually observed ones. Stop condition: if either kind fails to persist where it should, or the result is unknown, return to step two, three, or four and do not proceed to release.
7. Plan for growth and subgraph boundaries
Where: the operations plan and the subgraph design. Input: expected conversation length and whether subgraphs are used. Action: write a cleanup or retention policy for checkpoints, such as periodically deleting those older than N days, and for data a subgraph must share with its parent, decide between a store and configuring the subgraph to write to the parent checkpoint. Completion check: the cleanup interval, its owner, and the subgraph data path are recorded. Stop condition: do not release a long-conversation scenario that has no cleanup plan.
Task example
This is a hypothetical manual walkthrough with nothing executed. Imagine a support graph that needs the current conversation's messages and pending steps, plus the user's preferred reply language. The first replays with the thread, must survive an interrupt, and belongs to the checkpointer, using the conversation number as thread_id. The second must still be readable when the user starts a new conversation, so it belongs to the store. According to the documentation, InMemorySaver and InMemoryStore can serve during development, but in-memory checkpoints are lost on restart, so a persistent backend is needed before release. The documentation names no durable store implementation, so if the preference must survive restarts, that item stays marked as awaiting an implementation source. All observations here are expectations from the documentation and still need verifying in your own environment.
Completion checks
- Ownership stage: every item is marked as within a thread or across threads, with a matching usage scenario and restart-survival requirement.
- Configuration stage: the self-deployed branch attaches the checkpointer and store separately, the Agent Server branch records server-managed persistence; the source, length, and backend limits of
thread_idhave been checked, and each store item has a durability decision with an implementation and owner or a pending mark. - Runtime stage: thread state after restart, cross-thread reads, and any store data required to survive restarts were each checked, with expectation and actual observation kept distinct.
Verification scope
Only the supplied LangGraph persistence documentation was read. Installation, login, API execution, and output were not tested, and the example is a hypothetical walkthrough based on the documentation. The full checkpointer and store guides are linked from that page but were not part of the supplied material, so their details are out of scope.
Sources
All links are official pages; verification dates are listed per source, and links point to the version checked.