qdrant-hybrid-search-combining
Fusing scores from multiple searches into a single ranked result (RRF, DBSF, custom fusion). Use when someone asks 'RRF or DBSF?', 'how to combine sparse and dense', 'how to combine scores from multiple searches?', 'custom fusion', 'fusion is not producing good results', 'how do I tune RRF', 'what k
- 01GitHub stars
- 267
- 02Installs
- New
- 03Files scanned
- 1
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 fe2df73db3e34f1a… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Combining Prefetch Results
The outer query fuses ranked candidate lists from all parallel prefetches into one ranked list of results. Fusion methods differ in whether they use rank, score or directly vector representations of candidates (their similarity to the outer query) and whether final score incorporates payload metadata. All methods support flat (one fusion step) and nested (multi-stage) prefetch structures.
Tune in this order, cheapest first: confirm fusion beats each prefetch alone on your labels, compare Qdrant's default RRF vs DBSF, if tuning RRF: settle k, then sweep weights at that k, and validate on held-out queries. A weight pair is only valid for the k it was tuned with Tune in this order
Scores Are Not Comparable Across Prefetches & You Want Some Easy Baseline
Use when: searches produce scores on different scales, like BM25 and cosine on dense embeddings.
RRF
- RRF (Reciprocal Rank Fusion): rank-based, ignores scores magnitude.
- Start with RRF at Qdrant's defaults,
k=2and equal weights. - Tune
kto control rank sensitivity in RRF fusion, choosing the value from your labels Use labels to choose akrange. - Add per-prefetch weights when one search should dominate, using Weighted RRF. Weights should be customized per collection and retrievers' score distributions. Tune weights last.
DBSF
- DBSF (Distribution-Based Score Fusion): normalizes each prefetch's scores (mean ± 3 standard deviations) before fusing, so pick it when you trust the retrievers' raw scores to carry magnitude. Normalization is per query, so don't compare absolute DBSF scores across queries, and raise the prefetch
limitif one outlier makes rankings unstable. - DBSF has no parameters to tune, so compare it before hand-tuning RRF
kand weights. Confirm on your own labels Compare RRF and DBSF on your labels
Need Custom Fusion
Use when: recency, popularity or other payload values should affect the merged ranking alongside candidate scores or you need a custom fusion.
With formula query, access score of each prefetch and, if desired, payload field values.
If you want to implement custom fusion on score of each prefetch:
- Use decay or any other available expressions for normalizing score distributions before fusing them.
- Parameters of these expressions should be based on the collection & retriever score distributions (for example, adjusting these parameters on a subsample of real queries).
- Formula query is unable to provide ranks for custom fusions
When using FormulaQuery over multiple prefetches (e.g. per-representation weighting):
$score[i]indexes prefetches in declaration order. Reordering theprefetch=list silently shifts which weight applies to which retriever.- Provide
defaultsfor every$score[i]so the formula still evaluates for candidates that surfaced from only a subset of prefetches. - On Qdrant 1.19.1 or newer,
maxandminexpressions take the best or worst of several$score[i](for example, keep each point's best score across per-field BM25 prefetches), cap a boost (min(cap, boost)), or clamp a value withmax(lo, min(hi, x)). A point absent from a prefetch has$score[i]of0.0, which winsmaxover negative scores andminover positive ones, so setdefaults(keys include the$, placed besideformula, never inside it) to a value outside the expected score range such as-1e30formaxor1e30forminMax and min. - On 1.19.1 or newer,
acoshsupports exact geodesic-distance rescoring for hyperbolic embeddings (Lorentz model withDotdistance,acosh(-$score), negated so closest ranks first). The input must be at least 1 Hyperbolic distance. - Start with RRF when scores are on incomparable scales (e.g. BM25 + cosine). Reach for
FormulaQueryonly when explicit per-representation weighting or payload-driven boosts are required, and normalize each$score[i](decay or min-max on a sampled distribution) before combining linearly.
Need Good Ranking of Fused Candidates and Ready To Spend More Resources
Use when: you want to use similarity between query and candidates' vector representations as the prefetches combiner and simultaneously ranker. More resource heavy than score/rank based fusions, but might be necessary due to use case requirements or need in a high top-K precision of results (when parallel prefetches have overall a good recall of retrieved candidates).
More candidates only help if the ranker can use them. Deeper prefetches can raise the best possible score
You can use any type of vector as an outer query over the prefetches, to perform the fusion on the server-side in one QueryAPI request: sparse, dense, multivector. For that, same type of vector representations for documents need to be stored as named vectors per point.
Instead of using client-side fusion through cross-encoders, a popular option is Late interaction models-based fusion, through reranking on multivectors (e.g. ColBERT for text, ColPali and ColQwen for images).
- Most precise but highest compute/resource usage.
- Configure multivectors used for fusion through reranking with HNSW disabled like in Hybrid Search with Reranking tutorial.
What NOT to Do
- Use linear weighted fusion on incomparable score ranges. Why not.
- Use "vibe" defined weights in weighted RRF. Weights should be fine-tuned per dataset and retrieval pipelines.
- Pick any fusion type without comparative experiments.
- Use late interaction multivectors for fusion without evaluating cheaper analogues, for example, MUVERA. More in multi-vector Qdrant search course
Files
1- SKILL.md
c548aa90a67.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from qdrant/skills8
Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.
Guides running and managing Qdrant Managed Cloud clusters with the Qdrant Cloud MCP, the qcloud CLI, the Cloud API, and Terraform. Use when someone asks 'my Cloud cluster is unhealthy', 'check my Qdrant Cloud cluster', 'use the Cloud MCP', 'manage Qdrant Cloud from my agent', 'qcloud or Terraform',
Choosing and wiring up the interface for managing Qdrant Managed Cloud: Console, the Cloud MCP, the qcloud CLI, the Cloud API, Terraform, or Pulumi, plus authentication, management keys, and CI use. Use when someone says 'which Cloud interface should I use', 'qcloud or Terraform', 'automate cluster
Operating a running Qdrant Managed Cloud cluster: reading health, metrics, logs, and alerts, resizing, backups and restores, version updates, access audits, and which changes an agent may make unprompted. Use when someone says 'my Cloud cluster is unhealthy', 'cluster keeps restarting', 'check clust
Guides Qdrant deployment selection. Use when someone asks 'how to deploy Qdrant', 'Docker vs Cloud', 'local mode', 'embedded Qdrant', 'Qdrant EDGE', 'which deployment option', 'self-hosted vs cloud', or 'need lowest latency deployment'. Also use when choosing between deployment types for a new proje
Guides building on Qdrant Edge, the embedded in-process shard. Use when someone asks 'how to sync Edge with the server', 'keep a local shard in sync with Qdrant Cloud', 'BM25 or keyword search on Edge', 'hybrid search on Edge', 'embeddings on device', 'Edge snapshots', 'apply a partial snapshot', 'w
Diagnoses and guides Qdrant horizontal scaling decisions. Use when someone asks 'vertical or horizontal?', 'how many nodes?', 'how many shards?', 'how to add nodes', 'resharding', 'data doesn't fit', 'need more capacity', 'change replication factor', 'reduce replicas', or 'remove extra replicas'. Al
Setting up and running Qdrant Hybrid Cloud on your own Kubernetes cluster (managed, on-prem, or edge): prerequisites, storage/CSI and backups, installing the Qdrant Cloud agent and operator, creating/exposing/securing clusters, registry mirroring, and secret rotation. Use when someone wants to set u
Related knowledge skillsscan passed
Produces a tailored Sanity Studio upgrade plan by inspecting the repository's installed versions, config, and source, then reporting only the breaking changes that actually apply. Covers Studio v3 and later; v2 projects are identified and redirected, not planned. Use this skill whenever someone want
Restrict file edits to a specific directory for the session. Use for: freeze edits to directory, lock editing scope. (gstack)
Upgrades an MWAA environment to a newer Airflow version — within 2.x, within 3.x, or across the 2.x-to-3.x boundary. Computes the version-jump path, inserting the 2.11.x stepping-stone and Python-transition step when needed. Chooses an approach by whether run history and the same environment (URL/AR
Configure single-project Cloud Logging on Google Cloud: regional log buckets, log sinks, log views, restricting or hiding sensitive logs in the default view (_Default) filter, IAM permissions for views (Logs View Accessor, IAM conditions), logs-based metrics, log exclusions, and sampling. Don't use
Use when picking the search_space= argument for Search(). Covers the three provider classes (PtxasSearchSpace, NvccSearchSpace, LocalSearchSpaceBin), how to pin a version/variant/tag, the attention-focused 'att' variant for attention kernels (FlashAttention, GQA, MHA, MLA, FlashInfer Batch Decode),