The Realm development stack is two processes: a Python FastAPI engine on port 8000 and a Next.js web client on port 3000. The web client proxies requests atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/at6132/econ/llms.txt
Use this file to discover all available pages before exploring further.
/api/engine to the engine, so you only need one browser tab. Everything runs in-memory by default; you can persist to SQLite with a single API call.
Prerequisites
Before you start, make sure you have:- Python 3.10+ — the engine’s
pyproject.tomlrequires>=3.10; Python 3.11+ is recommended - Node.js 18+ — required for the Next.js web client
- git — to clone the repository
Setup
Install the engine
Install the To also enable LLM agents (Tier 3) or Lua eval, install optional extras:
realm-engine package in editable mode. This pulls in FastAPI and uvicorn.Start the engine
Run uvicorn from the You should see
engine/ directory. The --reload flag restarts the server automatically when you edit Python files.Application startup complete. The engine is now available at http://localhost:8000.Start the web client
Open the app
Go to http://localhost:3000 in your browser. You should see the Realm map. From here you can claim a plot, survey it, pick a production recipe, and advance ticks to watch inventory update.
Running both terminals at once
Resetting the world
During development you can reset the in-memory world to any named scenario without restarting the server. ThePOST /dev/reset endpoint destroys the current world and bootstraps a fresh one.
frontier (default)
frontier (default)
A 48×36 grid. You start with $10,000 and a small starter inventory (timber, coal, electricity, iron ore, copper ore, clay, grain). Several Tier 1 NPC vendors and buyers seed the first markets. The standard starting scenario for testing the core economic loop.
cartel
cartel
Same grid and starter as
frontier, but the grain market is disrupted: the normal vendor listing is split between the incumbent vendor at near-market price and a cartel_grain_cell holding stock at a premium. Tests price manipulation and market intelligence dynamics.bootstrapper
bootstrapper
A smaller 32×24 grid. You start with only $4,850 — tight capital forces careful resource allocation. Good for testing early-game constraint paths.
speculator
speculator
A 40×30 grid with $20,500 starting capital. More cash than the frontier scenario but on a medium map. Good for testing market positioning and order-book strategies.
millrace
millrace
A 42×28 grid with $9,750 starting capital. A near-frontier starting position with a slightly different map shape.
archive
archive
A 48×36 grid (same as frontier) with $10,800 starting capital. Market intel is pre-activated for the first 280 ticks —
GET /world returns full market_history from the start. Good for testing analytics and charting flows.genesis
genesis
A large 96×72 grid with 50 algorithmic settlers and two population hubs (
pop_hub_e, pop_hub_w) each seeded with $50,000 for aggregate demand. Terrain-correlated subsurface (stronger ore under mountains, clay in forests and plains). The genesis_exchange seeds cold-start liquidity in grain, timber, coal, and electricity. Intended for testing large-world dynamics and the full settlement economy.Saving and loading
The engine holds world state in memory. To persist it to disk, call the save endpoint:saves/realm_dev.sqlite at the repo root. The saves/ directory is created automatically if it does not exist. Save files are self-contained SQLite databases — you can copy, rename, or share them freely.
Verifying the engine
To confirm the engine is running correctly, hit the health endpoint:http://localhost:8000/docs (Swagger UI) and http://localhost:8000/redoc (ReDoc) while the server is running.
Optional: LLM agents
Tier 3 LLM-driven agents (named characters with memory) require an Anthropic API key:GET /llm/status and trigger a planning step with POST /llm/step?party=<agent_party_id>. The engine tracks session spend in micro-dollars and enforces a configurable cap to prevent runaway costs.
For more on each endpoint see the Engine API Reference. For architecture details, see Technical Architecture.