jido / guides
AGENTS.md1.9k starsChanged 10 months agoApache-2.0View on GitHub
After: You can define agents with schemas, hooks, and the cmd/2/cmd/3 contract. Agents are immutable data structures that hold state and respond to actions. The core operation is cmd/2 (or cmd/3 with options), which processes actions and returns an updated agent plus any runtime-owned directives. Jido keeps agent decision logic pure. Actions may be pure or effectful. Directives are for effects you want the runtime to own. The fundamental operation: Key invariants: - The returned agent is always complete—no "apply…
Trending
Quiet since August.thin dataabout the whole repository
Who's talking about agentjido/jido
- @adolfoneto.elixiremfoco.com“Jido is a toolkit for building autonomous, distributed agent systems in Elixir. #ElixirLang …”Bluesky · Mar 17, 2025 · 13 likes
- A Hacker News story“Show HN: Jido – Run 10k agents at 25KB each (Elixir)”Hacker News · Dec 30, 2024 · 13 points
- agentjido/jido_ai“feat: add timeouts to Jido.AI.Agent”GitHub · Jun 10, 2025 · 2 reactions
- @hugobarauna.com“This one looks promising: github.com/agentjido/jido”Bluesky · Jan 6, 2025 · 2 likes
- dwyl/technology-stack“`Jido` - Autonomous Agent Framework for `Elixir`”GitHub · Aug 6, 2026 · 1 reactions
The biggest 5 of 12 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 12
Talked about on GitHub, Bluesky and Hacker News (12 times).
On GitHub · 8
- Jun 10, 2025feat: add timeouts to Jido.AI.Agent — agentjido/jido_ai2 reactions · 1 comment
- Aug 6, 2026`Jido` - Autonomous Agent Framework for `Elixir` — dwyl/technology-stack1 reaction
- Jun 23, 2025deps(deps): bump jido from 1.1.0-rc.2 to 1.2.0 — agentjido/jido_ai1 reaction · 3 comments
- Aug 24, 2026mix(deps): bump jido from 2.3.2 to 2.3.3 — agentjido/jido_run0 reactions · 1 comment
- Aug 15, 2026chore(deps): Bump jido from 2.3.2 to 2.3.3 — beam-bots/bb_jido0 reactions
3 more on GitHub
- Aug 14, 2026deps(deps): bump jido from 2.3.2 to 2.3.3 — agentjido/jido_memory0 reactions · 2 comments
- Jun 3, 2026[Add] Jido (agentjido/jido) — PyTorchKR/landscape0 reactions
- May 11, 2026RFC companion: official OpenTelemetry adapter role in Jido observability standards — agentjido/jido_otel0 reactions
On Bluesky · 3
- Mar 17, 2025Jido is a toolkit for building autonomous, distributed agent systems in Elixir. #ElixirLang github.com/agentjido/jido — @adolfoneto.elixiremfoco.com13 likes and reposts
- Jan 6, 2025This one looks promising: github.com/agentjido/jido — @hugobarauna.com2 likes and reposts · 1 reply
- Jul 5, 2025Building out dynamic workflows with Jido and moving into saga orchestration with Reactor. #ElixrLang, a dream experience.… — @nickelcity.dev1 likes and repost
On Hacker News · 1
- Dec 30, 2024Show HN: Jido – Run 10k agents at 25KB each (Elixir)13 points · 9 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,638 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .spec/AGENTS.mdAGENTS.md
- test/AGENTS.mdAGENTS.md
- hex-releaseSkill
- pr-reviewSkill
The file
We split this agents.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Use an effectful action when the current step needs a result back now to continue reasoning or update state.
- Distinctive: line 182
Add default params based on current state
- Very specific: line 245
If the module is primarily a durable coordinator for named collaborators, use Jido.Pod instead of Jido.Agent.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agents
<!-- covers: jido.agents_and_actions.schema_defined_agents jido.agents_and_actions.pure_cmd_contract -->After: You can define agents with schemas, hooks, and the cmd/2/cmd/3 contract.
Agents are immutable data structures that hold state and respond to actions. The
core operation is cmd/2 (or cmd/3 with options), which processes actions and
returns an updated agent plus any runtime-owned directives.
Jido keeps agent decision logic pure. Actions may be pure or effectful. Directives are for effects you want the runtime to own.
Defining an Agent
defmodule MyAgent do
use Jido.Agent,
name: "my_agent", # Required - alphanumeric + underscores
description: "My custom agent", # Optional
category: "example", # Optional
tags: ["demo"], # Default: []
vsn: "1.0.0", # Optional
schema: [ # State schema (see below)
status: [type: :atom, default: :idle],
counter: [type: :integer, default: 0]
],
strategy: Jido.Agent.Strategy.Direct, # Default
plugins: [MyPlugin], # Default: []
default_plugins: true, # Load built-in plugins (Default: true)
schedules: [ # Declarative cron schedules (Default: [])
{"*/5 * * * *", "heartbeat.tick", job_id: :heartbeat}
]
endThe cmd/2 and cmd/3 Contract
The fundamental operation:
{agent, directives} = MyAgent.cmd(agent, action)
{agent, directives} = MyAgent.cmd(agent, action, opts)Key invariants:
- The returned
agentis always complete—no "apply directives" step needed directivesdescribe runtime-owned external effects only—they never modify agent state- Agent decision logic stays explicit and testable
Use an effectful action when the current step needs a result back now to continue reasoning or update state. Use a directive when the workflow has already decided on an outbound effect and wants the runtime or integration layer to own delivery.
Action formats:
# Action module with no params
{agent, directives} = MyAgent.cmd(agent, MyAction)
# Action with params
{agent, directives} = MyAgent.cmd(agent, {MyAction, %{value: 42}})
# Action with params and context
{agent, directives} = MyAgent.cmd(agent, {MyAction, %{value: 42}, %{user_id: 123}})
# Action with params, context, and per-instruction opts
{agent, directives} = MyAgent.cmd(agent, {MyAction, %{value: 42}, %{}, [timeout: 5000]})
# Full instruction struct
{agent, directives} = MyAgent.cmd(agent, %Instruction{action: MyAction, params: %{}})
# List of actions (processed in sequence)
{agent, directives} = MyAgent.cmd(agent, [Action1, {Action2, %{x: 1}}])Execution options via cmd/3:
Pass options that apply to all actions in the command:
# With timeout (5 second limit per action)
{agent, directives} = MyAgent.cmd(agent, MyAction, timeout: 5000)
# With timeout and no retries
{agent, directives} = MyAgent.cmd(agent, MyAction, timeout: 1000, max_retries: 0)
# Options applied to all actions in a list
{agent, directives} = MyAgent.cmd(agent, [Action1, Action2], timeout: 5000)Supported options:
:timeout— Maximum time (in ms) for each action to complete:max_retries— Maximum retry attempts on failure:backoff— Initial backoff time in ms (doubles with each retry)
State Management
set/2 — Update State
Deep-merges attributes into agent state:
{:ok, agent} = MyAgent.set(agent, %{status: :running})
{:ok, agent} = MyAgent.set(agent, counter: 5)validate/2 — Validate Against Schema
# Validate state, keeping extra fields
{:ok, agent} = MyAgent.validate(agent)
# Strict mode: only schema-defined fields are kept
{:ok, agent} = MyAgent.validate(agent, strict: true)Optional state size budget
Set max_state_size to a byte limit when you define an agent:
use Jido.Agent,
name: "bounded_agent",
max_state_size: 10 * 1024 * 1024The default is nil (no limit). Jido measures the complete agent.state with
:erlang.external_size/1, including plugin, thread, and strategy data. This is
an external term size, not a process heap or total memory limit. The calculation
visits the state, so its cost grows with the state. No size calculation runs when
the limit is nil.
set/2, validate/2, and restore/2 return
{:error, %Jido.Error.ValidationError{kind: :state_size}} when the candidate state
exceeds the limit. Error details contain max_state_size and actual_state_size.
MyAgent.new/1 keeps its existing struct return contract and raises this error
for oversized initial state. The base Jido.Agent.new/1 returns a tagged error.
A failed cmd/2 or cmd/3 returns the original agent and one error directive
with context: :state_size. It discards the command's other directives. This
also applies to before/after hooks and custom strategies. An action that has
already performed an external effect cannot be rolled back.
Core state helpers that return a struct, such as StateOps.apply_result/2,
Strategy.State.put/2, and the thread, memory, and plugin state helpers, raise
the same validation error. The command boundary converts it to an error
directive. Jido.Agent.StateBudget.replace/2 is a tagged-result boundary for
custom code that replaces the complete state.
AgentServer checks initial state, command results, and directive results before it accepts them. Runtime references count towards the limit. Persistence checks the complete state after thread and plugin restoration. Leave room for runtime metadata when you choose a budget. If mandatory orphan metadata cannot fit, the runtime stops with a structured shutdown reason.
Jido does not choose which data to delete. The application can compact its state
and retry. Direct Elixir struct or map edits cannot be intercepted; call
validate/2 or a checked state helper before you use such a value. An arbitrary
custom callback that replaces the public API must also use these checks.
Lifecycle Hooks
Optional callbacks for pure transformations before/after command processing.
on_before_cmd/2
Called before action processing. Transform agent or action:
def on_before_cmd(agent, action) do
# Example: log the action being processed
{:ok, agent} = set(agent, %{last_action: inspect(action)})
{:ok, agent, action}
endUse cases:
- Mirror action params into agent state
- Add default params based on current state
- Enforce invariants before execution
on_after_cmd/3
Called after action processing. Transform agent or directives:
def on_after_cmd(agent, action, directives) do
# Example: auto-validate after every command
{:ok, agent} = validate(agent)
{:ok, agent, directives}
endUse cases:
- Auto-validate state after changes
- Derive computed fields
- Add invariant checks
Schema Options
Agent state is validated against a schema. Two formats are supported:
NimbleOptions (legacy, familiar)
use Jido.Agent,
name: "my_agent",
schema: [
status: [type: :atom, default: :idle],
counter: [type: :integer, default: 0],
config: [type: {:map, :atom, :string}, default: %{}]
]Zoi (recommended for new code)
use Jido.Agent,
name: "my_agent",
schema: Zoi.object(%{
status: Zoi.atom() |> Zoi.default(:idle),
counter: Zoi.integer() |> Zoi.default(0),
config: Zoi.map() |> Zoi.default(%{})
})Both are handled transparently by the Agent module.
Creating Agents
# Create with defaults
agent = MyAgent.new()
# Create with custom ID
agent = MyAgent.new(id: "custom-id")
# Create with initial state
agent = MyAgent.new(state: %{counter: 10})If the module is primarily a durable coordinator for named collaborators, use
Jido.Pod instead of Jido.Agent. Jido.Pod wraps the same agent model and
adds a canonical topology plus a reserved singleton pod plugin.
Further Reading
- Actions — Defining actions that transform agent state
- State Operations — Internal state transitions during
cmd/2 - Directives — External effects emitted by agents
- Strategies — Execution strategies for
cmd/2 - Plugins — Default Plugins — Built-in plugins (identity, thread) and how to override them
- Pods — Manager-led durable topologies built on top of agents
Jido.Agent— Full module documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

