AI integration layer for the Jido ecosystem - LLM orchestration and reasoning strategies for building intelligent agents in Elixir.
Jido.AI provides a comprehensive toolkit for building intelligent agents with LLMs. It implements proven reasoning strategies for tool use, multi-step reasoning, and complex planning - all designed to get better results from language models.
# Quick example: `Jido.AI.Agent` with tool use
defmodule MyApp.Agent do
use Jido.AI.Agent,
name: "my_agent",
tools: [MyApp.Actions.Calculator, MyApp.Actions.Search],
model: :fast
end
{:ok, pid} = Jido.AgentServer.start(agent: MyApp.Agent)
{:ok, response} = MyApp.Agent.ask_sync(pid, "What is 15 * 23?")def deps do
[
{:jido, "~> 2.0"},
{:jido_ai, "~> 2.0.0-beta"}
]
endConfigure model aliases and LLM provider credentials (see Configuration Reference):
# config/config.exs
config :jido_ai,
model_aliases: %{
fast: "anthropic:claude-haiku-4-5",
capable: "anthropic:claude-sonnet-4-20250514"
}
config :req_llm,
anthropic_api_key: System.get_env("ANTHROPIC_API_KEY"),
openai_api_key: System.get_env("OPENAI_API_KEY")Strategies are agent patterns that determine how an LLM approaches a problem. They are the foundation of building intelligent agents with Jido.AI.
| Strategy | Pattern | Best For |
|---|---|---|
| Chain-of-Draft | Minimal intermediate drafts | Low-latency multi-step reasoning |
| ReAct | Reason-Act loop | Tool-using agents |
| Chain-of-Thought | Sequential reasoning | Multi-step problems |
| Algorithm-of-Thoughts | Single-query algorithmic search | Structured exploration with explicit finalization |
| Tree-of-Thoughts | Explore multiple paths | Complex planning |
| Graph-of-Thoughts | Networked reasoning | Interconnected concepts |
| TRM | Recursive self-supervision | Iterative refinement |
| Adaptive | Strategy selection | Variable problem types |
When to use which strategy:
- Chain-of-Draft - For concise reasoning with lower token/latency overhead
- ReAct - When your agent needs to use tools or APIs
- Chain-of-Thought - For multi-step reasoning and math problems
- Algorithm-of-Thoughts - For one-pass exploration with explicit
answer:finalization - Tree-of-Thoughts - When exploring multiple solution paths is beneficial
- Graph-of-Thoughts - For problems with interconnected concepts
- TRM - For iterative improvement loops
- Adaptive - When you need dynamic strategy selection based on the problem
# `Jido.AI.Agent` with tools
defmodule MyApp.Agent do
use Jido.AI.Agent,
name: "my_agent",
tools: [MyApp.Actions.Calculator, MyApp.Actions.Search],
model: :fast
end
# Chain-of-Thought agent for step-by-step reasoning
defmodule MyApp.Reasoner do
use Jido.AI.CoTAgent,
name: "reasoner",
model: :fast
end
{:ok, pid} = Jido.AgentServer.start(agent: MyApp.Reasoner)
{:ok, result} = MyApp.Reasoner.think_sync(pid, "Solve: 3 cats catch 3 mice in 3 minutes...")- Package Overview (Production Map) - Prioritized feature map and runtime architecture
- Migration Guide: Plugins And Signals (v2 -> v3) - Breaking-change module/signal mapping
- Getting Started - First working agent in minutes
- Strategy Selection Playbook - Choose CoD/CoT/ReAct/AoT/ToT/GoT/TRM/Adaptive
- First Agent - Tool-using
Jido.AI.Agentwith request handles - Request Lifecycle And Concurrency -
ask/awaitand concurrent safety - Thread Context And Message Projection - Multi-turn context management
- Tool Calling With Actions - Adapt
Jido.Actionmodules as tools - Observability Basics - Telemetry events and normalization
- CLI Workflows - Interactive, one-shot, and batch CLI usage
- Architecture And Runtime Flow - Query to runtime lifecycle
- Strategy Internals - Extending strategy adapters safely
- Directives Runtime Contract - Runtime side-effect semantics
- Signals, Namespaces, Contracts - Canonical event contracts
- Plugins And Actions Composition - Lifecycle and action composition
- Skills System - Load/register/use skills
- Security And Validation - Input and error hardening
- Error Model And Recovery - Retry and failure policy
- Actions Catalog - Built-in action inventory
- Configuration Reference - Defaults and config keys
lib/examples/README.md- Full examples index (agents, scripts, skills, strategies)lib/examples/strategies/react_agent.md- ReAct strategy exampleexamples/strategies/chain_of_draft.md- Chain-of-Draft examplelib/examples/strategies/chain_of_thought.md- Chain-of-Thought exampleexamples/strategies/algorithm_of_thoughts.md- Algorithm-of-Thoughts examplelib/examples/strategies/tree_of_thoughts.md- Tree-of-Thoughts examplelib/examples/strategies/adaptive_strategy.md- Adaptive strategy example
Use these references as the production baseline for ReAct:
Not sure which technique to use? Start here:
Building an agent?
├─ Need to use tools/APIs?
│ └─ Use ReAct Strategy
├─ Need concise multi-step reasoning?
│ └─ Use Chain-of-Draft
├─ Need one-pass algorithmic search output?
│ └─ Use Algorithm-of-Thoughts
├─ Multi-step reasoning?
│ └─ Use Chain-of-Thought
└─ Complex planning?
└─ Use Tree-of-Thoughts
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Apache-2.0 - See LICENSE.md for details.