For current LangChain agent development, use a checkpointer to save graph state for one conversation thread and a store for application data that must be available across threads. Many agents need both. Choose based on what the information represents, how it should be retrieved, and how it will be persisted and maintained.
First decide where the information must be available
LangChain memory is not one interchangeable feature. The key distinction is scope: a conversation’s working state belongs to a thread, while information intended to carry from one thread to another belongs in a store.
As an Amazon Associate I earn from qualifying purchases.
| Need | Use | Typical contents |
|---|---|---|
| Resume or continue one conversation or workflow | Checkpointer | Graph state, often including messages and resumable workflow state |
| Make application-defined information available across conversations | Store | User preferences, learned facts, or shared knowledge |
| Support both the current conversation and durable cross-conversation context | Both | Thread state in the checkpointer; selected durable information in the store |
LangChain’s persistence documentation describes these as complementary: a checkpointer tracks the current thread, and a store holds durable information across threads. Neither automatically replaces the other.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesUse a checkpointer for short-term, thread-level state
Current LangChain agent guidance treats short-term memory as part of agent state. Conversation history is commonly stored under a messages key. A checkpointer saves graph-state snapshots so the thread can continue or resume; state is read at the start of a step and updated as the agent runs, including when it completes a tool call. The graph configuration’s thread_id identifies which thread’s state is being accessed. See the short-term memory guide.
#1 Best Overall
For a quickstart or local experiment, the documentation shows in-process options such as InMemorySaver (also referred to as MemorySaver in examples). These are convenient, but their checkpoints disappear when the process restarts. They are not durable storage for a deployed application.
For durable persistence, select a database-backed checkpointer that fits your deployment. LangChain documents PostgreSQL, including PostgresSaver, and identifies SQLite as a local file-based option for development. Integration documentation also covers MongoDB. The official material does not establish a universal database choice or comparative performance benchmark; make that decision against your own deployment and persistence requirements.
Rank #2
Use a store for long-term, cross-thread information
A store holds application-defined data outside an individual graph thread. A node or application code can write and retrieve this information when later runs need it. Examples include a user’s preferences, facts learned from interactions, or knowledge shared across conversations. A store can coexist with a checkpointer: the checkpointer maintains the active thread, while the store supplies selected information beyond it. LangChain’s guide to adding memory describes store-backed long-term memory.
Design the store around what the agent needs to learn or do later, rather than treating all past activity as useful memory. LangMem distinguishes three broad kinds:
Rank #3
- Semantic memory: facts and knowledge.
- Episodic memory: past interactions, examples, actions, and outcomes.
- Procedural memory: instructions, workflows, and behavior patterns.
These categories are useful only when they map to a real future need. Define what information should be captured, how it will be retrieved, and how stale or incorrect entries will be updated or removed. LangChain’s LangMem conceptual guide discusses memory types and namespace-based scoping; design namespaces carefully so one user’s information cannot leak into another user’s context.
Memory is not the same as a transcript, logs, or RAG
A transcript or trace records what happened; it does not become useful long-term memory merely by being stored. LangChain’s memory-loop guidance describes a process of capturing traces, analyzing them for useful signal, and updating context that can be retrieved later. The durable memory is the selected lesson or fact that changes what a future run can know or do—not necessarily the entire conversation. See How to Build Memory into AI Agents.
Rank #4
Keep logs and traces for debugging and analysis when appropriate, but do not confuse those records with the context your agent should load on a later run. If a document corpus is authoritative and does not depend on interaction history, retrieval over that corpus may be the better fit than adding those documents to agent memory. The LangMem conceptual guide makes this distinction between interaction-derived memory and ordinary retrieval relevant.
Free tools Windows power users keep installed
One-click scans. No signup required.
Plan persistence setup and operations
Complete database setup
Database-backed persistence requires schema setup. LangChain’s memory guide notes that implementations commonly expose a setup() method, but the exact procedure depends on the integration. Check the specific implementation and complete its setup or migrations as a deliberate deployment step, or ensure startup handles them safely.
Best Value
Control history length and checkpoint growth
A complete message history can exceed a model’s context window. Even below that limit, LangChain warns that long context can slow responses, increase costs, and draw attention to stale or irrelevant material. Choose a policy to trim, delete, or summarize messages in line with the application’s needs; do not assume that retaining every message makes the agent more useful. The short-term memory guide covers managing conversation history.
Checkpoints can also accumulate during long-running conversations, increasing storage use and potentially latency. The persistence guide recommends pruning old checkpoints or setting a retention policy.
Use identifiers and namespaces that preserve isolation
Checkpointer access is thread-scoped through thread_id. For PostgresSaver, the persistence documentation recommends keeping thread IDs under 255 characters. Use stable identifiers with an appropriate scope, and avoid putting unrelated users into the same thread. For long-term stores, use namespace design to keep data scoped to the right user or application context.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Verify that stored memory is actually useful
Capture only a small, relevant subset of traces as durable context, ensure later runs really load the updates, and use evaluations to protect important behavior. A memory write that is never retrieved—or that injects an outdated lesson—does not improve the agent.
A practical selection sequence
- Identify the scope. If the data belongs to one conversation or resumable workflow, use thread state and a checkpointer. If it should follow a user or be shared across threads, use a store.
- Identify the data shape. Graph-state snapshots associated with a
thread_idpoint to a checkpointer. Application-defined items that nodes or application code read and write point to a store. - Choose persistence for the environment. Use in-process memory for examples or experiments where losing state on restart is acceptable. For durable deployment, select a database-backed integration and complete its schema setup.
- Define the memory policy. Specify what to retain, when to retrieve it, how to update or remove stale information, and how to limit long conversation histories.
- Test the whole path. Confirm state resumes under the intended thread ID, cross-thread information is properly scoped, stored updates are retrieved on later runs, and retention behavior works as intended.
Older examples built around langchain.memory may describe legacy abstractions. For current agent development, use the present LangChain/LangGraph concepts—thread state with a checkpointer and cross-thread data with a store—rather than assuming an older memory class is the current standard.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




