lostbean

lostbean

Jido Composer - Composable Agent Flows in Elixir

Hey everyone! I’ve been working on a library called
Jido Composer (hex, docs) and wanted to share it with the community.

What it does

Jido Composer lets you build agent flows by combining two patterns:

  • Workflow — deterministic FSM pipelines with compile-time validated
    transitions
  • Orchestrator — LLM-driven tool-calling loops (provider-agnostic via
    req_llm)

The thing that makes it interesting is that both patterns share the same Node
interface (context -> context), so they nest freely. Workflows can contain
orchestrators as steps, orchestrators can invoke workflows as tools, and you can
go as deep as you want.

Here’s a concrete example — a support bot (orchestrator) that uses a refund
pipeline (workflow) as a tool, where the pipeline itself contains an LLM-driven
fraud check (orchestrator):

# LLM reasons about fraud signals
defmodule FraudCheck do
  use Jido.Composer.Orchestrator,
    name: "fraud_check",
    model: "anthropic:claude-sonnet-4-20250514",
    nodes: [TransactionHistoryAction, RiskScoreAction],
    system_prompt: "Assess fraud risk using available tools."
end

# Deterministic refund pipeline with fraud check + human approval
defmodule RefundPipeline do
  use Jido.Composer.Workflow,
    name: "refund_pipeline",
    nodes: %{
      validate: ValidateRefundAction,
      fraud:    FraudCheck,                    # orchestrator as a step
      approval: %HumanNode{name: "approve", prompt: "Approve refund?"},
      process:  ProcessRefundAction
    },
    transitions: %{
      {:validate, :ok}       => :fraud,
      {:fraud, :ok}          => :approval,
      {:fraud, :flagged}     => :failed,
      {:approval, :approved} => :process,
      {:approval, :rejected} => :failed,
      {:process, :ok}        => :done
    },
    initial: :validate
end

# Support bot with the refund pipeline as one of its tools
defmodule SupportBot do
  use Jido.Composer.Orchestrator,
    name: "support_bot",
    model: "anthropic:claude-sonnet-4-20250514",
    nodes: [RefundPipeline, OrderStatusAction, FAQAction],
    system_prompt: "Help the customer. Use refund_pipeline for refund requests."
end

Three levels deep — LLM flexibility where you need it, FSM guarantees where you
don’t.

What else is built in

  • HumanNode — first-class approval gates that suspend the flow for human
    decisions
  • FanOutNode — parallel branches with merge strategies
  • Checkpoint/resume — persist any running or suspended flow to storage,
    resume later with idempotent semantics, even across deeply nested agent
    hierarchies
  • Generalized suspension — not just human gates; also handles rate limits,
    async completions, and custom pause reasons

Built on Jido, complements Jido AI

Composer is built on the core Jido packages
(jido, jido_action, jido_signal). It complements
Jido AI, which focuses on reasoning
strategies (ReAct, CoT, ToT, and more). Composer focuses on structure — how
you wire agents together, gate them, run them in parallel, and persist them. You
can wrap a Jido AI agent as a node inside a Composer workflow to get structured
flow control around open-ended reasoning.

Getting started

def deps do
  [{:jido_composer, "~> 0.2.0"}]
end

The repo includes 7 interactive livebooks, from a basic ETL pipeline (no API key
needed) to multi-agent pipelines with human-in-the-loop and observability. The
Getting Started guide
walks through your first workflow in 5 minutes.

Would love to hear feedback, questions, or ideas for composition patterns you’d
find useful!

https://github.com/lostbean/jido_composer

Where Next?

Popular in Announcing Top

zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 11220 107
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement