# WeaviateDocumentStore

Use the Weaviate database as your document store.

***

## Basic Information

- Used with the following retrievers:
  - `WeaviateBM25Retriever`
  - `WeaviateEmbeddingRetriever`
- Type: `haystack_integrations.document_stores.weaviate.document_store.WeaviateDocumentStore`

## Overview

For details, see [WeaviateDocumentStore](https://docs.haystack.deepset.ai/docs/weaviatedocumentstore) in Haystack documentation.

## Authorization

If you're using a paid option, you need a Weaviate account and a `url` and `api_key` to use this document store. You can 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 preprocesses files into the document store:

1. Add `DocumentWriter` to your pipeline.
2. Add `WeaviateDocumentStore` and configure it on the component card.
3. Connect the components using their `document_store` connection point.

### In a Query Pipeline

To retrieve files from the document store:

1. Add a Weaviate retriever to your pipeline.
2. Add `WeaviateDocumentStore` and configure it on the component card.
3. Connect the components using their `document_store` connection point.

### Example

This how to connect the components:

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

When you switch to YAML, you can see that the document store is an argument of `DocumentWriter` or Weaviate retriever:

```yaml
  DocumentWriter:
    type: haystack.components.writers.document_writer.DocumentWriter
    init_parameters:
      policy: NONE
      document_store:
        type: haystack_integrations.document_stores.weaviate.document_store.WeaviateDocumentStore # document store confguration
        init_parameters:
          grpc_port: 50051
          grpc_secure: false

```

## Init Parameters

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