Aex Brain

Introduction

What Brain is, and the four things that plug into it.

Brain runs agent sessions. It holds the conversation, decides what happens next, calls the model, hands out tool calls, and journals every step. That is the entire job.

Run it as a server your app talks to over HTTP, or embed the brain crate in a Rust service you already own.

Brain is under early development. Contracts are replaced in place until the first stable release, and there is no upgrade path from earlier builds.

The four parts

Everything Brain does not do itself is one of four things you supply.

PartYou supplyBrain does
Agent loopThe policy: given what just happened, what nextRuns it in a WebAssembly sandbox and carries out the decision
ModelA binding: provider, model name, keyPins it for the life of the session and makes the call
ToolA name, description, schema, and where it runsLogs the call and sends it to the bound environment
EnvironmentSomewhere tool calls actually executeSets it up, attaches, calls, cancels, tears it down

The packages we ship use the same interface you would. Nothing built in gets a shortcut.

Why it is split this way

Brain never runs tool code. That is the load-bearing decision. A tool call is a message to somewhere else — a sandbox VM, a browser tab, your backend, the user's laptop — so a crashing or hostile tool takes down its own environment, not the process holding your sessions.

The agent loop is sealed off for the same reason. It receives an observation and returns a decision. No network, no filesystem, no secrets, no clock. Brain performs every effect the loop asks for.

Where to go next

  • Quickstart — a running server and a first session.
  • Sessions — the log, turns, and how recovery works.
  • API reference — generated from the session contract.

On this page