Qdrant Explained: Vector Search, Payload Filtering and Hybrid Retrieval for RAG
Qdrant explained: how the open-source vector database stores embeddings with payloads, filters searches by metadata, and fuses dense and sparse retrieval.
By Galactic News Editorial · Published 2026-11-26T10:39:38+00:00 · Updated 2026-11-26T10:39:38+00:00
Qdrant is an open-source vector database built for retrieval-augmented generation. It stores embeddings alongside structured metadata. It searches by meaning and by filter in the same query. It combines dense and sparse retrieval into hybrid search. This explainer covers how Qdrant works, how payload filtering works, and how hybrid retrieval fits a RAG pipeline.
What Qdrant is
Qdrant is a standalone vector database server written in Rust. It is released under the Apache 2.0 licence. Each stored item is called a point. A point holds one or more vectors and a JSON payload. The payload is metadata: document id, source, date, tenant, access role, or any other field your app needs.
The vector index is HNSW, a graph-based approximate nearest-neighbour index. Qdrant's distinguishing feature is filterable HNSW. If payload indexes exist before the graph is built, Qdrant adds filter-aware edges. Filtered searches stay accurate. That matters because most real RAG queries are filtered. A user should only see their own tenant's documents. A support bot should only cite current docs.
Qdrant runs as a single server or as a distributed cluster. A managed option, Qdrant Cloud, is also available. The open-source server and the cloud service share the same core engine and API.
Qdrant vector database RAG basics: collections and points
A collection is a set of points that share a vector schema. You define the vector size and distance metric when you create it. Cosine distance is the usual choice for text embeddings. A collection can hold several named vectors. That is how hybrid search works: one collection holds a dense vector and a sparse vector for the same document.
Points are added with an upsert call. Each point has an id, a vector and a payload:
from qdrant_client import QdrantClient, models
client = QdrantClient(url="http://localhost:6333")
client.upsert(
collection_name="docs",
points=[
models.PointStruct(
id=1,
vector=[0.12, -0.04, 0.87],
payload={
"title": "Resetting the gateway router",
"tenant_id": "acme",
"doc_type": "manual",
"updated": "2026-10-01",
},
)
],
)
The payload travels with the point. A search can return it with the result. That means the RAG pipeline gets the text chunk and its metadata in one round trip. No second lookup is needed.
Payload filtering in Qdrant
Payload filtering restricts which points can take part in a query. Conditions are evaluated against the payload, not after retrieval. A filtered search still returns a full result set. The filter is part of the search, not a post-processing step.
Filters use three clauses. must means every condition holds. should means at least one holds. must_not excludes points that match. Clauses nest, so complex rules are possible.
from qdrant_client import models
results = client.query_points(
collection_name="docs",
query=[0.2, 0.1, 0.9, 0.7],
query_filter=models.Filter(
must=[
models.FieldCondition(
key="tenant_id",
match=models.MatchValue(value="acme"),
),
models.FieldCondition(
key="doc_type",
match=models.MatchValue(value="manual"),
),
],
must_not=[
models.FieldCondition(
key="archived",
match=models.MatchValue(value=True),
),
],
),
limit=5,
with_payload=True,
).points
Payload indexes make filters fast. Qdrant supports keyword, integer, float, boolean, geo, datetime, text and UUID indexes. Create the index before the HNSW graph is built. That is when filter-aware edges are added. Adding an index later still filters correctly, but without the accuracy benefit of filter-aware edges. For multi-tenant RAG, mark the tenant field with is_tenant=true. Qdrant co-locates each tenant's vectors for faster sequential reads.
Hybrid retrieval for RAG
Dense vectors capture meaning. Sparse vectors capture exact words. Each fails alone. Dense search misses a rare product code. Sparse search misses a paraphrase. Hybrid retrieval runs both and fuses the results.
Qdrant's Query API does this with prefetch and fusion. Each prefetch runs one retriever and returns its top candidates. The main query then fuses the lists. Reciprocal rank fusion, or RRF, is the standard choice. It ranks by position in each list, not by raw score. Dense and sparse scores never have to be made comparable. Distribution-based score fusion, DBSF, is a second option. Hybrid queries arrived in Qdrant 1.10. DBSF followed in 1.11.
hits = client.query_points(
collection_name="docs",
prefetch=[
models.Prefetch(
query=dense_vector,
using="dense",
limit=20,
),
models.Prefetch(
query=sparse_vector,
using="sparse",
limit=20,
),
],
query=models.FusionQuery(fusion=models.Fusion.RRF),
limit=5,
).points
Qdrant can generate sparse BM25 vectors on the server since version 1.15.2. The client sends text, and the server converts it. That removes the need for a separate BM25 step in your code. Embedding models can also run on Qdrant Cloud through Cloud Inference. Client-side embedding with FastEmbed remains the common path for self-hosted setups.
Where the filter goes in a hybrid query
Filter placement matters in hybrid search. Put the filter inside every prefetch. Each retriever then spends its candidates on eligible points only. A filter only at the top level can starve the fusion step. One retriever may return only ineligible points, and the fusion has nothing to work with.
results = client.query_points(
collection_name="docs",
prefetch=[
models.Prefetch(
query=dense_vector,
using="dense",
filter=tenant_filter,
limit=20,
),
models.Prefetch(
query=sparse_vector,
using="sparse",
filter=tenant_filter,
limit=20,
),
],
query=models.FusionQuery(fusion=models.Fusion.RRF),
limit=5,
).points
The rule is simple. Filter early, fuse late. Every retriever should see only the points the user is allowed to see.
Dense vs sparse vs hybrid at a glance
| Approach | Strength | Weakness | Best for |
|---|---|---|---|
| Dense only | Understands meaning and paraphrase | Misses exact codes and names | General Q and A over prose |
| Sparse / BM25 only | Exact term matching | No sense of meaning | Code, SKUs, legal citations |
| Hybrid (dense + sparse) | Both meaning and exact terms | More setup and tuning | Production RAG with mixed content |
| Hybrid + payload filter | Correct scope and ranking | Needs indexes planned early | Multi-tenant and permissioned RAG |
Building a RAG pipeline on Qdrant in 5 steps
- Chunk the documents. Split source text into chunks of a few hundred words. Keep headings and source metadata with each chunk.
- Create the collection. Define a dense vector and a sparse vector. Set cosine distance for the dense one. Add payload indexes for tenant, document type and date before loading data.
- Embed and upsert. Generate dense embeddings and sparse BM25 vectors for each chunk. Upsert points with the chunk text in the payload.
- Query with prefetch and fusion. Run dense and sparse prefetch with the same payload filter. Fuse with RRF. Return the top five to ten chunks.
- Generate with context. Pass the retrieved chunks to the language model. Cite the source documents from the payload metadata.
When Qdrant is the right choice
Qdrant fits when retrieval must respect rich filters. Multi-tenant document search, permissioned knowledge bases and hybrid RAG are its strong cases. Its payload model and filter-aware HNSW are the differentiators. It is a weaker fit when the workload is mostly lexical search. It is also weaker for complex polygon geospatial queries. Its geo filters cover radius search, not arbitrary multi-polygon geofencing.
The bottom line
Qdrant earns its place in RAG pipelines through filtering. Vectors carry meaning. Payloads carry the rules about who can see what. Hybrid search adds exact-word matching to semantic search. The pattern to remember is filter early, fuse late, and create payload indexes before the graph is built. Get those three right, and Qdrant retrieval is fast, scoped and accurate.