WorldForge
Inspiration
The premise came from a frustration with AI storytelling systems: they're either world simulators with no narrative soul (Dwarf-Fortress-style emergent chronicles that read like server logs) or LLM storytellers with no world (AI Dungeon-style free generation where the world contradicts itself by the third paragraph). The gap between "a world that genuinely runs" and "a story that genuinely moves" felt bridgeable — but only if you refuse to let the LLM be both the physics engine and the narrator.
The deeper inspiration was the Three-Body Problem's central horror: a civilization that mathematically proves it cannot survive, where prediction horizon grows only logarithmically with precision — $T_{\text{pred}} = \frac{1}{\lambda}\ln!\left(\frac{\Delta}{\delta_0}\right)$. That's not a story you can let an LLM improvise; the math has to be ground truth, and the LLM's only job is to translate it into the scene of a scientist weeping at a console. That single image — the kernel computes the verdict, the LLM only weeps — became the entire architectural red line.
The north star crystallized late, in one sentence from the project owner: One Sentence + LLM + Framework = A Progressing World — one sentence in, a living world out.
What it does
WorldForge is a world simulator + bounded-rational agents + causal explanation layer. You give it one sentence:
worldforge "Three-body World"
and it runs the full pipeline:
- Legislation — the LLM drafts the world's rules (a declarative DSL), GUI, gameplay, characters, and even the cognitive model of that world's subjects (what they can misjudge, and how).
- Compilation — a deterministic kernel compiles those rules. The LLM never adjudicates a runtime outcome.
- Progressing — the world auto-advances. Agents observe (through an observation filter, never raw truth), update beliefs (three strategies: rational / dogmatic / conspiratorial), form persistent commitments, and act. Other agents react next tick — not telepathically this tick.
- Three postures — you can be Creator (onboarding), Guest (possess a character, setuid-style), or Bystander (just watch it live, fast-forward, get a recap when you return).
The Three-Body world is the first instance; economy, politics, investigation are verified instances of the same framework — not special-cased.
How we built it
The architecture rests on one red line (I2): the LLM never adjudicates anything with a deterministic truth source. Everything else follows:
- Deterministic kernels (symplectic integrator for three-body physics, DSL rule engine for economy/politics, GameKernel for gameplay) compute ground truth.
- AgentMind — a full stack:
CognitiveModel(belief vs ground truth, Sabre-style committed beliefs),ObservationFilter(agents see filtered, delayed, noisy projections — never raw state),belief_update(rational/dogmatic/conspiratorial revision with backfire — $\text{belief} \mathrel{+}= \text{evidence} \times w_e \times w_u$, but dogmatic agents reinforce on contradiction),CharacterGraph(trust-gated information propagation),multi_scale_agents(Individual → Organization → Collective). - Decision-commitment lifecycle — the insight that made the world feel real: major decisions aren't instantaneous state deltas, they're
Commitmentobjects that lock budgets, trigger organizational reactions, face opposition, and execute over ticks. A scientist's observatory isn'tshelter += 30; it's a proposal → 40% budget → 3-tick delay → long-livedWorldModifier. - Two-stage causal narrative — LLM-1 proposes a causal graph (cause/mechanism/effect, from the agent's subjective world only), a symbolic validator checks it (does the agent actually hold that belief? is the action in-scope? did it use facts the agent couldn't know?), LLM-2 realizes it into prose, and an NLI bidirectional-entailment guard catches any flip of the kernel's verdict.
- Q7: LLM-generated cognitive models — the project's one genuine research gap. Story2Game generates action preconditions; PDDL generates physics; nobody generates "what can the subjects of this world misjudge." We do.
Challenges we ran into
- The shadow-world drift. The worldbook mixed kernel facts with LLM prose; the next tick's narration read the prose as fact, and within a few ticks the "world" was a fanfic of itself. Fix:
WorldBookEntry.provenance(canonical_event / narrative_rendering / agent_observation / agent_belief / rumor / lore) and narration reads only canonical as its factual skeleton. - LLMs systematically "correct" counter-intuitive causation back to common sense (Yamin et al.). A civilization that correctly dehydrated but still perished would get silently flipped to "survived" by the narrator. This made the consistency guard a main-path component, not an edge-case fallback. NLI bidirectional entailment replaced keyword matching.
- Parallel agent orchestration kept killing agents mid-task. Multiple sub-agents sharing a working tree caused
git resetcross-fire; several died across session boundaries with half-finished work. Fix: worktree isolation + "commit every small unit, never one big commit" discipline. We recovered every dead agent's landed code. - The "script picks the right answer" trap. Early AgentMind decision logic was
if danger > 0.5: evacuate(). That's an NPC with database access, not a bounded-rational subject. The rebuild: subjective-utility softmax over subjective probabilities, with personality tuning belief formation (evidence weight, risk profile, update rate) — never action directly. Determinism ≠ correctness: same seed produces the same stable mistake.
Accomplishments that we're proud of
- The red line held. Across 90 commits and ~1700 tests, the LLM never once adjudicated a deterministic outcome. The three-body evacuation is mathematically proven ($T_{\text{pred}}^{\text{best}} < \overline{\Delta}_{\text{chaos}}$), not narrated.
- Stable, explainable mistakes. A dogmatic scientist, given five rounds of contradictory evidence, monotonically reinforces her wrong belief (predicted 0.5 → 0.30 → 0.007 → −0.43 → ...) — the same backfire the belief-revision literature predicts, and it's fully deterministic and traceable to a cognitive-bias error source.
- The distrust disaster, reproduced. A scientist knows the disaster probability is 90%, but the leader distrusts her → the proposal never reaches the decision body → civilization persists into chaos →
destroyed_decision. The error is traceable to an information source, not random NPC stupidity. - Q7 is a real gap. Generating per-world cognitive models (what subjects misjudge, and the structure of that misjudgement) has no prior work we could find. It's the one piece that could lift this from a workshop paper to a real contribution.
- One sentence in, a world out.
worldforge "三体世界"with no flags produces a self-progressing world with agents, commitments, and causal narrative. The north star is met.
What we learned
- The right place for an LLM is legislation and translation, never adjudication. Every time we let the LLM touch a runtime outcome, the world lost necessity and became a random story generator. Every time we kept it out, the world gained weight.
- Bounded rationality is an architecture, not a prompt. "You are a stubborn scientist" in a prompt does nothing reliable. "Evidence weight × 0.3, contradiction → backfire" in a numeric kernel produces a character who coherently refuses to update — and you can replay the exact trace.
- Major decisions should be objects, not deltas.
world.shelter += 30is a world with no memory. ACommitmentwith progress, opposition, and scheduled effects is a world with history and path dependence. The latter is what makes a world feel alive. - Dramatic irony is an engineering primitive. The gap between ground truth and an agent's committed belief is exactly the literary device — and it's measurable, deterministic, and narratable.
What's next for WorldForge
- Multi-world AgentMind live demo. Verify the framework (not just the three-body instance) end-to-end at the user-facing layer: politics, investigation, cyberpunk, fantasy — each running the full observe → believe → commit → react → narrate loop.
- Long-horizon belief evolution. Cross-tick cognitive accumulation as a first-class narrative object — the dogmatic scientist who, after surviving one false alarm, becomes even harder to reach on the real one.
- Automated AgentMind generation (Q7) wired into onboarding as default, so one sentence doesn't just generate rules and a GUI — it generates the kind of minds that inhabit that world.
- Evaluation. A user study comparing WorldForge's narrative coherence against a pure-LLM baseline, and an ablation showing the decision-commitment layer's effect on perceived world realism. The engineering is done; the science is next.
- Localize the Run. To run all models LOCALLY on a Nvidia DGX Spark and no data leaves the machine.
Built With
- chatgpt
- codex
- python
- sillytavern
Log in or sign up for Devpost to join the conversation.