Skip to main content

Cognee Qdrant Adapter

Installation

If published, the package can be simply installed via pip:

pip install cognee-community-vector-adapter-qdrant

In case it is not published yet, you can use poetry to locally build the adapter package:

pip install poetry
poetry install # run this command in the directory containing the pyproject.toml file

Connection Setup

For a quick local setup, you can run a docker container that qdrant provides (https://qdrant.tech/documentation/quickstart/). After this, you will be able to connect to the Qdrant DB through the appropriate ports. The command for running the docker container looks something like the following:

docker run -p 6333:6333 -p 6334:6334 \
    -v "$(pwd)/qdrant_storage:/qdrant/storage:z" \
    qdrant/qdrant

Usage

Import and register the adapter in your code:

from cognee_community_vector_adapter_qdrant import register

Also, specify the dataset handler in the .env file:

VECTOR_DATASET_DATABASE_HANDLER="qdrant"

Quantization

The adapter supports Qdrant's quantization methods, including TurboQuant (introduced in Qdrant 1.18). Quantization compresses stored vectors and reduces memory cost; it is disabled by default.

Mode Compression Notes
tq4 8x TurboQuant 4-bit. Recommended default; SQ-level recall
tq2 16x TurboQuant 2-bit. Beats binary 2-bit by 9–24 pp
tq1.5 ~21x TurboQuant 1.5-bit
tq1 32x TurboQuant 1-bit. Beats binary 1-bit by 9–21 pp
sq 4x Scalar int8 — safe baseline
bq1 32x Binary 1-bit
bq2 16x Binary 2-bit
pq 16x Product quantization (compression ratio X16)
none 1x No quantization (default, backward-compatible)

Set the mode via env var:

QDRANT_QUANTIZATION=tq4
QDRANT_QUANTIZATION_ALWAYS_RAM=true
QDRANT_QUANTIZATION_RESCORE=true
QDRANT_QUANTIZATION_OVERSAMPLING=2.0

Requires qdrant-client>=1.18 and Qdrant server >=1.18 for any tq* mode.

Migrating existing collections

Setting QDRANT_QUANTIZATION only affects newly created collections. To enable quantization on an existing collection without re-ingesting data, call update_quantization:

from cognee.infrastructure.databases.vector import get_vector_engine

adapter = get_vector_engine()
await adapter.update_quantization("Entity_name")
await adapter.update_quantization("DocumentChunk_text")

Qdrant rebuilds the affected index in the background; queries during the rebuild transparently fall back to full vectors.

Example

See example in example.py file.

Metadata

Release files for cognee-community-vector-adapter-qdrant 0.4.0

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

Source distribution (sdist)

Source distribution for cognee-community-vector-adapter-qdrant 0.4.0
File Size Uploaded Provenance
cognee_community_vector_adapter_qdrant-0.4.0.tar.gz 12.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cognee-community-vector-adapter-qdrant 0.4.0
File Interpreter ABI Platform
cognee_community_vector_adapter_qdrant-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / cognee_community_vector_adapter_qdrant-0.4.0.tar.gz

Download URL cognee_community_vector_adapter_qdrant-0.4.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
780efabe4e96c30a6196f0154e1dbcf1f241beff87f25c139533d996f952028f
BLAKE2b-256 checksum
How to use checksums
8886b2079af9838d6cea62e67481255ec0d7c65df84a008d3564c3b22da72610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0

Release files / cognee_community_vector_adapter_qdrant-0.4.0-py3-none-any.whl

Download URL cognee_community_vector_adapter_qdrant-0.4.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cc6d77062711eaf5b5a1b9170b9e418c32038ef5d2f0b4834420d130140d5d2
BLAKE2b-256 checksum
How to use checksums
2640c09ee2315c2d907dea9a45dcad51906b3deb599f857314d03d1203f90dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0

Security for cognee-community-vector-adapter-qdrant 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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