Help us shape the future of Go! Take the 2026 Go Developer Survey

spacemolt

module
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: MIT

README ยถ

Spacemolt Multi-Agent System

An autonomous multi-agent system and development toolkit for the SpaceMolt game. Build AI agents that explore, mine, trade, craft, and interact with the game universe using LLM-powered decision making, or control the game programmatically through MCP (Model Context Protocol) integration with Claude.

Table of Contents

Overview

The Spacemolt Multi-Agent System is a comprehensive development toolkit and automation platform that provides:

Autonomous Agent Framework
  • Explore the universe independently using LLM-driven decision making
  • Learn from experiences and build knowledge over time
  • Collaborate by sharing information through a persistent knowledge base
  • Play autonomously with specialized agent types (explorers, miners, traders, fighters, pirates, craftsmen, salvagers, prophets, random)
  • Persist all discoveries automatically to SQLite storage
  • Customize agent personalities and behaviors through JSON configuration
Claude AI Integration (MCP)
  • Direct Control - Play SpaceMolt through Claude using Model Context Protocol
  • 151 Game Commands - Auto-generated tools from OpenAPI spec covering the entire game API
  • Crafting Intelligence - Query recipes and plan crafting based on inventory
  • Real-time Updates - WebSocket and SSE bridges for live game state
  • Multiple Bridges - Choose between WebSocket, SSE, or service-based architectures
Development Tools
  • Web UI - React/TypeScript frontend for monitoring and controlling agents
  • REST API - Programmatic control and status monitoring
  • Knowledge Analytics - Query system for mining discoveries, market data, and routes
  • Automated Agents - Pre-built specialized bots for common tasks

Each agent has a unique personality that drives their behavior, making decisions based on current situation, past experiences, and cumulative knowledge.

Key Features

๐Ÿค– Multiple Integration Modes
  • LLM-Powered Agents - Autonomous agents with personality-driven decision making
  • Claude Integration - Direct control via MCP (Model Context Protocol)
  • Automated Bots - Pre-built specialized agents for specific tasks
  • Programmatic API - REST API for custom integrations
๐ŸŽฎ Comprehensive Game Coverage
  • 151 Game Commands - Auto-generated from OpenAPI spec, covering entire game API
  • All Game Systems - Navigation, combat, mining, trading, crafting, factions, bases
  • Real-time Updates - WebSocket and SSE support for live game state
  • Version Tracking - Automatic API version compatibility checking
๐Ÿง  Knowledge & Learning
  • Shared Knowledge Base - SQLite database with discoveries from all agents
  • Advanced Analytics - Rich deposits, depleting resources, danger zones, market trends
  • Experience Tracking - Complete action history for learning and improvement
  • Route Optimization - Fuel cost and travel time learning
๐Ÿ› ๏ธ Crafting System
  • Recipe Database - Complete recipe and skill tree data
  • Material Planning - Calculate requirements for any craftable item
  • Profit Analysis - Find profitable crafting opportunities
  • MCP Integration - Query crafting data through Claude
๐Ÿ“Š Monitoring & Control
  • React Web UI - Modern frontend for monitoring and control
  • REST API - Programmatic access to agent status and control
  • Agent Registry - Centralized status and coordination
๐Ÿ” Flexible Storage
  • Multiple Backends - File, encrypted SQLite, OS keyring for credentials
  • Knowledge Persistence - Long-term accumulation across sessions
  • Market Data Capture - Historical price and listing tracking
  • Captain's Log - In-game logging and note-taking

Recent Additions

Claude AI Integration (MCP)

Play SpaceMolt directly through Claude with the Model Context Protocol. Three bridge implementations (WebSocket, SSE, Service) provide 151 auto-generated tools covering the entire game API.

Automated Specialized Agents

Ten pre-built automated agents (explorer, miner, trader, fighter, pirate, salvager, craftsman, prophet, random, llm-miner) provide task-specific automation without requiring LLM setup. Perfect for focused farming, exploration, or testing.

Web-Based Monitoring

React/TypeScript frontend provides modern UI for monitoring agent activity, viewing knowledge base, and controlling agents. Includes real-time dashboards, map views, and analytics.

Advanced Crafting System

Complete crafting database with recipe queries, material requirements calculation, and profit analysis. Integrated with both MCP and agent decision-making.

Enhanced Knowledge Base

Upgraded analytics for market trends, danger zones, route optimization, and resource depletion tracking. Agents share discoveries and learn from collective experience.

Playbook System

Strategic playbooks guide agents in specialized roles (explorer, miner, trader, fighter, etc.) with proven tactics and decision patterns.

MCP Integration - Play Through Claude

Use Claude AI to play SpaceMolt directly through the Model Context Protocol:

Available Bridges:

  • mcp-ws-bridge - WebSocket bridge with 151 auto-generated game commands
  • mcp-sse-bridge - Server-Sent Events bridge for streaming updates
  • mcp-bridge-service - Service-based architecture for persistent connections

Claude Integration Features:

  • Full game API access (navigation, combat, mining, trading, crafting, missions, factions)
  • Recipe and skill tree queries for crafting decisions
  • Real-time game state updates
  • Market data and price analysis
  • Faction management and warfare
  • Base building and management

See cmd/mcp-ws-bridge/README.md and docs/MCP_TOOLS_IMPLEMENTATION.md for details.

Automatic Knowledge Persistence & Analytics

All agent discoveries are automatically saved to a SQLite knowledge base with advanced analytics:

  • Systems: Names, positions, security levels, factions, connections
  • POIs: Stations, asteroid belts, planets with resources
  • Resources: Mining locations with richness, depletion tracking, and trend analysis
  • Experiences: Complete action history for learning
  • Anomalies: Automatic detection of rich deposits, depleting resources, and opportunities
  • Routes: Optimization through learning fuel costs and travel times
  • Markets: Price analytics and best buy/sell identification
  • Danger Zones: Hostile activity tracking and risk assessment

Query Tools:

./scripts/query-knowledge.sh systems          # View discovered systems
./scripts/query-analytics.sh rich-deposits    # Find best mining spots
./scripts/query-analytics.sh anomalies        # View detected opportunities

Quick Start

Prerequisites

Core Requirements:

For LLM-Powered Agents:

  • Ollama running locally with the llama3.2 model (or other LLM provider)

For Claude Integration:

  • Claude Desktop or Claude API access for MCP functionality

For Web UI:

  • Node.js 18+ and npm (for frontend development)
Installing Ollama (Optional - for LLM agents)
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Start Ollama service
ollama serve

# Pull the required model (in another terminal)
ollama pull llama3.2
Building
# Clone the repository
git clone https://github.com/rsned/spacemolt.git
cd spacemolt

# Build core binaries
make build

# Or build specific tools
go build -o bin/agent-server ./cmd/agent-server
go build -o bin/mcp-ws-bridge ./cmd/mcp-ws-bridge

Core Executables:

  • bin/agent-server - Main server for running autonomous LLM agents
  • bin/mcp-ws-bridge - MCP bridge for Claude integration

Specialized Automated Agents (legacy โ€” migrating to overmind roles):

  • bin/auto-explorer - Automated exploration bot
  • bin/auto-trader - Automated trading bot
  • bin/auto-fighter - Automated combat bot
  • bin/auto-prophet - Automated prophet bot
  • bin/auto-random - Automated random-action bot
Quick Start Guides

Choose your path:

  1. LLM-Powered Autonomous Agents - Continue reading below for full agent setup
  2. Claude Integration (MCP) - See cmd/mcp-ws-bridge/README.md
  3. Automated Bots - See Automated Specialized Agents for pre-built automation
  4. Web UI Development - See frontend/README.md
Running Autonomous LLM Agents

The agent-server is the primary way to run autonomous agents. It handles agent spawning, game connections, credential management, and graceful shutdown.

Basic Usage
# Start all agents found in data/agents/
bin/agent-server

# Start specific agents (highest priority method)
bin/agent-server --agents=explorer-7,miner-2

# Use environment variable
export SPACEMOLT_AGENTS=explorer-7,miner-2
bin/agent-server

# Use configuration file (see agents_config.yaml.example)
bin/agent-server --config=agents_config.yaml

The server will:

  1. Discover agents based on your selection method
  2. Load each agent's personality from data/agents/<id>/personality.json
  3. Check for existing credentials (login) or register new agents
  4. Connect to the game server with retry logic
  5. Start the autonomous decision loop for each agent
  6. Run until you press Ctrl+C for graceful shutdown
Test Agent Setup

Test an agent's personality and LLM connection without connecting to the game:

# Test the explorer-7 personality
bin/test-agent data/agents/explorer-7/personality.json

# Test with SQLite storage (default)
bin/test-agent data/agents/miner-2/personality.json --db-backend=sqlite --db-path=test-knowledge.db

# Test with in-memory storage
bin/test-agent data/agents/pirate-1/personality.json --db-backend=memory

Database Backends

The system supports two knowledge base backends:

SQLite (Default)

Persists all agent knowledge to disk, allowing discoveries to accumulate across sessions:

# Use SQLite (default)
bin/agent-server --db-backend=sqlite --db-path=spacemolt-knowledge.db

Benefits:

  • Knowledge persists across restarts
  • Agents remember systems, POIs, and connections from previous sessions
  • Experience history is maintained
  • Enables long-term learning and accumulation

Database location:

  • Default: spacemolt-knowledge.db in current directory
  • Custom path via --db-path flag

Query the database:

# View all discovered systems
sqlite3 spacemolt-knowledge.db "SELECT id, name, visit_count, last_visited FROM systems;"

# View agent experiences
sqlite3 spacemolt-knowledge.db "SELECT agent_id, type, description, time FROM experiences ORDER BY time DESC LIMIT 20;"

# View registered agents
sqlite3 spacemolt-knowledge.db "SELECT id, name, role, faction FROM agents;"
In-Memory

All knowledge is lost when the program exits:

# Use in-memory backend
bin/agent-server --db-backend=memory

Use cases:

  • Testing and development
  • Fresh start each session
  • No database file management

Architecture

System Overview
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          SpaceMolt Game Server                          โ”‚
โ”‚                         (game.spacemolt.com)                            โ”‚
โ”‚                                                                         โ”‚
โ”‚  WebSocket API โ”‚ HTTP API โ”‚ OpenAPI Spec                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚            โ”‚             โ”‚
         โ”‚            โ”‚             โ”‚ (sync spec)
         โ”‚            โ”‚             โ–ผ
         โ”‚            โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚            โ”‚        โ”‚ generate-mcp-    โ”‚
         โ”‚            โ”‚        โ”‚ tools            โ”‚
         โ”‚            โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚            โ”‚                 โ”‚
         โ”‚            โ”‚                 โ–ผ (generates 151 tools)
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                                         โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚ Agent Server   โ”‚  โ”‚ MCP Bridges  โ”‚  โ”‚  Web UI / API      โ”‚โ”‚
โ”‚                โ”‚  โ”‚              โ”‚  โ”‚                    โ”‚โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚  โ”‚โ€ข ws-bridge   โ”‚  โ”‚โ€ข React Frontend    โ”‚โ”‚
โ”‚ โ”‚Agent Mgr   โ”‚ โ”‚  โ”‚โ€ข sse-bridge  โ”‚  โ”‚โ€ข REST API Server   โ”‚โ”‚
โ”‚ โ”‚            โ”‚ โ”‚  โ”‚โ€ข service     โ”‚  โ”‚โ€ข Agent Registry    โ”‚โ”‚
โ”‚ โ”‚โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚ โ”‚  โ”‚              โ”‚  โ”‚                    โ”‚โ”‚
โ”‚ โ”‚โ”‚Runner 1  โ”‚โ”‚ โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚ โ”‚โ”‚Explorer  โ”‚โ”‚ โ”‚         โ”‚                    โ”‚            โ”‚
โ”‚ โ”‚โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚ โ”‚         โ”‚                    โ”‚            โ”‚
โ”‚ โ”‚โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚ โ”‚         โ–ผ                    โ–ผ            โ”‚
โ”‚ โ”‚โ”‚Runner 2  โ”‚โ”‚ โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚ โ”‚โ”‚Miner     โ”‚โ”‚ โ”‚  โ”‚ Claude AI    โ”‚   โ”‚   Monitoring   โ”‚   โ”‚
โ”‚ โ”‚โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚ โ”‚  โ”‚              โ”‚   โ”‚   Dashboard    โ”‚   โ”‚
โ”‚ โ”‚โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚ โ”‚  โ”‚โ€ข Desktop     โ”‚   โ”‚                โ”‚   โ”‚
โ”‚ โ”‚โ”‚Runner 3  โ”‚โ”‚ โ”‚  โ”‚โ€ข API         โ”‚   โ”‚                โ”‚   โ”‚
โ”‚ โ”‚โ”‚Fighter   โ”‚โ”‚ โ”‚  โ”‚              โ”‚   โ”‚                โ”‚   โ”‚
โ”‚ โ”‚โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚ โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚                                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                           โ”‚
         โ”‚                                                   โ”‚
         โ”‚                                                   โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
    โ”‚                          โ”‚    โ”‚                      โ”‚โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚โ”‚
โ”‚  Knowledge Base            โ”‚  โ”‚  Credentials  โ”‚           โ”‚โ”‚
โ”‚  (SQLite)                  โ”‚  โ”‚  Storage      โ”‚           โ”‚โ”‚
โ”‚                            โ”‚  โ”‚               โ”‚           โ”‚โ”‚
โ”‚โ€ข Systems/POIs              โ”‚  โ”‚โ€ข file         โ”‚           โ”‚โ”‚
โ”‚โ€ข Experiences               โ”‚  โ”‚โ€ข sqlite       โ”‚           โ”‚โ”‚
โ”‚โ€ข Market Data               โ”‚  โ”‚โ€ข keyring      โ”‚           โ”‚โ”‚
โ”‚โ€ข Routes                    โ”‚  โ”‚               โ”‚           โ”‚โ”‚
โ”‚โ€ข Danger Zones              โ”‚  โ”‚               โ”‚           โ”‚โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚โ”‚
                                                            โ”‚โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
    โ”‚                                                         โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”‚
โ”‚ Automated      โ”‚  โ”‚ Ollama LLM   โ”‚                        โ”‚
โ”‚ Agents         โ”‚  โ”‚              โ”‚                        โ”‚
โ”‚                โ”‚  โ”‚โ€ข llama3.2    โ”‚                        โ”‚
โ”‚โ€ข auto-explorer โ”‚  โ”‚โ€ข mistral     โ”‚                        โ”‚
โ”‚โ€ข auto-trader   โ”‚  โ”‚โ€ข other       โ”‚                        โ”‚
โ”‚โ€ข auto-fighter  โ”‚  โ”‚  models      โ”‚                        โ”‚
โ”‚โ€ข auto-prophet  โ”‚  โ”‚              โ”‚                        โ”‚
โ”‚โ€ข auto-random   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                           โ”‚
                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Components:

  1. Agent Server - Core autonomous agent framework with LLM integration
  2. MCP Bridges - Connect Claude AI to the game (WebSocket, SSE, Service)
  3. Knowledge Base - Shared SQLite database for discoveries and analytics
  4. Web UI - React frontend for monitoring and control
  5. API Server - REST API for programmatic agent control
  6. Automated Agents - Specialized pre-built bots for specific tasks
  7. Credentials - Flexible storage (file, encrypted SQLite, OS keyring)

Command-Line Options

Agent Server
bin/agent-server [options]

Agent Selection:
  --agents string
        Comma-separated list of agent IDs (highest priority)
  --agents-dir string
        Directory containing agent personalities (default "data/agents")
  --config string
        Path to configuration file (default "agents_config.yaml")

Server Configuration:
  --server-url string
        Game server WebSocket URL (default "wss://game.spacemolt.com/ws")
  --max-agents int
        Maximum concurrent agents (default 10)
  --decision-interval duration
        Decision interval for agents (default 5s)

Knowledge Base:
  --db-backend string
        Backend: "sqlite" or "memory" (default "sqlite")
  --db-path string
        Path to SQLite database (default "data/spacemolt-knowledge.db")

LLM Configuration:
  --llm-url string
        LLM server URL (default "http://localhost:11434")
  --llm-model string
        LLM model name (default "llama3.2")

Credentials:
  --creds-backend string
        Backend: "file", "sqlite", or "keyring" (default "file")
  --creds-path string
        Path for credentials storage (default "data/credentials")

Environment Variables:

  • SPACEMOLT_AGENTS - Comma-separated agent IDs (medium priority)
  • SPACEMOLT_PASSPHRASE - Passphrase for SQLite credential encryption

See cmd/agent-server/README.md for detailed documentation.

Agent Test Utility
bin/test-agent [options] personality.json

Options:
  --db-backend string
        Database backend: "sqlite" or "memory" (default "sqlite")
  --db-path string
        Path to SQLite database file (default "spacemolt-knowledge.db")

How It Works

System Architecture

The agent server manages multiple autonomous agents, each with their own:

  • WebSocket connection to the game server (required by game architecture)
  • Personality defining behavior, traits, and motivations
  • Memory for tracking experiences and discoveries
  • Decision loop making autonomous choices every 5-10 seconds
Agent Lifecycle
  1. Discovery - Server finds agents using priority order:

    • CLI flags (--agents=id1,id2) โ†’ Environment (SPACEMOLT_AGENTS) โ†’ Config file โ†’ Auto-discover
  2. Initialization - For each agent:

    • Load personality from data/agents/<agent-id>/personality.json
    • Check for existing credentials in provider or data/agents/<agent-id>/credentials.json
  3. Connection & Authentication - Each agent independently:

    • First time (no credentials):
      • Connects to game server
      • Registers new account with sanitized username
      • Receives authentication token
      • Saves credentials to provider (with fallback to file)
    • Returning agent (has credentials):
      • Connects to game server
      • Logs in with username and token
      • Resumes previous session
    • Both include retry logic: up to 3 attempts with exponential backoff (2s, 4s, 8s)
  4. Autonomous Play Loop - Each agent continuously:

    • Receives game state updates every 10 seconds (tick)
    • Examines current situation (location, fuel, cargo, nearby objects)
    • Queries past experiences from knowledge base
    • Consults personality traits and motivations
    • Uses LLM to decide next action
    • Executes action through game client
    • Learns from the result (success/failure)
    • Updates knowledge base with discoveries
  5. Graceful Shutdown - On Ctrl+C:

    • Server stops all agent decision loops
    • Closes all WebSocket connections
    • Commits knowledge to database
    • Exits cleanly
Tick-Based Action System

The game server operates on a 10-second tick cycle:

  • Action commands (mine, travel, attack, etc.): Limited to 1 per tick
  • Query commands (get_status, get_system, etc.): Unlimited

Agents respect this by:

  • Tracking the last tick when an action was executed
  • Only sending action commands on new ticks
  • Using queries freely between ticks for information gathering
  • Retrying immediately if an action fails (failures don't consume tick)
Credential Management

The system supports flexible credential storage:

Backends:

  • file - Store in <creds-path>/<agent-id>.json (default)
  • sqlite - Encrypted SQLite database (requires SPACEMOLT_PASSPHRASE)
  • keyring - OS keyring/keychain integration

Fallback mechanism:

  1. Try primary provider (configured backend)
  2. If provider fails, fall back to data/agents/<agent-id>/credentials.json
  3. Load also checks fallback location if provider has no credentials

This ensures agents can always save/load credentials even if the primary backend fails.

Supported Actions

Navigation:

  • undock - Leave the current station
  • dock - Dock at a station in the current system
  • travel - Travel to a POI within the system
  • jump - Jump to another star system

Resource Gathering:

  • mine - Mine resources at the current location

Queries (no tick cost):

  • get_status - Current player/ship state
  • get_system - Current system details
  • get_ship - Detailed vessel specifications
  • get_skills - Full skill tree

See docs/api_commands_reference.md for the complete list of action and query commands.

Knowledge Persistence

With SQLite backend (default), agents accumulate knowledge over time:

  • Systems - Discovered star systems with visit counts and timestamps
  • Connections - Known jump routes between systems
  • POIs - Points of interest (stations, asteroids, anomalies)
  • Experiences - Agent action history and outcomes (last 100 per agent)
  • Agents - Registered agent metadata
  • Shared knowledge - All agents see each other's discoveries

Agent Personalities

The system includes diverse agent personalities, each specialized for different playstyles:

  • Explorers - Curiosity-driven agents who document discoveries
  • Miners - Resource-focused industrial miners
  • Traders - Commerce-focused merchants maximizing profits
  • Fighters - Combat specialists and bounty hunters
  • Pirates - Aggressive raiders plundering trade routes
  • Salvagers - Scavengers finding value in debris
  • Craftsmen - Builders and manufacturers
  • Engineers - Technical specialists and researchers

See data/agents/README.md for detailed documentation on creating and customizing agent personalities.

Creating New Agents
  1. Create a new directory: mkdir -p data/agents/my-agent
  2. Add a personality.json file with the agent's configuration
  3. Run the agent server: bin/agent-server --agents=my-agent

Example personality structure:

{
  "name": "My Agent",
  "id": "my-agent",
  "role": "Explorer",
  "faction": "Independent",
  "traits": {
    "curiosity": 0.8,
    "risk_tolerance": 0.5,
    "altruism": 0.7,
    "patience": 0.6,
    "aggression": 0.2
  },
  "motivations": {
    "primary": "explore_unknown",
    "secondary": "help_others",
    "tertiary": "document_findings"
  },
  "skills": {
    "navigation": "intermediate",
    "scanning": "basic",
    "combat": "novice"
  },
  "biography": "A newly independent explorer seeking to make their mark."
}

Example Sessions

Scenario 1: Starting from Scratch (First Agent)

Create and register your first autonomous agent:

# 1. Make sure you have an agent personality
ls data/agents/explorer-7/personality.json

# 2. Start the agent server (will auto-register)
bin/agent-server --agents=explorer-7

# Output:
# === Spacemolt Agent Server ===
# Found 1 agent(s) to start: [explorer-7]
# โœ“ Knowledge base initialized (sqlite)
# โœ“ LLM client initialized (llama3.2 @ http://localhost:11434)
# โœ“ Credentials provider initialized (file)
# โœ“ Agent manager created (max agents: 10)
#
# === Spawning Agents ===
# [explorer-7] Spawning agent: Deep Space Seven (Explorer)
# [explorer-7] Registering new agent
# [explorer-7] โœ“ Connected successfully
# [explorer-7] โœ“ Registered as explorer-7-Deep_Space_Seven
# [explorer-7] โœ“ Saved credentials to data/agents/explorer-7/credentials.json
# โœ“ [explorer-7] Started successfully (faction: Terran)
#
# === Agent Server Started ===
# โœ“ Successfully started: 1/1 agents
# Press Ctrl+C to stop all agents and exit

# The agent is now:
# - Registered in the game with a new account
# - Credentials saved to data/agents/explorer-7/credentials.json
# - Autonomously exploring and making decisions
# - Building knowledge in data/spacemolt-knowledge.db

# Let it run for 5-10 minutes, then stop with Ctrl+C
# Credentials are saved - next time it will log in automatically!
Scenario 2: Running with Existing Agents

Restart agents that have already been registered (they log in automatically):

# Start the same agent - it will login instead of register
bin/agent-server --agents=explorer-7

# Output:
# [explorer-7] Spawning agent: Deep Space Seven (Explorer)
# [explorer-7] Logging in with existing credentials
# [explorer-7] โœ“ Connected successfully
# [explorer-7] โœ“ Logged in successfully
# โœ“ [explorer-7] Started successfully (faction: Terran)

# The agent:
# - Found existing credentials
# - Logged in with saved username/token
# - Resumed from its last position in the game
# - Remembers all previous discoveries from knowledge base
Scenario 3: Multi-Agent Fleet

Run multiple agents simultaneously with diverse specializations:

# Start a diverse fleet
bin/agent-server --agents=explorer-7,miner-2,trader-1,fighter-1

# Output shows each agent starting:
# [explorer-7] โœ“ Logged in successfully (has credentials)
# [miner-2] โœ“ Registered as miner-2-Ore_Crusher (first time - no credentials)
# [trader-1] โœ“ Logged in successfully (has credentials)
# [fighter-1] โœ“ Registered as fighter-1-Steel_Fang (first time - no credentials)
#
# โœ“ Successfully started: 4/4 agents

# Watch as they collaborate:
# - Explorer-7: Maps new systems and reports discoveries
# - Miner-2: Focuses on resource extraction
# - Trader-1: Moves goods between stations
# - Fighter-1: Patrols for threats
#
# All agents share the same knowledge base!
# Explorer's discoveries help Miner find resources
# Trader benefits from both Explorer and Miner's intel
Scenario 4: Persistent Knowledge Accumulation

Demonstrate how knowledge persists across sessions:

# Session 1: Initial exploration
bin/agent-server --agents=explorer-7
# Let run for 5 minutes, then Ctrl+C

# Check what was discovered
sqlite3 data/spacemolt-knowledge.db "SELECT id, name, visit_count FROM systems;"
# Output:
# Sol|Sol|3
# Alpha-Centauri|Alpha Centauri|2
# Sirius|Sirius|1

# Session 2: Add more explorers
bin/agent-server --agents=explorer-7,explorer-8,explorer-9

# All three explorers:
# - Share knowledge of the 3 systems already discovered
# - Don't waste time re-exploring known territory
# - Can branch out in different directions
# - Build on each other's discoveries

# Session 3: Bring in specialists after exploration
bin/agent-server --agents=explorer-7,miner-2,miner-3,trader-1

# Specialists benefit from exploration:
# - Miners know which systems have rich asteroids
# - Traders know which stations buy/sell what
# - No wasted exploration time for specialists
Scenario 5: Different Configuration Methods

Use different methods to select agents:

# Method 1: CLI flags (highest priority)
bin/agent-server --agents=miner-2,miner-3

# Method 2: Environment variable
export SPACEMOLT_AGENTS=explorer-7,trader-1
bin/agent-server

# Method 3: Configuration file
cat > agents_config.yaml <<EOF
agents:
  enabled:
    - explorer-7
    - explorer-8
    - miner-2
    - miner-3
    - trader-1
EOF
bin/agent-server --config=agents_config.yaml

# Method 4: Auto-discover (all agents with personality.json)
bin/agent-server --agents-dir=data/agents
# Starts ALL agents found in data/agents/
Scenario 6: Custom Configuration

Run with custom backends and settings:

# Use SQLite for everything with encryption
export SPACEMOLT_PASSPHRASE=my-secure-password
bin/agent-server \
  --agents=explorer-7,miner-2 \
  --db-backend=sqlite \
  --db-path=data/game-knowledge.db \
  --creds-backend=sqlite \
  --creds-path=data/secure-creds.db \
  --llm-model=mistral \
  --decision-interval=3s

# Use memory mode for testing (no persistence)
bin/agent-server \
  --agents=test-agent \
  --db-backend=memory \
  --creds-backend=file

# Connect to custom game server
bin/agent-server \
  --agents=explorer-7 \
  --server-url=ws://localhost:8080/ws
Scenario 7: Handling Failures

The server continues if some agents fail:

bin/agent-server --agents=valid-agent,missing-agent,explorer-7

# Output:
# โŒ [missing-agent] Failed to load personality: file not found
# โœ“ [valid-agent] Started successfully
# โœ“ [explorer-7] Started successfully
#
# โš  Failed to start: 1 agents: [missing-agent]
# โœ“ Successfully started: 2/3 agents
# Server continues running with 2 agents

# If ALL agents fail, server exits with error:
bin/agent-server --agents=nonexistent1,nonexistent2
# โŒ FATAL: All agents failed to start
# Check your configuration and credentials
# (exits with code 1)

Claude Integration via MCP

Play SpaceMolt through Claude AI using the Model Context Protocol.

Quick Start with MCP
# Build the MCP bridge
go build -o bin/mcp-ws-bridge ./cmd/mcp-ws-bridge

# Configure Claude Desktop
# Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "spacemolt": {
      "command": "/path/to/bin/mcp-ws-bridge",
      "args": ["--username", "your-username", "--token", "your-token"]
    }
  }
}

# Restart Claude Desktop
# Now Claude can control your SpaceMolt character!
Available MCP Servers
  1. mcp-ws-bridge - Full game control (151 commands)

    • Navigation, combat, mining, trading
    • Faction management, base building
    • Market orders, crafting, missions
    • See cmd/mcp-ws-bridge/README.md
  2. mcp-sse-bridge - Server-Sent Events variant

    • Alternative architecture for streaming updates
    • Same functionality as WebSocket bridge
Example Claude Interactions
You: "Check my ship status in SpaceMolt"
Claude: *uses get_status tool*

You: "Mine some asteroids"
Claude: *uses mine tool repeatedly*

You: "Travel to the nearest station and sell my cargo"
Claude: *uses travel, dock, and view_market tools*
Auto-Generated Tools

The MCP bridge tools are automatically generated from the game's OpenAPI spec:

# Update tools when game API changes
make update-mcp

# This will:
# 1. Download latest openapi.json from game server
# 2. Regenerate all 151 tool definitions
# 3. Update cmd/mcp-ws-bridge/tools_generated.go

See docs/MCP_TOOLS_IMPLEMENTATION.md for details.

Automated Specialized Agents

Pre-built bots for specific tasks (no LLM required):

Available Automated Agents
  • auto-explorer - Systematically explores and maps systems
  • auto-trader - Trades goods between stations
  • auto-fighter - Engages in combat and bounty hunting
  • auto-prophet - Prophet-style agent with strategic foresight
  • auto-random - Random-action agent for testing and exploration
Running Agents

Standing/recurring agent behaviors are now run under overmind, which supervises a fleet of worker processes driven by per-role config in data/overmind/roles.yaml (scheduled commands + an idle script per role). This replaces the old one-binary-per-bot model (e.g. mining now runs as the resident role's idle: idle_mine).

# Build the supervisor and worker runtime
make build   # produces bin/overmind and bin/worker

# Edit the fleet roster (data/overmind/fleet.yaml) and roles (data/overmind/roles.yaml),
# then launch the supervised fleet
bin/overmind

The remaining auto-* binaries above are legacy specialized bots not yet migrated to roles; see docs/superpowers/specs/2026-06-22-retire-auto-tools-design.md for the migration roadmap.

Web Interface

React Frontend

Modern web UI for monitoring and controlling agents:

# Setup frontend
cd frontend
npm install

# Development mode
npm run dev

# Production build
npm run build

See frontend/README.md for details.

Simple HTML Dashboard

Lightweight monitoring interface:

# Serve the web directory
cd web
python3 -m http.server 8080

# Visit http://localhost:8080

REST API

Programmatic control and monitoring:

# Start API server (usually part of agent-server)
bin/agent-server --enable-api --api-port 8080

# Query agent status
curl http://localhost:8080/api/agents

# Get specific agent
curl http://localhost:8080/api/agents/explorer-7

# Stream agent events
curl http://localhost:8080/api/stream

See pkg/api/ for API documentation.

Development

Running Linters
golangci-lint run ./...
Running Tests
# Run all tests
go test ./...

# Run specific package tests
go test ./pkg/knowledge/...

# Run tests with verbose output
go test ./pkg/knowledge/... -v

# Run benchmarks
go test ./pkg/knowledge/... -bench=.
Project Structure
spacemolt/
โ”œโ”€โ”€ cmd/                        # Command-line executables
โ”‚   โ”œโ”€โ”€ agent-server/           # Main LLM agent server (primary)
โ”‚   โ”œโ”€โ”€ mcp-ws-bridge/          # MCP WebSocket bridge for Claude
โ”‚   โ”œโ”€โ”€ mcp-sse-bridge/         # MCP SSE bridge (alternative)
โ”‚   โ”œโ”€โ”€ mcp-bridge-service/     # MCP service-based architecture
โ”‚   โ”œโ”€โ”€ generate-mcp-tools/     # Auto-generate MCP tools from OpenAPI
โ”‚   โ”œโ”€โ”€ update-server-docs/     # Sync API docs from game server
โ”‚   โ”œโ”€โ”€ auto-explorer/          # Automated exploration bot
โ”‚   โ”œโ”€โ”€ auto-trader/            # Automated trading bot
โ”‚   โ”œโ”€โ”€ auto-fighter/           # Automated combat bot
โ”‚   โ”œโ”€โ”€ auto-prophet/           # Automated prophet bot
โ”‚   โ”œโ”€โ”€ auto-random/            # Automated random-action bot
โ”‚   โ”œโ”€โ”€ benchmark/              # Performance benchmarking
โ”‚   โ”œโ”€โ”€ daily-summary/          # Daily activity summaries
โ”‚   โ”œโ”€โ”€ skill-tree/             # Skill tree visualization
โ”‚   โ””โ”€โ”€ ...                     # 20+ additional utilities
โ”œโ”€โ”€ pkg/                        # Reusable Go packages
โ”‚   โ”œโ”€โ”€ agent/                  # Agent framework & personality system
โ”‚   โ”œโ”€โ”€ game/                   # Game client & WebSocket communication
โ”‚   โ”œโ”€โ”€ credentials/            # Multi-backend credential storage
โ”‚   โ”œโ”€โ”€ knowledge/              # SQLite knowledge base & analytics
โ”‚   โ”œโ”€โ”€ llm/                    # LLM client (Ollama/OpenAI compatible)
โ”‚   โ”œโ”€โ”€ api/                    # REST API server
โ”‚   โ”œโ”€โ”€ registry/               # Agent status registry
โ”‚   โ”œโ”€โ”€ prompts/                # Prompt management system
โ”‚   โ”œโ”€โ”€ config/                 # Configuration management
โ”‚   โ””โ”€โ”€ version/                # Version compatibility checking
โ”œโ”€โ”€ internal/                   # Internal packages
โ”‚   โ”œโ”€โ”€ protocol/               # Internal protocol definitions
โ”‚   โ””โ”€โ”€ ws/                     # WebSocket utilities
โ”œโ”€โ”€ server/                     # Agent server implementation
โ”œโ”€โ”€ frontend/                   # React/TypeScript web UI
โ”‚   โ”œโ”€โ”€ src/                    # React components & pages
โ”‚   โ”œโ”€โ”€ public/                 # Static assets
โ”‚   โ”œโ”€โ”€ package.json            # Node dependencies
โ”‚   โ””โ”€โ”€ vite.config.ts          # Vite configuration
โ”œโ”€โ”€ web/                        # Simple HTML/JS monitoring interface
โ”‚   โ”œโ”€โ”€ index.html              # Dashboard
โ”‚   โ”œโ”€โ”€ js/                     # JavaScript
โ”‚   โ””โ”€โ”€ css/                    # Stylesheets
โ”œโ”€โ”€ data/                       # Data storage (auto-generated)
โ”‚   โ”œโ”€โ”€ agents/                 # Agent personality configurations
โ”‚   โ”‚   โ”œโ”€โ”€ explorer-7/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ personality.json
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ biography.md
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ credentials.json (auto-generated)
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ spacemolt-knowledge.db  # Shared knowledge base (SQLite)
โ”‚   โ””โ”€โ”€ credentials/            # File-based credentials
โ”œโ”€โ”€ diagrams/                   # Architecture and system diagrams
โ”œโ”€โ”€ docs/                       # Documentation (50+ documents)
โ”‚   โ”œโ”€โ”€ MCP_TOOLS_IMPLEMENTATION.md
โ”‚   โ”œโ”€โ”€ api_commands_reference.md
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ playbook/                   # Strategic playbooks for agents
โ”‚   โ”œโ”€โ”€ explorer.md
โ”‚   โ”œโ”€โ”€ miner.md
โ”‚   โ”œโ”€โ”€ trader.md
โ”‚   โ”œโ”€โ”€ fighter.md
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ server_docs/                # Auto-synced API documentation
โ”‚   โ”œโ”€โ”€ openapi.json            # OpenAPI specification
โ”‚   โ”œโ”€โ”€ api.md                  # API reference
โ”‚   โ””โ”€โ”€ skill.md                # Skill tree documentation
โ”œโ”€โ”€ scripts/                    # Utility scripts
โ”‚   โ”œโ”€โ”€ query-knowledge.sh      # Query knowledge base
โ”‚   โ”œโ”€โ”€ query-analytics.sh      # Query analytics
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ Makefile                    # Build automation
โ”œโ”€โ”€ agents_config.yaml.example  # Example agent configuration
โ””โ”€โ”€ go.mod                      # Go module definition

Troubleshooting

Game Connection Issues
# Test connection to game server
curl https://game.spacemolt.com/api/version

# Verify WebSocket connectivity
# Check firewall rules allow outbound WSS connections

# Test with simple client
go run ./cmd/play-simple --username your-user --token your-token
Ollama Connection Issues (for LLM agents)
# Verify Ollama is running
curl http://localhost:11434/api/tags

# Check if model is available
ollama list

# Pull the required model
ollama pull llama3.2

# Test Ollama directly
curl http://localhost:11434/api/generate -d '{"model":"llama3.2","prompt":"test"}'
MCP Bridge Issues
# Test MCP bridge manually
bin/mcp-ws-bridge --username your-user --token your-token

# Check Claude Desktop logs
# macOS: ~/Library/Logs/Claude/
# Check for MCP server startup errors

# Verify configuration
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Common issues:
# - Incorrect path to mcp-ws-bridge binary
# - Missing or invalid credentials
# - Firewall blocking game server connection
Agent Not Responding
  • Check agent-server logs for errors
  • Verify Ollama is running: curl http://localhost:11434/api/tags
  • Check agent personality file is valid JSON
  • Ensure agent has valid credentials in credentials.json
Database Issues
# Check database contents
sqlite3 data/spacemolt-knowledge.db ".schema"
sqlite3 data/spacemolt-knowledge.db "SELECT * FROM systems;"

# Check for corruption
sqlite3 data/spacemolt-knowledge.db "PRAGMA integrity_check;"

# Reset database (delete and start fresh)
rm data/spacemolt-knowledge.db
bin/agent-server
Agents Not Spawning
  • Verify agent directory exists: ls data/agents/explorer-7/
  • Check personality.json is valid: jq . data/agents/explorer-7/personality.json
  • Verify credentials if reusing existing agent
  • Review debug logs for specific errors
  • Check agent-server logs for detailed error messages
Frontend Development Issues
# Clear frontend cache
cd frontend
rm -rf node_modules package-lock.json
npm install

# Check for TypeScript errors
npm run type-check

# Verify Vite dev server
npm run dev
# Should start on http://localhost:5173
Build Issues
# Clean build cache
go clean -cache -testcache -modcache

# Update dependencies
go mod tidy
go mod download

# Rebuild everything
make clean
make build

# Check for lint errors
make lint

Contributing

Contributions are welcome! Areas of interest:

Agent Development:

  • New agent personalities and behaviors
  • Improved decision-making algorithms and strategies
  • Enhanced learning and knowledge sharing
  • Better prompt engineering for LLM agents

MCP Integration:

  • Additional MCP bridges and servers
  • Better Claude integration patterns
  • Tool improvements and new capabilities
  • Enhanced crafting intelligence

Automation:

  • New specialized automated agents
  • Improved efficiency algorithms
  • Better resource management
  • Advanced trading strategies

UI/UX:

  • React frontend enhancements
  • New monitoring dashboards
  • Better visualization of agent activity
  • Mobile-responsive designs

Infrastructure:

  • Performance optimizations
  • Better error handling and recovery
  • Enhanced testing coverage
  • Documentation improvements

Analytics:

  • Advanced knowledge base queries
  • Better market analysis
  • Route optimization
  • Profit calculation improvements

See existing code for patterns and conventions. All contributions should:

  • Pass make lint and make test
  • Include tests for new functionality
  • Update documentation as needed
  • Follow Go best practices

License

MIT License - See LICENSE file for details

Acknowledgments

Game & Platform:

  • SpaceMolt - The game that makes this possible
  • SpaceMolt community for testing and feedback

AI & LLM:

Core Libraries:

Frontend:

Development:

  • golangci-lint - Go linting
  • Go 1.24 - Programming language
  • OpenAPI specification - API documentation and code generation

Directories ยถ

Path Synopsis
cmd
arbitrage-scanner command
Command arbitrage-scanner detects cross-station buy-low/sell-high spreads in data/market.db, persists them to arbitrage_opportunities, and lists/claims/ completes them.
Command arbitrage-scanner detects cross-station buy-low/sell-high spreads in data/market.db, persists them to arbitrage_opportunities, and lists/claims/ completes them.
auto-explorer command
auto-fighter command
auto-prophet command
auto-random command
auto-trader command
data/convert-recipes command
convert-recipes transforms SpaceMolt recipe JSON to the format expected by the crafting server
convert-recipes transforms SpaceMolt recipe JSON to the format expected by the crafting server
data/convert-skills command
convert-skills transforms SpaceMolt skill JSON to the format expected by the crafting server
convert-skills transforms SpaceMolt skill JSON to the format expected by the crafting server
data/data-diff command
data/json-diff command
json-diff normalizes two JSON files so they can be meaningfully diffed.
json-diff normalizes two JSON files so they can be meaningfully diffed.
data/purge-preepoch command
Command purge-preepoch removes dead-epoch market captures from the knowledge database.
Command purge-preepoch removes dead-epoch market captures from the knowledge database.
data/struct-audit command
Command struct-audit dumps Go struct definitions (name, fields, json tags, resolved types) as JSON for the import-struct audit pipeline.
Command struct-audit dumps Go struct definitions (name, fields, json tags, resolved types) as JSON for the import-struct audit pipeline.
databot command
Command databot runs the dataservice query responder as a specific agent.
Command databot runs the dataservice query responder as a specific agent.
debug/benchmark command
debug/dump-missions command
Command dump-missions logs in as an agent, fetches the mission board at the current station plus the agent's active missions, and prints the raw server JSON for both.
Command dump-missions logs in as an agent, fetches the mission board at the current station plus the agent's active missions, and prints the raw server JSON for both.
debug/login-probe command
Command login-probe empirically measures the game server's per-IP /login rate limit so the overmind supervisor's StaggerInterval (default game.SleepMedium = 5s) can be validated against the real ceiling.
Command login-probe empirically measures the game server's per-IP /login rate limit so the overmind supervisor's StaggerInterval (default game.SleepMedium = 5s) can be validated against the real ceiling.
market-dashboard command
Command market-dashboard serves a read-only web dashboard over data/market.db for validating market collection.
Command market-dashboard serves a read-only web dashboard over data/market.db for validating market collection.
overmind command
Command overmind is the supervisor process that manages worker agents.
Command overmind is the supervisor process that manages worker agents.
overmind-dashboard command
Command overmind-dashboard serves the unified fleet ops dashboard: live galaxy map, per-agent cards, and fleet accounting, backed by the overmind status files, the knowledge DB, and market.db โ€” strictly read-only.
Command overmind-dashboard serves the unified fleet ops dashboard: live galaxy map, per-agent cards, and fleet accounting, backed by the overmind status files, the knowledge DB, and market.db โ€” strictly read-only.
skill-runner command
Command skill-runner is the unified agent binary that runs YAML-defined skills and Go strategies.
Command skill-runner is the unified agent binary that runs YAML-defined skills and Go strategies.
status-registry command
tools/action-log-scan command
action-log-scan paginates through an agent's server-side action log (get_action_log) and reports the distinct event_types seen, with per-type counts, the owning category, and an example summary.
action-log-scan paginates through an agent's server-side action log (get_action_log) and reports the distinct event_types seen, with per-type counts, the owning category, and an example summary.
tools/action-visualizer command
Action Visualizer โ€” interactive web tool for exploring the game action space.
Action Visualizer โ€” interactive web tool for exploring the game action space.
tools/agents-by-system command
Command agents-by-system reads the latest agent snapshots from daily-summary.db, joins them against the spacemolt knowledge base (systems + pois), and renders an HTML page grouping agents by the empire of the system they are currently in, then by system, then POI.
Command agents-by-system reads the latest agent snapshots from daily-summary.db, joins them against the spacemolt knowledge base (systems + pois), and renders an HTML page grouping agents by the empire of the system they are currently in, then by system, then POI.
tools/bulk-buy-order command
bulk-buy-order places buy orders for every item in the crafting database to seed market data.
bulk-buy-order places buy orders for every item in the crafting database to seed market data.
tools/bulk-sell-order command
bulk-sell-order sells items from station storage by creating sell orders.
bulk-sell-order sells items from station storage by creating sell orders.
tools/craft-dashboard command
Command craft-dashboard serves a live HTML dashboard for Executor B's dispatched craft plans: each plan's DAG rendered as a mermaid flowchart (done nodes faded grey, dispatched nodes bold/gold, parked nodes red) plus a per-item progress table.
Command craft-dashboard serves a live HTML dashboard for Executor B's dispatched craft plans: each plan's DAG rendered as a mermaid flowchart (done nodes faded grey, dispatched nodes bold/gold, parked nodes red) plus a per-item progress table.
tools/daily-summary command
Command daily-summary connects to game agents, captures state snapshots, stores them in SQLite, and generates diff reports showing day-over-day changes.
Command daily-summary connects to game agents, captures state snapshots, stores them in SQLite, and generates diff reports showing day-over-day changes.
tools/faction-dashboard command
Command faction-dashboard collects comprehensive faction data from member agents into the shared knowledge base and renders static HTML dashboards.
Command faction-dashboard collects comprehensive faction data from member agents into the shared knowledge base and renders static HTML dashboards.
tools/fit command
Command fit is an offline ship-fitting calculator.
Command fit is an offline ship-fitting calculator.
tools/fleet-report command
Command fleet-report prints a per-agent hauler report: current location and credits, the agent's starting balance, total and since-midnight credit deltas, and realized arbitrage profit.
Command fleet-report prints a per-agent hauler report: current location and credits, the agent's starting balance, total and since-midnight credit deltas, and realized arbitrage profit.
tools/haul-dashboard command
Command haul-dashboard renders a self-contained hauler dashboard HTML file from the durable haul_results + fleet_timeseries history in market.db and the live fleet-status.json.
Command haul-dashboard renders a self-contained hauler dashboard HTML file from the durable haul_results + fleet_timeseries history in market.db and the live fleet-status.json.
tools/haul-distances command
Command haul-distances reports, for each hauler in the live fleet-status file, the jump distance from its current system to the nearest AVAILABLE arbitrage opportunity's buy system โ€” using the same jump graph and name resolution the hauler ranker uses.
Command haul-distances reports, for each hauler in the live fleet-status file, the jump distance from its current system to the nearest AVAILABLE arbitrage opportunity's buy system โ€” using the same jump graph and name resolution the hauler ranker uses.
tools/haul-pnl command
haul-pnl reconciles each hauler's TRUE realized profit-and-loss from the server-side action log against the numbers recorded in market.db.
haul-pnl reconciles each hauler's TRUE realized profit-and-loss from the server-side action log against the numbers recorded in market.db.
tools/kb-drift-audit command
Command kb-drift-audit compares the knowledge-base sqlite DB against the authoritative catalog/map JSON files in data/game-api/ and reports:
Command kb-drift-audit compares the knowledge-base sqlite DB against the authoritative catalog/map JSON files in data/game-api/ and reports:
tools/market-prune command
Command market-prune enforces a retention window on the market_orders table.
Command market-prune enforces a retention window on the market_orders table.
tools/market-recompute-ohlcv command
Command market-recompute-ohlcv repairs market_ohlcv rows poisoned by the game's "not for sale" sentinel price (999999).
Command market-recompute-ohlcv repairs market_ohlcv rows poisoned by the game's "not for sale" sentinel price (999999).
tools/market-snapshot command
Command market-snapshot summarizes a raw view_market response snapshot: how many orders match a given source (e.g.
Command market-snapshot summarizes a raw view_market response snapshot: how many orders match a given source (e.g.
tools/market-stats command
Command market-stats prints summary statistics for the market intelligence database (default: ~/spacemolt/spacemolt/data/market.db).
Command market-stats prints summary statistics for the market intelligence database (default: ~/spacemolt/spacemolt/data/market.db).
tools/overmind-status command
Command overmind-status serves a live HTML status page for one or more overminds.
Command overmind-status serves a live HTML status page for one or more overminds.
tools/play_as command
tools/play_as-slog-example command
Example: Integrating slog into play_as/main.go This shows how to add configurable log levels to the existing tool
Example: Integrating slog into play_as/main.go This shows how to add configurable log levels to the existing tool
tools/run-skill command
Command run-skill connects an agent to the game server and executes one or more named skills from data/skills/ in sequence.
Command run-skill connects an agent to the game server and executes one or more named skills from data/skills/ in sequence.
tools/server-cmd command
server-cmd sends a raw command to the game server using an agent's credentials and prints the full JSON response.
server-cmd sends a raw command to the game server using an agent's credentials and prints the full JSON response.
tools/skill-graph command
Command skill-graph reads a skill YAML file and outputs a DOT digraph representation suitable for rendering with Graphviz.
Command skill-graph reads a skill YAML file and outputs a DOT digraph representation suitable for rendering with Graphviz.
tools/skill-tree command
skill-tree reads skills.json and generates Graphviz DOT files (one per category) showing the skill dependency tree.
skill-tree reads skills.json and generates Graphviz DOT files (one per category) showing the skill dependency tree.
tools/slog-demo command
Slog demonstration - comparing std log vs log/slog
Slog demonstration - comparing std log vs log/slog
tools/spar command
Command spar runs a controlled PvP sparring match between two or more of our own agents in a non-empire arena, so combat mechanics are observable and testable.
Command spar runs a controlled PvP sparring match between two or more of our own agents in a non-empire arena, so combat mechanics are observable and testable.
tools/view-learning command
Command view-learning provides interactive access to agent learning records.
Command view-learning provides interactive access to agent learning records.
tools/view-market command
Command view-market provides interactive access to market data.
Command view-market provides interactive access to market data.
worker command
Command worker is a thin stub overmind worker process.
Command worker is a thin stub overmind worker process.
internal
pkg
actionspace
Package actionspace evaluates game state to produce a pruned set of valid mutation commands with targets, precondition metadata, and branching factor metrics.
Package actionspace evaluates game state to produce a pruned set of valid mutation commands with targets, precondition metadata, and branching factor metrics.
agentstate
Package agentstate provides a unified state object that combines live game state, knowledge-base enrichment, action space evaluation, and optional agent strategic context into a single object attachable to any tool or call.
Package agentstate provides a unified state object that combines live game state, knowledge-base enrichment, action space evaluation, and optional agent strategic context into a single object attachable to any tool or call.
api
buildinfo
Package buildinfo is the single source of a running binary's build identity: a human-readable version label plus the embedded git commit, build time, and dirty flags.
Package buildinfo is the single source of a running binary's build identity: a human-readable version label plus the embedded git commit, build time, and dirty flags.
calllog
Package calllog provides structured JSON logging for game API request/response pairs.
Package calllog provides structured JSON logging for game API request/response pairs.
craftbrain
Package craftbrain plans the full recursive work needed to build a target (item, ship, or facility): what to mine, buy, haul, and craft, and where.
Package craftbrain plans the full recursive work needed to build a target (item, ship, or facility): what to mine, buy, haul, and craft, and where.
craftdash
Package craftdash renders the operator's live monitor for craft-plan execution: each plans.PlanRun's DAG as a mermaid flowchart (done nodes faded grey, dispatched nodes bold/gold, parked nodes red) plus a per-item progress table.
Package craftdash renders the operator's live monitor for craft-plan execution: each plans.PlanRun's DAG as a mermaid flowchart (done nodes faded grey, dispatched nodes bold/gold, parked nodes red) plus a per-item progress table.
craftplan
Package craftplan computes what an agent can craft right now and what is missing to craft a target recipe.
Package craftplan computes what an agent can craft right now and what is missing to craft a target recipe.
dataservice
Package dataservice provides an agent-to-agent query service.
Package dataservice provides an agent-to-agent query service.
dataservice/handlers
Package handlers provides concrete Handler implementations for the dataservice query registry.
Package handlers provides concrete Handler implementations for the dataservice query registry.
faction
Package faction collects comprehensive faction data from a connected game client and persists it to the knowledge base for the faction dashboard.
Package faction collects comprehensive faction data from a connected game client and persists it to the knowledge base for the faction dashboard.
finditem
Package finditem answers "where can I buy this item?" by composing the market database's sell-side availability with jump distances from the knowledge base's system graph.
Package finditem answers "where can I buy this item?" by composing the market database's sell-side availability with jump distances from the knowledge base's system graph.
fitting
Package fitting computes ship-module fitting against the game's catalog data.
Package fitting computes ship-module fitting against the game's catalog data.
galaxy
Package galaxy provides in-memory galaxy graph representation and pathfinding.
Package galaxy provides in-memory galaxy graph representation and pathfinding.
game
Package game โ€” structured server-error types and goal-reached classification.
Package game โ€” structured server-error types and goal-reached classification.
game/serverapi
Package serverapi defines types that mirror the game server's JSON wire format.
Package serverapi defines types that mirror the game server's JSON wire format.
handoff
Package handoff is the crafting-brain executor's stock-handoff channel: a flock-guarded JSON queue file.
Package handoff is the crafting-brain executor's stock-handoff channel: a flock-guarded JSON queue file.
huddash
Package huddash renders a self-contained hauler dashboard HTML page (inline SVG, no JavaScript) from the durable haul_results + fleet_timeseries history in market.db plus the live fleet-status.json.
Package huddash renders a self-contained hauler dashboard HTML page (inline SVG, no JavaScript) from the durable haul_results + fleet_timeseries history in market.db plus the live fleet-status.json.
llm
market
Package market โ€” order-book depth helpers.
Package market โ€” order-book depth helpers.
navigation
Package navigation holds pure routing algorithms (BFS shortest-hops and Held-Karp / nearest-neighbor waypoint ordering) over a jump graph.
Package navigation holds pure routing algorithms (BFS shortest-hops and Held-Karp / nearest-neighbor waypoint ordering) over a jump graph.
ovdash
Package ovdash contains the read-only data plumbing behind cmd/overmind-dashboard: galaxy topology, live fleet snapshots, SSE deltas, and earnings accounting.
Package ovdash contains the read-only data plumbing behind cmd/overmind-dashboard: galaxy topology, live fleet snapshots, SSE deltas, and earnings accounting.
overmind/balances
Package balances records fleet balance snapshots so the overmind can track each agent's starting balance and day-over-day credit deltas.
Package balances records fleet balance snapshots so the overmind can track each agent's starting balance and day-over-day credit deltas.
overmind/checkpoint
Package checkpoint persists a single worker's resumable state to SQLite.
Package checkpoint persists a single worker's resumable state to SQLite.
overmind/control
Package control defines the overmind<->worker control-channel wire format.
Package control defines the overmind<->worker control-channel wire format.
overmind/plans
Package plans is the dispatch-time envelope around a craftbrain.Plan: the accept transform (park cycles/blocked nodes, pin crafts to a roster, route feeder recipients, insert synthetic cross-station transfers) and the flock-guarded on-disk PlanRun state that Executor B advances tick by tick.
Package plans is the dispatch-time envelope around a craftbrain.Plan: the accept transform (park cycles/blocked nodes, pin crafts to a roster, route feeder recipients, insert synthetic cross-station transfers) and the flock-guarded on-disk PlanRun state that Executor B advances tick by tick.
overmind/supervisor
Package supervisor runs the overmind control server and worker lifecycle.
Package supervisor runs the overmind control server and worker lifecycle.
overmind/tasks
Package tasks holds the overmind's assigned-task model, seed-file loader, and the in-memory store that matches pending tasks to idle workers.
Package tasks holds the overmind's assigned-task model, seed-file loader, and the in-memory store that matches pending tasks to idle workers.
ovstatus
Package ovstatus renders a live status page for one or more overminds.
Package ovstatus renders a live status page for one or more overminds.
pricing
Package pricing computes a suggested sell price for a craftable item from the live market cost of its inputs plus a profit margin.
Package pricing computes a suggested sell price for a craftable item from the live market cost of its inputs plus a profit margin.
rescue
Package rescue is the cross-overmind stranded-worker rescue channel: a flock-guarded JSON queue file.
Package rescue is the cross-overmind stranded-worker rescue channel: a flock-guarded JSON queue file.
respfmt
Package respfmt produces human-readable, styled renderings of game server responses.
Package respfmt produces human-readable, styled renderings of game server responses.
skills
Package skills provides composable state machine definitions for game actions.
Package skills provides composable state machine definitions for game actions.
spar
Package spar provides a controlled PvP sparring harness: it logs in two or more agents, equips and moves them to a non-empire arena, and runs scripted (or human-partnered) battles so combat mechanics are observable and testable.
Package spar provides a controlled PvP sparring harness: it logs in two or more agents, equips and moves them to a non-empire arena, and runs scripted (or human-partnered) battles so combat mechanics are observable and testable.
tot
worker
Package worker provides shared command-parsing and execution primitives used by the play_as REPL and the headless worker agent.
Package worker provides shared command-parsing and execution primitives used by the play_as REPL and the headless worker agent.
scripts
buildinfo-probe command
Command buildinfo-probe prints only the build version string.
Command buildinfo-probe prints only the build version string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL