Why Brood Agent?

The idea of RLM has fascinated me since its proposal, but I didn’t really have a harness to put those ideas into practice. So I built Brood Agent.

It:

  1. Gives LLM agents an Elixir REPL and one tool to access it: elixir_repl
  2. Runs a persistent daemon so you can access it from anywhere
  3. Provides agentic patterns, such as subagents, as first class citizens through the Brood API

How does it work?

Every agent gets its own REPL. If you’re new to REPLs, the simplest way to picture it is typing bun or node or iex (Elixir’s REPL) into your terminal and being dropped into an interactive environment:

bash · ~/project
Starting iex drops you into a live Elixir REPL.

Once you’re here, you can do things like assign values to variables:

iex · session state
Variables stay bound in the REPL across evaluations.

And perform actions, like renaming files:

iex · side effects
Reuses files from the prior turn and renames both files on disk.

This is the same thing Brood Agent does, but for every agent. Agents are spun up with their own REPL and a rich Elixir (and Brood) API.

The power of Elixir in every tool call

Elixir was a natural fit for a harness for several reasons:

  1. It supports dynamic runtime evaluation, so it’s possible for an LLM to express intent in raw code.
  2. The language and API are expansive, so the agent can get creative in how it evaluates commands. An example: opening persistent SSH connections.
  3. It runs on BEAM, which allowed me to create a fault tolerant and supervised daemon that I can access from any surface.

With a dedicated Brood API, the agent can now perform and chain operations with Elixir’s expressiveness:

elixir_repl 1 tool call
# This is ONE tool call
# Run a shell command and show test failures
{out, _} = Brood.sh("mix test --failed")
# Grab the files that failed
files = Regex.scan(~r/test\/\S+\.exs/, out) |> Enum.uniq()
# For every one of those files, spawn a subagent to fix them
for [f] <- files, do: Brood.spawn("implementer", "fix #{f}", worktree: true)
# In the tool call output, return how many agents were spawned
%{spawned: length(files)}
return value · 1 tool call %{spawned: 3}
test/auth_test.exs worktree
test/router_test.exs worktree
test/sync_test.exs worktree

Built for lower API costs

Because elixir_repl always returns the output of the evaluation, agents can decide what to include in their outputs in tool calls.

I take this a step further by providing agents the ability to modify their own conversations. Essentially, all conversations sent to model providers are actually projections on top of raw JSONL. In a nutshell, this means that agents can pick and choose what to send.

For instance, say that a tool call results in a massive amount of output:

elixir_repl call_04 Brood.sh("mix test --trace")
1,840 lines · raw log dump sitting in context
<tool-context call_id="call_04" tokens="42,180" />

Agents can now mark certain tool calls as “pruned” using the Brood.prune API. These tool calls do not get sent in the projection.

elixir_repl · projection
call_04 is dropped from future model input while staying intact in the JSONL transcript.

This allows the agent to proactively manage its context, resulting in significant token savings.

First-class support for every provider

I didn’t just want this to be my test bed for RLM. I wanted to prove that RLM was possible as a daily driver. To accomplish this, I needed the harness to be able to do the same things other harnesses do, or better, such as being model agnostic, and allowing the use of subagents.

So I made Brood Agent so that you can both run local models using tools like Ollama or llama.cpp, but also your subscriptions such as Claude Code, Codex, Antigravity. This means you can easily have an orchestrator that runs on the latest Opus model, while spinning up subagents on your local model.

orchestrator Antigravity · Neon
subscription · plans & merges coordinating
Brood BEAM Daemon Brood.spawn/3 · isolated REPLs · message bus
billing-api coding…
Claude Code · Opus
subscription · worktree
log-triage scanning…
Ollama · Qwen 4 $0/tok
local · read-only
security-review auditing…
Codex · Astra
subscription · diff check

When you install Brood Agent, it automatically picks up your existing API keys in the environment and detects what CLI tools you have installed. And switching models mid-conversation is (usually) seamless between providers.

Extensibility

Because Brood Agent is built on Elixir, we can take advantage of some Elixir features, like hot swapping modules. This allowed me to implement and iterate on an extension system. And you can take advantage of these features too.

As an example, the background task and scheduler modules are built on top of the extension system. As I found issues with these modules, I asked the agents to fix these issues, and then restart the modules on the fly.

Brood Daemon live · 0 downtime
Reloads all userland extensions in place while the daemon, agent REPLs, and MCP stay online.

This has other added benefits, like being able to setup and modify MCP servers without exiting the daemon. And because the source code for Brood Agent is available to the agent, it can diagnose and correct issues within Brood Agent.

Open-source

The harness is MIT licensed and open source so feel free to look around. Brood Agent is also set up with feedback tooling so you can open GitHub Issues using agents.

Here are the providers Brood Agent currently supports:

  • APIs: Anthropic · OpenAI · Google · xAI · OpenRouter · Fireworks · Meta · Z.ai · Tinfoil (with secure enclave)
  • Local: Ollama · llama.cpp · OpenAI-compatible
  • Subscriptions: Claude Code · Codex · Antigravity

Quickstart

Native install

Prebuilt binaries are available for macOS (Apple Silicon & Intel) and Linux (x86_64).

sh
$ curl -fsSL https://broodagent.com/install.sh | sh
$ brood # picks up existing API keys & CLI logins (or: brood login)

Run the daemon in Docker

Prefer to isolate the daemon in a container? Multi-arch images (linux/amd64 and linux/arm64) are published to ghcr.io/dextermiguel/brood. Install the CLI, then run:

sh
$ brood daemon setup docker # starts ghcr.io/dextermiguel/brood:latest & connects this terminal

Daemon state (agents, logins, and MCP config) persists in a brood-state Docker volume across container updates, and you can connect from any machine with brood daemon connect.

There are plans to support web and desktop surfaces in the future.