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
    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
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphchannelsdeltaDeltaChannel
    Class●Since v1.1

    DeltaChannel

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

    Bases

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

    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
    |
    None
    =
    None
    )

    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 | None
    Default:None
    constructor
    __init__
    NameType
    reducerCallable[[Any, Sequence[Any]], Any]
    typtype[Value] | None
    snapshot_frequencyint | None
    attribute
    value: Any
    attribute
    reducer: reducer
    attribute
    snapshot_frequency: snapshot_frequency
    attribute
    typ: typ
    attribute
    ValueType: Any
    attribute
    UpdateType: Any
    method
    is_snapshot_step

    True if pregel should write a snapshot blob at this step.

    method
    copy
    method
    from_checkpoint

    Initialize from a stored blob or sentinel.

    Blob types (dispatched via serde ext code, not dict key inspection):

    • DELTA_SENTINEL / MISSING: start empty; caller replays writes.
    • _DeltaSnapshot(value): restore value directly from snapshot.
    • plain value (migration from old BinOp blobs): use directly.
    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 DELTA_SENTINEL.

    Snapshot decisions are made by create_checkpoint in pregel (which has the step number) via is_snapshot_step. checkpoint() is only called for non-snapshot steps or when no checkpointer is available.

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

    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_frequency=None (default): pure delta; stores only DELTA_SENTINEL in checkpoint blobs; reads replay all ancestor writes.

    snapshot_frequency=N: create_checkpoint writes a full _DeltaSnapshot blob every N steps, bounding replay depth to N.

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

    Every Nth pregel step writes a snapshot blob. None (default) = pure delta, never snapshot.