WeaviateDocumentStore

Use the Weaviate database as your document store.

Basic Information

Overview

For details, see 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.

Usage

For instructions on how to create a secret to connect to the document store, write documents, and then retrieve them, see Connect to external database.

Example Configuration

In an Indexing Pipeline

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:

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

  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 in Haystack documentation.