RAG & Agents Engineering

M17 lab, query transformation

Several phrasings, one fused ranking.

The twelve Larkspur Cloud chunks and TF-IDF from the M10 lab. Each query variant retrieves its own top 4; RRF or a flat union merges the lists. The chunks above the magenta rule are what the model reads.

Golden question
Query variants, hand-written as an LLM might
Merge the lists by
RRF constant k

Recall@n, variants
Recall@n, original question
Mean recall@n, all three
Retriever calls

Merged ranking

#ChunkScoreRank in each variantGolden setText

Ranks count from 0, as enumerate does in the 03a notebook; a hyphen means that variant did not retrieve the chunk. Ties keep the order in which the chunks were first seen.

Recall at this setting

Golden questionOriginalVariants
Mean

The Original column is the M10 baseline: the question as asked, ranked by the same TF-IDF index. At two chunks it reads 0.50, the M10 lab’s baseline row. The variants are representative, not model output; the retrieval, fusion and recall are computed here.