Query Rewriting & HyDE in Retrieval‑Augmented Generation
Diagnosis Table
Symptom Likely Root Cause Immediate Mitigation
Low relevance but correct intent Query too terse or uses domain jargon unknown to the retriever Run an Intent Analyzer and consider a safe rewrite (add missing qualifiers).
High relevance, unintended facts HyDE synthetic document mismatches real sources Verify HyDE output against a deterministic Live‑Value Resolver before composition.
Compliance flags on answer Original query contains regulated entities (e.g., ticker symbols) that were altered Preserve the exact token sequence; skip rewrite and apply rule‑based guardrails.
Sudden latency spikes Both rewrite and HyDE pipelines fire for every request Add a Decision Helper that selects a single strategy per query.
Repeated hallucinations on numeric topics Retrieval fell back to stale cache instead of live API Route numeric sub‑queries to an authoritative tool/API.
Decision Flow
flowchart TD A["User query"] --> B["Is query…