Skip to content

Brain and Tools en

ZoyLuo edited this page Jun 5, 2026 · 1 revision

Brain and Tools

The brain layer translates "human words" into "actions". It handles intent only — deciding what to do, not micromanaging how (that's Task System and Goal Engine).

BrainCoordinator — the tool-calling loop

  1. Receive a player message (or an IdleCoordinator trigger).
  2. Query DeepSeek with a structured world snapshot (position, inventory, health, hunger, nearby blocks / entities, current task).
  3. The model returns one or more tool calls.
  4. ActionDispatcher dispatches them one by one, feeding results back to the model.
  5. Loop until a final reply or the brain.maxTurnsPerRequest cap.

The caps (maxTurnsPerRequest / maxToolCallsPerTurn) are a key guard — they stop the model from spiraling into token-burning "manual block-by-block" behavior. See Configuration.

ActionDispatcher — dispatch + interception

Besides routing calls to handlers, it does safety interception:

  • Right after a goal fails, it blocks the model from switching to manual block-by-block ops — move_to / mine_block / strip_mine (and assign_task{move/mine/strip_mine}). Those burn turns and can dig the bot into water / lava / a mob pit and get it killed. Blocked, the model is nudged back to high-level goals (mine_ore auto-locates ore, gather auto-finds resources) or to stop.

ToolRegistry — 56 tools

Tools fall into four groups; the last three can be toggled in the brain config (see Configuration):

🎯 High-level goals / tasks (on by default)

The entry to back-chaining and deterministic tasks — the model should prefer these.

achieve_goal · achieve_armor · achieve_workstation · set_goal · advance_goal · goal_status · assign_task · mine_ore · mine_vein · gather · craft · plan_craft · smelt · eat · farm · harvest_crop · harvest · fish · trade · breed · sleep · light_area · stockpile · guard · follow · hold · equip_armor · equip_best_tool · attack · attack_entity · stop · get_task_status · abort_task · inventory · find_container · deposit · deposit_all · withdraw · goto_place · say · tell_bot

🔩 Low-level actions (exposeLowLevelTools)

Fine-grained ops; can be disabled to steer the model toward high-level routes.

move_to · mine_block · place_block · look_at · select_hotbar

🧩 Memory (enableMemoryTools)

remember · recall · forget · mark_place · set_base

🤝 Coordination (enableCoordinationTools)

post_job · list_jobs

The full tool list and exact grouping live in ToolRegistry; /aibot brain status shows the actually-available tools and call activity in-game.

Why this design

A pure LLM driving the world "hallucinates actions" and is unreliable. AIBot has the model emit intent-level tool calls only and leaves real execution to the deterministic engine — that's where LLM plans, Tasks execute lands.

Further reading: Goal Engine · Task System · Safety Net

Clone this wiki locally