Files
langgraph/libs/checkpoint
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>John Kennedy
9b18243fa6 chore(deps): bump the all-dependencies group in /libs/checkpoint with 2 updates (#6850)
Bumps the all-dependencies group in /libs/checkpoint with 2 updates:
[langchain-core](https://github.com/langchain-ai/langchain) and
[redis](https://github.com/redis/redis-py).

Updates `langchain-core` from 1.2.12 to 1.2.13
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchain/releases">langchain-core's
releases</a>.</em></p>
<blockquote>
<h2>langchain-core==1.2.13</h2>
<p>Changes since langchain-core==1.2.12</p>
<p>release(core): 1.2.13 (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35230">#35230</a>)
docs(core): expanded <code>get_lc_namespace</code> docstring (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35229">#35229</a>)
feat(openrouter): add <code>langchain-openrouter</code> provider package
(<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35211">#35211</a>)
style: bump ruff version to 0.15 (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35042">#35042</a>)</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/langchain-ai/langchain/commit/b026fd605b0cc150f943e6ea8a8aed45e23373e5"><code>b026fd6</code></a>
release(core): 1.2.13 (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35230">#35230</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchain/commit/1573757b3bf53bab48b7ff3804707adf3a173e96"><code>1573757</code></a>
docs(core): expanded <code>get_lc_namespace</code> docstring (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35229">#35229</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchain/commit/f9fd7be695c70f33cb6cbeb4cca1547ee225c5b1"><code>f9fd7be</code></a>
feat(openrouter): add <code>langchain-openrouter</code> provider package
(<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35211">#35211</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchain/commit/b97c629f9ade098236aa56d861a21706a9830f54"><code>b97c629</code></a>
style: bump ruff version to 0.15 (<a
href="https://redirect.github.com/langchain-ai/langchain/issues/35042">#35042</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchain/commit/1493b4c5eed3b6c08358a5ce5d890bc8b52b4874"><code>1493b4c</code></a>
fix: Server-Side Request Forgery (SSRF) in
HTMLHeaderTextSplitter.split_text_...</li>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchain/compare/langchain-core==1.2.12...langchain-core==1.2.13">compare
view</a></li>
</ul>
</details>
<br />

Updates `redis` from 7.1.1 to 7.2.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/redis/redis-py/releases">redis's
releases</a>.</em></p>
<blockquote>
<h2>7.2.0</h2>
<h1>Changes</h1>
<p><strong>Redis 8.6 Support</strong>
Added support for Redis 8.6, including new commands and features for
streams idempotent production and HOTKEYS.</p>
<p><strong>Smart Client Handoff (Maintenance Notifications) for Cluster
note: Pending a Redis Enterprise version release</strong></p>
<p>This release introduces comprehensive support for Redis Enterprise
Cluster maintenance notifications via SMIGRATING/SMIGRATED push
notifications. The client now automatically handles slot migrations
by:</p>
<p>Relaxing timeouts during migration (SMIGRATING) to prevent false
failures
Triggering cluster state reloads upon completion (SMIGRATED)
Enabling seamless operations during Redis Enterprise maintenance
windows</p>
<p><strong>OpenTelemetry Native Metrics Support</strong>
Added comprehensive OpenTelemetry metrics support following the <a
href="https://opentelemetry.io/docs/specs/semconv/database/database-metrics/">OpenTelemetry
Database Client Semantic Conventions</a>.
Metric groups include:</p>
<ul>
<li>Command metrics: Operation duration with retry tracking</li>
<li>Connection basic: Connection count and creation time</li>
<li>Resiliency: Errors, handoffs, timeout relaxation</li>
<li>Connection advanced: Wait time and use time</li>
<li>Pubsub metrics: Published and received messages</li>
<li>Stream metrics: Processing duration and maintenance
notifications</li>
</ul>
<h2>🚀 New Features</h2>
<ul>
<li>Added OTel instrumentation and metrics export for sync client (<a
href="https://redirect.github.com/redis/redis-py/issues/3954">#3954</a>)</li>
<li>Add maintenance notifications support for OSS API cluster clients
(<a
href="https://redirect.github.com/redis/redis-py/issues/3946">#3946</a>)</li>
<li>Adding hotkeys commands support. (<a
href="https://redirect.github.com/redis/redis-py/issues/3924">#3924</a>)</li>
<li>Adds support for the new Idempotent Producers feature in Redis 8.6
(<a
href="https://redirect.github.com/redis/redis-py/issues/3926">#3926</a>)</li>
<li>Adding support for vrange command. (<a
href="https://redirect.github.com/redis/redis-py/issues/3927">#3927</a>)</li>
<li>Added a local digest command to the client to execute the XXH3
locally… (<a
href="https://redirect.github.com/redis/redis-py/issues/3884">#3884</a>)</li>
<li>Add DriverInfo class for upstream driver tracking (<a
href="https://redirect.github.com/redis/redis-py/issues/3880">#3880</a>)</li>
<li>Add ssl_password support to async Redis client (<a
href="https://redirect.github.com/redis/redis-py/issues/3878">#3878</a>)</li>
<li>Add ssl_ca_path support to async Redis client (<a
href="https://redirect.github.com/redis/redis-py/issues/3879">#3879</a>)</li>
</ul>
<h2>⚠️ Deprecations</h2>
<ul>
<li>Adding special handling of client_tracking_on and
client_tracking_off for cluster clients. Marking those two functions as
deprecated for cluster - embedded client-side caching feature should be
used instead. (<a
href="https://redirect.github.com/redis/redis-py/issues/3858">#3858</a>)</li>
</ul>
<h2>🐛 Bug Fixes</h2>
<ul>
<li>Fix handling of circular MOVED redirects in cluster slot mapping (<a
href="https://redirect.github.com/redis/redis-py/issues/3899">#3899</a>)</li>
<li>fix(asyncio): prevent deadlock when Lock.release() is cancelled (<a
href="https://redirect.github.com/redis/redis-py/issues/3900">#3900</a>)</li>
<li>Fix unrecoverable connection state (<a
href="https://redirect.github.com/redis/redis-py/issues/3905">#3905</a>)</li>
<li>Fixed potential race condition between call_later() and
run_forever() (<a
href="https://redirect.github.com/redis/redis-py/issues/3897">#3897</a>)</li>
<li>Fix RuntimeError in ClusterPubSub sharded message generator (<a
href="https://redirect.github.com/redis/redis-py/issues/3889">#3889</a>)</li>
<li>Fix async connection pool lock contention during connection
establishment (<a
href="https://redirect.github.com/redis/redis-py/issues/3885">#3885</a>)</li>
<li>Fix PubSub client health check handling for sync client
implementation (<a
href="https://redirect.github.com/redis/redis-py/issues/3870">#3870</a>)</li>
<li>Adding retries for the overall connect - socket connect + handshake.
Fix for pubsub reconnect issues. (<a
href="https://redirect.github.com/redis/redis-py/issues/3863">#3863</a>)</li>
<li>Adding special handling of client_tracking_on and
client_tracking_off for cluster clients. Marking those two functions as
deprecated for cluster - embedded client-side caching feature should be
used instead. (<a
href="https://redirect.github.com/redis/redis-py/issues/3858">#3858</a>)</li>
<li><a
href="https://redirect.github.com/redis/redis-py/issues/3618">#3618</a>
Fix client-side cache invalidation for mixed str and bytes Redis keys
(<a
href="https://redirect.github.com/redis/redis-py/issues/3766">#3766</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/redis/redis-py/commit/915e8b41d2bd3cb053f82dd4faa72a0ca55f2ce2"><code>915e8b4</code></a>
Updating server version to 7.2.0</li>
<li><a
href="https://github.com/redis/redis-py/commit/b41e47d76911563232e09a95c05ccc09c010def6"><code>b41e47d</code></a>
Added OTel instrumentation and metrics export for sync client (<a
href="https://redirect.github.com/redis/redis-py/issues/3954">#3954</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/9c8ad166a83929656fd00d52f65072890f7b7f1e"><code>9c8ad16</code></a>
Fix type hints for spop and srandmember methods (<a
href="https://redirect.github.com/redis/redis-py/issues/3943">#3943</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/34c73c783ec2e8ade103ad2d324630cff6a26d58"><code>34c73c7</code></a>
Add maintenance notifications support for OSS API cluster clients (<a
href="https://redirect.github.com/redis/redis-py/issues/3946">#3946</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/24974feafdcd1a03bc2254fbdfd028316106ab0e"><code>24974fe</code></a>
Renamed initial health check policies and unhealthy database argument
(<a
href="https://redirect.github.com/redis/redis-py/issues/3949">#3949</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/3d6b571e3df69c1ab0060e7a53fea7ac0c50a725"><code>3d6b571</code></a>
Reorganize pipeline actions (<a
href="https://redirect.github.com/redis/redis-py/issues/3951">#3951</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/877d7a2987ca388489fbe221df806e5cc9cc51a9"><code>877d7a2</code></a>
Disabled SCH in MultiDBClient underlying clients (<a
href="https://redirect.github.com/redis/redis-py/issues/3938">#3938</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/9ac9ee6ce13f4b292b1d2d3db81ef0f30afe29b4"><code>9ac9ee6</code></a>
Adding hotkeys commands support. (<a
href="https://redirect.github.com/redis/redis-py/issues/3924">#3924</a>)</li>
<li><a
href="https://github.com/redis/redis-py/commit/65623b7fad9833b5281d6ce7f44f62f942621234"><code>65623b7</code></a>
Extending the tests to validate more supported scorers for hybrid
search. Add...</li>
<li><a
href="https://github.com/redis/redis-py/commit/2b2f2cf5416862d15399f422c3658c0e1d671a10"><code>2b2f2cf</code></a>
Adds support for the new Idempotent Producers feature in Redis 8.6 (<a
href="https://redirect.github.com/redis/redis-py/issues/3926">#3926</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/redis/redis-py/compare/v7.1.1...v7.2.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Kennedy <65985482+jkennedyvz@users.noreply.github.com>
2026-02-17 10:13:43 -08:00
..
2025-05-15 17:39:14 -07:00

LangGraph Checkpoint

This library defines the base interface for LangGraph checkpointers. Checkpointers provide a persistence layer for LangGraph. They allow you to interact with and manage the graph's state. When you use a graph with a checkpointer, the checkpointer saves a checkpoint of the graph state at every superstep, enabling several powerful capabilities like human-in-the-loop, "memory" between interactions and more.

Key concepts

Checkpoint

Checkpoint is a snapshot of the graph state at a given point in time. Checkpoint tuple refers to an object containing checkpoint and the associated config, metadata and pending writes.

Thread

Threads enable the checkpointing of multiple different runs, making them essential for multi-tenant chat applications and other scenarios where maintaining separate states is necessary. A thread is a unique ID assigned to a series of checkpoints saved by a checkpointer. When using a checkpointer, you must specify a thread_id and optionally checkpoint_id when running the graph.

  • thread_id is simply the ID of a thread. This is always required.
  • checkpoint_id can optionally be passed. This identifier refers to a specific checkpoint within a thread. This can be used to kick off a run of a graph from some point halfway through a thread.

You must pass these when invoking the graph as part of the configurable part of the config, e.g.

{"configurable": {"thread_id": "1"}}  # valid config
{"configurable": {"thread_id": "1", "checkpoint_id": "0c62ca34-ac19-445d-bbb0-5b4984975b2a"}}  # also valid config

Serde

langgraph_checkpoint also defines protocol for serialization/deserialization (serde) and provides an default implementation (langgraph.checkpoint.serde.jsonplus.JsonPlusSerializer) that handles a wide variety of types, including LangChain and LangGraph primitives, datetimes, enums and more.

Pending writes

When a graph node fails mid-execution at a given superstep, LangGraph stores pending checkpoint writes from any other nodes that completed successfully at that superstep, so that whenever we resume graph execution from that superstep we don't re-run the successful nodes.

Interface

Each checkpointer should conform to langgraph.checkpoint.base.BaseCheckpointSaver interface and must implement the following methods:

  • .put - Store a checkpoint with its configuration and metadata.
  • .put_writes - Store intermediate writes linked to a checkpoint (i.e. pending writes).
  • .get_tuple - Fetch a checkpoint tuple using for a given configuration (thread_id and checkpoint_id).
  • .list - List checkpoints that match a given configuration and filter criteria.
  • .delete_thread() - Delete all checkpoints and writes associated with a thread.
  • .get_next_version() - Generate the next version ID for a channel.

If the checkpointer will be used with asynchronous graph execution (i.e. executing the graph via .ainvoke, .astream, .abatch), checkpointer must implement asynchronous versions of the above methods (.aput, .aput_writes, .aget_tuple, .alist). Similarly, the checkpointer must implement .adelete_thread() if asynchronous thread cleanup is desired. The base class provides a default implementation of .get_next_version() that generates an integer sequence starting from 1, but this method should be overridden for custom versioning schemes.

Usage

from langgraph.checkpoint.memory import InMemorySaver

write_config = {"configurable": {"thread_id": "1", "checkpoint_ns": ""}}
read_config = {"configurable": {"thread_id": "1"}}

checkpointer = InMemorySaver()
checkpoint = {
    "v": 4,
    "ts": "2024-07-31T20:14:19.804150+00:00",
    "id": "1ef4f797-8335-6428-8001-8a1503f9b875",
    "channel_values": {
      "my_key": "meow",
      "node": "node"
    },
    "channel_versions": {
      "__start__": 2,
      "my_key": 3,
      "start:node": 3,
      "node": 3
    },
    "versions_seen": {
      "__input__": {},
      "__start__": {
        "__start__": 1
      },
      "node": {
        "start:node": 2
      }
    },
}

# store checkpoint
checkpointer.put(write_config, checkpoint, {}, {})

# load checkpoint
checkpointer.get(read_config)

# list checkpoints
list(checkpointer.list(read_config))