Bumps the all-dependencies group in /libs/checkpoint with 2 updates: [langchain-core](https://github.com/langchain-ai/langchain) and [ruff](https://github.com/astral-sh/ruff). Updates `langchain-core` from 1.2.17 to 1.2.19 <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.19</h2> <p>Changes since langchain-core==1.2.18</p> <p>release(core): 1.2.19 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35832">#35832</a>) chore(core): move BaseCrossEncoder to langchain-core (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35809">#35809</a>) chore: bump tornado from 6.5.2 to 6.5.5 in /libs/core (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35775">#35775</a>)</p> <h2>langchain-core==1.2.18</h2> <p>Changes since langchain-core==1.2.17</p> <p>release(core): 1.2.18 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35704">#35704</a>) fix(core): fix double backticks in deprecation docstring for alternative_import (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35658">#35658</a>) fix(core): preserve default_factory when generating tool call schema (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35550">#35550</a>) feat(openai): support tool search (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35582">#35582</a>) chore: bump the minor-and-patch group across 3 directories with 7 updates (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35605">#35605</a>)</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/langchain-ai/langchain/commit/41cca203e633d8506b563f263b005cb52909300d"><code>41cca20</code></a> release(core): 1.2.19 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35832">#35832</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/307cdcac9e4e3d7cdcc86eeb3a4688b486f8e1d8"><code>307cdca</code></a> chore(core): move BaseCrossEncoder to langchain-core (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35809">#35809</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/cee6430b1cd2530cdebcdb8820ed4ebf700556a4"><code>cee6430</code></a> refactor(xai): remove redundant <code>lc_attributes</code> override (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35791">#35791</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/6b9b4c6546332346b787f337b92879fc9b6b530c"><code>6b9b4c6</code></a> feat(xai): support <code>base_url</code> alias and <code>XAI_API_BASE</code> env var (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35790">#35790</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/b676167707b9c8e27feef7e58a11edb0fe011703"><code>b676167</code></a> fix(deepseek): accept <code>base_url</code> as alias for <code>api_base</code> (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35789">#35789</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/5d9568b5f5a94ef21bee094f38694415e099ed73"><code>5d9568b</code></a> feat(model-profiles): new fields + <code>Makefile</code> target (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35788">#35788</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/1891d414beceeef8e23a05e9e8f6011ccbf4d8b2"><code>1891d41</code></a> chore: bump tornado from 6.5.2 to 6.5.5 in /libs/text-splitters (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35774">#35774</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/1d954bccfad779097f63688b324f82fed48f4c5e"><code>1d954bc</code></a> chore: bump tornado from 6.5.2 to 6.5.5 in /libs/langchain (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35773">#35773</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/261b1d57e40b8470673d923b925aeed58415bc59"><code>261b1d5</code></a> chore: bump tornado from 6.5.2 to 6.5.5 in /libs/core (<a href="https://redirect.github.com/langchain-ai/langchain/issues/35775">#35775</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/9521c679db9641912b97297d434adc8d000b5a9c"><code>9521c67</code></a> fix(openai): close PIL Image handles in token counting to prevent fd leak (<a href="https://redirect.github.com/langchain-ai/langchain/issues/3">#3</a>...</li> <li>Additional commits viewable in <a href="https://github.com/langchain-ai/langchain/compare/langchain-core==1.2.17...langchain-core==1.2.19">compare view</a></li> </ul> </details> <br /> Updates `ruff` from 0.15.5 to 0.15.6 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/releases">ruff's releases</a>.</em></p> <blockquote> <h2>0.15.6</h2> <h2>Release Notes</h2> <p>Released on 2026-03-12.</p> <h3>Preview features</h3> <ul> <li>Add support for <code>lazy</code> import parsing (<a href="https://redirect.github.com/astral-sh/ruff/pull/23755">#23755</a>)</li> <li>Add support for star-unpacking of comprehensions (PEP 798) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23788">#23788</a>)</li> <li>Reject semantic syntax errors for lazy imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23757">#23757</a>)</li> <li>Drop a few rules from the preview default set (<a href="https://redirect.github.com/astral-sh/ruff/pull/23879">#23879</a>)</li> <li>[<code>airflow</code>] Flag <code>Variable.get()</code> calls outside of task execution context (<code>AIR003</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23584">#23584</a>)</li> <li>[<code>airflow</code>] Flag runtime-varying values in DAG/task constructor arguments (<code>AIR304</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23631">#23631</a>)</li> <li>[<code>flake8-bugbear</code>] Implement <code>delattr-with-constant</code> (<code>B043</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23737">#23737</a>)</li> <li>[<code>flake8-tidy-imports</code>] Add <code>TID254</code> to enforce lazy imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23777">#23777</a>)</li> <li>[<code>flake8-tidy-imports</code>] Allow users to ban lazy imports with <code>TID254</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23847">#23847</a>)</li> <li>[<code>isort</code>] Retain <code>lazy</code> keyword when sorting imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23762">#23762</a>)</li> <li>[<code>pyupgrade</code>] Add <code>from __future__ import annotations</code> automatically (<code>UP006</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23260">#23260</a>)</li> <li>[<code>refurb</code>] Support <code>newline</code> parameter in <code>FURB101</code> for Python 3.13+ (<a href="https://redirect.github.com/astral-sh/ruff/pull/23754">#23754</a>)</li> <li>[<code>ruff</code>] Add <code>os-path-commonprefix</code> (<code>RUF071</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23814">#23814</a>)</li> <li>[<code>ruff</code>] Add unsafe fix for os-path-commonprefix (<code>RUF071</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23852">#23852</a>)</li> <li>[<code>ruff</code>] Limit <code>RUF036</code> to typing contexts; make it unsafe for non-typing-only (<a href="https://redirect.github.com/astral-sh/ruff/pull/23765">#23765</a>)</li> <li>[<code>ruff</code>] Use starred unpacking for <code>RUF017</code> in Python 3.15+ (<a href="https://redirect.github.com/astral-sh/ruff/pull/23789">#23789</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix <code>--add-noqa</code> creating unwanted leading whitespace (<a href="https://redirect.github.com/astral-sh/ruff/pull/23773">#23773</a>)</li> <li>Fix <code>--add-noqa</code> breaking shebangs (<a href="https://redirect.github.com/astral-sh/ruff/pull/23577">#23577</a>)</li> <li>[formatter] Fix lambda body formatting for multiline calls and subscripts (<a href="https://redirect.github.com/astral-sh/ruff/pull/23866">#23866</a>)</li> <li>[formatter] Preserve required annotation parentheses in annotated assignments (<a href="https://redirect.github.com/astral-sh/ruff/pull/23865">#23865</a>)</li> <li>[formatter] Preserve type-expression parentheses in the formatter (<a href="https://redirect.github.com/astral-sh/ruff/pull/23867">#23867</a>)</li> <li>[<code>flake8-annotations</code>] Fix stack overflow in <code>ANN401</code> on quoted annotations with escape sequences (<a href="https://redirect.github.com/astral-sh/ruff/pull/23912">#23912</a>)</li> <li>[<code>pep8-naming</code>] Check naming conventions in <code>match</code> pattern bindings (<code>N806</code>, <code>N815</code>, <code>N816</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23899">#23899</a>)</li> <li>[<code>perflint</code>] Fix comment duplication in fixes (<code>PERF401</code>, <code>PERF403</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23729">#23729</a>)</li> <li>[<code>pyupgrade</code>] Properly trigger <code>super</code> change in nested class (<code>UP008</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/22677">#22677</a>)</li> <li>[<code>ruff</code>] Avoid syntax errors in <code>RUF036</code> fixes (<a href="https://redirect.github.com/astral-sh/ruff/pull/23764">#23764</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-bandit</code>] Flag <code>S501</code> with <code>requests.request</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23873">#23873</a>)</li> <li>[<code>flake8-executable</code>] Fix WSL detection in non-Docker containers (<a href="https://redirect.github.com/astral-sh/ruff/pull/22879">#22879</a>)</li> <li>[<code>flake8-print</code>] Ignore <code>pprint</code> calls with <code>stream=</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23787">#23787</a>)</li> </ul> <h3>Documentation</h3> <ul> <li>Update docs for Markdown code block formatting (<a href="https://redirect.github.com/astral-sh/ruff/pull/23871">#23871</a>)</li> <li>[<code>flake8-bugbear</code>] Fix misleading description for <code>B904</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23731">#23731</a>)</li> </ul> <h3>Contributors</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's changelog</a>.</em></p> <blockquote> <h2>0.15.6</h2> <p>Released on 2026-03-12.</p> <h3>Preview features</h3> <ul> <li>Add support for <code>lazy</code> import parsing (<a href="https://redirect.github.com/astral-sh/ruff/pull/23755">#23755</a>)</li> <li>Add support for star-unpacking of comprehensions (PEP 798) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23788">#23788</a>)</li> <li>Reject semantic syntax errors for lazy imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23757">#23757</a>)</li> <li>Drop a few rules from the preview default set (<a href="https://redirect.github.com/astral-sh/ruff/pull/23879">#23879</a>)</li> <li>[<code>airflow</code>] Flag <code>Variable.get()</code> calls outside of task execution context (<code>AIR003</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23584">#23584</a>)</li> <li>[<code>airflow</code>] Flag runtime-varying values in DAG/task constructor arguments (<code>AIR304</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23631">#23631</a>)</li> <li>[<code>flake8-bugbear</code>] Implement <code>delattr-with-constant</code> (<code>B043</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23737">#23737</a>)</li> <li>[<code>flake8-tidy-imports</code>] Add <code>TID254</code> to enforce lazy imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23777">#23777</a>)</li> <li>[<code>flake8-tidy-imports</code>] Allow users to ban lazy imports with <code>TID254</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23847">#23847</a>)</li> <li>[<code>isort</code>] Retain <code>lazy</code> keyword when sorting imports (<a href="https://redirect.github.com/astral-sh/ruff/pull/23762">#23762</a>)</li> <li>[<code>pyupgrade</code>] Add <code>from __future__ import annotations</code> automatically (<code>UP006</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23260">#23260</a>)</li> <li>[<code>refurb</code>] Support <code>newline</code> parameter in <code>FURB101</code> for Python 3.13+ (<a href="https://redirect.github.com/astral-sh/ruff/pull/23754">#23754</a>)</li> <li>[<code>ruff</code>] Add <code>os-path-commonprefix</code> (<code>RUF071</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23814">#23814</a>)</li> <li>[<code>ruff</code>] Add unsafe fix for os-path-commonprefix (<code>RUF071</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23852">#23852</a>)</li> <li>[<code>ruff</code>] Limit <code>RUF036</code> to typing contexts; make it unsafe for non-typing-only (<a href="https://redirect.github.com/astral-sh/ruff/pull/23765">#23765</a>)</li> <li>[<code>ruff</code>] Use starred unpacking for <code>RUF017</code> in Python 3.15+ (<a href="https://redirect.github.com/astral-sh/ruff/pull/23789">#23789</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix <code>--add-noqa</code> creating unwanted leading whitespace (<a href="https://redirect.github.com/astral-sh/ruff/pull/23773">#23773</a>)</li> <li>Fix <code>--add-noqa</code> breaking shebangs (<a href="https://redirect.github.com/astral-sh/ruff/pull/23577">#23577</a>)</li> <li>[formatter] Fix lambda body formatting for multiline calls and subscripts (<a href="https://redirect.github.com/astral-sh/ruff/pull/23866">#23866</a>)</li> <li>[formatter] Preserve required annotation parentheses in annotated assignments (<a href="https://redirect.github.com/astral-sh/ruff/pull/23865">#23865</a>)</li> <li>[formatter] Preserve type-expression parentheses in the formatter (<a href="https://redirect.github.com/astral-sh/ruff/pull/23867">#23867</a>)</li> <li>[<code>flake8-annotations</code>] Fix stack overflow in <code>ANN401</code> on quoted annotations with escape sequences (<a href="https://redirect.github.com/astral-sh/ruff/pull/23912">#23912</a>)</li> <li>[<code>pep8-naming</code>] Check naming conventions in <code>match</code> pattern bindings (<code>N806</code>, <code>N815</code>, <code>N816</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23899">#23899</a>)</li> <li>[<code>perflint</code>] Fix comment duplication in fixes (<code>PERF401</code>, <code>PERF403</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23729">#23729</a>)</li> <li>[<code>pyupgrade</code>] Properly trigger <code>super</code> change in nested class (<code>UP008</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/22677">#22677</a>)</li> <li>[<code>ruff</code>] Avoid syntax errors in <code>RUF036</code> fixes (<a href="https://redirect.github.com/astral-sh/ruff/pull/23764">#23764</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-bandit</code>] Flag <code>S501</code> with <code>requests.request</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23873">#23873</a>)</li> <li>[<code>flake8-executable</code>] Fix WSL detection in non-Docker containers (<a href="https://redirect.github.com/astral-sh/ruff/pull/22879">#22879</a>)</li> <li>[<code>flake8-print</code>] Ignore <code>pprint</code> calls with <code>stream=</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23787">#23787</a>)</li> </ul> <h3>Documentation</h3> <ul> <li>Update docs for Markdown code block formatting (<a href="https://redirect.github.com/astral-sh/ruff/pull/23871">#23871</a>)</li> <li>[<code>flake8-bugbear</code>] Fix misleading description for <code>B904</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/23731">#23731</a>)</li> </ul> <h3>Contributors</h3> <ul> <li><a href="https://github.com/zsol"><code>@zsol</code></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/astral-sh/ruff/commit/e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675"><code>e4c7f35</code></a> Bump 0.15.6 (<a href="https://redirect.github.com/astral-sh/ruff/issues/23919">#23919</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/edfe6c17a493669227da45ce7edc786208d9d0b0"><code>edfe6c1</code></a> [ty] Narrow type context during collection literal inference (<a href="https://redirect.github.com/astral-sh/ruff/issues/23844">#23844</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/dd16d689abd9d0fa1caf4316e70479fd422b6142"><code>dd16d68</code></a> Exclude broken symlink in ecosystem check (<a href="https://redirect.github.com/astral-sh/ruff/issues/23921">#23921</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/3f94c6ac6397cdc3160459d9d6e3892e3f3242dd"><code>3f94c6a</code></a> Fix stack overflow in ANN401 on quoted annotations with escape sequences (<a href="https://redirect.github.com/astral-sh/ruff/issues/23">#23</a>...</li> <li><a href="https://github.com/astral-sh/ruff/commit/91fc7bd3f936974d7107ba8fd0668bc251a55c58"><code>91fc7bd</code></a> [ty] Fix false-positive diagnostics for PEP-604 union annotations on attribut...</li> <li><a href="https://github.com/astral-sh/ruff/commit/04229cffb44dfe8c64a0879eb3cea472a08d1565"><code>04229cf</code></a> [ty] Initial test suite for PEP-728 <code>TypedDict</code> features (<a href="https://redirect.github.com/astral-sh/ruff/issues/23832">#23832</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/728b9d6fd300d492fc2572bcfade170141296f97"><code>728b9d6</code></a> [<code>pep8-naming</code>] Check naming conventions in <code>match</code> pattern bindings (<code>N806</code>,...</li> <li><a href="https://github.com/astral-sh/ruff/commit/88d1eecd261679fc9d1d10f30d814230a7f28513"><code>88d1eec</code></a> [ty] Ensure a <code>type[]</code> type <code>T</code> is always considered assignable to a union th...</li> <li><a href="https://github.com/astral-sh/ruff/commit/37cdd61406ad4965847c9baa7c3f6ca633887d68"><code>37cdd61</code></a> Fix lambda body formatting for multiline calls and subscripts (<a href="https://redirect.github.com/astral-sh/ruff/issues/23866">#23866</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/a25a4df54aca67d23b4867ddad634fe0768fd6a2"><code>a25a4df</code></a> [ty] Disambiguate duplicate-looking overloaded callables in union display (<a href="https://redirect.github.com/astral-sh/ruff/issues/2">#2</a>...</li> <li>Additional commits viewable in <a href="https://github.com/astral-sh/ruff/compare/0.15.5...0.15.6">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>
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_idis simply the ID of a thread. This is always required.checkpoint_idcan 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_idandcheckpoint_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))