adk_graph (erlang_adk v0.2.5)
View Sourceadk_graph - Graph-based workflow engine for Erlang ADK.
This module allows constructing stateful execution graphs where nodes can be agents, functions, or sub-graphs, and edges define the conditional routing.
Summary
Functions
Add a conditional edge that decides the next node based on state.
Add a deterministic edge from one node to another.
Add a computation node to the graph.
Compile the graph, verifying it is well-formed.
Initialize a new, empty graph.
Execute the compiled graph with an initial state.
Execute with a configurable safety bound for cyclic graphs.
Set the entry point (starting node) of the graph.
Types
Functions
-spec add_conditional_edge(Graph :: graph(), From :: node_name(), ConditionFn :: edge_condition()) -> graph().
Add a conditional edge that decides the next node based on state.
Add a deterministic edge from one node to another.
Add a computation node to the graph.
-spec compile(Graph :: graph()) -> {ok, compiled_graph()} | {error, term()}.
Compile the graph, verifying it is well-formed.
-spec new() -> graph().
Initialize a new, empty graph.
-spec run(CompiledGraph :: compiled_graph(), InitialState :: map()) -> {ok, map()} | {error, term()}.
Execute the compiled graph with an initial state.
-spec run(CompiledGraph :: compiled_graph(), InitialState :: map(), Opts :: map()) -> {ok, map()} | {error, term()}.
Execute with a configurable safety bound for cyclic graphs.
Set the entry point (starting node) of the graph.