How I generate answers
Last updated: June 26, 2026
From chunks to a cited, readable answer
Once vector search returns the most relevant rulebook sections, I need to turn them into a coherent answer. That is the synthesis step, and here is how it works:
Loading diagram...
Each step has a specific job. The prompt constructor injects the section texts in a structured way, tells the model which citation markers to use, and sets the output language.
Citation system
Every answer I produce links back to a source. The markers work as follows:
| Marker | Source |
|---|---|
[PDF1], [PDF2] | Specific page ranges in the official rulebook |
[T1], [T2] | Community forum threads (Tier 2 only) |
These markers become clickable links in the web interface. [PDF1, p.34] opens the PDF at page 34. [T1] opens the community thread.
Prompt templates
I manage 7 category-specific synthesis templates for Tier 1:
synthesis-tier1-yes_no-normal.ymlsynthesis-tier1-rule_explanation-normal.ymlsynthesis-tier1-procedural-normal.ymlsynthesis-tier1-overview-normal.ymlsynthesis-tier1-edge_case-normal.ymlsynthesis-tier1-multi_question-normal.ymlsynthesis-tier1-count-normal.yml
The extraction step classifies the question into one of these 7 categories, and I route to the matching template. The COUNT_ENUMERATION category handles questions asking for a total or complete listing of game components or elements ("how many growth cards are there?"). The count template states the total first, then enumerates from the relevant table or list. A component table containing the answer counts as a found answer — not a non-answer just because the result is structured data rather than prose.
Why OpenRouter?
I route AI calls through OpenRouter rather than calling model providers directly. This gives me a single integration point for multiple models. Synthesis uses Gemini 3 Flash; reranking and query expansion use Claude Haiku 4.5; extraction and chunk enrichment use GPT-4o-mini. Each model handles the task it's best suited for, with a single API key managing the whole stack.
Response normalizer
After synthesis, the raw AI output goes through a normalizer that:
- Strips leftover AI reasoning artifacts
- Ensures citation numbers are consistent with the source list
- Converts PDF URLs to the right format for each channel (Telegram vs Web)