# QdrantDocumentStore

Use the Qdrant database as your document store.

***

## Basic Information

- Used with the following retrievers:
  - `QdrantEmbeddingRetriever`
  - `QdrantSparseEmbeddingRetriever`
  - `QdrantHybridRetriever`
- Type: `haystack_integrations.document_stores.qdrant.document_store.QdrantDocumentStore`

:::info Hosting
 You must host the Qdrant database locally to make it work with <ProductName />. For instructions, see [Qdrant documentation](https://qdrant.tech/documentation/guides/installation/).
 :::

## Overview

For details, see [QdrantDocumentStore](https://docs.haystack.deepset.ai/docs/qdrant-document-store) in Haystack documentation.

## Authorization

To use an API key for your Qdrant database, create a secret for it and then pass it its name in the `api_key` parameter of the document store. To learn more about secrets, see [Add Secrets to Connect to Third Party Providers](/docs/how-to-guides/managing-access/add-secrets.mdx).

<UsageInstructions />

## Example Configuration

### In an Index

To write the preprocessed files into the document store:

1. Add `DocumentWriter` to your pipeline.
2. Add `QdrantDocumentStore` and configure it on the component card.
3. Connect the two components.

### In a Query Pipeline

To retrieve files from the document store:

1. Add a Qdrant retriever to your pipeline.
2. Add `QdrantDocumentStore` and configure it on the component card.
3. Connect the document store and the retriever.

### Example

You connect the components using their `document_store` connection point:

<ClickableImage
  src="/img/concepts/qdrantdocumentstore.png"
  alt="The Configure button under the document_store parameter on a component card"
  size="large"
/>

When you switch to YAML, you can see that the document store is an argument of `DocumentWriter`. It's the same for retrievers:

```yaml
components:
  DocumentWriter:
    type: haystack.components.writers.document_writer.DocumentWriter
    init_parameters:
      policy: NONE
      document_store:
        type: haystack_integrations.document_stores.qdrant.document_store.QdrantDocumentStore # document store configuration
        init_parameters:
          port: 6333
          grpc_port: 6334
          prefer_grpc: false
          force_disable_check_same_thread: false
          index: Document
          embedding_dim: 768
          on_disk: false
          use_sparse_embeddings: false
          sparse_idf: false
          similarity: cosine
          return_embedding: false
          progress_bar: true
          recreate_index: false
          wait_result_from_api: true
          write_batch_size: 100
          scroll_size: 10000
```

## Init Parameters

To check the parameters you can customize for this document store, see [QdrantDocumentStore API reference](https://docs.haystack.deepset.ai/reference/integrations-qdrant#qdrantdocumentstore) in Haystack documentation.
