Brain
Build agents your way. Run their tools wherever the work lives.
Brain is an open-source agent runtime. You choose the agent loop, the model, the tools and where each one runs. Brain saves the session and gives your application one API to drive it.
Picture a support agent that looks up an order in your backend, checks a delivery page in a browser and updates a ticket. Each tool runs where it can reach what it needs.
Why Brain
- Own the agent's behavior
- Start with a ready-made loop, or write your own context management, model calls and tool sequencing. Official loops use the same public interfaces as yours.
- Run each tool where it belongs
- Your app's process, the user's browser tab, an HTTPS backend or a remote sandbox. Choose per tool when you create a session.
- Drive it from your app
- Send messages, stream progress, submit background work and collect results later through one session API. Host it yourself, or let Aex host it.
Try an order lookup
The quickstart gives an agent a function from your app and asks whether an order has shipped. It includes the server command, matching package versions, a complete program and the expected result.
You need Docker, Node.js 22 or newer and an OpenAI API key, which is billed by OpenAI. Your app's functions run in your process, so keep it connected while the agent needs them.
Keep building
Project status
Brain is in early preview, and APIs may change before 1.0. Saved history survives a server restart when storage is intact. Interrupted work is marked as failed, not resumed or retried, and history can't restore lost browser or sandbox files.
MIT licensed. Explore the API reference, benchmarks or contributor guide.