Behavior for CLI adapters that drive different agent types.
Adapters encapsulate the specifics of how to:
- Start an agent
- Submit a query
- Wait for completion
- Extract the result
This keeps the Mix task clean and allows new agent types (CoT, ToT, etc.) to be added by implementing this behavior.
Built-in Adapters
Jido.AI.Reasoning.ReAct.CLIAdapter- ForJido.AI.AgentmodulesJido.AI.Reasoning.AlgorithmOfThoughts.CLIAdapter- ForJido.AI.AoTAgentagentsJido.AI.Reasoning.ChainOfDraft.CLIAdapter- For Chain-of-Draft agentsJido.AI.Reasoning.TreeOfThoughts.CLIAdapter- For Tree-of-Thoughts agentsJido.AI.Reasoning.ChainOfThought.CLIAdapter- For Chain-of-Thought agentsJido.AI.Reasoning.GraphOfThoughts.CLIAdapter- For Graph-of-Thoughts agentsJido.AI.Reasoning.TRM.CLIAdapter- For TRM (Tiny-Recursive-Model) agentsJido.AI.Reasoning.Adaptive.CLIAdapter- For Adaptive strategy agents (auto-selects reasoning approach)
Custom Agents
Agent modules can optionally implement cli_adapter/0 to specify their adapter:
defmodule MyApp.CustomAgent do
use Jido.AI.Agent, ...
def cli_adapter, do: Jido.AI.Reasoning.ReAct.CLIAdapter
endIf not implemented, the CLI will infer the adapter from --type or default to ReAct.
Summary
Callbacks
Wait for the agent to complete and return the result.
Create an ephemeral agent module with the given configuration. Returns the module name. Only called when --agent is not provided.
Start an agent and return its pid.
Stop the agent process.
Submit a query to the running agent.
Functions
Resolve the adapter module for an agent type or agent module.
Types
Callbacks
@callback await(pid(), timeout_ms :: non_neg_integer(), config()) :: {:ok, result()} | {:error, term()}
Wait for the agent to complete and return the result.
Create an ephemeral agent module with the given configuration. Returns the module name. Only called when --agent is not provided.
@callback start_agent(jido_instance :: atom(), agent_module :: module(), config()) :: {:ok, pid()} | {:error, term()}
Start an agent and return its pid.
@callback stop(pid()) :: :ok
Stop the agent process.
Submit a query to the running agent.