Query Experience Flow

How the Archivist Works

From question to cited answer — seven steps through the archive

I

Natural Query

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.js
II

DM Personality & Creativity

Dual 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 Sliders
III

Hybrid Retrieval

Query routes through two parallel paths — vector semantic search (ChromaDB) for narrative rules and structured filtering for stats. Normalized embeddings ensure consistent matching.

ChromaDB FastAPI
IV

Confidence Gating

Threshold-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.1
V

Grounded Answer

Gemini 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 Citations
── result display ──
VI

3D Scene Response

Answer 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 Room
VII

Mobile Drawer & Toolkit

On 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