← Master Index
Vol. 14 Module 14.2 Lecture

Qdrant

Vector Databases

How This Lesson Fits the Module & Volume

Qdrant closes Module 14.2: a Rust-based open-source vector database known for fast filtered search, rich JSON payloads, and clean APIs (REST/gRPC). Many production RAG stacks pair Qdrant with LangChain or LlamaIndex.

Use this lecture to synthesize the local vs managed and filter/scale trade-offs across FAISS → Chroma → Pinecone → Milvus → Weaviate → Qdrant before orchestration frameworks in 14.3.

Learning Objectives

By the end of this lesson, students should be able to:

  • Create Qdrant collections with distance metrics and point payloads.
  • Upsert points and query with Filter conditions on payload fields.
  • Explain payload indexes for filter performance at scale.
  • Compare Qdrant Cloud vs self-hosted Docker/K8s.
  • Select among Module 14.2 stores using a decision table.
  • Bridge vector storage into Module 14.3 orchestration for full RAG apps.
Definition

Qdrant is an open-source vector similarity search engine that stores vectors with arbitrary JSON payloads, supports advanced filtering during ANN search, and exposes REST and gRPC APIs for high-performance retrieval workloads.

Module 14.2 Comparison Snapshot

StoreSweet spotWatch-outs
FAISSLocal ANN / researchNo DB features
ChromaDX + local RAGScale ceiling
PineconeManaged SaaSCost / lock-in
MilvusHuge self-host fleetsOps complexity
WeaviateHybrid + modulesSchema/module learning
QdrantFiltered search + payloadsYou still size cluster

Collections, Points, Payloads

from qdrant_client import QdrantClient from qdrant_client.models import ( Distance, VectorParams, PointStruct, Filter, FieldCondition, MatchValue ) client = QdrantClient(url="http://localhost:6333") client.recreate_collection( collection_name="rag_chunks", vectors_config=VectorParams(size=384, distance=Distance.COSINE), ) client.upsert( collection_name="rag_chunks", points=[ PointStruct( id=1, vector=emb_1, payload={"text": "Reset MFA in Security settings.", "product": "auth", "tenant": "acme"}, ), PointStruct( id=2, vector=emb_2, payload={"text": "Download invoices from Billing.", "product": "billing", "tenant": "acme"}, ), ], ) hits = client.search( collection_name="rag_chunks", query_vector=query_emb, limit=5, query_filter=Filter( must=[ FieldCondition(key="tenant", match=MatchValue(value="acme")), FieldCondition(key="product", match=MatchValue(value="auth")), ] ), ) for h in hits: print(h.id, h.score, h.payload["text"])

Filtering and Scale

Payload design

Stable keys

Payload index

Speed filters

Filtered ANN

Search + constraints

RAG context

text from payload

Qdrant applies filters during search rather than only as a post-pass—critical when tenancy must not leak neighbors. At scale, index frequently filtered fields; unindexed payload scans hurt latency.

Strengths

  • Excellent filtered vector search
  • Flexible JSON payloads
  • Strong OSS + cloud story
  • Popular RAG framework adapters

Tradeoffs

  • Cluster sizing still on you (self-host)
  • Payload bloat increases storage
  • Need discipline on filter indexes
  • Not a full document warehouse
Common Misconception

“Storing full PDFs in every payload is fine.” Keep chunk text lean; large blobs belong in object storage with IDs in payload. Fat payloads raise RAM/disk and slow snapshots.

Knowledge Check

  1. Short Answer: What does a Qdrant point contain? Answer: Id, vector, and optional JSON payload.
  2. True/False: Qdrant supports filtering during similarity search. Answer: True.
  3. Multiple Choice: Distance.COSINE is set on: (a) the LLM, (b) collection vector params, (c) CSS. Answer: (b).
  4. Short Answer: Why index payload fields used in filters? Answer: To keep filtered search latency low at scale.
  5. True/False: Qdrant is only available as closed-source SaaS. Answer: False—it is open source (with cloud option).
  6. Multiple Choice: Multi-tenant isolation often uses: (a) payload filters / collections, (b) random seeds, (c) dropout. Answer: (a).
  7. Short Answer: When prefer Pinecone over self-hosted Qdrant? Answer: When you want managed ops / less cluster work.
  8. Short Answer: What Module follows vector DBs? Answer: 14.3 LangChain & orchestration frameworks.
  9. Multiple Choice: Oversized payloads mainly hurt: (a) ethics boards, (b) storage/memory and ops, (c) tokenization rules only. Answer: (b).
  10. True/False: Frameworks like LangChain commonly integrate Qdrant as a vector store. Answer: True.

Key Takeaways

  • Qdrant excels at vector search with rich, filterable payloads.
  • Design lean payloads and index filter keys for production latency.
  • Use the Module 14.2 table to pick local, managed, or distributed stores.
  • Storage alone is not an app—orchestration comes next.
  • Next module: LangChain wires models, retrievers, and tools into pipelines.
Trainer’s Guide

Capstone mini: Teams pick FAISS, Chroma, or Qdrant for a 2-tenant FAQ bot and justify filters, ops, and cost.

Transition: Preview how the same Qdrant collection becomes a LangChain VectorStore in 14.3.

Recap: Qdrant finishes the vector DB tour with filtered payloads. Continue to LangChain.