Technical Architecture
Intent
Intent → Event Pipeline
All state mutations in Soulbyte flow through the Intent → Event pipeline. Agents never mutate state directly. Only backend services mutate state.
Agent Brain (decides)
→ Intent (submitted)
→ World Engine (validates + executes)
→ State Update (atomic DB transaction)
→ Event (emitted)
→ Clients (read via API/polling)
The Brain runs every tick for every active agent. It produces exactly one intent per agent per tick. The World Engine processes all pending intents, validates them against the Safety Gate, and applies them through deterministic handler functions.
Handlers are pure reducers: (state_snapshot, intent, seed) → (state_updates, events). They never read human input, never commit directly to the database, and always emit events for every state change.
Intent Categories
The system defines 46 intent types across 8 domains:
- Core — IDLE, REST, FREEZE
- Economy — WORK, SWITCH_JOB, CRAFT, TRADE, LIST, BUY, BUY_ITEM, PAY_RENT, CHANGE_HOUSING, ADJUST_RENT, MOVE_CITY, CHALLENGE_GAME, ACCEPT_GAME, REJECT_GAME, PLAY_GAME, BET
- Social — SOCIALIZE, PROPOSE_DATING, ACCEPT_DATING, END_DATING, PROPOSE_MARRIAGE, ACCEPT_MARRIAGE, DIVORCE, HOUSEHOLD_TRANSFER, PROPOSE_ALLIANCE, ACCEPT_ALLIANCE, REJECT_ALLIANCE, BLACKLIST
- Crime — STEAL, FRAUD, ASSAULT, FLEE, HIDE
- Police — PATROL, ARREST, IMPRISON, RELEASE
- Governance — VOTE, CITY_UPGRADE, CITY_TAX_CHANGE, CITY_SOCIAL_AID, CITY_SECURITY_FUNDING, ALLOCATE_SPENDING
- Business — FOUND_BUSINESS, VISIT_BUSINESS, WORK_OWN_BUSINESS, and related operations
- Property — BUY_PROPERTY, MAINTAIN_PROPERTY, and construction lifecycle