Final result from building and compiling a StateGraph.
Should not be instantiated directly, only using the StateGraph .compile()
instance method.
class CompiledStateGraphCompiledGraph<N, S, U, ExtractStateType<C>, ExtractUpdateType<I, ExtractStateType<I>>, ExtractStateType<O>, NodeReturnType, CommandInstance<InferInterruptResumeType<InterruptType>, Prettify<U>, N>, InferWriterType<WriterType>>Whether to automatically validate the graph structure when it is compiled. Defaults to true.
The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances
Optional checkpointer for persisting graph state. When provided, saves a checkpoint of the graph state at every superstep. When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.
The default configuration for graph execution, can be overridden on a per-invocation basis
Whether to enable debug logging. Defaults to false.
The description of the compiled graph. This is used by the supervisor agent to describe the handoff to the agent.
Optional array of node names or "all" to interrupt after executing these nodes. Used for implementing human-in-the-loop workflows.
Optional array of node names or "all" to interrupt before executing these nodes. Used for implementing human-in-the-loop workflows.
The name of the task, analogous to the node name in StateGraph.
The nodes in the graph, mapping node names to their PregelNode instances
Optional retry policy for handling failures in node execution
Optional timeout in milliseconds for the execution of each superstep
Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads
The streaming modes enabled for this graph. Defaults to ["values"]. Supported modes:
Execute multiple operations in a single batch. This is more efficient than executing operations individually.
Returns a drawable representation of the computation graph.
Gets the current state of the graph. Requires a checkpointer to be configured.
Gets the history of graph states. Requires a checkpointer to be configured. Useful for:
Gets all subgraphs within this graph asynchronously. A subgraph is a Pregel instance that is nested within a node of this graph.
Run the graph with a single input and config.
Create a new runnable sequence that runs each individual runnable in series, piping the output of one runnable into another runnable or runnable-like.
Streams the execution of the graph, emitting state updates as they occur. This is the primary method for observing graph execution in real-time.
Stream modes:
Updates the state of the graph with new values. Requires a checkpointer to be configured.
This method can be used for:
Validates the graph structure to ensure it is well-formed. Checks for:
Creates a new instance of the Pregel graph with updated configuration. This method follows the immutable pattern - instead of modifying the current instance, it returns a new instance with the merged configuration.
Returns a drawable representation of the computation graph.
Gets all subgraphs within this graph. A subgraph is a Pregel instance that is nested within a node of this graph.
Whether to automatically validate the graph structure when it is compiled. Defaults to true.
Optional cache for the graph, useful for caching tasks.
The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances
Optional checkpointer for persisting graph state.
The default configuration for graph execution, can be overridden on a per-invocation basis
Whether to enable debug logging. Defaults to false.
The input channels for the graph. These channels receive the initial input when the graph is invoked.
Optional array of node names or "all" to interrupt after executing these nodes.
Optional array of node names or "all" to interrupt before executing these nodes.
The name of the task, analogous to the node name in StateGraph.
The nodes in the graph, mapping node names to their PregelNode instances
The output channels for the graph. These channels contain the final output when the graph completes.
Optional retry policy for handling failures in node execution
Optional timeout in milliseconds for the execution of each superstep
Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads
Optional channels to stream. If not specified, all channels will be streamed.
The streaming modes enabled for this graph. Defaults to ["values"].
Execute multiple operations in a single batch.
Returns a drawable representation of the computation graph.
Returns a drawable representation of the computation graph.
Gets the current state of the graph.
Gets the history of graph states.
Gets all subgraphs within this graph.
Gets all subgraphs within this graph asynchronously.
Run the graph with a single input and config.
Create a new runnable sequence that runs each individual runnable in series,
Streams the execution of the graph, emitting state updates as they occur.
Updates the state of the graph with new values.
Validates the graph structure to ensure it is well-formed.
Creates a new instance of the Pregel graph with updated configuration.
Whether to automatically validate the graph structure when it is compiled. Defaults to true.
Optional cache for the graph, useful for caching tasks.
The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances
Optional checkpointer for persisting graph state.
The default configuration for graph execution, can be overridden on a per-invocation basis
Whether to enable debug logging. Defaults to false.
The input channels for the graph. These channels receive the initial input when the graph is invoked.
Optional array of node names or "all" to interrupt after executing these nodes.
Optional array of node names or "all" to interrupt before executing these nodes.
The name of the task, analogous to the node name in StateGraph.
The nodes in the graph, mapping node names to their PregelNode instances
The output channels for the graph. These channels contain the final output when the graph completes.
Optional retry policy for handling failures in node execution
Optional timeout in milliseconds for the execution of each superstep
Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads
Optional channels to stream. If not specified, all channels will be streamed.
The streaming modes enabled for this graph. Defaults to ["values"].
Execute multiple operations in a single batch.
Returns a drawable representation of the computation graph.
Returns a drawable representation of the computation graph.
Gets the current state of the graph.
Gets the history of graph states.
Gets all subgraphs within this graph.
Gets all subgraphs within this graph asynchronously.
Run the graph with a single input and config.
Create a new runnable sequence that runs each individual runnable in series,
Streams the execution of the graph, emitting state updates as they occur.
Updates the state of the graph with new values.
Validates the graph structure to ensure it is well-formed.
Creates a new instance of the Pregel graph with updated configuration.