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 address 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’ and ‘late arrival’, and the expanded text feeds both the embedding and the keyword half of the hybrid query, which is where a vocabulary mismatch shows up. Query decomposition, a built-in Knowledge Bases setting, splits a compound question into sub-queries retrieved separately and merged. That helps when one question needs several passages; this one needs a single passage retrieval never returns. 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 numberOfResults is tempting for the same reason, and it does raise recall, at the cost of tokens on every request and a context diluted with thirty-five passages nobody needed. Relaxing the similarity threshold widens the same miss.
Q. The right passage never enters 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 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, and Bedrock Knowledge Bases has a built-in setting for it. Query transformation rewrites the query into a different shape, such as a metadata filter plus a narrower semantic search. Picking between the three 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 numberOfResults does raise recall. It also adds tokens on every request and leaves the model reading past passages nobody needed. Fix the query first. When the fix takes several retrieval passes with a decision between them, agentic retrieval is the next step.