graph LR
Pregel["Pregel"]
_loop["_loop"]
_algo["_algo"]
StateGraph["StateGraph"]
BaseCheckpointSaver["BaseCheckpointSaver"]
BaseChannel["BaseChannel"]
_runner["_runner"]
_executor["_executor"]
Pregel -- "drives" --> _loop
Pregel -- "relies on" --> StateGraph
_loop -- "delegates to" --> _algo
_loop -- "utilizes" --> BaseCheckpointSaver
_loop -- "dispatches to" --> _runner
_loop -- "interacts with" --> BaseChannel
_algo -- "interacts with" --> BaseChannel
_algo -- "receives context from" --> _loop
StateGraph -- "provides topology to" --> Pregel
_runner -- "utilizes" --> _executor
The langgraph.pregel subsystem orchestrates the execution of agentic workflows defined as state graphs. The central component, Pregel, acts as the primary entry point, managing the overall iterative execution. It relies on StateGraph to understand the workflow's topology, including its nodes and transitions. The core iterative process is managed by _loop, which coordinates "supersteps" of the Pregel algorithm. Within each superstep, _algo applies state updates and determines the next set of tasks to execute, interacting closely with BaseChannel for data flow. Individual node execution is handled by _runner, which dispatches tasks to _executor for concrete computation. BaseCheckpointSaver ensures the persistence and fault tolerance of the graph's state across these iterations. This architecture promotes a clear separation of concerns, with Pregel as the high-level orchestrator, _loop managing the iterative flow, _algo handling state transitions, and _runner/_executor responsible for task execution, all supported by robust state management and communication channels.
The public interface and primary orchestrator of the Pregel execution engine. It serves as the entry point for users, handling graph initialization, validation, and driving the overall iterative execution flow.
Related Classes/Methods:
Manages the iterative execution of the Pregel algorithm's "supersteps." It coordinates the flow of control and data between these steps, processes channel writes, emits events, and interacts with the checkpointing system to ensure state persistence.
Related Classes/Methods:
Implements the fundamental Pregel logic within each superstep. It applies channel writes to the graph's state and determines which tasks (nodes) should be executed in the subsequent superstep based on the current state and the graph's topology.
Related Classes/Methods:
Defines the structure of the agentic workflow, including its nodes (agents/steps) and edges (transitions). It provides the underlying graph topology that the Pregel engine traverses and executes.
Related Classes/Methods:
An abstract component responsible for persisting and retrieving the execution state of the graph. It enables long-running, stateful workflows and provides fault tolerance by allowing the engine to resume from a saved state.
Related Classes/Methods:
Provides the mechanism for communication and state propagation between nodes within the Pregel execution model. It acts as a conduit for data flow and state updates across supersteps.
Related Classes/Methods:
Orchestrates the execution of individual nodes or tasks within a specific superstep, acting as an intermediary between the _loop and the actual task execution logic.
Related Classes/Methods:
Executes the concrete logic of individual nodes or agents as determined by the _runner. This component is responsible for invoking the actual computational units of the graph.
Related Classes/Methods: