PineconeDocumentStore

Use the Pinecone database as your document store.

Basic Information

  • Used with the following retrievers:
  • Type: haystack_integrations.document_stores.pinecone.document_store.PineconeDocumentStore

Overview

For details, see PineconeDocumentStore in Haystack documentation.

Authorization

You need a Pinecone API key to use PineconeDocumentStore. 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 PineconeDocumentStore and configure it on the component card.
  3. Connect DocumentWriter with the document store.

In a Query Pipeline

To retrieve files from the document store:

  1. Add a Pinecone retriever to your pipeline.
  2. Add PineconeDocumentStore and configure it on the component card.
  3. Connect the retriever with the document store.

Example

This is how you connect the document store to other components:

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

  writer:
    type: haystack.components.writers.document_writer.DocumentWriter
    init_parameters:
      document_store:
        type: haystack_integrations.document_stores.pinecone.document_store.PineconeDocumentStore # document store configuration
        init_parameters:
          api_key: "type: env_var\nenv_vars:\n  - PINECONE_API_KEY\nstrict: false\n"
          index: default
          namespace: default
          batch_size: 100
          dimension: 768
          metric: cosine
      policy: OVERWRITE

Init Parameters

To check the parameters you can customize for this document store, see PineconeDocumentStore API reference in Haystack documentation.