Research system · embodied agents

M.A.C.E.

What becomes possible when an embodied agent can think, act, and watch itself at useful speed? I rebuilt the Voyager pattern as three long-lived agents with a local reflex loop, generated skills, continuous supervision, and cooperative interruption.

Concurrent agentsComputer visionCerebras inferenceMineflayerTypeScript · Bun
34recorded agent sessions
26,048event-bus events
4,714LLM calls inspected
174successful tasks logged

Observed totals from logged runs. They show the depth of the inspection pass, not a benchmark success rate.

01 · System shape

A head, a hand,
and an eye.

Alpha proposes macro tasks. Beta retrieves or generates JavaScript and executes it. Gamma verifies outcomes and watches the environment. They are long-lived actors inside one Bun process, cooperatively interleaved through a typed event bus while model requests and game actions are awaiting completion.

Head · Alpha

Choose the next useful task

Proposes curriculum steps and falls back to a symbolic survival policy when the learned planner repeats or fails.

Hand · Beta

Retrieve, generate, execute

Selects the top three stored skills, generates code when needed, and runs one task at a time with timeout and abort control.

Eye · Gamma

Watch and verify

Checks local danger continuously, requests visual criticism when needed, and returns success, retry, or interrupt events.

02 · Research idea

Two speeds
of intelligence.

Specialized inference hardware changes which old research ideas are practical. The architecture keeps a fast, deterministic survival loop beside a slower language-model loop. Local health, hunger, and hostile-entity checks can react immediately while strategic planning and visual criticism continue at their own cadence.

Reflex path≈ 50 ms local check

Direct game-state danger detection does not wait for an LLM. It can trigger a survival interrupt as soon as the bot becomes unsafe.

Strategic pathModel-backed deliberation

Planning, code generation, and screenshot-based verification use the model when the decision benefits from richer context.

The eye checks on a three-second cadence, escalates only inside a warning band, and suppresses monitoring while it is already performing task verification. A storm damper stops repeated interrupts after three signals, cools down, then allows replanning.

03 · Control

Interrupt the
moving hand.

Generated code receives a narrow set of Mineflayer objects and movement, mining, crafting, and combat primitives. Beta runs only one task at a time. Completion races a 120-second timeout and an abort signal; every cooperating primitive checks the shared abort state and clears goals and controls when interrupted.

One incident, one shared clock

01ProposeAlpha emits a task
02RetrieveBeta finds skills
03ExecuteGenerated action begins
!InterruptDanger crosses threshold
05SurviveLocal routine takes control
06ReplanClean state resumes

Cancellation is cooperative. The wrapper can stop the primitives it owns; it does not pretend that arbitrary JavaScript can always be killed safely.

04 · Reuse

A small, visible
skill memory.

Successful programs are stored in local libSQL with 384-dimensional BGE-small embeddings. A new task is embedded, compared against the small library with cosine similarity, and the top three programs enter Beta’s prompt. The search is intentionally transparent at this scale: an O(n) scan, not an invisible retrieval service.

Embed

Task → 384D vector

Local ONNX inference creates the query representation.

Retrieve

Top three programs

Cosine similarity selects candidate skills and their recorded outcomes.

Verify

Store only after success

Gamma’s result controls whether a generated program becomes reusable memory.

05 · What the logs revealed

Speed amplifies
bad state.

The strongest result is the failure analysis. Concurrency made several hidden defects loud enough to measure: a repeated emergency transition became an event storm; an inventory-presence check rewarded a proxy instead of the requested change; and storing every accepted skill created extensive duplicate code.

Runaway transition

21,778 events

One session repeated the same mining request, turning a bad state edge into a bus-wide storm.

Reward hacking

Presence ≠ progress

A success predicate checked whether inventory contained an item, rather than whether the requested action changed inventory.

Memory duplication

182 rows · 89 unique

93 redundant rows made up 51.1% of the stored rows, showing that verification alone is insufficient without skill deduplication.

Open the engineering response

The next architecture revision should treat event backpressure, delta-based rewards, replayable state transitions, and semantic/code deduplication as core components. The logs are already structured for that work: asynchronous FIFO writes, sanitized multimodal records, per-stage timestamps, and public-safe screenshots make failure replay possible.

06 · Architecture summary

The engine,
on this page.

The important implementation details stay readable here: who owns each decision, how the event contract moves work, where interruption is allowed, and which parts are deterministic.

Alpha contractTask proposal and curriculum

Receives completion or failure, tracks repeated mining, consults hunger and inventory state, and emits one next task.

Beta contractSingle-flight execution

Retrieves the top three skills, applies a timeout and survival guard, executes through bounded primitives, and reports for verification.

Gamma contractVerification and recovery

Combines local danger state with screenshot criticism, retries failed goals, and emits cooldown-controlled interrupts.

Previous project← Agent P-DFNext projectKotchAIna →