October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

LangChain Memory Explained: Choosing Between Checkpointers and Stores

A checkpointer preserves one LangChain thread’s graph state; a store makes selected application data available across threads. Here’s how to choose and operate each.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use 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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

  • 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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. 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.
  2. Identify the data shape. Graph-state snapshots associated with a thread_id point to a checkpointer. Application-defined items that nodes or application code read and write point to a store.
  3. 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.
  4. 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.
  5. 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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.