# Qdrant

#### Integrating Qdrant with Qyver

This guide explains how to configure and integrate Qdrant with Qyver.

**Configuring an Existing Managed Qdrant Instance**

To use Qdrant with Qyver, you can start a managed Qdrant instance (a **free tier** is available). Instructions for setting up a managed instance are included in the **Starting a Managed Qdrant Instance** section below.

Once the instance is running, ensure:

* The server can access the Qdrant instance.
* Authentication settings are correctly configured.

***

#### Configuration Modifications

To integrate Qdrant, add the `QdrantVectorDatabase` class and include it in the executor:

```python
from qyver import framework as qv

vector_database = qv.QdrantVectorDatabase(
    "<your_qdrant_url>",  # (Required) Qdrant server URL (typically includes a port)
    "<your_api_key>",  # (Required) API key for authentication
    default_query_limit=10,  # (Optional) Maximum number of results per query (defaults to 10)
    # Additional parameters can be passed as kwargs following Qdrant's official Python client documentation.
)
```

Once configured, assign it to the executor:

```python
...
executor = qv.RestExecutor(
    sources=[source],
    indices=[index],
    queries=[qv.RestQuery(qv.RestDescriptor("query"), query)],
    vector_database=vector_database,  # Use the QdrantVectorDatabase instance
)
...
```

***

#### Starting a Managed Qdrant Instance

To create a **managed Qdrant instance**, follow these steps:

1. Sign in to [Qdrant Cloud](https://cloud.qdrant.io/login).
2. Click **Overview** in the left menu.
3. Select **Create Cluster** (free-tier or production-ready).
   * Free-tier includes **0.5 vCPU, 1GB RAM, 4GB storage** on **one node**.
   * Paid plans offer customization options like platform selection, region, and high availability (HA).
4. Once the cluster is created, generate an **API key** and store it securely (it cannot be retrieved later).
5. Use this API key in your **QdrantVectorDatabase** configuration.
