tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Vector Databases > Qdrant Vector Database with Python

Qdrant Vector Database with Python

Author: Venkata Sudhakar

Qdrant is a modern vector database written in Rust, designed for high-performance similarity search with rich filtering capabilities. It offers a Python client, REST and gRPC APIs, and runs locally via Docker or as a managed cloud service. Qdrant's payload filtering system is more expressive than Pinecone's and its on-disk storage mode allows indexing datasets larger than available RAM - a key advantage for large product catalogues.

Qdrant organises vectors into collections. Each point in a collection has a vector, an optional ID, and a payload (structured metadata). Qdrant supports named vectors within a single point - allowing you to store multiple embedding representations of the same product, such as a text embedding and an image embedding, and search across either or both.

The below example creates a Qdrant collection for ShopMax India products, inserts product vectors with payload, and performs filtered semantic search using the Qdrant Python client.


It gives the following output,

Products under Rs 75000 (by similarity):
  [0.923] Samsung Galaxy S24 smartphone - Rs 74999 (Mumbai)
  [0.891] OnePlus 12 5G smartphone - Rs 64999 (Delhi)
  [0.834] Sony WH-1000XM5 headphones - Rs 29999 (Mumbai)

Qdrant filtered out the MacBook and iPad (above Rs 75000) before scoring, ensuring the results contain only affordable products. Qdrant's Range filter supports lt, lte, gt, gte - ideal for price range queries. For production ShopMax deployments, enable Qdrant's on-disk storage to handle catalogues of millions of products without RAM constraints, and use gRPC transport for 3-4x faster bulk inserts compared to the REST API.


 
  


  
bl  br