Qdrant Guide 2025: Open-Source Vector Database for AI Apps
A practical guide to Qdrant for developers building vector search and RAG applications — from Docker setup to production hybrid search.
What Is Qdrant?
Qdrant is an open-source vector database and vector similarity search engine written in Rust. It is designed specifically for storing and querying embedding vectors — the high-dimensional numerical representations produced by machine learning models like OpenAI text-embedding-3-small or Cohere Embed.
Unlike general-purpose databases bolted on with a vector extension, Qdrant was built from the ground up for vector search. It supports dense vectors (from embedding models), sparse vectors (BM25-style keyword weights), and hybrid search combining both — all with filtering by JSON payload attached to each vector point.
The primary use case is RAG (Retrieval-Augmented Generation): embed your documents, store them in Qdrant, and at query time retrieve the most relevant chunks to pass as context to an LLM like Claude or GPT-4o.
Deployment Options
Qdrant Cloud (Managed)
Free tier: 1 GB cluster, no credit card required. Connect at your-cluster.qdrant.tech:6333. Supports AWS, GCP, and Azure regions. Best for production without infrastructure management.
Docker (Self-hosted)
Run locally or on any server. REST API on port 6333, gRPC on port 6334. Free, unlimited storage, full control. Ideal for development and on-premise deployments.
Kubernetes (Helm chart)
Official Helm chart for scalable multi-node deployments. Supports distributed mode with sharding for large-scale production workloads.
Python SDK Quickstart
# Install
pip install qdrant-client openai
# Create collection, upsert points, search
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct, Filter, FieldCondition, MatchValue
from openai import OpenAI
# Connect to local Docker instance (or Qdrant Cloud)
client = QdrantClient(host="localhost", port=6333)
# For Qdrant Cloud: QdrantClient(url="https://xyz.qdrant.tech", api_key="YOUR_KEY")
oai = OpenAI(api_key="YOUR_OPENAI_API_KEY")
# Create a collection
client.create_collection(
collection_name="my_docs",
vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
)
# Embed and upsert documents
texts = ["Claude is an AI assistant by Anthropic.", "Qdrant is a vector database written in Rust."]
embeddings = oai.embeddings.create(model="text-embedding-3-small", input=texts)
points = [
PointStruct(
id=i,
vector=e.embedding,
payload={"text": texts[i], "category": "ai"}
)
for i, e in enumerate(embeddings.data)
]
client.upsert(collection_name="my_docs", points=points)
# Search with optional payload filter
query = "Who made Claude?"
q_embed = oai.embeddings.create(model="text-embedding-3-small", input=[query])
results = client.search(
collection_name="my_docs",
query_vector=q_embed.data[0].embedding,
query_filter=Filter(must=[FieldCondition(key="category", match=MatchValue(value="ai"))]),
limit=3,
)
for hit in results:
print(f"Score: {hit.score:.3f} | {hit.payload['text']}") Core Concepts
Collections
A named container for points. Defined with a fixed vector size and distance metric — you cannot change these after creation. Use one collection per embedding model.
Points
The basic unit — each point has an id (integer or UUID), a vector (float array), and an optional payload (arbitrary JSON metadata).
Payloads & Filtering
JSON metadata attached to each point. You can filter by payload fields before vector similarity is computed — only matching points are searched. Supports match, range, geo, and nested conditions.
Named Vectors
A single point can carry multiple named vectors — for example, a dense vector from an embedding model and a sparse vector for BM25 keyword matching. This enables hybrid search in one collection.
Distance Metrics
| Metric | Qdrant Enum | Best for |
|---|---|---|
| Cosine | Distance.COSINE | Text embeddings (direction, not magnitude) |
| Dot product | Distance.DOT | Models trained for dot product (e.g. ColBERT) |
| Euclidean | Distance.EUCLID | Image embeddings, coordinates |
| Manhattan | Distance.MANHATTAN | Sparse high-dim spaces |
HNSW Index Tuning & Quantization
Qdrant uses HNSW (Hierarchical Navigable Small World) for approximate nearest-neighbor search. Key parameters when creating a collection:
from qdrant_client.models import HnswConfigDiff, ScalarQuantizationConfig, ScalarType
client.create_collection(
collection_name="optimized_docs",
vectors_config=VectorParams(
size=1536,
distance=Distance.COSINE,
hnsw_config=HnswConfigDiff(
m=16, # edges per node — higher = better recall, more RAM
ef_construct=100, # build-time depth — higher = better index quality
),
quantization_config=ScalarQuantizationConfig(
type=ScalarType.INT8, # compress float32 to int8 — ~4x memory savings
quantile=0.99,
always_ram=True, # keep quantized vectors in RAM for speed
),
),
) Qdrant supports three quantization modes: Scalar (float32 → int8, 4x reduction), Product (PQ, even smaller but slower), and Binary (extreme compression, best for very large collections).
Qdrant vs Alternatives
| Database | Type | Best for | Free tier |
|---|---|---|---|
| Qdrant | Open-source / cloud | High perf, filtering, hybrid search, self-host | 1 GB cloud |
| Pinecone | Managed cloud | Fastest managed setup, production RAG | 2 GB serverless |
| Weaviate | Open-source / cloud | Hybrid BM25+vector, generative search modules | Sandbox (14 days) |
| Chroma | Open-source, local | Prototyping, Python notebooks, zero-config | Fully free (local) |
See also: Pinecone guide, LlamaIndex guide, LangChain guide, and OpenAI API guide.
Monitor Qdrant Cloud Status
Qdrant Cloud outages can silently break your RAG pipeline. Prismix tracks live Qdrant status and sends instant alerts before your users notice.
Vector DB Troubleshooting →