Component brief / Infrastructure

Qdrant: vector retrieval with payload-aware filtering.

Published
Updated
Last verified
Reading time
4 minutes
Topics
qdrant / vector-search / rag

What it is

Qdrant is an open-source database for similarity search. A collection groups records that share vector settings, such as the same number of values per vector. Each record is called a point. It can hold a vector for a manual passage and a payload, extra fields such as the product name and manual version. A payload filter uses those fields to decide which points are eligible for a query. Clients can submit operations over its REST HTTP interface or use gRPC, a remote procedure call protocol. Qdrant overview · Filtering

A dense vector stores a value at every position. An embedding model can use one to represent a passage for semantic search, which seeks matches by meaning. A sparse vector stores only the non-zero positions, which can represent weights for individual words in lexical search. Qdrant can combine both result lists in hybrid search. For example, a question about a login error could match the explanation by meaning and find the exact error code by word. Named vectors let the same point store more than one representation, for example a title vector and a body vector. Qdrant hybrid search

Where it fits

A separate step prepares documents. It divides them into passages called chunks and generates an embedding, a vector representing each passage. Qdrant stores and searches those vectors.

Documents are chunked and embedded before storage in Qdrant. A question is embedded and combined with a payload filter to retrieve ranked evidence.

The application assigns stable identifiers, records which embedding model produced each vector and keeps a link back to the original passage. It also applies access rules and decides how to use the search results.

When to use it

Choose Qdrant when:

  • semantic search must combine with tenant, document, date or permission filters;
  • dense and lexical signals need hybrid retrieval;
  • the corpus or query load should scale independently from the application database;
  • multiple vector types belong to one record; or
  • retrieval behaviour needs a purpose-built API and operational boundary.

For a small prototype, an in-process index or Qdrant client's local mode may be sufficient. For data already governed in PostgreSQL, pgvector can avoid another service.

Trade-offs

Qdrant introduces a stateful service with backups, monitoring, capacity planning and version upgrades. Payload fields used frequently in filters should receive payload indexes; otherwise filtering can become an avoidable bottleneck.

Vector dimension and distance must match the embedding model. Changing models usually means creating new vectors or rebuilding a collection, not silently mixing representations. Store model name, version and chunking strategy with the indexed data.

Approximate nearest-neighbour search uses an index to find close vectors without checking every record. This can make a search faster and can also miss a relevant result. Measure recall by checking how many relevant passages your search finds. Quantisation stores a more compact version of a vector, for example by using fewer bits per value, which can reduce memory use at the cost of precision.

Alternatives

  • PostgreSQL with pgvector keeps relational data and vectors under one operational model.
  • Elasticsearch/OpenSearch may be preferable when an existing lexical-search platform already owns the corpus.
  • Managed vector services or Qdrant Cloud reduce operations but add a provider boundary and recurring service cost.
  • An in-memory index is simpler for a small, rebuildable corpus with one application instance.

Integration example

This example uses two made-up vectors so you can try the filter without downloading an embedding model. A real application would produce the document and query vectors with a compatible model. The filter only allows points whose component is fastembed.

from qdrant_client import QdrantClient, models

client = QdrantClient(":memory:")
client.create_collection(
    collection_name="briefs",
    vectors_config=models.VectorParams(size=2, distance=models.Distance.COSINE),
)
client.upsert(
    collection_name="briefs",
    points=[
        models.PointStruct(id=1, vector=[0.2, 0.8], payload={"component": "docling"}),
        models.PointStruct(id=2, vector=[0.9, 0.1], payload={"component": "fastembed"}),
    ],
)

hits = client.query_points(
    collection_name="briefs",
    query=[0.8, 0.2],
    query_filter=models.Filter(must=[
        models.FieldCondition(key="component", match=models.MatchValue(value="fastembed")),
    ]),
    limit=3,
).points

The collection uses cosine similarity, which compares the directions of vectors. This client stores the collection in memory for the life of the process. A production service can use durable storage and payload indexes, which help Qdrant look up filter fields such as component efficiently. Qdrant quickstart · Filtering

Update, 15 November 2026. The example uses upsert and query_points. The current Python client removed the old add and query helpers. Qdrant Python client releases

AI Disclosure

Researched and drafted with AI assistance, then reviewed by Søren Dalby. Sources are linked; errors may remain, and corrections are welcome.

Sources