Qdrant Python Client

1.17.0 · active · verified Sat Feb 28

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

Install

Imports

Quickstart

query_points() is the unified search interface in 1.10+. upload_points() replaces the removed upload_records().

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)

view raw JSON →