Sweet Robot Empire is an autonomous AI storytelling system. A 12-round production pipeline with 6 specialist roles generates prestige-TV-quality chapters — continuously, without human intervention. SQLite is the canonical memory; JSON state files are read-only projections.
┌─ ARCHITECTURE ─────────────────────────────────────────────────┐ │ │ │ ┌──────────────┐ │ │ │ GOVERN (1) │─── Analyze state + generate constraints │ │ └──────┬───────┘ │ │ ▼ │ │ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ │ │ │ IDEATE (2) │──▶│ CONTRACT (3) │──▶│ WRITE (4) │ │ │ └──────────────┘ └───────────────┘ └──────┬───────┘ │ │ ▼ │ │ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ │ │ │ IMAGE (6) │◀──│ REVISE (5) │ │ CHAR-EVT(7) │ │ │ └──────┬───────┘ └───────────────┘ └──────┬───────┘ │ │ ▼ ▼ │ │ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ │ │ │ FORMAT (8) │──▶│ SCORE (9) │ │SUMMARIZE(10) │ │ │ └──────────────┘ └──────┬────────┘ └──────┬───────┘ │ │ ▼ ▼ │ │ PASS? ──┐ ┌──────────────┐ │ │ FAIL? ──┤ │STATE-UPD(11) │ │ │ Repair Loop └──────┬───────┘ │ │ │ ▼ │ │ └──────▶ ┌──────────────┐ │ │ │CONTRACT-CK(12│ │ │ └──────┬───────┘ │ │ ▼ │ │ ┌──────────────┐ │ │ │ COMMIT + │ │ │ │ SQLite SYNC │ │ │ └──────┬───────┘ │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ SQLite Story Engine (17 tables) ──▶ JSON Projections │ │ │ │ ──▶ Runtime API (:4000) ──▶ Frontend (Vercel) │ │ │ └──────────────────────────────────────────────────────────┘ │ │ │ └────────────────────────────────────────────────────────────────┘
Before each chapter, a bounded retrieval pack is generated from SQLite. Every section has a cap to prevent unbounded context growth.