LangGraph Checkpointer in Practice: How to Choose Between MemorySaver, SQLite, and Redis

Compare InMemorySaver, SQLite, Redis and Postgres for LangGraph checkpoint persistence, concurrency, recovery, privacy and external-operation idempotency.

Published · 2026-06-1520 min readXBSTACK
Evidence 13 cited sources
On this page

2026-10-09 documentation review: LangGraph’s Python interrupt documentation covers interrupt(response_schema=...) on LangGraph 1.2.12 and later, and Command(resume=...) on the original thread_id. This is a documentation and API-contract check—not a fresh benchmark of all saver backends. The original SQLite Store partial-commit case was tested on 3.1.1; the dated November 26 retest below independently verifies the same path on 3.1.3. See official interrupts and official persistence.

October 21, 2026: Does deleting a thread securely erase its SQLite file contents?

An API-level deletion is not proof of physical erasure. The October 20 upstream LangGraph report #9362 describes possible residual text or embeddings in SQLite database files, WAL files, or related storage after delete_thread() and SqliteStore.delete(). This is an upstream report and verification checklist, not an independent XBSTACK reproduction or a claim about all package versions.

For privacy-related deletion guarantees, test three independent properties: (1) deleted threads and Store entries are no longer returned by the application API; (2) database copies, WAL/SHM files, snapshots, and backups have defined retention boundaries; and (3) SQLite secure_delete, checkpointing, and VACUUM behavior is verified against disposable, isolated databases. Do not run untested database maintenance commands against live production files. Pin the exact LangGraph and checkpoint-sqlite versions, track upstream fixes, and include storage-level retention checks in account-deletion regression tests. See AI Agent tool authorization and audit boundaries.

Upstream status check (November 1, 2026): LangGraph issue #9362 remains open. A contributor posted a reference diff and maintenance examples that propose enabling PRAGMA secure_delete=ON before deletion, checking the result of PRAGMA wal_checkpoint(TRUNCATE) after commit, and considering VACUUM for pages freed by earlier deletions. The comment reports bounded tests with synthetic data on specific SQLite versions; the reference diff is not a merged LangGraph release, and it does not prove erasure from backups, snapshots, or physical media. Validate any maintenance procedure on an isolated copy and during a controlled maintenance window; active readers can prevent WAL truncation. See SQLite’s secure_delete, wal_checkpoint, and VACUUM documentation.

LangGraph Checkpointer: durable state is not exactly-once tool execution

For local prototypes, InMemorySaver is convenient but dies with the process. SQLite can work on a single host with disciplined concurrency. Multi-worker production deployments need a shared durable saver plus a tested restart/recovery path. Interrupt resumption restarts the interrupted node, so a checkpoint does not make a payment, email, or database write exactly-once: the business executor must enforce idempotency. See the official persistence guide and the human approval walkthrough.

December 1, 2026: checkpoint recovery does not establish remote absence

A more durable saver does not eliminate an outstanding external request. In today’s independent SQLite policy fixture, recovery returned UNRESOLVED while the original write was still pending and the lookup was empty; it reused the result only after the original committed. Three tests passed. This Python standard-library fixture is not a benchmark of SqliteSaver, RedisSaver, PostgresSaver or a remote provider.

Test checkpoint durability separately from the business executor’s handling of uncertain outcomes. Restoring graph state is not evidence that an external write never happened. Interpret an empty lookup according to the provider’s actual contract. See the LangGraph tool timeout and failure recovery guide for the experiment and its limitations.

What This Guide Covers

  • What core data does the LangGraph Checkpointer actually save in the state machine?
  • Can MemorySaver (or InMemorySaver) truly be used in production environments?
  • For what kind of projects is the SQLite Checkpointer suitable, and what are its concurrency and read/write limitations?
  • In which high-concurrency scenarios is the Redis Checkpointer appropriate, and what prerequisite Redis modules are required?
  • What is the underlying physical addressing relationship between thread_id and the Checkpointer?
  • Why is the Checkpointer indispensable for Human-in-the-loop workflows and failure recovery mechanisms?
  • How should individual developers and professional teams approach Checkpointer architecture selection at different stages of their business?

Who This Guide Is For

  • Backend and full-stack engineers who have successfully run local LangGraph demos and are preparing to deploy Agent services into production.
  • AI system architects designing multi-turn conversations, approval workflows, exception retries, or long-running asynchronous execution tasks.
  • Developers struggling to choose between MemorySaver, SQLite, Redis, and Postgres due to uncertainty about their respective pros, cons, and applicable boundaries.
  • Designers planning highly available storage architectures for AI Agents on platforms like Synology NAS, lightweight VPSs, or Kubernetes container clouds.

1. A Beginner’s Hard-Nosed Practical Observation

In production environments with multiple instances or high concurrency, the state persistence strategy for an Agent is the critical dividing line that determines whether a system survives.

Failure scenario (illustrative, not an incident reported by XBSTACK): a container running financial audit workflows is terminated by an out-of-memory condition. After restart, an InMemorySaver instance starts empty, so previously interrupted approval threads cannot be reconstructed from the old process’s memory. A restart policy does not turn volatile checkpoints into durable state.

In a production deployment, a persistent saver shared across the relevant workers, isolated thread_id values, recoverable checkpoint storage and a replay-safe tool execution policy all matter. Persistence alone cannot guarantee recovery of a partially completed external payment or database write; those need idempotency and reconciliation.


2. The Underlying Physical Mechanisms and State Anatomy of Checkpointers

Where This Article Fits in the LangGraph Series

This article specifically addresses checkpointer selection and state persistence. If you have not designed your ID hierarchy, start with thread_id, session_id, and user_id design. For approval pauses and resumption, continue with LangGraph human-in-the-loop approval workflows. For recovery after tool failures, see tool errors, timeouts, and retry strategies. If users can see streamed content that disappears after cancellation or refresh, read streaming, checkpoints, and cancellation recovery consistency.

Do not choose a checkpointer by storage price alone. A cheaper state layer that increases failed recovery, duplicate execution, or manual compensation can raise the cost of each successful task. The OpenAI outcome-based pricing and AI Agent ROI analysis puts persistence back into the full Agent cost model: checkpoint storage is part of Agent Cost, while the optimization target is task success and cost per verified outcome.

Practical Review Checklist

Before pushing the Checkpointer to production, complete at least these 5 checks:

  • After a container restart, can the same thread_id be restored to its last checkpoint, and can an interrupted node be safely re-executed from the beginning using Command(resume=...)?
  • Will multiple concurrent tasks from the same user write to different thread_id instances?
  • Have the backup and recovery commands for SQLite / Redis / Postgres actually been tested in practice?
  • If a Human-in-the-loop suspension exceeds 24 hours, can the state still be recovered?
  • Can error logs simultaneously pinpoint thread_id, the checkpoint ID, the current node, and the cause of failure?

The Checkpointer captures snapshots of the directed graph at the end of each node’s execution, serializes them, and binds them to a unique thread_id. This provides the physical foundation for Agent task retries, time travel, and human approval.

We need to make one thing clear: the Checkpointer does not solve ordinary caching problems; it solves durable execution. When we pass a checkpointer during Graph compilation, LangGraph automatically intercepts and saves the current graph state snapshot after every step of the graph’s execution (i.e., after each node finishes running).

These snapshots are organized by thread_id. A thread is like a branch in Git, recording all historical commits (checkpoints) for that thread. Each checkpoint contains not only the current state dictionary but also extremely rich physical metadata.

For orientation, the following is an illustrative schema, not raw output captured from a specific LangGraph serializer or a verified production run. The actual stored fields vary by saver implementation and version:

{
  "thread_id": "usr_9982:billing_audit:task_20260615_001",
  "checkpoint_id": "1ef23b8f-89a1-6a20-b001-c91823abf100",
  "current_node": "agent_review_node",
  "state": {
    "messages": [
      {
        "type": "human",
        "content": "5 invoice"
      },
      {
        "type": "ai",
        "content": "",
        "tool_calls": [
          {
            "name": "fetch_invoices",
            "args": {
              "month": "2026-05"
            },
            "id": "call_tx_9982"
          }
        ]
      }
    ],
    "invoice_list": [],
    "audit_status": "pending_fetch"
  },
  "pending_action": null,
  "error_state": null,
  "metadata": {
    "source": "loop",
    "step": 2,
    "run_id": "run_0f8e91cd-89b2-44a1-b873-120aef2b001f"
  },
  "created_at": "2026-06-15T10:28:29Z"
}

As the structure above shows, the Checkpointer records:

  • The specific node in the current graph: This tells the state machine which Node to start executing from when it is next awakened.
  • Complete State data: Including conversation message history (the messages list) and custom business state fields (such as invoice_list).
  • Error states and pending actions: If a node throws an exception during execution, or if an interrupt_before breakpoint is configured before a node, this records the pending tool calls or exception information.
  • Metadata: Contains step counts, run_id for individual runs, etc., for observability path analysis.

With this foundation, when an Agent is interrupted by network failures, API timeouts, or container restarts, the same thread_id can retrieve a persisted checkpoint and resume from a framework-supported boundary. That can avoid re-running earlier graph nodes, but it does not automatically reconcile external side effects; the application still needs idempotency, result lookup, or compensation for tools that may already have completed.


3. MemorySaver / InMemorySaver: Suitable for Demos, Not for Production

The sole value of memory-based Checkpointers is zero-configuration out-of-the-box usability. Because they lack persistent storage, any process restart or multi-instance load balancing will cause the state to vanish instantly.

In the Python documentation, the official examples commonly use InMemorySaver; in the JavaScript/TypeScript version, the corresponding name is MemorySaver. Their physical essence is identical: they maintain a dict or Map in process memory to read and write checkpoint objects.

When used for local development, running unit tests, or quickly validating a state machine branch logic, their usage is extremely straightforward:

from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import StateGraph

memory_checkpointer = InMemorySaver()

graph = builder.compile(checkpointer=memory_checkpointer)

config = {"configurable": {"thread_id": "local_demo_thread"}}
result = graph.invoke({"input": "task"}, config=config)

However, the in-memory checkpointer has three fatal physical flaws that make it absolutely unsuitable for production deployment:

  1. Process-resident limitations: If your application is deployed on a Kubernetes cluster, managed by PM2, or hosted on a Serverless platform like Vercel, new processes start empty during container scaling, node drift, or automatic restarts after crashes. Once user requests are routed to a new instance by the load balancer, the preceding state is lost, resulting in errors.

  2. Memory capacity exhaustion (OOM) risk: As conversation turns and concurrent users accumulate, the checkpoint list stored in process memory grows indefinitely. The message history within each checkpoint consumes significant memory, which can directly cause the application process to be forcibly killed by the system due to memory leaks or exhaustion.

  3. Inability to persistently audit state: Once the service undergoes a hot update or a normal maintenance restart, all historical execution chains physically evaporate, making them unavailable for subsequent product data tracing and compliance auditing.

Therefore, unless you are writing single-machine scripts or running local pytest tests, you should physically remove InMemorySaver from your dependencies at the very beginning of the project’s inception.


4. SQLite Checkpointer: A Low-Cost Choice for Personal Projects and Single-Machine Deployments

SQLite provides zero-deployment-cost disk-level persistence with support for both synchronous and asynchronous drivers, making it an ideal choice for single-machine applications and small-scale tool sites, though it requires handling database lock barriers under concurrent writes.

If your Agent service is currently a tool-type site developed by a single person, or if it is deployed on an independent cloud server or even a private NAS device, SQLite is an extremely cost-effective choice. It ensures that state remains intact after process restarts without requiring you to additionally manage complex database clusters.

LangGraph officially provides a standalone extension package langgraph-checkpoint-sqlite to support SQLite persistence. It includes the synchronous SqliteSaver and the asynchronous AsyncSqliteSaver implemented based on aiosqlite.

Let’s look at a practical code example of standard initialization for AsyncSqliteSaver in an asynchronous application (such as FastAPI):

import asyncio
import os
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
from langgraph.graph import StateGraph

DB_PATH = "data/agent_checkpoints.db"
os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)

async def run_agent_workflow():
    async with AsyncSqliteSaver.from_conn_string(DB_PATH) as checkpointer:
        await checkpointer.asetup()

        graph = builder.compile(checkpointer=checkpointer)

        config = {"configurable": {"thread_id": "sqlite_user_task_4451"}}

        async for event in graph.astream(
            {"messages": [("user", "Analyze the structure of this document")]},
            config=config,
            stream_mode="values"
        ):
            print(event)

asyncio.run(run_agent_workflow())

When using SQLite, you need to be aware of the following two common pitfalls:

  • SQLite write contention: SQLite has a single-writer concurrency boundary. Use a busy timeout, short transactions and, when appropriate, WAL mode to improve concurrent readers and writer coordination; measure actual contention under your workload. check_same_thread=False only changes Python’s thread-affinity check—it does not cure database locks.
  • Checkpoint retention and size: Define retention and pruning rules for checkpoints and writes, back up before destructive maintenance, and monitor the database file and free space. VACUUM can reclaim file space after data is deleted but is not a replacement for retention management and should not be scheduled blindly during active writes.

2026-08-12 update: SqliteStore.batch() can still partially commit after it raises

A newly confirmed transaction-boundary issue belongs next to the SQLite persistence discussion. This does not mean every SqliteSaver checkpoint write partially commits. The affected API in this reproduction is langgraph.store.sqlite.SqliteStore.batch(), a Store API shipped in the same langgraph-checkpoint-sqlite package. If an application uses SQLite both for checkpointing and as a LangGraph Store, and relies on batch() as an all-or-nothing boundary, that assumption needs its own regression test.

LangGraph issue #8590, opened on August 11, 2026, reports that an earlier mutation in a Store batch can remain persisted when a later operation raises. The observable case in the issue refreshes TTL through GetOp(..., refresh_ttl=True) and then triggers a serialization TypeError with an invalid PutOp. The batch fails, but the earlier TTL refresh is not rolled back.

On August 12, I reran the synchronous minimal reproduction with langgraph-checkpoint-sqlite==3.1.1. It uses an in-memory SQLite database and makes no model, API, or external database calls. The core batch is only:

store.batch([
    GetOp(("test",), "key", refresh_ttl=True),
    PutOp(("test",), "invalid", {"value": object()}),
])

After pinning the original expires_at, the recorded output was:

langgraph-checkpoint-sqlite 3.1.1
caught TypeError
original_expiration 2000-01-01 00:00:00
actual_expiration 2026-08-12 03:26:59
partial_commit_reproduced True

The exact refreshed timestamp is not the important part. The batch raised TypeError, yet the earlier TTL mutation remained in the database. On this version, SqliteStore.batch() therefore should not be treated as an atomic transaction boundary where any failure guarantees rollback of all earlier operations.

The upstream issue points to the synchronous and asynchronous SQLite Store _cursor() contexts committing unconditionally in finally. The proposed repair is to commit only on normal exit and roll back on any BaseException before re-raising it. When I rechecked the issue on August 12, it was still open and showed no linked pull request or released fix.

Until a fixed release passes the same regression test, the production boundary should stay conservative: do not place failure-sensitive writes behind an assumption that the current batch() is atomic; pre-validate fallible inputs where possible; and avoid mixing an earlier mutation with later operations that may raise when the business requirement is truly all-or-nothing. For this specific TTL reproduction, avoiding refresh_on_read inside a critical batch can avoid the demonstrated mutation path when the product semantics allow it, but that is a narrow workaround, not a general transaction fix.

XBSTACK has published the reproduction at xbstack/langgraph-sqlite-partial-commit-repro, including the pinned package version, minimal script, recorded output, version matrix, and a fixed-version verification gate; the same fixture also remains in the site source under experiments/langgraph-sqlite-partial-commit-repro/. If upstream publishes a PR or release, the wording should only change from “reproduced/open” to “fixed/verified” after that same fixture passes against the candidate version.

November 26, 2026 retest: partial commit still reproduces on SQLite Checkpoint 3.1.3

I reran the unchanged synchronous fixture in an isolated environment using Python 3.11.15, SQLite 3.53.2, langgraph-checkpoint-sqlite==3.1.3 and langgraph-checkpoint==4.3.2. The later PutOp still raised TypeError, but the earlier TTL changed from 2000-01-01 00:00:00 to 2026-11-26 09:46:22. The installed synchronous SqliteStore._cursor() still commits in its finally block. This specific synchronous failure path still fails the atomic rollback invariant on 3.1.3; it is not a claim about every checkpoint write. Version 3.1.2, async batches and cancellation were not tested. Updating the main LangGraph package does not establish that this separate SQLite package has been fixed.

Recorded result and environment · Retest feedback on upstream issue #8590.


5. Redis Checkpointer: A Tool for High Concurrency and Low-Latency State Management

Redis Checkpointer is one candidate for distributed agents when its persistence, indexing, data volume, cost and recovery characteristics meet the application requirements. However, because it relies on memory, it requires an additional relational database mount for long-term auditing and compliance tracing.

If your Agent service has a large daily active user base and is deployed across multiple instances in a distributed Kubernetes cluster, where users have strict requirements for response latency, a Redis-based persistence solution is the best match.

Redis uses in-memory access and can offer low latency on suitable workloads, but measured end-to-end checkpoint latency depends on network, index, payload, persistence and contention, which significantly reduces the overhead of saving snapshots during state machine transitions on each node. The official LangGraph integration package provides langgraph-checkpoint-redis, which includes RedisSaver and ShallowRedisSaver for memory optimization.

There is one mandatory prerequisite when using the Redis Saver: the connected Redis instance must support the “RedisJSON” and “RediSearch” official modules. This is because LangGraph relies on JSON format parsing and secondary index searching when retrieving states and backtracking historical snapshots for specific threads. If you are using an older version of Redis or a default Redis container image without these modules installed, calling the setup method will result in an immediate error and crash.

Let’s look at the complete practical code for the Redis Saver:

from langgraph.checkpoint.redis import RedisSaver
from langgraph.graph import StateGraph

import os
REDIS_URI = os.environ["REDIS_URI"]  # Use a protected secret source; TLS when remote.

redis_checkpointer = RedisSaver.from_conn_string(REDIS_URI)

redis_checkpointer.setup()

graph = builder.compile(checkpointer=redis_checkpointer)

config = {"configurable": {"thread_id": "redis_thread_9872"}}
graph.invoke({"messages": [("user", "Executesystemcheck")]}, config=config)

In Redis architecture selection, we must consider the following critical design factors:

  • Memory capacity protection (ShallowRedisSaver): The default RedisSaver saves the complete checkpoint history for every thread. If an Agent engages in hundreds of rounds of conversation with a user, the state is saved verbatim each time. This causes Redis memory to fill up rapidly. To mitigate this, use ShallowRedisSaver, which employs an overwrite mechanism, retaining only the latest checkpoint node per thread_id in Redis. While this prevents “time travel” (loading historical versions), it ensures constant memory usage.

  • Memory eviction and persistence strategies: In production environments, you must disable the allkeys-lru or volatile-lru memory eviction policies on your Redis instances. If Redis automatically evicts the latest checkpoint for active threads due to memory pressure, the user’s Agent workflow will crash with errors in the next conversation turn. Additionally, you must choose AOF/replication/backups for the required RPO/RTO and test failure recovery. An everysec AOF fsync may still lose recently acknowledged writes; it does not guarantee zero data loss.


6. Postgres: A Common Choice for Multi-Worker Production

LangGraph’s PostgreSQL implementations are PostgresSaver and AsyncPostgresSaver. They are a stronger fit for multi-user, multi-process, or multi-worker production and can use PostgreSQL transactions, JSONB, backups, and HA tooling, but reliability still depends on the database deployment, permissions, backups, and idempotency of external side effects.

When the system becomes multi-tenant, long-running, multi-process or multi-worker and needs database-level backup, auditing and operations, PostgreSQL is often a strong default choice. The final decision should still reflect the infrastructure you already operate, throughput requirements, and the team’s database expertise.

In fact, LangChain’s official managed service, LangSmith Agent Server, uses Postgres as the underlying storage medium for checkpoint data by default. Through the langgraph-checkpoint-postgres package, we can easily build highly available enterprise-grade Agents.

Here, I must share a subtle pitfall that cost me an entire day: If you prefer not to use the default connection string factory and instead want to manually manage the connection pool (e.g., reusing an existing database connection pool in FastAPI), you must enable the following two configurations during initialization:

  1. 1 and autocommit=True: LangGraph’s table creation and state update operations rely on non-blocking transaction commits. If these are not enabled, the .setup() method will either deadlock permanently or throw a transaction exception when creating the checkpoints table.
  2. 2 and row_factory=dict_row: LangGraph internally extracts database rows based on column name key-value pairs (e.g., row["checkpoint_id"]). Using the default tuple row factory will cause parsing errors, resulting in an KeyError exception and a crash.

Below is the production-grade code for manually managing connections and initializing PostgresSaver:

import psycopg
from psycopg.rows import dict_row
from langgraph.checkpoint.postgres import PostgresSaver

import os
DB_URI = os.environ["LANGGRAPH_POSTGRES_DSN"]  # Never embed DB passwords in published source.

conn = psycopg.connect(DB_URI, autocommit=True, row_factory=dict_row)

postgres_checkpointer = PostgresSaver(conn)

postgres_checkpointer.setup()

graph = builder.compile(checkpointer=postgres_checkpointer)

config = {
    "configurable": {
        "thread_id": "org_100:user_200:task_abc",
    }
}

To mitigate the physical risk of remote code execution (RCE) caused by third-party library deserialization vulnerabilities, you must set the LANGGRAPH_STRICT_MSGPACK=true environment variable in production. This ensures that when reading and restoring State from Postgres, only trusted built-in data types are deserialized.


7. Deep Dive: Benchmarking the Four Checkpointer Backends

When selecting an architecture, we need to compare each solution’s latency, concurrency, disaster recovery capabilities, and operational complexity to determine the most suitable persistence backend for the current business stage.

To facilitate quick decision-making, I have organized these four typical Checkpointer options into a comparative table:

Physical DimensionMemorySaverSQLiteRedisPostgres
Ideal Use CaseTutorial demos, local unit testsPersonal tools, single-node deployment, lightweight backendsHigh-concurrency short sessions, low-latency distributed servicesDistributed multi-user, enterprise-grade long-task auditing
Operational CostZero cost, no external dependenciesExtremely low, single-file managementModerate, requires additional memory module configurationHigh, requires a highly available relational database
Concurrency CapabilityLimited to single-process concurrencyWeak; multi-threaded writes easily lock the databaseExtremely strong, high-throughput concurrencyStrong, supports connection pools and high-concurrency transactions
Disaster Recovery & PersistencePhysically evaporates upon restartDisk-level persistence; backups are requiredPrimarily memory-based, relies on AOF disk syncPhysically persisted, mature backup and recovery mechanisms
Time Travel SupportSupports full historical rollbackSupports full historical rollbackConfigurable full or Shallow overwrite modesSupports full history, facilitating JSONB query analysis
Physical ConstraintsLimited by process-assigned RAMWrite locks limit suitability for high concurrencyRedisJSON and RediSearch must be available; Redis 8+ includes them, older servers may use Redis StackMust configure autocommit and dict_row

8. Thread ID and State Isolation: Preventing Cross-Thread Contamination

The thread_id serves as the physical primary key for the Checkpointer when reading state. Without strict tenant isolation and robust owner verification, the system will inevitably face unauthorized access and catastrophic context cross-contamination.

In my recent development summaries, I explored this issue in depth. If all user requests blindly share a single thread_id, or if user_id is used directly as the thread_id, then under high-concurrency scenarios, User A’s operation snapshots will physically overwrite User B’s preceding states in the Checkpointer tables, causing the state machine’s context to instantly cross-contaminate.

When designing production interfaces, we must standardize thread_id as a composite key. For example, we define: thread_id = user_id + business_type + task_id

Furthermore, the API gateway layer must not pass the client-supplied thread_id directly to the directed graph compilation layer. Instead, it must construct a physical barrier based on owner verification to prevent privilege escalation. Below is the pseudo-code for the strong validation logic I designed at the gateway interception layer:

def process_incoming_request(user_context: dict, client_payload: dict):
    current_user_id = user_context["user_id"]
    requested_thread_id = client_payload["thread_id"]

    thread_parts = requested_thread_id.split(":")
    if len(thread_parts) < 3 or thread_parts[0] != current_user_id:
        raise PermissionError("security: Readcurrentuser Checkpoint state")

    config = {
        "configurable": {
            "thread_id": requested_thread_id,
            "user_id": current_user_id
        }
    }

    return graph.invoke({"input": client_payload["prompt"]}, config=config)

9. Common Pitfalls and Error Logs

Avoiding common compilation and runtime errors is a necessary prerequisite for ensuring that the Checkpointer reliably performs state recovery.

Based on my practical experience troubleshooting these issues, the following error messages appear most frequently. If you see similar logs in your console, you can directly apply my step-by-step troubleshooting guide to resolve them:

1. SQLite Lock Database Errors

sqlite3.OperationalError: database is locked
  • Cause: Under high-concurrency requests, multiple threads attempt to write to the SQLite checkpoint_writes table simultaneously.
  • Solution: When configuring AsyncSqliteSaver.from_conn_string, ensure that a connection timeout is set (timeout=30) and configure WAL mode at the SQLite database level.

2. Postgres Connection Hangs and Configuration Errors

psycopg.errors.ActiveSqlTransaction: CREATE TABLE cannot run inside a transaction block

Or throw it when reading the data:

KeyError: 'checkpoint_id'
  • Root cause: The absence of an explicit autocommit=True configuration causes DDL statements to deadlock, or the lack of row_factory=dict_row prevents LangGraph from physically extracting data rows as dictionaries.
  • Solution: When creating the psycopg connection object, explicitly specify autocommit=True, row_factory=dict_row.

3. Redis Index Missing Error

redis.exceptions.ResponseError: Cannot create index: ft.create require RediSearch module v2.0+
  • Cause: The Redis image used is a standard Redis Server, which lacks the core RedisJSON or RediSearch modules.
  • Solution: Replace the Redis image with redis/redis-stack-server:latest, or confirm with your Redis cloud hosting provider that these two module plugins are enabled.

4. Serialization Failure Error

TypeError: Object of type CustomToolResult is not JSON serializable
  • Root cause: Your Tool returned an object that is a custom Python class instance (for example, directly returning a database ORM object) instead of converting it to a basic dict or JSON string. The Checkpointer cannot serialize this complex object into a byte stream when saving the graph state to disk.
  • Solution: Ensure that all data returned by your Tool function to the Node consists of standard primitive types (str, int, dict, list).
  • If the value serializes successfully but its timezone semantics change after restore, continue with LangGraph Checkpoint Loses ZoneInfo and fold. That case is not a hard serialization failure: the datetime round-trip preserves the instant while losing the IANA timezone rule and fold semantics.

10. Production Readiness Checklist & FAQ

Production Readiness Checklist

  • Have you completely removed MemorySaver / InMemorySaver from your production dependencies?
  • If using SQLite, have you enabled WAL mode and configured a script for automatic VACUUM?
  • If using Redis, have you selected the redis-stack image and disabled the automatic memory eviction policy to prevent loss of active states?
  • If using Postgres, did you force-enable autocommit=True and row_factory=dict_row during connection initialization?
  • Have you configured LANGGRAPH_STRICT_MSGPACK=true in your environment variables to ensure secure deserialization?
  • Does your API interface layer perform strict validation on the thread_id passed by clients to prevent cross-tenant state leakage due to unauthorized access?
  • When a Tool execution throws an exception, can the Checkpointer correctly save error_state and suspend the state to support subsequent retries?

FAQ

Since MemorySaver is not suitable for production, why is it still a staple in official examples?

Its sole purpose is to lower the barrier to entry. To help beginners quickly run Agent demos without needing to install and configure SQLite, Redis, or Postgres, the default configuration uses an in-memory Saver. However, in real-world commercial applications, process memory is an unsafe, temporary medium.

If my SQLite file gets corrupted, can the Agent recover?

If the database file is corrupted and there is no backup, all thread states stored within that file are permanently lost. The Agent will be forced to create a new thread and start from scratch. For projects using SQLite, it is recommended to schedule a daily late-night backup of the .db file to physical cold storage (such as a dedicated drive on a Synology NAS).

How do I choose between ShallowRedisSaver and the standard RedisSaver?

If the application does not need full checkpoint history and mainly cares about the latest state, evaluate ShallowRedisSaver. Retaining less checkpoint history can reduce Redis storage pressure, but the memory reduction depends on state size, checkpoint count, TTL, and access pattern; there is no universal “80% savings” result. Measure key count, bytes per key, total memory, recovery requirements, and historical-debugging needs before choosing it.

Will frequent read/write operations by the Postgres Checkpointer slow down the Agent’s response time?

Under high-concurrency write loads, Postgres’s I/O overhead is indeed higher than Redis’s pure memory writes. If performance becomes a bottleneck, you can adopt a read-write separation architecture in your application design. Alternatively, use a Redis checkpointer to handle short-term conversation states, and asynchronously sync to Postgres for long-term persistent auditing only when the workflow is fully archived or at critical nodes such as triggering interrupts.


October 22, 2026 update: Store namespace isolation advisory

The maintainers published GHSA-6hmw-9432-67qq on October 21, 2026. This is a cross-thread Store namespace validation issue, not a blanket claim that checkpoint resume is broken. PostgreSQL and SQLite stores joined namespace labels with ., allowing an untrusted label such as ("tenant.bob",) to address data stored under ("tenant", "bob") on affected methods. InMemoryStore compares tuples and is not affected.

PackageAffectedFixed
langgraph-checkpoint-postgres<3.1.33.1.3
langgraph-checkpoint-sqlite<3.1.23.1.2

The fix requires langgraph-checkpoint >=4.3.0 for namespace validation. Audit installed versions, whether untrusted input controls namespace labels, and authorization around get/search/delete/list_namespaces/batch/abatch. After upgrading, test that namespace aliases cannot read or modify another tenant’s data. A patched dependency does not itself prove application-specific access controls are correct.

November 6, 2026: SQLite Store integer-filter precision is not a Checkpointer recovery defect

LangGraph #9607 reports that structured numeric filtering in langgraph.store.sqlite.SqliteStore can match adjacent integers above the exact-integer boundary 2^53; the supplied reproduction compares 2^53 with 2^53+1. This concerns Store value filtering and numeric precision, not the Checkpointer’s transaction or replay behavior covered here. It is an upstream report with a public API reproduction; XBSTACK has not independently repeated the exact-version test, and no claim is made about every SQLite deployment. For identifiers that must remain exact, compare underlying storage and query types, avoid unsafe conversions, and rerun a minimal regression after the upstream fix. Labels: LangGraph, SQLite Store, integer precision, data consistency.

November 20, 2026: missing AnyValue from get_state does not prove checkpoint loss

LangGraph #9722 reports that when parallel nodes include a successful AnyValue write and a failing sibling, get_state(config).values may omit the value even though pending_writes and the successful task result still contain it. A LastValue control shows the value; the reported resume can consume the pending write without rerunning the successful node. A missing value in the snapshot view is not by itself evidence of lost persisted data.

Pin thread_id, channel type and LangGraph version. Compare snapshot.values, snapshot.tasks, checkpoint pending_writes and resume behavior before considering any database repair. This upstream report is distinct from choosing SQLite, Redis or Postgres, and is not presented as an independent local reproduction.

Official persistence reference

LangGraph’s current persistence documentation defines checkpoints as thread-scoped state snapshots saved at graph super-step boundaries, with pending writes used for fault-tolerant resume. It also distinguishes the checkpointer from the cross-thread Store interface. Use the official persistence reference when validating whether a behavior is framework semantics, backend-specific behavior, or an XBSTACK reproduction.

Series Navigation

LangGraph Production-Grade Agent Orchestration in Practice Series:

More to Explore

Topic path / LangGraph

Continue through the production LangGraph learning path

The LangGraph hub organizes state isolation, checkpointing, human approval, retries, observability, supervisors, subgraphs and memory into one reviewable path.

Next step: make state and recovery explicit

Full decision path →

Move from the current symptom to the next state, checkpoint, resume, or failure-recovery boundary.

Continue with state and memoryLangGraph Failure Recovery: Tool Errors, Timeouts, Retry, and error_handlerLangGraph failure recovery: timeout replay tests and a synthetic SQLite race explain error_handler, resume, idempotency, empty lookups and unknown outcomes.Continue with state and memoryLangGraph Human in the Loop: Multi-Agent Approval WorkflowBuild a LangGraph human in the loop approval workflow with interrupt(), Command(resume), checkpointers, parallel approvals and idempotent tool execution.Continue with state and memoryLangGraph State Isolation in Practice: Designing thread_id, session_id, and user_idLangGraph State Isolation in Practice: A practical guide to state isolation design in multi-user Agent systems using LangGraph.
Comments & evidence

DISCUSSION

Questions, verification and corrections

Sign in to comment. Every new comment is reviewed before publication; while pending, it is visible only to you and the administrator.

Sign-in required Reviewed before public
Loading the discussion…