adk_graph_node (erlang_adk v0.7.0)

View Source

adk_graph_node - Helper functions for creating common graph nodes.

Erlang ADK graphs can contain various node types. This module provides builders for common node types to simplify graph construction.

Summary

Functions

Create a node that executes an agent. The agent will generate a response based on the current state (memory/events).

Create a node that executes a pure Erlang function on the state. Function should take a map (State) and return a map (StateDelta).

Create a node that executes pending tool calls.

Functions

agent_node(Name, Config, Tools)

-spec agent_node(Name :: binary(), Config :: map(), Tools :: [module()]) -> fun((map()) -> map()).

Create a node that executes an agent. The agent will generate a response based on the current state (memory/events).

function_node(Fun)

-spec function_node(Fun :: fun((map()) -> map())) -> fun((map()) -> map()).

Create a node that executes a pure Erlang function on the state. Function should take a map (State) and return a map (StateDelta).

tool_node(ToolsList)

-spec tool_node(ToolsList :: [module()]) -> fun((map()) -> map()).

Create a node that executes pending tool calls.