Bumps the minor-and-patch 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.20 to 1.2.22 <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.22</h2> <p>Changes since langchain-core==1.2.21</p> <p>release(core): 1.2.22 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36201">#36201</a>) fix(core): validate paths in <code>prompt.save</code> and <code>load_prompt</code>, deprecate methods (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36200">#36200</a>)</p> <h2>langchain-core==1.2.21</h2> <p>Changes since langchain-core==1.2.20</p> <p>release(core): 1.2.21 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36179">#36179</a>) fix(core,model-profiles): add missing <code>ModelProfile</code> fields, warn on schema drift (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36129">#36129</a>) chore(core): remove stale blockbuster allowlist for deleted context module (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36168">#36168</a>) ci: suppress pytest streaming output in CI (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36092">#36092</a>)</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/langchain-ai/langchain/commit/d22df94537e4267f72dc1bbfc8e3849baf20d9f7"><code>d22df94</code></a> release(core): 1.2.22 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36201">#36201</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/27add913474e01e33bededf4096151130ba0d47c"><code>27add91</code></a> fix(core): validate paths in <code>prompt.save</code> and <code>load_prompt</code>, deprecate metho...</li> <li><a href="https://github.com/langchain-ai/langchain/commit/7563fceb40ce31165524f3f57ec65e487c02b1a7"><code>7563fce</code></a> chore(model-profiles): refresh model profile data (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36195">#36195</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/3e64c255b84b283b3a65216b19b9838734258c96"><code>3e64c25</code></a> chore: use repo permissions instead of org membership for maintainer override...</li> <li><a href="https://github.com/langchain-ai/langchain/commit/1778b082ecd64a9dedd48674d874ca1bfcbe4c7d"><code>1778b08</code></a> chore(partners): bump <code>langchain-core</code> min to <code>1.2.21</code> (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36183">#36183</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/ad574fce0d52740c249b0db7bde871d779ffb93d"><code>ad574fc</code></a> fix(openai): bump min core version (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36180">#36180</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/19f81cf6f1d73f7adf156491ba0617497a526b8c"><code>19f81cf</code></a> release(core): 1.2.21 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36179">#36179</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/6d07ef28a7023dc7b832fe52862f7a6fc0a187f3"><code>6d07ef2</code></a> release(openai): 1.1.12 (<a href="https://redirect.github.com/langchain-ai/langchain/issues/36178">#36178</a>)</li> <li><a href="https://github.com/langchain-ai/langchain/commit/2f64d80cc65091985873c339ca76a59af7baf739"><code>2f64d80</code></a> fix(core,model-profiles): add missing <code>ModelProfile</code> fields, warn on schema d...</li> <li><a href="https://github.com/langchain-ai/langchain/commit/5ffece5c033365baf4a3df52ffed5c6bfbed27ee"><code>5ffece5</code></a> chore(core): remove stale blockbuster allowlist for deleted context module (#...</li> <li>Additional commits viewable in <a href="https://github.com/langchain-ai/langchain/compare/langchain-core==1.2.20...langchain-core==1.2.22">compare view</a></li> </ul> </details> <br /> Updates `redis` from 7.3.0 to 7.4.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.4.0</h2> <h1>Changes</h1> <h2>🐛 Bug Fixes</h2> <ul> <li>Fix AttributeError in cluster metrics recording when connection is None or ClusterNode object instance is used to extract the connection info (<a href="https://redirect.github.com/redis/redis-py/issues/3999">#3999</a>)</li> <li>Fixing security concern in <strong>repr</strong> methods for ConnectionPools - passwords might leak in plain text logs (<a href="https://redirect.github.com/redis/redis-py/issues/3998">#3998</a>)</li> <li>Refactored connection count and SCH metric collection (<a href="https://redirect.github.com/redis/redis-py/issues/4001">#4001</a>)</li> </ul> <h2>🧪 Experimental Features</h2> <p>-Refactored health check logic for MultiDBClient (<a href="https://redirect.github.com/redis/redis-py/issues/3994">#3994</a>)</p> <h2>🧰 Maintenance</h2> <ul> <li>Expose basic Otel classes and functions to be importable through redis.observability to match the examples in the readthedocs (<a href="https://redirect.github.com/redis/redis-py/issues/3996">#3996</a>)</li> </ul> <p>We'd like to thank all the contributors who worked on this release! <a href="https://github.com/vladvildanov"><code>@vladvildanov</code></a> <a href="https://github.com/petyaslavova"><code>@petyaslavova</code></a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/redis/redis-py/commit/b72f24ad6a2226d46aed770e18094a86117d2217"><code>b72f24a</code></a> Updating lib version to 7.4.0</li> <li><a href="https://github.com/redis/redis-py/commit/0a4e0afe36504c3fb6df1e38683ea946febac9d3"><code>0a4e0af</code></a> Refactored health check logic for MultiDBClient (<a href="https://redirect.github.com/redis/redis-py/issues/3994">#3994</a>)</li> <li><a href="https://github.com/redis/redis-py/commit/15492c9156d3ab8dce05360977480510cf24fbf9"><code>15492c9</code></a> Refactored connection count and SCH metric collection (<a href="https://redirect.github.com/redis/redis-py/issues/4001">#4001</a>)</li> <li><a href="https://github.com/redis/redis-py/commit/cd964ac96649df872a051835e9a52e05a5090607"><code>cd964ac</code></a> Expose basic Otel classes and funtions to be importable through redis.observa...</li> <li><a href="https://github.com/redis/redis-py/commit/46ab74d02ed9b15176f67edb817de83524f8145a"><code>46ab74d</code></a> Fixing security concern in <strong>repr</strong> methods for ConnectionPools - passwords m...</li> <li><a href="https://github.com/redis/redis-py/commit/26482dbaae38abdb1966d9b1c803331e2dab2053"><code>26482db</code></a> Fix AttributeError in cluster metrics recording when connection is None or Cl...</li> <li>See full diff in <a href="https://github.com/redis/redis-py/compare/v7.3.0...v7.4.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>
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))