← Portfolio

Prototype · three rewrite strategies benchmarked

Query Rewriting for a Global Asset Manager’s Research RAG (Prototype)

An asset manager’s internal research assistant retrieved well when users asked well. We benchmarked three ways to rewrite the questions they actually ask, and matched each to the kind of question it fixes.

query.rewriteprototype
AnalystWhat is the outlook for emerging markets?
HyDEDraft a likely answer, embed it with the question
Rewrite · retrieve · readEM growth outlook? · EM inflation and rates? · EM currency risk?
STORMFollow-ups: which regions lead? what are the risks?
Illustration
At a glance
ResultPrototype · three rewrite strategies benchmarked
BeforeVague questions without keywords; Three questions asked at once; Users unsure what to ask next
StackRAG, Query Rewriting, HyDE, Asset Management
Related serviceEnterprise RAG

What problem did the client have?

A global asset manager already ran a multimodal RAG pipeline over its research publications. Retrieval was fine for precise questions and poor for real ones: vague questions that never named the asset class, compound questions that asked three things at once, and questions that needed a follow-up the user had not thought of.

What did we build?

A prototype query-rewriting layer in front of the existing retriever, tested on the firm’s own public research (an emerging-markets report). Each strategy was measured on retrieval before and after the rewrite, so the result was a routing decision, not an opinion.

Before: Vague questions without keywords; Three questions asked at once; Users unsure what to ask next. After: Prototype · three rewrite strategies benchmarked.

Before

  • Vague questions without keywords
  • Three questions asked at once
  • Users unsure what to ask next

How it works

  1. Hypothetical answer first (HyDE). For a vague question, the model drafts a plausible answer, a question is rewritten from that draft, and both are embedded. The draft may be wrong, but it carries the vocabulary the real documents use.

  2. Rewrite, retrieve, read. For a compound question, a rewriter splits it into separate retrievable queries before anything is searched, so each part finds its own evidence.

  3. Perspective-driven follow-ups (STORM). For an exploratory question, a small set of perspective agents each proposes one follow-up query, surfacing angles the user would have asked next.

  4. Measure at retrieval, not at the answer. Every strategy was scored on what it retrieved, against the unrewritten baseline, so a fluent answer could not hide a weak search.

  5. Route by question type. The outcome: HyDE for vague questions, rewrite-retrieve-read for compound ones, STORM when the user needs help deciding what to ask.

After

Prototype · three rewrite strategies benchmarked

Stack

RAGQuery RewritingHyDEAsset Management

Why does it hold up in production?

Most RAG failures are blamed on the model and caused by the question. Rewriting is cheap, but only one strategy suits each kind of question; applying all of them to every query adds latency and noise. Measuring at retrieval is what made the routing defensible.

First-Sprint Data Scientist

A vetted engineer embedded in your team, a shipped deliverable by end of sprint 1.

Pick a time below and you will speak with me directly. Bring the use case, the data and the constraints, and I will give you a straight view on feasibility, effort and the first thing to ship.

Book a call

Cat Yung

Hong Kong & London time zones

Book a call · 30 min with Cat Yung