Skip to main content

Module graph

Module graph 

Source
Expand description

Graph-based orchestration with conditional routing, cycles, and fan-out/fan-in.

A Graph is a directed graph of GraphNodes connected by edges. Edges can be unconditional or conditional (predicate-based). Nodes return a NodeOutcome that controls the traversal.

Structs§

AgentNode
Wraps an Agent as a GraphNode. Reads state["input"] as the prompt, writes the response to state["output"], and returns NodeOutcome::Continue.
Edge
An edge connecting two nodes. Can be unconditional or conditional.
FnNode
A node built from an async closure.
Graph
A directed graph of nodes with conditional routing, cycle support, and fan-out/fan-in parallel execution.
GraphBuilder
Builder for constructing a Graph.
GraphContext
Shared state flowing through a graph. Nodes read and write entries.

Enums§

NodeOutcome
The outcome of a node’s execution, controlling graph traversal.

Traits§

GraphNode
A node in a Graph. Receives the shared context and returns an outcome.