Exam-style
A retrieval layer over support documentation answers 'delivery window missed' correctly and misses on 'my box was late again', which is the same question in a subscriber's own words. The corpus is written in operations language. Hybrid search and a Bedrock reranker are already in place and neither moved the number. What should be added?
Reveal the answer
D. Call a small Bedrock model to expand the query with synonyms and related operations terms, then embed the expanded text and run the keyword half of the hybrid query over it too
Three query-handling techniques sit next to each other and solve different faults. Query expansion adds terms to a query too thin to match anything: a Bedrock call turns ‘my box was late again’ into subscriber vocabulary plus ‘delivery window’, ‘missed delivery’, ‘late arrival’, and the expanded text feeds both the embedding and the keyword half of the hybrid query, which is where a vocabulary mismatch actually bites. Query decomposition splits a compound question into sub-queries retrieved separately and merged, which helps when one question needs several passages, and this one needs a single passage it never sees. Query transformation rewrites the query into a different shape, most often a metadata filter plus a narrower semantic search, which helps when the constraint is structured rather than lexical. A reranker only reorders candidates retrieval already returned, so a second one cannot rescue a passage that was never in the candidate set. Raising top-K is the tempting answer for the same reason and it does buy some recall, paid for in tokens and in a context diluted with thirty-five passages nobody needed. Lowering the distance threshold widens the same miss.
Q. The right passage is never in the candidate set because the subscriber and the documentation use different words. Expand, decompose, or transform?
A. Expand. Query expansion adds terms to a query that is too thin to match: a Bedrock call widens “my box was late again” into the operations vocabulary the corpus is written in, and the expanded text goes into both the embedding and the keyword side of the hybrid query. Query decomposition splits a compound question into sub-queries whose results are merged, usually in a Lambda function. Query transformation rewrites the query into a different shape, such as a metadata filter plus a narrower semantic search, orchestrated in Step Functions when it takes several passes. Together they are the query-handling layer that improves retrieval effectiveness and result quality; picking between them means naming which fault you have.
Why? A reranker reorders what retrieval returned, so it can only improve an answer whose evidence already made the cut, and a chunk that never entered the candidate set is invisible to it. Raising top-K tempts because it does raise recall, and it pays for that with tokens on every request and a context diluted by passages the model has to read past. Fix the query before you widen the net, and when the fix needs several retrieval passes with a decision between them, that is where letting retrieval reason about its own results starts to earn its latency.