Skip to content

Hybrid retrieval

Hybrid retrieval combines semantic dense similarity with lexical sparse matching. QQL exposes a shorthand and an explicit multi-stage form.

QQLSchema-resolved hybrid searchTry in playground
QUERY TEXT 'zero downtime deployment' FROM runbooks
USING HYBRID DENSE dense SPARSE sparse FUSION RRF
WHERE service = 'gateway'
LIMIT 10;

If the collection has exactly one dense and one sparse vector, omit the names:

QQLHybrid defaultsTry in playground
QUERY 'zero downtime deployment' FROM runbooks
USING HYBRID
LIMIT 10;
QQLWeighted RRF pipelineTry in playground
WITH
semantic AS (
QUERY TEXT 'zero downtime deployment'
USING dense
WHERE service = 'gateway'
LIMIT 120
),
lexical AS (
QUERY TEXT 'zero downtime deployment'
USING sparse
WHERE service = 'gateway'
LIMIT 180
)
QUERY FUSION RRF
FROM runbooks
PREFETCH (semantic, lexical)
PARAMS (rrf_k = 40, rrf_weights = [0.7, 0.3])
LIMIT 10;

Use the explicit form when candidate limits, filters, or weights differ by stage. rrf_weights length must equal the prefetch count.

FusionPrefer when
RRFRanking positions are reliable but score scales differ
DBSFNormalized score magnitude carries useful information