Skip to content

ShowcasedPath oneGames & creative

The Goblin Warren

A browser D&D 5e dungeon crawl whose AI Dungeon Master answers rules questions with cited sources.

by Anshu Mandal

Edition conflicts the Knowledge Base flagged for review instead of passing to the agent
6
Typical time to return a rules answer
1.3–2.2 s
Rule and condition documents indexed in the Knowledge Base
120

What it does

A player asks what Prone does. The Dungeon Master answers with citations.

Players lead a Fighter, Wizard and Cleric through five dungeon levels, exploring under fog of war and fighting turn-based d20 combat with 3D dice. At any point they can ask the Dungeon Master a rules question.

Each answer comes with clickable rule chips, a graph of the documents used and a trace of every lookup. A toggle switches between the 2014 and 2024 rules, and the DM notes when a rule changed between them.

The problem

An AI Dungeon Master that makes up rules breaks the game.

D&D 5e has two editions that disagree on many small rules, and a language model will readily blend them or invent a ruling that sounds right. Players then can't tell whether an answer is real. Exact numbers such as armor class, hit points and spell dice have to be correct, not close.

What they built

SRD rules and monsters modelled per edition, with deterministic IDs.

87 rules, 33 conditions, 14 spells and 15 monsters in 2014 and 2024 editions; 120 documents in the Knowledge Base.

  • rule

    One SRD rule in a given edition, with its rule text.

  • condition

    One condition, such as Prone or Grappled, in a given edition.

  • spell

    A spell with its level, school, dice, save and effects.

  • monster

    A monster stat block: AC, HP, CR, speed and attacks with to-hit and damage.

  • hero

    One of the party's playable heroes, loaded by the game.

  • room

    A dungeon room the game loads from the dataset.

The stack

Two Context endpoints: one for rule prose, one for numbers.

  • Sanity Studio 6
  • Sanity Context MCP
  • Knowledge Base
  • Content Lake
  • GROQ
  • Next.js 16
  • React 19
  • Phaser 4
  • AI SDK 7
  • Baseten
  • DeepSeek V4.1 Flash
  • Tailwind 4
  • Vitest
  • Playwright
  • Claude Code
  • Vercel

The hard part

The server looks rules up first, and any citation no lookup returned is removed.

Before the model runs, the server queries the Knowledge Base endpoint and the GROQ endpoint in parallel. The model gets one optional tool round, then must answer without tools. Citations no lookup returned are stripped, and GROQ queries must filter by _type or _id, with drafts blocked.

The Knowledge Base flagged six places where its entries blended the two editions. The DM surfaces those edition notes as a rules-changed callout, so players see where 2014 and 2024 differ.

More from path one

See the full showcase