Table of Contents

Qdrant

Qdrant is a high-performance, open-source vector similarity search engine and database written in Rust. With over 30,000 GitHub stars, it is designed for production-grade applications requiring fast, filtered vector search with rich payload support and horizontal scalability.

Repository github.com/qdrant/qdrant
License Apache 2.0
Language Rust
Stars 30K+
Category Vector Database

Key Features

Architecture

Qdrant is designed as a standalone service with a focus on performance and operational simplicity:

graph TB subgraph API["API Layer"] REST[REST API] GRPC[gRPC API] end subgraph Engine["Search Engine"] Router[Query Router] Planner[Query Planner] Filter[Filter Engine] end subgraph Collections["Collection Layer"] C1[Collection 1] C2[Collection 2] end subgraph Segments["Segment Storage"] HNSW[HNSW Index] Payload[Payload Index] Vectors[Vector Storage] WAL[Write-Ahead Log] end subgraph Distributed["Distributed Layer"] Shard[Sharding] Replica[Replication] Raft[Raft Consensus] end API --> Engine Engine --> Collections Collections --> Segments Collections --> Distributed

HNSW Configuration

HNSW performance is controlled through three primary parameters:

For small datasets below the full_scan_threshold (default 10,000 KB), Qdrant automatically uses brute-force search for better performance.

Filterable HNSW

Qdrant extends standard HNSW by adding extra edges based on indexed payload values, enabling efficient searches under structured conditions without full-scan operations. Key considerations:

Code Example

from qdrant_client import QdrantClient
from qdrant_client.models import (
    Distance, VectorParams, PointStruct,
    Filter, FieldCondition, MatchValue,
    PayloadSchemaType
)
 
client = QdrantClient(host="localhost", port=6333)
 
# Create collection with HNSW configuration
client.create_collection(
    collection_name="documents",
    vectors_config=VectorParams(
        size=768, distance=Distance.COSINE,
        hnsw_config={"m": 16, "ef_construct": 100}
    )
)
 
# Create payload index BEFORE inserting data
client.create_payload_index(
    collection_name="documents",
    field_name="category",
    field_schema=PayloadSchemaType.KEYWORD
)
 
# Insert vectors with payloads
client.upsert(
    collection_name="documents",
    points=[
        PointStruct(id=1, vector=[0.1] * 768,
                    payload={"title": "RAG Guide", "category": "ai"}),
        PointStruct(id=2, vector=[0.2] * 768,
                    payload={"title": "SQL Basics", "category": "database"}),
    ]
)
 
# Filtered vector search
results = client.search(
    collection_name="documents",
    query_vector=[0.15] * 768,
    query_filter=Filter(
        must=[FieldCondition(key="category", match=MatchValue(value="ai"))]
    ),
    limit=5
)
for r in results:
    print(f"{r.payload['title']}: {r.score:.4f}")

References

See Also