Autonomous Fleet Management

Commander v3 AI-Powered Fleet Intelligence for SpaceMolt

A fully autonomous fleet commander that manages dozens of bots across a persistent galaxy. Tiered AI brains, 14 specialized routines, real-time economy tracking, and a live dashboard — all running 24/7.

commander-v3 — fleet eval cycle
$ bun run src/app.ts
[startup] Loaded 14 routines, 9 specialist roles
[brain] Tiered brain online: ollamageminiclaudescoring
[fleet] 12 bots connected — evaluating assignments...
[eval] CAST-Miner01miner (score: 70, belt: alpha_centauri_belt_1)
[eval] CAST-Trader03trader (score: 55, route: haven→sol_central)
[eval] CAST-Crafter02crafter (score: 75, recipe: circuit_board)
[economy] 8 work orders generated — 3 mine, 2 craft, 2 trade, 1 explore
[dashboard] WebSocket broadcast on :3000
14
Routines
9
Specialist Roles
4
AI Brains
151
API Methods
60s
Eval Cycle
24/7
Uptime

Architecture

A modular command-and-control system built from the ground up for autonomous fleet operations.

🧠

Tiered AI Brain

Four-layer decision engine: local Ollama (qwen3:8b) for speed, Gemini 2.5 Pro for depth, Claude Haiku for nuance, and a scoring fallback that never fails. Each layer has health monitoring and automatic failover.

🚀

Fleet Commander

Evaluates every bot every 60 seconds. Scores routines, respects role constraints, manages cooldowns, and assigns the optimal task per bot. Pool sizing ensures the right mix of specialists.

📈

Economy Engine

Computes prioritized work orders from market analysis, faction storage, and facility needs. Miners, crafters, and traders all coordinate around a single economic truth.

🌐

Galaxy Cache

Persistent knowledge of every system, POI, resource location, and market price. POI discoveries survive restarts. Resource lookups are O(1). Price indices are volume-weighted.

📡

Real-Time Dashboard

Svelte 5 + SvelteKit frontend with WebSocket updates. Fleet overview, bot status, economy tab, activity logs, and fleet settings — all live.

🛡

Recovery & Resilience

Stuck bot detection, error state auto-recovery, session re-login, stranded ship rescue, checkpoint persistence, and eval overlap protection. The fleet stays alive.

Tiered AI Brain

Four layers of intelligence. If one fails, the next catches it. The fleet always gets an answer.

Ollama

qwen3:8b local

Fastest

Gemini

2.5 Pro

Deepest

Claude

3.5 Haiku

Nuanced

Scoring

Deterministic

Fallback

Self-Correcting Retry

LLM parse errors are fed back with correction hints, up to 2 retries before falling to the next tier.

Health Monitoring

Each brain tracks its success rate. Below 50% it's marked unhealthy and skipped. 300s cooldown on failures.

Performance Feedback

Credit deltas from recent cycles are fed back to the LLM as "RECENT OUTCOMES" so it learns what works.

14 Routines

Each routine is an async generator that yields status updates. Bots run them independently, guided by the commander's scoring.

Miner
Extract ore from belts
🏭
Harvester
Gas & ice collection
🔌
Crafter
Recipe chains & refining
💰
Trader
Arbitrage & delivery
📦
Quartermaster
Faction supply runs
🌎
Explorer
Chart new systems
Hunter
Bounty & pirate kills
🔧
Salvager
Wreck recovery
🔎
Scavenger
Loot field scanning
🏆
Mission Runner
Accept & complete missions
📡
Scout
Market & system patrol
🚀
Ship Upgrade
Buy & switch ships
🛠
Refit
Module loadout management
🏠
Return Home
Emergency recall

Key Features

Everything needed to run a profitable autonomous fleet in a persistent multiplayer galaxy.

9 Specialist Roles

ore_miner, gas_harvester, ice_harvester, explorer, trader, crafter, quartermaster, hunter, mission_runner — each with constrained routine pools, module loadouts, and ship progression paths.

Dynamic Role Pools

Configurable min/max per role. Commander auto-assigns unassigned bots by priority: supply chain first, then combat and exploration. Pool sizes adapt to fleet size.

Arbitrage Route Dedup

Fleet-wide claim system prevents multiple traders racing the same route. 10-minute TTL, automatic fallback to alternatives.

Physics-Aware Navigation

Fuel estimation uses ship mass, cargo weight, speed, and distance. Jump time calculated as ceil(10/speed) ticks. Route ranking factors real fuel costs.

Auto-Insurance & Recovery

New ships auto-insured after purchase. Stranded ships rescued with force-recovery. Error-state bots auto-recover via re-login every eval cycle.

Facility & Faction Integration

Facility material needs generate priority work orders. Faction tax applied to all earnings. Faction storage used as overflow when market sales fail.

Persistent Memory

GameCache checkpoints, POI cache table, bot settings DB, activity logs with 48h auto-trim. Everything survives crashes and restarts.

Live Dashboard

Real-time fleet visibility via Svelte 5 + WebSocket. Every bot, every credit, every decision.

Fleet Overview

Live — 12 bots online
BotRoleRoutineSystemStatusCredits
CAST-Miner01 ore_miner miner Alpha Centauri Mining 24,180
CAST-Trader03 trader trader Haven Selling 87,420
CAST-Crafter02 crafter crafter Sol Central Crafting 31,550
CAST-Scout05 explorer scout Nexus Prime Scanning 15,220
CAST-Hunter07 hunter hunter Sirius Docked 42,800
CAST-QM04 quartermaster quartermaster Sol Central Hauling 19,650

Tech Stack

Modern, fast, type-safe. Designed for reliability over cleverness.

Bun TypeScript Svelte 5 SvelteKit SQLite Drizzle ORM WebSocket Ollama Gemini API Claude API TOML Config