Skip to content

loguntsovae/qdrant-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qdrant-patterns

Production patterns for Qdrant vector search, distilled from running 380M+ vectors in production.

Each pattern is a self-contained, runnable Python file with inline comments explaining the why behind each decision.

Patterns

File What it covers
01_hnsw_tuning.py HNSW parameter selection, RAM estimation, ef at search time
02_geo_filtered_search.py Geo-filtered ANN search — payload geo index + radius filter
03_batch_upsert.py Bulk upload with chunking, retry and backpressure
04_snapshot_s3.py Collection backup: snapshot -> download -> S3 -> restore
05_payload_indexing.py Keyword/integer payload indexes for fast filtered search

Quick start

pip install -r requirements.txt
# Start Qdrant locally
docker run -p 6333:6333 qdrant/qdrant

python patterns/01_hnsw_tuning.py

Key decisions

HNSW m and ef_construct — see docs/hnsw_guide.md for a tuning guide with RAM estimates and recall tradeoffs.

Geo index before search — Qdrant evaluates payload filters before touching the HNSW graph. Without a geo index, geo filtering is O(n) full scan. With it, matching candidates are resolved in the index first, then ANN runs only on them.

Snapshots over re-embedding — creating a snapshot of a live collection takes seconds and produces a portable file. Restoring from snapshot is 10-100x faster than re-embedding from scratch. Back up daily, seed new instances from snapshots.

Payload indexes are selective — only index fields you filter on in queries. Each index adds RAM and write overhead. High-cardinality ID fields don't benefit from indexing.

Tested against

Qdrant 1.9+, Python 3.12+

About

Production patterns for Qdrant vector search — HNSW tuning, geo-filtered ANN, batch upsert, snapshot/S3, payload indexing

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages