From question to cited answer — seven steps through the archive
User asks a D&D rules question in plain language through the 3D fantasy book interface — "How does grappling work?" or "What's a Goblin's HP?"
React Three.jsDual slider system shapes the response: AI creativity controls inventiveness, DM personality selects from 3 distinct Dungeon Master voices for flavor and tone.
DM Toolkit Dual SlidersQuery routes through two parallel paths — vector semantic search (ChromaDB) for narrative rules and structured filtering for stats. Normalized embeddings ensure consistent matching.
ChromaDB FastAPIThreshold-based filtering (score < 1.1) validates relevance. Out-of-domain queries are rejected with clear messaging. No hallucinated rules make it through.
RAG Pipeline Threshold: 1.1Gemini 1.5 Flash generates a response grounded in retrieved chunks. Every answer includes source citations so users can trace rulings back to official SRD content.
Gemini 1.5 Source CitationsAnswer renders inside the fantasy book within the 3D dungeon room. Loading indicators, themed error messages, and confidence scores all display in-world.
Three.js Dungeon RoomOn mobile, the full 3D scene fills the screen while the DM toolkit lives in a swipeable bottom drawer. Touch-optimized targets and swipe gestures for seamless play.
Mobile-First Bottom Drawer