> For the complete documentation index, see [llms.txt](https://nomadamas.gitbook.io/ragchain-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nomadamas.gitbook.io/ragchain-docs/utils/slim-vector-store/pinecone-slim.md).

# Pinecone Slim

## Overview

The `PineconeSlim` class is a slim vector store of [Pinecone](https://www.pinecone.io/), optimized for RAGchain.

## Usage

Its usage is similar to Langchain's [`Pinecone`](https://python.langchain.com/docs/integrations/vectorstores/pinecone) class. Due to its inheritance to [`Pinecone`](https://python.langchain.com/docs/integrations/vectorstores/pinecone) class, you can use any function in [`Pinecone`](https://python.langchain.com/docs/integrations/vectorstores/pinecone) class. Plus, you can initialize with [`Pinecone`](https://python.langchain.com/docs/integrations/vectorstores/pinecone) class initializer.

For the optimal utilization of `PineconeSlim` VectorStore, developers are strongly recommended to employ the `add_passages()` method when saving passages. The use of alternative methods may not fully leverage the capabilities and advantages inherent in Slim VectorStore.

Here is a basic example:

```python
import pinecone
from RAGchain.utils.vectorstore import PineconeSlim
from RAGchain.utils.embed import EmbeddingFactory

index = pinecone.Index(index_name="your_index_name")

# Initialize PineconeSlim
pinecone_slim = PineconeSlim(
    index=index,
    embedding=EmbeddingFactory('openai').get(),
    text_key="text",
    namespace="your_namespace"
)

# add passage to PineconeSlim
passages =[...list_of_passages...] # Assume we have list_of_passages retrieved earlier
pinecone_slim.add_passages(passages)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nomadamas.gitbook.io/ragchain-docs/utils/slim-vector-store/pinecone-slim.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
