LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphchannelsdeltaDeltaChannel
    Class●Since v1.2

    DeltaChannel

    Copy
    DeltaChannel(
      self,
      reducer: Callable[[Any, Sequence[Any]], Any],
      typ: type

    Bases

    Generic[Value]BaseChannel[Any, Any, Any]

    Used in Docs

    • LangGraph runtime

    Constructors

    Attributes

    Methods

    Inherited fromBaseChannel

    Attributes

    Akey: key

    Methods

    Mconsume
    —

    Notify the channel that a subscribed task ran.

    Mfinish
    —

    Notify the channel that the Pregel run is finishing.

    View source on GitHub
    [
    Value
    ]
    |
    None
    =
    None
    ,
    *
    ,
    snapshot_frequency
    :
    int
    =
    1000
    )

    Parameters

    NameTypeDescription
    reducer*Callable[[Any, Sequence[Any]], Any]

    (state, list[writes]) -> new_state. Must be deterministic and batching-invariant as described above.

    typtype[Value] | None
    Default:None
    snapshot_frequencyint
    Default:1000
    constructor
    __init__
    NameType
    reducerCallable[[Any, Sequence[Any]], Any]
    typtype[Value] | None
    snapshot_frequencyint
    attribute
    value: Any
    attribute
    reducer: reducer
    attribute
    snapshot_frequency: snapshot_frequency
    attribute
    typ: typ
    attribute
    ValueType: Any
    attribute
    UpdateType: Any
    method
    copy
    method
    from_checkpoint

    Initialize from a stored blob.

    method
    replay_writes

    Apply ancestor writes oldest-to-newest via a single reducer call.

    If any write is an Overwrite, the last one in the sequence acts as the reset point: its value becomes the new base and only writes after it are passed to the reducer.

    method
    update
    method
    get
    method
    is_available
    method
    checkpoint

    Return stored representation: always MISSING.

    Snapshot decisions live in create_checkpoint (which has the channel version) and write _DeltaSnapshot(ch.get()) directly into channel_values. For non-snapshot steps the channel does not appear in channel_values; reconstruction walks ancestor writes via the saver's get_delta_channel_history.

    Reducer channel that stores only a sentinel in checkpoint blobs and reconstructs state by replaying ancestor writes through the reducer.

    Beta

    DeltaChannel is in beta. The API and on-disk representation may change in future releases. Threads written with DeltaChannel today are expected to remain readable, but the surrounding contract (BaseCheckpointSaver.get_delta_channel_history, the _DeltaSnapshot blob shape, the counters_since_delta_snapshot metadata field) is not yet stable.

    The reducer receives the current accumulated value and a batch of writes in one call: reducer(state, [write1, write2, ...]) -> new_state.

    Reducers must be deterministic and batching-invariant (associative across folds): applying two consecutive write batches separately must produce the same state as applying their concatenation once:

    reducer(reducer(state, xs), ys) == reducer(state, xs + ys)
    

    This lets LangGraph replay checkpointed writes in larger batches than they were originally produced without changing reconstructed state.

    Snapshot cadence is driven by two counters: per-channel update count and total supersteps since last snapshot. create_checkpoint writes a full _DeltaSnapshot blob when EITHER the update count reaches snapshot_frequency OR the supersteps count reaches the system-wide DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT bound (default 5000), bounding replay depth even for channels that stop receiving writes.

    The value type (e.g. list, dict). Inferred automatically from the outer type when used inside Annotated[T, DeltaChannel(...)].

    Every Nth update to this channel writes a snapshot blob (default 1000). Must be a positive int.