# PineconeDocumentStore

Use the Pinecone database as your document store.

***

## Basic Information

- Used with the following retrievers:
  - `PineconeEmbeddingRetriever`
- Type: `haystack_integrations.document_stores.pinecone.document_store.PineconeDocumentStore`

## Overview

For details, see [PineconeDocumentStore](https://docs.haystack.deepset.ai/docs/pinecone-document-store) 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](/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 `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:

<ClickableImage
  src="/img/concepts/pineconedocumentstore.png"
  alt="The document store in pipeline builder"
  size="large"
/>

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

```yaml
  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
            env_vars:
            - PINECONE_API_KEY
            strict: false
          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](https://docs.haystack.deepset.ai/reference/integrations-pinecone#pineconedocumentstore) in Haystack documentation.
