← Back to portfolio Repo

Case study · Project 02

AI Dungeon Master

A choose-your-own-adventure where the dungeon master is a pipeline, not a free-form chatbot. Structured world state, validated turn deltas, streaming narrative, and a latency inspector for local models.

Problem

Most LLM roleplay demos are chat with flavor text. Over a long session they forget who rules the city, which door was locked, or whether the player is a disgraced knight. Free-form generation optimizes for the next paragraph, not for a coherent campaign. Players (and interviewers) can feel the drift immediately.

The goal was a system that still feels creative, but treats the world as data: factions, locations, NPCs, flags, and constraints that update in a controlled way every turn.

Approach

Why this design

Validated deltas beat pure chat when consistency across long sessions matters. The product story is inspectability: you can reason about what the model changed, not only what it wrote. That matches a systems-first view of AI—architecture and state before “make it funnier.”

Stack

Frontend: React 19, TypeScript, Vite, Tailwind, Zustand, React Flow.
Backend: Python, FastAPI, SQLAlchemy, Pydantic, Alembic, SQLite, SSE.
Models: Anthropic Claude and/or local Ollama.

Role on the build

Product and systems direction: pipeline shape, state model, human-facing loop (setup → turn → inspect). Implementation steered heavily with AI coding agents; ML literacy informed model routing and latency expectations for local vs cloud. Graphic direction for the dark / gold “chronicle” feel.

Links

Repo: github.com/derkaiserelias1/AI_roleplayer

Open repo Back to Project 02 All work