Qdrant Python Client
Official Python client for the Qdrant vector search engine. Supports both remote server (gRPC or REST) and local in-memory/on-disk mode without a running server. All data operations use query_points() as the unified interface as of 1.10+. Prior search/recommend/discover methods removed in 1.14.0. Bundles FastEmbed for optional local embedding generation. Async support via AsyncQdrantClient.
Warnings
- breaking client.search(), client.recommend(), client.discover(), client.search_batch(), client.recommend_batch(), client.discovery_batch() all removed in 1.14.0. Massive amount of tutorials, LangChain/LlamaIndex integrations, and LLM-generated code uses client.search(). Raises AttributeError on 1.14+.
- breaking client.upload_records() removed in 1.14.0. Raises AttributeError.
- breaking init_from parameter in create_collection() removed in 1.14.0.
- breaking Pydantic <2.2.1 is not supported. Supported versions are v1.10.x and >=2.2.1. Intermediate Pydantic 2.0–2.2.0 raises validation errors.
- gotcha Local in-memory mode (QdrantClient(':memory:')) does not persist. Data is lost when the process exits. QdrantClient(path='...') persists to disk but does not support concurrent multi-process access.
- gotcha collection.query_points() offset parameter is no longer propagated into prefetches for nested queries. Pre-1.13 behavior silently passed offset into sub-queries; current behavior does not.
- gotcha AsyncQdrantClient raw gRPC methods are not accessible from the sync QdrantClient as of 1.11. Mixing sync client with raw async gRPC calls raises AttributeError.
Install
-
pip install qdrant-client -
pip install 'qdrant-client[fastembed]'
Imports
- query_points (unified search API)
from qdrant_client import QdrantClient from qdrant_client.models import Distance, VectorParams, PointStruct, QueryRequest client = QdrantClient(':memory:') results = client.query_points(collection_name='my_col', query=[0.1, 0.2], limit=5) - upload_points (replaces upload_records)
client.upload_points(collection_name='my_col', points=[PointStruct(id=1, vector=[0.1, 0.2], payload={'text': 'hello'})])
Quickstart
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
# In-memory (no server needed)
client = QdrantClient(':memory:')
# Persistent local mode
# client = QdrantClient(path='/path/to/db')
# Remote server
# client = QdrantClient(url='http://localhost:6333')
client.create_collection(
collection_name='my_docs',
vectors_config=VectorParams(size=4, distance=Distance.COSINE),
)
client.upload_points(
collection_name='my_docs',
points=[
PointStruct(id=1, vector=[0.1, 0.2, 0.3, 0.4], payload={'text': 'hello'}),
PointStruct(id=2, vector=[0.5, 0.6, 0.7, 0.8], payload={'text': 'world'}),
],
)
results = client.query_points(
collection_name='my_docs',
query=[0.1, 0.2, 0.3, 0.4],
limit=2,
)
print(results.points)