The Qdrant adapter is one of Cognee’s community adapters, which can be found on our community repo.
Make sure that ENABLE_BACKEND_ACCESS_CONTROL in your .env file is NOT set to False.
Multi-user mode is enabled by default, therefore ENABLE_BACKEND_ACCESS_CONTROL=True by default.
Installation
Firstly, you will need to install the adapter package:
pip install cognee-community-vector-adapter-qdrant
Setup
You will need a running Qdrant database instance, and the existing handler works with both local and cloud setups.
All you need to do is provide the necessary connection information, like the following example does for a local setup:
VECTOR_DB_PROVIDER="qdrant"
VECTOR_DB_URL="http://localhost:6333"
For a local database instance, you can use docker, as in the code below. For a cloud setup,
you can read Qdrant’s docs on how to set it up.
docker run -p 6333:6333 -p 6334:6334 \
-v "$(pwd)/qdrant_storage:/qdrant/storage:z" \
qdrant/qdrant
Usage
After setting up your instance and connection information, you will need to register the adapter and handler to Cognee,
so it knows which database to use. Registering the adapter also registers the dataset database handler.
In your code, add the following import statement:
from cognee_community_vector_adapter_qdrant import register
The final important piece of information is to let Cognee know which handler you are using.
This can be done by setting the following .env variable:
VECTOR_DATASET_DATABASE_HANDLER="qdrant"