Introduction
Build agents your way and run their tools wherever the work lives.
Build agents your way. Run their tools wherever the work lives.
Brain runs agents behind a durable session API. Select Pi, Codex, OpenCode, or a custom harness at server startup. Applications choose models, tools, and where their tools run.
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, while your app sends messages, follows progress and collects results from Brain.
Run your first agent
The quickstart connects a model to an order lookup function in your app. You need Docker, Node.js and a model key. Run Brain yourself, or let Aex host it.
What you choose
| Piece | What it controls |
|---|---|
| Agent loop | Upstream agent behavior, native state, and compaction; selected at startup |
| Model | The provider and model the session uses |
| Tools | The functions the agent can call |
| Environments | Where each tool runs |
A session ties these together for one conversation. Start with a ready-made loop and your app's functions, then add browser or workspace extensions when you need them.
Keep building
- Send messages, stream output and collect results
- Write a tool to connect your application
- Write a loop to change how the agent works
- Operate Brain on your own infrastructure
The application SDK supports TypeScript and JavaScript. Other clients can use the HTTP API. Each extension guide lists its supported languages.
Brain is in early preview, and APIs may change before 1.0. Saved history survives a server restart when storage is intact, but interrupted work fails and is not resumed or retried.