How it works
An agent harness: the tools, context, shared state and control loop around a model. One rule holds it together: the model decides, the code does.
The control loop
The world moves in real time, 20 ticks a second; a model takes seconds to answer. So the model is never in the fast loop. It chooses a goal, such as gather_wood(10) or build_shelter(), and code carries it out, retries, gives up cleanly and reports back. The model is asked again only when that goal succeeds, fails, or something important happens.
sequenceDiagram
participant W as Environment
participant Body as Agent body
participant Brain as Model
W->>Body: state (position, inventory, health, time, threats)
Body->>Body: compress to a short briefing
Body->>Brain: "what should I do next?"
Brain-->>Body: goal: e.g. gather_wood(10)
loop deterministic, no model involved
Body->>W: low-level actions until the goal completes or fails
end
Body->>Brain: only on completion, failure, or a significant eventKeep the model in the loop and the agent is slow, expensive and overtaken by events. Keep it out, and a team works through three simulated days on fewer than a hundred decisions each. A new ability is a new tool, not more consulting of the model.
Three layers
- World
- A Minecraft server in Docker: the shared environment, reset from the same seed for every run.
- Bodies
- One Node.js process per agent, with a library of skills: deterministic code that acts in the world.
- Brains
- The models (Claude, GPT, or a free local model), behind one interface. Only this layer costs money.
What an agent is given
- A goal, stated as an outcome
- What to achieve, never the steps.
- Tools, and only tools
- A fixed list of 27 skills, each described with what it does and how it fails.
- A short account of its situation
- What it holds, what is nearby, its health, the time, who else is around.
- Feedback in plain words
- Every tool reports success or failure in words the model can replan against.
- Teammates, when there are any
- It can see them, talk, ask questions, ask for help and hand them items.
More detail: facts, not advice, and the reflexes
The harness adds facts, never suggestions. It says when an agent has made the same decision several times running, refuses a premature “done” once and says what is still missing (a false claim of success is itself counted), lets it give up with a reason, and, as its own condition, can list what the goal still lacks.
A few reflexes are code, not the model’s choice, and cover only the seconds a decision takes: the body steps back from a monster within reach, backs away from a creeper, takes cover from an archer, and gets out of water or lava. Its next observation says what it did.
Read further
- Method and limits: how runs are done, measured and judged, and what the numbers can’t show.
- The skills: each one, what it does and how it fails.
- How agents talk: messages, requests and questions between teammates.