Fuse already-per-scope-fused result lists into a single cross-scope ranking.
Each entry in scopeResults is a per-scope ranked list (already internally fused
across its providers via Fuse()). Cross-scope RRF treats each scope's ranking as
one input list to a new RRF computation, so records that appear in multiple scopes
get boosted.
Map of scopeID → per-scope results.
Maximum number of results to return.
OptionalfusionWeights: Record<string, number>Optional per-scope weights keyed by scope ID. Missing keys default to 1.0.
Fused, cross-scope-ranked results (not yet deduplicated).
Deduplicate results by EntityName+RecordID. When the same record appears from multiple sources (e.g., vector + entity), prefer entity results (they have richer metadata like snippets and field data) and merge the score breakdowns. The final score is the maximum across sources.
Fuse multiple ranked result lists using RRF, deduplicate, and return the top results up to maxResults.
When only one source has results, scores are normalized relative to the top result so the best match appears at ~95% rather than raw cosine similarity (~40-50%).
Labeled result lists from each search source
Maximum number of results to return
OptionalfusionWeights: FusionWeightsByProviderOptional per-provider weights applied during RRF.
Keys match SearchSource values (plus any custom source types).
Missing keys default to 1.0. Only applied when there are 2+ sources.
Fused, deduplicated, and ranked results
Handles fusion and deduplication of multi-source search results using Reciprocal Rank Fusion.