
Why expansion works: a short, ambiguous query becomes several reformulations that each search independently and fuse via Reciprocal Rank Fusion; HyDE takes the opposite path and embeds a hypothetical answer instead of the question.
Stage Category: FILTER (Generates and fuses search results)Transformation: 1 query → N query variations → fused results
When to Use
When NOT to Use
Parameters
Fusion Methods
Configuration Examples
How Query Expansion Works
- Original Query: “how to fix memory leaks”
- LLM Generates Variations:
- “memory leak detection and resolution”
- “debugging memory issues in applications”
- “preventing memory leaks in code”
- Execute Searches: Run the
feature_search_configfor the original query (unlessinclude_originalisfalse) and for each variation, concurrently - Fuse Results: Combine using RRF or linear fusion
- Return: Deduplicated, ranked result set
Reciprocal Rank Fusion (RRF)
RRF combines results from multiple queries using the formula:k is rrf_k (60 by default), and rank_i is the document’s rank in query i’s results.
Output Schema
Each returned document carries the fused result in itsscore. With rrf, a document ranked first by all four queries scores 4 / (60 + 1), about 0.066.
The stage metadata reports how the run went:
Performance
Common Pipeline Patterns
Expanded Search + Rerank
Expansion + Filter + Summarize
Cost Optimization
Error Handling
Related
- Feature Search - Single query search
- Feature Search - Vector + text search
- Rerank - Re-score fused results

