Skip to main content
The PineconeHandshake class provides seamless integration between Chonkie’s chunking system and Pinecone, a managed vector database. Embed and store your Chonkie chunks in Pinecone directly from the Chonkie SDK.

Installation

Before using the Pinecone handshake, make sure to install the required dependencies:

Initialization

Parameters

Optional[pinecone.Pinecone]
default:"None"
Pinecone client instance. If not provided, a new client will be created based on other parameters.
Optional[str]
default:"None"
Pinecone API key for authentication.
Union[str, Literal['random']]
default:"random"
Name of the index to use. If ā€œrandomā€, a unique name will be generated.
Union[str, BaseEmbeddings]
default:"minishlab/potion-retrieval-32M"
Embedding model to use. Can be a model name or a BaseEmbeddings instance.
Optional[int]
default:"None"
Dimension of the embeddings. If not provided, will be inferred from the embedding model.
dict[str, Any]
default:"{}"
Additional keyword arguments to pass to the Pinecone client or index creation.

Writing Chunks to Pinecone

Searching Chunks in Pinecone

You can retrieve the most similar chunks from your Pinecone index using the search method: