



What it does
Butterfly is named after the butterfly effect — the idea that something very small can change everything that comes after it. In Butterfly, that small thing might be the police arriving ten minutes early, a vault code slipping into the wrong hands, or a driver deciding that the money is no longer worth the risk. The story takes place in the middle of a heist. The Mastermind is trying to get everyone to the vault, the Driver is mostly interested in getting home alive, the Insider has secrets of their own, and Detective Reyes is slowly putting the pieces together. They are all watching the same world, but they do not know the same things and they do not want the same outcome. You are allowed to change one part of their story and then watch what happens. Perhaps Reyes makes a bad call and raids too early. Perhaps the Insider sees an opportunity to betray the crew. Perhaps the Mastermind panics and changes the plan, which gives the Driver a reason to run. Nobody is following a written ending, so one small decision can quietly turn into an entirely different heist.
How the agents run concurrently
All four agents live inside the same Mozaik runtime and react independently to semantic world events. A single event can match several participants at once, starting separate runLoops without waiting for one another, so their LLM inference and tool-use windows genuinely overlap and may resolve in any order. They share a HeistState containing the world’s heat, chaos, attention, heist progress, evidence, money, and relationships, while each role has its own goals and partial view of that state. Agent tool calls deterministically update the shared world and can emit new events, which other participants independently observe and react to while the system is still running. There is no central scheduler deciding which agent acts next. Butterfly visualizes the real turn timestamps and causal fan-out in the UI, and the repository also includes npm run prove-concurrency as a headless wall-clock test showing the agents’ execution windows overlap. Selected high-impact actions also use Mozaik Interception, allowing one pending agent action to be paused or vetoed while the other agents continue running concurrently.
Newsletter
For developers who want to learn how to build self-organizing agents.
Join our online hackathon
Join our online hackathon for building multi-agent systems.