jido

jido

๐Ÿค– Autonomous agent framework for Elixir. Built for distributed, autonomous behavior and dynamic workflows.

Stars: 267

Visit
 screenshot

Jido is a toolkit for building autonomous, distributed agent systems in Elixir. It provides the foundation for creating smart, composable workflows that can evolve and respond to their environment. Geared towards Agent builders, it contains core state primitives, composable actions, agent data structures, real-time sensors, signal system, skills, and testing tools. Jido is designed for multi-node Elixir clusters and offers rich helpers for unit and property-based testing.

README:

Jido (่‡ชๅ‹•)

Jido is a toolkit for building autonomous, distributed agent systems in Elixir.

The name "Jido" (่‡ชๅ‹•) comes from the Japanese word meaning "automatic" or "automated", where ่‡ช (ji) means "self" and ๅ‹• (dล) means "movement".

Hex Version Hex Docs Mix Test Coverage Status Apache 2 License

Overview

Jido provides the foundation for building autonomous agents that can plan, execute, and adapt their behavior in distributed Elixir applications. Think of it as a toolkit for creating smart, composable workflows that can evolve and respond to their environment.

This package is geared towards Agent builders. It contains the basis building blocks for creating advanced agentic systems. This is why there's no AI baked into the core of this framework.

To see demo's and examples, check out our Jido Workbench. It includes many examples of agents and workflows, including:

  • Agents with Tools
  • ChatBots
  • Agents acting as a Team
  • Multi-modal input & output
  • ... and many more examples

Jido Workbench relies on the following packages to extend Jido's capabilities:

  • jido_ai package for the AI capabilities.
  • jido_chat package for the chat capabilities.
  • jido_memory package for the memory capabilities.

Key Features

  • ๐Ÿ“ฆ State Management: Core state primitives for agents
  • ๐Ÿงฉ Composable Actions: Build complex behaviors from simple, reusable actions
  • ๐Ÿค– Agent Data Structures: Stateless agentic data structures for planning and execution
  • ๐Ÿ”ฅ Agent GenServer: OTP integration for agents, with dynamic supervisors
  • ๐Ÿ“ก Real-time Sensors: Event-driven data gathering and monitoring
  • ๐Ÿ“จ Signal System: Comprehensive system for agent and external communication
  • ๐Ÿง  Skills: Reusable, composable behavior modules - Plugins for agents
  • โšก Distributed by Design: Built for multi-node Elixir clusters
  • ๐Ÿงช Testing Tools: Rich helpers for unit and property-based testing

Installation

Add Jido to your dependencies:

def deps do
  [
    {:jido, "~> 1.1.0"}
  ]
end

Core Concepts

Actions

Actions are the fundamental building blocks in Jido. Each Action is a discrete, reusable unit of work with a clear interface:

defmodule MyApp.Actions.FormatUser do
  use Jido.Action,
    name: "format_user",
    description: "Formats user data by trimming whitespace and normalizing email",
    schema: [
      name: [type: :string, required: true],
      email: [type: :string, required: true]
    ]

  def run(params, _context) do
    {:ok, %{
      formatted_name: String.trim(params.name),
      email: String.downcase(params.email)
    }}
  end
end

# Execute a single Action via the Workflow system
{:ok, result} = Jido.Workflow.run(FormatUser, %{name: "John Doe", email: "[email protected]"})

Learn more about Actions โ†’

Agents

Agents are stateful entities that can plan and execute Actions. They maintain their state through a schema and can adapt their behavior:

defmodule MyApp.CalculatorAgent do
  use Jido.Agent,
    name: "calculator",
    description: "An adaptive calculating agent",
    actions: [
      MyApp.Actions.Add,
      MyApp.Actions.Multiply,
      Jido.Actions.Directives.RegisterAction
    ],
    schema: [
      value: [type: :float, default: 0.0],
      operations: [type: {:list, :atom}, default: []]
    ]
end

# Start the agent
{:ok, pid} = MyApp.CalculatorAgent.start_link()

# Synchronous call
{:ok, result} = MyApp.CalculatorAgent.call(pid, Signal.new!(%{type: "add", data: %{a: 1, b: 2}}))

# Asynchronous call
{:ok, response_ref} = MyApp.CalculatorAgent.cast(pid, Signal.new!(%{type: "add", data: %{a: 1, b: 2}}))

Learn more about Agents โ†’

Sensors

Sensors provide real-time monitoring and data gathering for your agents:

defmodule MyApp.Sensors.OperationCounter do
  use Jido.Sensor,
    name: "operation_counter",
    description: "Tracks operation usage metrics",
    schema: [
      emit_interval: [type: :pos_integer, default: 1000]
    ]

  def mount(opts) do
    {:ok, Map.merge(opts, %{counts: %{}})}
  end

  def handle_info({:operation, name}, state) do
    new_counts = Map.update(state.counts, name, 1, & &1 + 1)
    {:noreply, %{state | counts: new_counts}}
  end
end

Learn more about Sensors โ†’

Running in Production

Start your agents under supervision:

# In your application.ex
children = [
  # Agents fit into your existing supervision tree
  # Specify an id to always uniquely identify the agent
  {MyApp.CalculatorAgent, id: "calculator_1"}
]

Supervisor.start_link(children, strategy: :one_for_one)

Documentation

Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Run tests: mix test
  3. Run quality checks: mix quality
  4. Submit a PR

Please include tests for any new features or bug fixes.

See our Contributing Guide for detailed guidelines.

Testing

Jido is built with a test-driven mindset and provides comprehensive testing tools for building reliable agent systems. Our testing philosophy emphasizes:

  • Thorough test coverage for core functionality
  • Property-based testing for complex behaviors
  • Regression tests for every bug fix
  • Extensive testing helpers and utilities

Testing Utilities

Jido provides several testing helpers:

  • Jido.TestSupport - Common testing utilities
  • Property-based testing via StreamData
  • Mocking support through Mimic
  • PubSub testing helpers
  • Signal assertion helpers

Running Tests

# Run the test suite
mix test

# Run with coverage reporting
mix test --cover

# Run the full quality check suite
mix quality

While we strive for 100% test coverage, we prioritize meaningful tests that verify behavior over simple line coverage. Every new feature and bug fix includes corresponding tests to prevent regressions.

License

Apache License 2.0 - See LICENSE.md for details.

Support

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for jido

Similar Open Source Tools

For similar tasks

For similar jobs