Skip to main content

Module federation

Module federation 

Source
Expand description

Cross-engine search federation over multiple vector backends.

Federation queries several AsyncVectorIndex backends concurrently and merges their results with the existing fusion functions (rrf_fuse, weighted_sum_fuse).

§Why RRF is the default

Heterogeneous backends score on incompatible scales: Qdrant (cosine distance) returns scores in [0, 1]; Elasticsearch knn _score is (1 + cosine) / 2, also in [0, 1] but a different monotonic transform; the in-memory TurbovecIndex returns raw cosine in [-1, 1]. Score-based fusion (weighted sum) over these raw values ranks documents incorrectly because a 0.3 from one backend is not comparable to a 0.3 from another.

FusionStrategy::Rrf is rank-based (1/(k + rank)), so it is scale-invariant — it fuses heterogeneous backends correctly with no normalization. That is why it is the default. FusionStrategy::WeightedSum is opt-in: it normalizes each list with min-max first, which is only correct when every backend scores on a comparable scale, so it carries a caveat.

Structs§

FederatedSearch
Concurrent search over multiple AsyncVectorIndex backends.

Enums§

FusionStrategy
How federated result lists are merged.

Functions§

federate_results
Fuse pre-fetched result lists with no I/O.