zxygentoo

zxygentoo

Tubie - A simple, zero dependencies, 200 lines minimal agent composing library

Tubie is an agent composing library for elixir, zero dependencies, the entire thing is under 300 lines.

A recent project needs some simple agentic workflow. I know Jido is out there, but I want something small enough to fit entirely in my head and coding agent’s context :wink:. Hence this little experiment.

Core ideas (Inspired by the Python library PocketFlow):

  • Single world state
  • Agent defines as function : state → state
  • some combinators for common use cases

That’s it.

Basic agent can be defined as a simple expression:

tool calling:

weather_agent =
  call_llm
  |> Tubie.with_retry(max: 3, wait: 1_000)
  |> Tubie.with_fallback(fn state, e ->
    Tubie.State.error(state, Exception.message(e))
  end)
  |> Tubie.branch(has_tool_calls?, %{
    tools: execute_tools,
    done:  &Tubie.State.halt/1
  })
  |> Tubie.loop(max: 10)

map reduce:

summarizer =
  Tubie.fan_out(map_agents, as: :partials)
  |> Tubie.and_then(reduce)

there are more examples in examples folder

It’s still pretty rough around the edges, your feedback is welcome ~

https://github.com/zxygentoo/tubie/


I firmly believe BEAM ecosystem is the best platform for building agentic systems. When things getting really big, my gut feels is reaching for OTP will be the best bet instead of reinventing too many wheels. But sometimes, you may want some simple and flexible handtool to test things out :slight_smile:

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
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
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
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
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement