Repository navigation
Description
Feature Request: Server-side Hybrid Fusion (vector.fuse)
Originated from discussion #4044 (Qdrant to ArcadeDB migration).
Overview
Add a server-side multi-source fusion operator so a single SQL statement can combine ranked results from multiple indexes (dense vector + sparse vector + full-text + payload-based) and reduce them with a fusion strategy.
Today, hybrid retrieval requires two roundtrips and client-side reranking. After this issue, it is one query, fully composable with the rest of SQL.
The design generalizes Qdrant's Query API prefetch + FusionQuery to any source that yields ranked rows. The generic shape ("fuse N ranked sub-pipelines into one ranked output") is intentional, so it is not tied to dense+sparse hybrid alone.
Design
SQL surface
A new SQL function vector.fuse taking:
- An array of sub-pipelines, each a sub-
SELECTyielding@ridplus$score. - An options map with the fusion strategy and parameters.
SELECT * FROM `vector.fuse`(
[
(SELECT @rid, $score FROM `vector.neighbors`('Doc[dense_emb]', $denseVec, 50)),
(SELECT @rid, $score FROM `vector.sparseNeighbors`('Doc[tokens,weights]', $qIdx, $qVal, 50)),
(SELECT @rid, $score FROM Doc WHERE SEARCH_INDEX('Doc[content]', $queryText) = true)
],
{ fusion: 'RRF', k: 60, weights: [1.0, 1.0, 0.5], groupBy: 'source_file', groupSize: 1 }
) LIMIT 10The fused output is itself a ResultSet, so it composes with outer WHERE, ORDER BY, LIMIT, joins, and projections.
Fusion strategies
RRF(Reciprocal Rank Fusion).score = Σ_i weight_i / (k + rank_i)with defaultk = 60and default per-source weight1.0. This is the default.DBSF(Distribution-Based Score Fusion, Qdrant v1.11+). Per-source score normalization to[mean - 3σ, mean + 3σ], then weighted sum. Useful when sources produce comparable score distributions.LINEAR.score = Σ_i weight_i · score_iafter per-source min-max normalization. Covers the existingvector.hybridScoreuse case wrapped in the fusion shape.
The fusion key dispatches; per-strategy parameters live in the same options map.
Source contract
Any sub-pipeline yielding (@rid, $score) rows in ranked order is a valid source. This covers:
vector.neighbors(dense)vector.sparseNeighbors(sparse, see feat: LSM_SPARSE_VECTOR index for sparse embedding retrieval #4065)SEARCH_INDEX(full-text)- Any plain
SELECT ... ORDER BY <expr> DESC LIMIT N
If $score is missing, sources are treated as rank-only (RRF still works, DBSF and LINEAR do not).
Group-by integration
groupBy and groupSize in the fuse options apply after fusion (matching Qdrant's query_points_groups semantics, where grouping is the outermost step). Per-source groupBy remains available via each source's own options, so callers can diversify before fusion (per source) or after fusion (across sources), as needed.
Implementation notes
- Fusion is an executor step that consumes its child result sets, builds a
RID -> per-source-rank/scoretable, computes the fused score, and emits a sorted result set. - Sub-pipelines run in parallel by default;
parallel: falseoption to force sequential execution if a source has side effects. - Score-only sources (no
@rid) are rejected at planning time with a clear error.
Acceptance criteria
- New SQL function
vector.fuse(sources, options)accepting ≥2 sub-pipelines. - Each source must yield rows with
@ridand$score. - Fusion strategies:
RRF(withk,weights),DBSF,LINEAR. - Composable with
vector.neighbors,vector.sparseNeighbors,SEARCH_INDEX, plainSELECT ... ORDER BY. -
groupBy+groupSizeoptions applied after fusion. - Outer SQL can wrap the fuse with
WHERE,LIMIT,ORDER BY, projections. - Tests: dense+sparse, dense+fulltext, three-way, weighted RRF, DBSF, LINEAR.
- Doc page with worked examples covering each strategy.
Out of scope (future work)
- Nested fusion (fusion of fusions). Qdrant supports nested prefetches; this would be a follow-up.
- Cross-type / cross-collection fusion (joining ranked results across multiple types in one fuse). Possible today via UNION-style sources but not optimized.
- Auto-tuning of
weightsfrom labeled data.
Related
- Discussion: Migrating from Qdrant to ArcadeDB — stuck on sparse vector indexing and server-side hybrid search #4044
- Companion issues: feat: LSM_SPARSE_VECTOR index for sparse embedding retrieval #4065 (
LSM_SPARSE_VECTORindex), feat: groupBy/groupSize options on vector.neighbors for diversified retrieval #4067 (groupBy onvector.neighbors).
cc @astarso
Activity
feat: sparse vector index + hybrid fusion + group-by (#4065, #4066, #…
lvca commentedon May 4, 2026
All functional criteria + 9 strategy tests;
feat: sparse vector index + hybrid fusion + group-by (#4065, #4066, #…
feat: sparse vector index + hybrid fusion + group-by (ArcadeData#4065, …
chore(deps): bump the github-actions group with 5 updates [skip ci]