______ ______ _______ _______ _______ ▄████▄ | __ \ __ \ _ |_ _| | | ▄██▄██▄██▄ | __ < < |_| |_| | ▀▀ ▀▀ |______/___|__|___|___|_______|__|____|
An open-source managed agent platform
Quickstart · Docs · API reference · Examples · Roadmap
Brain is an open-source alternative to Claude Managed Agents. Run agent sessions on infrastructure you control. Your application sends messages and connects tools; Brain keeps the session history and runs Pi in an isolated environment for each session.
Four services divide the work:
- Brain accepts messages, orders turns and streams events.
- Storage keeps transcripts, attachments and session state across restarts.
- Tools calls uploaded code, remote services and connected client functions.
- Sandbox creates and cleans up isolated environments for Pi and uploaded tools.
Sessions can outlive client connections. Your application chooses each session’s model, instructions and tools, then reconnects to its event history whenever it needs to.
Follow the Docker quickstart to start the services and connect with the TypeScript SDK or CLI. The embedded application guide covers running the existing server package from Node.js.
import { Brain, Pi, Model, ApiKey } from '@aexhq/brain';
const brain = new Brain('http://127.0.0.1:8080', process.env.BRAIN_API_KEY);
const session = await brain.create({
id: 'support/issue-42',
harness: Pi(),
model: Model('openai/gpt-4.1-mini', ApiKey(process.env.OPENAI_API_KEY)),
});
await brain.send(session.id, { type: 'user.message', text: 'Hello.' });| I want to… | Read |
|---|---|
| Run my first session | Quickstart |
| Manage sessions from a browser | Dashboard |
| Understand how Brain runs a session | Architecture |
| Stream events, interrupt turns, and resume sessions | Session lifecycle |
| Write a tool service | Distributed tools |
| Connect a remote MCP server | MCP tools |
| Issue tokens and isolate customers | Authentication |
| Back up sessions and move them between servers | Persistence & recovery |
| Deploy and monitor Brain | Operations & observability |
| Call Brain from my backend | TypeScript SDK |
| Look up routes and config fields | HTTP API and Host configuration |
| See what's coming next | Roadmap |
Give your coding agent Brain's docs as plain text: llms-full.txt has every page in one file, and llms.txt lists the pages.
Install the dependencies and run every local check before you open a pull request. The checks need Go 1.26+, Node.js 24+, and Python 3.11+ for the sandbox execution fixture.
node scripts/setup.mjs
node scripts/check.mjsDevelopment & verification covers what the checks run, how CI publishes releases, and how to preview the docs.
Brain is released under the MIT License.
Docs · Roadmap · Architecture · License · Issues