If the index already exists, the Document Store connects to it. Otherwise, it creates a new index.
- When creating a new index, you can provide a `spec` in the form of a dictionary. This allows choosing between serverless and pod deployment options and setting additional parameters. Refer to the [Pinecone documentation](https://docs.pinecone.io/reference/api/control-plane/create_index) for more details. If not provided, a default spec with serverless deployment in the `us-east-1` region will be used (compatible with the free tier).
- You can provide `dimension` and `metric`, but they are only taken into account if the Pinecone index does not already exist.
Then, you can use the Document Store like this:
```python
from haystack import Document
from haystack_integrations.document_stores.pinecone import PineconeDocumentStore
## Make sure you have the PINECONE_API_KEY environment variable set
[`PineconeEmbeddingRetriever`](../pipeline-components/retrievers/pineconedenseretriever.mdx): Retrieves documents from the `PineconeDocumentStore` based on their dense embeddings (vectors).