- class langgraph_agent_toolkit.agents.components.checkpoint.empty.NoOpSaver(*, serde=None)[source][source]
Bases:
BaseCheckpointSaverA fake checkpointer that implements the BaseCheckpointSaver interface but doesn’t actually persist anything.
All operations are no-ops. This is useful for: - Testing without persistence - Running graphs without memory between executions - Situations where you want the graph structure but no state saving
- Parameters:
serde (SerializerProtocol)
- __init__(*, serde=None)[source][source]
- Parameters:
serde (SerializerProtocol | None)
- Return type:
None
- get(config)[source][source]
Return None - no checkpoint exists.
- Parameters:
config (RunnableConfig)
- Return type:
Checkpoint | None
- get_tuple(config)[source][source]
Return None - no checkpoint tuple exists.
- Parameters:
config (RunnableConfig)
- Return type:
CheckpointTuple | None
- list(config, *, filter=None, before=None, limit=None)[source][source]
Return an empty iterator - no checkpoints exist.
- put(config, checkpoint, metadata, new_versions)[source][source]
Pretend to save but not actually persist anything.
Return a config with a fake checkpoint_id to satisfy the interface.
- put_writes(config, writes, task_id, task_path='')[source][source]
Do nothing - no writes are persisted.
- async aget(config)[source][source]
Async version - always return None.
- Parameters:
config (RunnableConfig)
- Return type:
Checkpoint | None
- async aget_tuple(config)[source][source]
Async version - always return None.
- Parameters:
config (RunnableConfig)
- Return type:
CheckpointTuple | None
- async alist(config, *, filter=None, before=None, limit=None)[source][source]
Async version - always return an empty iterator.
- async aput(config, checkpoint, metadata, new_versions)[source][source]
Async version - pretend to save but not persist.
- async aput_writes(config, writes, task_id, task_path='')[source][source]
Async version - do nothing.
- async acopy_thread(source_thread_id, target_thread_id)[source]
Asynchronously copy all checkpoints and writes from one thread to another.
- Parameters:
- Return type:
None
!!! warning “DeltaChannel”
See copy_thread — the copy must carry the complete parent chain (or at least back to a _DeltaSnapshot ancestor for every DeltaChannel) so the target thread can reconstruct delta state.
- async adelete_for_runs(run_ids)[source]
Asynchronously delete all checkpoints and writes for the given run IDs.
- Parameters:
run_ids (Sequence[str]) – The run IDs whose checkpoints should be deleted.
- Return type:
None
!!! warning “DeltaChannel”
See delete_for_runs — deleting rows a still-live thread’s DeltaChannel reconstruction depends on (writes between the head and its nearest _DeltaSnapshot ancestor) will silently corrupt that channel’s state.
- async adelete_thread(thread_id)[source]
Delete all checkpoints and writes associated with a specific thread ID.
- Parameters:
thread_id (str) – The thread ID whose checkpoints should be deleted.
- Return type:
None
- async aget_delta_channel_history(*, config, channels)[source]
Async version of get_delta_channel_history.
!!! warning “Beta”
This method is part of the DeltaChannel support surface and is in beta. See get_delta_channel_history for caveats.
- async aprune(thread_ids, *, strategy='keep_latest')[source]
Asynchronously prune checkpoints for the given threads.
- Parameters:
- Return type:
None
!!! warning “DeltaChannel”
See prune for the full DeltaChannel caveat. In short: “keep_latest” must not drop ancestor checkpoints / writes that sit between the kept checkpoint and the nearest _DeltaSnapshot ancestor, or delta channels will silently reconstruct as empty.
- property config_specs: list
Define the configuration options for the checkpoint saver.
- Returns:
List of configuration field specs.
- Return type:
- copy_thread(source_thread_id, target_thread_id)[source]
Copy all checkpoints and writes from one thread to another.
- Parameters:
- Return type:
None
!!! warning “DeltaChannel”
Implementations must copy the complete parent chain (all ancestor checkpoints and their checkpoint_writes) — copying only the head checkpoint will leave the target thread with DeltaChannel state that cannot be reconstructed (no path back to a _DeltaSnapshot ancestor). Equivalently, the copy must include enough ancestors that every DeltaChannel-backed key has either a _DeltaSnapshot in channel_values somewhere in the chain, or a complete write history back to the chain root.
- delete_for_runs(run_ids)[source]
Delete all checkpoints and writes associated with the given run IDs.
- Parameters:
run_ids (Sequence[str]) – The run IDs whose checkpoints should be deleted.
- Return type:
None
!!! warning “DeltaChannel”
Deleting a run that produced ancestor checkpoint_writes — or the only _DeltaSnapshot blob — for a still-live thread will break reconstruction of any DeltaChannel whose history depended on those rows. See the DeltaChannel note on prune for safe-recovery strategies.
- delete_thread(thread_id)[source]
Delete all checkpoints and writes associated with a specific thread ID.
- Parameters:
thread_id (str) – The thread ID whose checkpoints should be deleted.
- Return type:
None
- get_delta_channel_history(*, config, channels)[source]
Walk the parent chain returning per-channel writes + seed.
!!! warning “Beta”
This method is part of the DeltaChannel support surface and is in beta. The signature, return shape (DeltaChannelHistory), and interaction with _DeltaSnapshot blobs may change. Override at your own risk; the default implementation will continue to work against the public BaseCheckpointSaver contract.
For each requested channel, walks ancestors of the checkpoint identified by config (following parent_config) and accumulates pending_writes for that channel. The walk terminates per-channel at the nearest ancestor whose channel_values[ch] is populated; that value is returned as seed. If the walk reaches the root without finding a stored value, seed is omitted from that channel’s entry — the consumer treats the absence as “start empty.”
Walks the parent chain (not list(before=…)): for forked threads, only on-path ancestors contribute.
The default implementation walks get_tuple + parent_config once for all channels — each ancestor visited once, not once per channel. Savers with direct storage access (InMemorySaver, PostgresSaver) override for performance; the return contract is fixed here.
- get_next_version(current, channel)[source]
Generate the next version ID for a channel.
Default is to use integer versions, incrementing by 1.
If you override, you can use str/int/float versions, as long as they are monotonically increasing.
- Parameters:
current (V | None) – The current version identifier (int, float, or str).
channel (None) – Deprecated argument, kept for backwards compatibility.
- Returns:
The next version identifier, which must be increasing.
- Return type:
V
- prune(thread_ids, *, strategy='keep_latest')[source]
Prune checkpoints for the given threads.
- Parameters:
- Return type:
None
!!! warning “DeltaChannel”
Custom implementations must be DeltaChannel-aware. DeltaChannel stores only a sentinel in channel_values for non-snapshot steps; reconstruction walks the parent chain via get_delta_channel_history, accumulating rows from checkpoint_writes until it reaches an ancestor whose channel_values contains a _DeltaSnapshot blob (written every snapshot_frequency updates).
A naive “keep_latest” that drops intermediate checkpoints and their writes can sever that chain: the surviving “latest” checkpoint is rarely a snapshot point itself, so its delta channels would silently reconstruct as empty (no error raised — get_delta_channel_history simply returns no seed). Safe options when the graph uses DeltaChannel:
Walk back from each kept checkpoint and preserve every ancestor (plus its checkpoint_writes) up to the nearest one whose channel_values already contains a _DeltaSnapshot for every DeltaChannel-backed key.
Force a fresh snapshot on the kept checkpoint before deleting ancestors — rewrite channel_values[k] = _DeltaSnapshot(value) for each delta channel k (resolving value via the existing ancestor walk first), then prune.
Skip pruning threads whose graph uses DeltaChannel until one of the above is implemented.
- serde: SerializerProtocol = <langgraph.checkpoint.serde.jsonplus.JsonPlusSerializer object>
- with_allowlist(extra_allowlist)[source]
Return a shallow clone with a derived msgpack allowlist.
- Parameters:
extra_allowlist (Collection[tuple[str, ...]])
- Return type:
BaseCheckpointSaver[V]