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: ReAct agent with tool use
defmodule MyApp.Agent do
use Jido.AI.ReActAgent,
name: "my_agent",
tools: [MyApp.Actions.Calculator, MyApp.Actions.Search],
model: :fast
end
{:ok, agent} = MyApp.Agent.start_link()
{:ok, response} = MyApp.Agent.chat(agent, "What is 15 * 23?")def deps do
[
{:jido, "~> 2.0"},
{:jido_ai, "~> 2.0"}
]
endConfigure your LLM provider (see Configuration Guide):
# config/config.exs
config :jido_ai, :models,
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 | Guide |
|---|---|---|---|
| ReAct | Reason-Act loop | Tool-using agents | Guide |
| Chain-of-Thought | Sequential reasoning | Multi-step problems | Guide |
| Tree-of-Thoughts | Explore multiple paths | Complex planning | Guide |
| Graph-of-Thoughts | Networked reasoning | Interconnected concepts | Guide |
| Adaptive | Strategy selection | Variable problem types | Guide |
When to use which strategy:
- ReAct - When your agent needs to use tools or APIs
- Chain-of-Thought - For multi-step reasoning and math problems
- Tree-of-Thoughts - When exploring multiple solution paths is beneficial
- Graph-of-Thoughts - For problems with interconnected concepts
- Adaptive - When you need dynamic strategy selection based on the problem
# ReAct agent with tools
defmodule MyApp.Agent do
use Jido.AI.ReActAgent,
name: "my_agent",
tools: [MyApp.Actions.Calculator, MyApp.Actions.Search],
model: :fast
end
# Chain-of-Thought for step-by-step reasoning
{:ok, result} = Jido.AI.Strategies.ChainOfThought.run(
"If 3 cats catch 3 mice in 3 minutes, how many cats are needed to catch 100 mice in 100 minutes?",
model: :fast
)- Overview - Library introduction and concepts
- Strategies - Reasoning strategies
- Architecture Overview - System design
- Strategies - Strategy implementation
- State Machines - Pure state machine pattern
- Directives - Declarative side effects
- Signals - Event-driven communication
- Tool System - Tool registry and execution
- Skills - Modular agent capabilities
- Configuration - Model aliases and providers
See the examples/ directory for runnable code:
examples/strategies/- Reasoning strategy examples
Not sure which technique to use? Start here:
Building an agent?
├─ Need to use tools/APIs?
│ └─ Use ReAct Strategy
├─ 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 for details.