An LLM-powered agent that calls a language model to generate responses, handles tool calls, and loops until a final text response is produced.
This is the primary agent type in ADK Elixir.
Summary
Functions
Build the LLM request from the current context and agent config.
Clone an agent with optional overrides.
Compile the instruction string, merging global + agent instruction
and substituting {key} state variables.
Compute the full tool list including auto-generated transfer tools.
Find an agent by name in the tree, or raise with a helpful error.
Get all agent names in the agent tree for error reporting.
Create a new LLM agent.
Compute the list of agents this agent can transfer to.
Types
@type t() :: %ADK.Agent.LlmAgent{ _peer_agents: term(), after_tool_callback: (map(), map(), map(), any() -> any()) | nil, before_tool_callback: (map(), map(), map() -> {:cont, map()} | {:halt, any()}) | nil, context_compressor: keyword() | nil, description: String.t(), disallow_transfer_to_parent: boolean(), disallow_transfer_to_peers: boolean(), generate_config: map(), global_instruction: String.t() | nil, instruction: String.t() | (map() -> String.t()), max_iterations: pos_integer(), model: String.t(), name: String.t(), on_tool_error_callback: (map(), map(), map(), term() -> {:retry, any()} | {:fallback, any()} | {:error, any()}) | nil, output_key: atom() | String.t() | nil, output_schema: map() | nil, parent_agent: t() | nil, planner: struct() | nil, sub_agents: [map()], tools: [map()] }
Functions
@spec build_request(ADK.Context.t(), t()) :: map()
Build the LLM request from the current context and agent config.
Clone an agent with optional overrides.
@spec compile_instruction(ADK.Context.t(), t()) :: String.t()
Compile the instruction string, merging global + agent instruction
and substituting {key} state variables.
Compute the full tool list including auto-generated transfer tools.
Find an agent by name in the tree, or raise with a helpful error.
Get all agent names in the agent tree for error reporting.
Create a new LLM agent.
Applies any skills from the :skills option, builds the struct, and
wires parent/peer references for sub-agent transfer.
Compute the list of agents this agent can transfer to.
Includes sub-agents, parent (if not disallowed), and peer siblings (if not disallowed).