R.4

Checkpointer and store API

A checkpointer saves one thread step by step under thread_id, a store saves JSON items by namespace across threads, and each has three backends at the pin.

The classes are in langgraph-checkpoint 4.3.2, langgraph-checkpoint-sqlite 3.1.3, and langgraph-checkpoint-postgres 3.2.1, from the langgraph repository at 1.2.22. A path below starts at libs/ of that repository. Section 5.2 runs the checkpointers, and section 5.4 runs the stores.

The checkpointers

ClassImportLineNotes
InMemorySaverlanggraph.checkpoint.memorycheckpoint/.../memory/__init__.py:34in one process only. MemorySaver is the old name of the same class, at line 634
SqliteSaverlanggraph.checkpoint.sqlitecheckpoint-sqlite/.../sqlite/__init__.py:49from_conn_string at line 104, setup at line 134
AsyncSqliteSaverlanggraph.checkpoint.sqlite.aiocheckpoint-sqlite/.../sqlite/aio.py:49setup at line 317
PostgresSaverlanggraph.checkpoint.postgrescheckpoint-postgres/.../postgres/__init__.py:45from_conn_string at line 69, setup at line 90
AsyncPostgresSaverlanggraph.checkpoint.postgres.aiocheckpoint-postgres/.../postgres/aio.py:45setup at line 95

Each class is a subclass of BaseCheckpointSaver. Each method has an async twin with an a in front of its name.

MethodWhat it doesLine
get_tuple(config)returns the CheckpointTuple that the config names, or the latest one of the thread262
list(config, ...)returns the checkpoints of a thread, newest first277
put(config, checkpoint, metadata, new_versions)saves one checkpoint301
put_writes(config, writes, task_id)saves the pending writes of one task324
delete_thread(thread_id)deletes every checkpoint and write of a thread344
get_next_version(current, channel)returns the next version of a channel721

Tables on disk

setup() creates the tables. Call it once before the first run on a new database.

SaverTables
SqliteSavercheckpoints, writes
PostgresSavercheckpoint_migrations, checkpoints, checkpoint_blobs, checkpoint_writes

Records

TypeFieldsLine
CheckpointTupleconfig, checkpoint, metadata, parent_config, pending_writesbase/__init__.py:140
Checkpointv, id, ts, channel_values, channel_versions, versions_seen, updated_channelsbase/__init__.py:93
CheckpointMetadatasource, step, parentsbase/__init__.py:39
StateSnapshotvalues, next, config, metadata, created_at, parent_config, tasks, interruptslanggraph/langgraph/types.py:721

source is input, loop, update, or fork. step is -1 for the input checkpoint and 0 for the first checkpoint of the loop. Capture 30-state-history-forks.txt shows input, loop, and update, and the lab replay of section 6.6 shows fork.

Config keys of a thread

Key in configurableMeaning
thread_idthe thread. A new value starts a new thread on the first checkpoint
checkpoint_idone checkpoint of the thread, for a replay or a fork
checkpoint_nsthe namespace of a subgraph. The empty string is the top graph

A graph with a checkpointer raises ValueError when the run config has no configurable entries at all. A configurable with other keys passes that check and fails later, such as with KeyError: 'checkpoint_ns'. The errors reference has the text.

State methods of a compiled graph

MethodWhat it doesLine in pregel/main.py
get_state(config)returns a StateSnapshot of the latest or the named checkpoint1479
get_state_history(config)yields the snapshots of a thread, newest first1529
update_state(config, values, as_node=None)writes a new checkpoint as if a node had returned values2636
bulk_update_state(config, supersteps)writes several updates in order1634

Durability

Durability is sync, async, or exit. The default is async. The old argument checkpoint_during still works with a warning: True maps to async and False to exit. Section 5.3 gives what each mode saves before a crash.

Checkpointers of a subgraph

The checkpointer argument of compile takes None, True, False, or a saver. None inherits the saver of the parent, True keeps the state of the subgraph across calls, and False turns checkpoints off. Section 6.7 describes the three.

The stores

ClassImportLineNotes
InMemoryStorelanggraph.store.memorycheckpoint/.../store/memory/__init__.py:136index=None at line 183
SqliteStorelanggraph.store.sqlitecheckpoint-sqlite/.../store/sqlite/base.py:789from_conn_string at line 1014, setup at line 1064
PostgresStorelanggraph.store.postgrescheckpoint-postgres/.../store/postgres/base.py:668from_conn_string at line 784, setup at line 1121. An index needs pgvector

InMemoryStore in langchain_core.stores is another class, a key-value store without namespaces. The register records the docs link to it as D106.

Each store is a subclass of BaseStore. Each method has an async twin with an a in front of its name.

MethodParameters and defaultsLine
getnamespace, key, refresh_ttl=None756
searchnamespace_prefix, then query=None, filter=None, limit=10, offset=0, refresh_ttl=None784
putnamespace, key, value, index=None, ttl866
deletenamespace, key952
list_namespacesprefix=None, suffix=None, max_depth=None, limit=100, offset=0966
batcha list of operations733

An Item has value, key, namespace, created_at, and updated_at. A SearchItem adds score. IndexConfig sets the embedding, its size, and the fields to embed, and TTLConfig sets the expiry.

A label of a namespace cannot be empty, and it cannot hold a period or a NUL byte. Each case raises InvalidNamespaceError.

StoreTables
SqliteStorestore, store_vectors, store_migrations, vector_migrations
PostgresStorestore, store_vectors, and its migration tables

The serializer

Both savers use JsonPlusSerializer by default. EncryptedSerializer wraps it with AES and reads its key from LANGGRAPH_AES_KEY. Section 5.6 shows which values come back changed.

LangChain (Python): langchain, langchain-core, langgraph, deepagents, langsmith 1.5.0 · c2f4036 · 2026-11-11 · Edition 2026.11