ALTWORLD: A Persistent Life-Sim Architecture That Separates LLM from Database to Solve AI Amnesia

✍️ OpenClawRadar📅 Published: March 31, 2026🔗 Source
ALTWORLD: A Persistent Life-Sim Architecture That Separates LLM from Database to Solve AI Amnesia
Ad

ALTWORLD is a persistent life-simulation game built to solve the "AI amnesia" problem common in AI-driven games and agents. Instead of relying on an LLM's context window to maintain world state, the system stores the canonical run state in structured tables and JSON blobs within a PostgreSQL database.

Architecture and Implementation

The project uses a Next.js App Router, Prisma, and PostgreSQL stack to handle complex transactional run creation. When a player inputs a move, the system mutates state through explicit simulation phases first, then generates narrative text after state changes. This strict separation ensures actions happen according to a timeline and past decisions influence future events.

The AI physically cannot hallucinate items like a sword into inventory because the PostgreSQL database will reject illogical state changes. The system can recover, restore, branch, and continue purely from hard data, creating a materially constrained life-sim tone rather than a pure power fantasy.

Ad

Key Components

  • World Forge: An AI-assisted tool where players pitch scenarios, and the system generates factions, NPCs, and pressures. Claude helped write strict JSON schema validation and normalization pipelines that convert generative drafts into hard database rows.
  • Simulation Loop: Includes lock-recovery and state-mutation logic for turn advancement, ensuring world systems and NPC decisions resolve before the narrative renderer is called.
  • State Management: The canonical run state is stored in PostgreSQL with structured tables and JSON blobs, completely separating the LLM from the database.

Development Approach

The developer used Claude heavily for underlying engineering tasks rather than just prose generation. Claude helped structure the architecture, write validation pipelines, and implement the simulation loop logic. The game runs on a self-made engine called StoriDev.

The project is free to try with guest preview runs offering a limited number of free moves before account creation is required. The developer specifically seeks feedback from other developers working on persistent AI agents or decoupled architectures.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

Fine-tuning llama3.2 3B for personalized health coaching using Apple Watch data and MLX
Use Cases

Fine-tuning llama3.2 3B for personalized health coaching using Apple Watch data and MLX

A developer fine-tuned llama3.2 3B on a Mac using MLX in 15 minutes to create a health coach LLM that analyzes personal Apple Health and Whoop data. The model provides specific health insights instead of generic advice, running locally with a 2GB memory footprint.

OpenClawRadar
Building a Personal AI Agent with Claude Code: Lessons from 6 Months of Wiz
Use Cases

Building a Personal AI Agent with Claude Code: Lessons from 6 Months of Wiz

A developer shares their experience building Wiz, a personal AI agent on Claude Code that handles morning reports, evening summaries, and inbox triage. The post details 9 mistakes made during development, including starting with overly ambitious goals and letting Claude generate core instructions without review.

OpenClawRadar
How One Team Replaced a 6-Figure HubSpot Agency with Claude Code
Use Cases

How One Team Replaced a 6-Figure HubSpot Agency with Claude Code

A mid-sized e-commerce company built their entire HubSpot Enterprise migration using Claude Code, replacing quotes of 20k-80k EUR for partial setups. They built 6 custom objects, 5 n8n integrations, and a KlickTipp migration in 4 months, with Claude Code handling both code and documentation.

OpenClawRadar
Practical Lessons from Using AI Agents on a 100k LOC Codebase
Use Cases

Practical Lessons from Using AI Agents on a 100k LOC Codebase

A developer shares six specific techniques learned while using Claude Code and Cursor to build a pandas-compatible API layer on top of chDB, including maintaining a CLAUDE.md rules file, using zero-context agents as critics, and structuring multi-agent workflows with filesystem-based coordination.

OpenClawRadar