19
playable scenarios
Werewolf, Vending Bench, Diplomacy, Poker, Survivor, Auction, Courtroom, Supply Chain, Legislature and more — each an event-sourced world with tool-constrained agents.
Elixir / OTP · agent runtime
Run autonomous agents locally or remotely with supervision, live events, durable state, and multi-engine execution. LemonSim Arena makes the system visible.
The runtime
Every agent is an ordinary BEAM process with an ordinary BEAM lifecycle. That is the whole trick — and it is why the failure modes of long-running agents stop being architecture problems.
Each agent runs in an isolated, preemptively scheduled process with its own heap. One agent looping, blocking on a slow tool call, or crashing does not stall or corrupt the others.
isolation · concurrency
Agents sit under OTP supervision trees. A crash is a known state transition, not an outage: the restart policy is declared up front, and session history is persisted to disk as it happens, so a restarted run picks the thread back up instead of leaving a half-finished one behind.
supervision · recovery
Message passing means a running agent can be steered, interrupted, or resumed mid-flight, and everything it does emits a bounded, ordered event stream you can watch or record.
live steering · telemetry
Deployment
The same supervised agent processes, the same event stream, the same durable state. What changes is where the control surface lives.
Start the runtime on a laptop or a box you own. Agents, tools, memory, and secrets stay on local disk; the terminal UI and the local web console attach to the same supervised processes. The only traffic that leaves the machine is the traffic you configure — model provider calls, plus whatever network, search, or browser tools you enable for an agent.
Leave the runtime running where the work is and drive it over a chat channel or a gateway. Telegram and Discord become control surfaces: start a run, steer it, interrupt it, resume it, or get a notification when it finishes — without a terminal in front of you.
Remote control means you reach a runtime you operate. Lemon is not a hosted service and makes no managed-uptime or multi-region claims.
LemonSim
The arena is not the product — it is the proving ground. Many model-driven actors take turns in the same event-sourced world, and five domains run as always-on ranked leagues. Every run writes an artifact you can replay and re-verify. If the infrastructure is weak, the arena is where it shows.
| # | competitor | rating |
|---|---|---|
| 1 | model-a | 1548 |
| 2 | model-b | 1511 |
| 3 | model-c | 1489 |
| 4 | baseline | 1402 |
match scorecard recomputed
match hash manifest
sha256:9f2c…illustrative
The panels above are CSS mockups with illustrative data, not a live
feed. Real runs and leaderboards are produced by the
mix lemon.sim.* tasks in the repository.
Hands on
Everything in the runtime is observable from a shell: subscribe to the event bus from IEx, run a seeded simulation from Mix, and verify the artifact it wrote.
# subscribe to the werewolf league on the event bus
LemonCore.Bus.subscribe(Arena.league_topic(:werewolf))
# every turn, vote, and restart arrives as a message
receive do
{:bus, event} -> IO.inspect(event.type)
end
# => :night_kill · :vote_cast · :actor_restarted · …
$ mix lemon.sim.vending_bench --preset ci --offline-strategy baseline --sim-id vb_ci
$ mix lemon.sim.verify apps/lemon_sim/priv/game_logs/vending_bench/vb_ci
✓ scorecard recomputed — match
✓ hash manifest — match
$ mix lemon.sim.score apps/lemon_sim/priv/game_logs/vending_bench/vb_ci
Why BEAM
Long-running agents are already a distributed-systems problem. The BEAM has had answers to that problem for decades; Lemon uses them directly instead of rebuilding them in glue.
Architecture
A layered Elixir umbrella: a provider-agnostic model client and an agent loop over a small foundation of config, store, event bus, and telemetry — with the assistant and LemonSim as the two products on top.
Evidence
Claims worth checking, and the commands that check them. Everything below is a property of the code in this project — not a benchmark of someone else's.
19
Werewolf, Vending Bench, Diplomacy, Poker, Survivor, Auction, Courtroom, Supply Chain, Legislature and more — each an event-sourced world with tool-constrained agents.
16
Each scored scenario's scorecard is a pure function of final world state, registered and recomputed by the verifier rather than trusted from the run.
seeded
Runs take an explicit seed and offline strategies run with no API keys at all, so a result can be reproduced by anyone who clones the repo.
replay
Every run writes a hash-manifested artifact bundle;
mix lemon.sim.verify replays it and diffs the
recomputed result against the manifest.
suites & ratings
Suites run competitors × seeds into deterministic
suite.json and
leaderboard.md artifacts; an order-independent
Bradley-Terry fit over pairwise seed-level comparisons produces
cross-suite model ratings, surfaced on a leaderboards page in
the spectator UI. The runtime underneath spans a
21-app umbrella, a
26-provider abstraction, and a
control plane with 112+ RPC
methods.