Skip to main content
First time creating a connector? Read this first.
Send processed data from Unstructured to Qdrant.

Requirements

You will need: The following video shows how to set up Qdrant Cloud:
  • For Qdrant local, the path to the local Qdrant installation, for example: /qdrant/local
  • For Qdrant client-server, the Qdrant server URL, for example: http://localhost:6333
  • For Qdrant Cloud:
    • A Qdrant account.
    • A Qdrant cluster.
    • The cluster’s URL. To get this URL, do the following:
      1. Sign in to your Qdrant Cloud account.
      2. On the sidebar, under Dashboard, click Clusters.
      3. Click the cluster’s name.
      4. Note the value of the Endpoint field, for example: https://<random-guid>.<region-id>.<cloud-provider>.cloud.qdrant.io.
    • A Qdrant API key.
  • The name of the target collection on the Qdrant local installation, Qdrant server, or Qdrant Cloud cluster. Qdrant requires the target collection to exist before Unstructured can write to the collection. The following example code demonstrates the use of the Python Qdrant Client to create a collection on a Qdrant Cloud cluster, configuring the collection for vectors with 3072 dimensions:
    Python
    from qdrant_client import QdrantClient, models
    import os
    
    client = QdrantClient(
        url=os.getenv("QDRANT_URL"),
        api_key=os.getenv("QDRANT_API_KEY")
    )
    
    client.create_collection(
        collection_name=os.getenv("QDRANT_COLLECTION"),
        vectors_config=models.VectorParams(
            size=3072,
            distance=models.Distance.COSINE
        )
    )
    
    collection = client.get_collection(
                     collection_name=os.getenv("QDRANT_COLLECTION")
                 )
    
    print(f"The collection named '{os.getenv("QDRANT_COLLECTION")}' exists and " +
          f"has a status of '{collection.status}'.")
    

Examples

To create a Qdrant destination connector, see the following examples. For more information on working with destination connectors using the Unstructured API, see Destination endpoints.
import os

from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateDestinationRequest
from unstructured_client.models.shared import CreateDestinationConnector

with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as client:
    response = client.destinations.create_destination(
        request=CreateDestinationRequest(
            create_destination_connector=CreateDestinationConnector(
                name="<name>",
                type="qdrant-cloud",
                config={
                    "url": "<url>",
                    "collection_name": "<collection-name>",
                    "batch_size": <batch-size>,
                    "api_key": "<api-key>"
                }
            )
        )
    )

    print(response.destination_connector_information)

Configuration settings

Replace the preceding placeholders as follows:
name
string
required
A unique name for this connector.
url
string
required
The Qdrant cluster’s URL.
collection_name
string
required
The name of the target collection on the Qdrant cluster.
batch_size
string
default:"50"
The maximum number of records to transmit at a time.
api_key
string
required
The Qdrant API key.

Learn more