Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Qdrant vector stores

An alpha Qdrant integration for Microsoft Agent Framework. QdrantCollection provides async batch storage and dense-vector search, QdrantStore manages collection clients, and QdrantSettings handles connection configuration.

Installation

pip install agent-framework-qdrant --pre

Requires Python 3.10+ and Qdrant server 1.16.2+. The official async qdrant-client SDK is installed automatically.

Connection settings

Set QDRANT_URL to your server URL and optionally QDRANT_API_KEY for authentication. If no URL is supplied, the SDK defaults to localhost.

Both constructors resolve settings from explicit url/api_key arguments, then an optional env_file_path, then environment variables. API keys accept str or AF SecretString and are unwrapped only when creating the SDK client.

You can instead pass a configured AsyncQdrantClient as async_client for advanced SDK options. Supplied clients bypass settings loading and remain caller-owned unless managed_client=True; connector-created clients are closed on async context exit.

Usage

This example stores and searches a record using a supplied vector, without an embedding service:

import asyncio
from dataclasses import dataclass
from typing import Annotated

from agent_framework import Filter, VectorStoreField, vectorstoremodel
from agent_framework_qdrant import QdrantStore


@vectorstoremodel
@dataclass
class Document:
    id: Annotated[int, VectorStoreField("key")]
    title: Annotated[str, VectorStoreField("data")]
    embedding: Annotated[
        list[float] | None, VectorStoreField("vector", dimensions=3)
    ] = None


async def main() -> None:
    async with QdrantStore() as store:
        collection = store.get_collection(Document, collection_name="documents")
        await collection.ensure_collection_exists()
        await collection.upsert(
            [Document(1, "Hello Qdrant", [1.0, 0.0, 0.0])],
            generate_vectors=False,
        )
        results = await collection.search(
            vector=[1.0, 0.0, 0.0],
            filter=Filter("title", "eq", "Hello Qdrant"),
            top=3,
        )
        async for result in results:
            print(result["record"].title, result["score"])


asyncio.run(main())

Use get([key], include_vectors=True) to retrieve vectors, or delete([key]) to remove records. Without include_vectors=True, retrieval omits vectors. Batch writes can partially succeed if the server reports an error. Tuple payload values, including nested tuples, are stored as JSON arrays without modifying the input records. Typed models restore tuples through their registered decoder.

Ordered retrieval (order_by) is not supported. Unordered retrieval uses bounded scroll pages without retaining the skipped prefix.

Capabilities and limits

  • Keys must be unsigned 64-bit integers or UUIDs (str or uuid.UUID). Arbitrary strings and automatically generated keys are not supported.
  • Multiple named dense-vector fields are supported. Binary, sparse, multivector-fusion, and keyword-hybrid search are not supported.
  • Vector fields must declare a floating-point element type. Qdrant stores dense vectors as float32; integer-valued inputs remain valid for floating-point fields.
  • Scores and thresholds use native Qdrant units. The default is cosine similarity; dot product, Euclidean distance, and Manhattan distance are also supported.
  • Portable filters require a server. SDK local mode supports unfiltered storage and dense search, but rejects portable filters and does not build payload indexes.
  • Filters support scalar comparisons, collection membership, and AND/OR/NOT. Literal text, nested-path, and array/object-equality filters are unsupported. Numeric range and mixed numeric membership operands are limited to +/- (2**53-1); integer equality supports the full signed 64-bit range.

Running integration tests locally

Start a disposable server using the Qdrant version pinned in CI, then run the integration suite from the python/ directory:

docker run -d --rm --name af-qdrant-test -p 127.0.0.1:16333:6333 qdrant/qdrant:v1.16.2
curl --fail --retry 20 --retry-delay 1 --retry-connrefused http://127.0.0.1:16333/readyz
QDRANT_TEST_URL=http://127.0.0.1:16333 uv run --frozen --directory packages/qdrant poe test-integration -p no:pytest-retry
docker stop af-qdrant-test

Disabling the retry plugin makes failures visible on the first attempt. To run only the concurrent-creation cases, append -k concurrent_collection_creation_validates_winning_schema to the test command. The fixtures create uniquely named collections and delete them after each test.

Documentation

Release files for agent-framework-qdrant 1.0.0a260918

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-framework-qdrant 1.0.0a260918
File Size Uploaded
agent_framework_qdrant-1.0.0a260918.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-framework-qdrant 1.0.0a260918
File Interpreter ABI Platform
agent_framework_qdrant-1.0.0a260918-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / agent_framework_qdrant-1.0.0a260918.tar.gz

Download URL agent_framework_qdrant-1.0.0a260918.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
812aea49ff0755aaab6f98976d3be7357331206b1ec2e66ec904f1151c78f8f0
BLAKE2b-256 checksum
How to use checksums
794b08669e3aaf4c2d3c887de02aabff8b853419f81ba5ac3e686ba98aeb5d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / agent_framework_qdrant-1.0.0a260918-py3-none-any.whl

Download URL agent_framework_qdrant-1.0.0a260918-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5eb5876e76fc8cbdee948056d93f05f5d7011666f173472b08453cf028c3262
BLAKE2b-256 checksum
How to use checksums
a7e96c88a47b1c42e0c366cb62473a9f04f8c8246c3241d9119c7077b0796efd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page