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

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.
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
👀 See Also

OpenClaw User Builds Bank and Credit Card Statement Summarization Skills
A new OpenClaw user self-hosted the tool on a hardened server and used it to develop two custom skills: one to summarize and categorize bank statements, and another to summarize credit card statements with categorization and break detection. The skills automatically generate reports when new statements appear and send Telegram notifications.

OpenClaw user reports significant improvements after switching to OpenAI OAuth with GPT-4
A developer struggling with Kimi k2.5 and Minimax2.7 models in OpenClaw switched to OpenAI's OAuth connection with GPT-4 and adaptive think, reporting immediate stability improvements and completing multiple automation tasks in 4-5 hours.

Running an AI News Channel with Telegram and OpenClaw: A Complete Workflow
A developer shares their setup for running a Telegram news channel with just 10-20 minutes of daily human oversight.

Using MCP Servers to Connect Claude to Live Databases for On-Demand Analysis
A developer built an MCP server for CybersecTools, connecting Claude to a database of 10,000+ cybersecurity products, enabling live data analysis instead of traditional dashboards. The server provides 40 tools for comparing vendors, analyzing market categories, and checking NIST CSF 2.0 coverage.