Class PineconeVectorStore
java.lang.Object
org.springframework.ai.vectorstore.PineconeVectorStore
- All Implemented Interfaces:
Consumer<List<Document>>
,DocumentWriter
,VectorStore
A VectorStore implementation backed by Pinecone, a cloud-based vector database. This
store supports creating, updating, deleting, and similarity searching of documents in a
Pinecone index.
- Author:
- Christian Tzolov, Adam Bchouti
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Configuration class for the PineconeVectorStore. -
Field Summary
-
Constructor Summary
ConstructorDescriptionPineconeVectorStore
(PineconeVectorStore.PineconeVectorStoreConfig config, EmbeddingClient embeddingClient) Constructs a new PineconeVectorStore. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a list of documents to the vector store.void
Adds a list of documents to the vector store based on the namespace.Deletes a list of documents by their IDs.Deletes a list of documents by their IDs based on the namespace.similaritySearch
(SearchRequest request) Retrieves documents by query embedding similarity and metadata filters to retrieve exactly the number of nearest-neighbor results that match the request criteria.similaritySearch
(SearchRequest request, String namespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.vectorstore.VectorStore
accept, similaritySearch
-
Field Details
-
filterExpressionConverter
-
-
Constructor Details
-
PineconeVectorStore
public PineconeVectorStore(PineconeVectorStore.PineconeVectorStoreConfig config, EmbeddingClient embeddingClient) Constructs a new PineconeVectorStore.- Parameters:
config
- The configuration for the store.embeddingClient
- The client for embedding operations.
-
-
Method Details
-
add
Adds a list of documents to the vector store based on the namespace.- Parameters:
documents
- The list of documents to be added.namespace
- The namespace to add the documents to
-
add
Adds a list of documents to the vector store.- Specified by:
add
in interfaceVectorStore
- Parameters:
documents
- The list of documents to be added.
-
delete
Deletes a list of documents by their IDs based on the namespace.- Parameters:
documentIds
- The list of document IDs to be deleted.namespace
- The namespace of the document IDs.- Returns:
- An optional boolean indicating the deletion status.
-
delete
Deletes a list of documents by their IDs.- Specified by:
delete
in interfaceVectorStore
- Parameters:
documentIds
- The list of document IDs to be deleted.- Returns:
- An optional boolean indicating the deletion status.
-
similaritySearch
-
similaritySearch
Description copied from interface:VectorStore
Retrieves documents by query embedding similarity and metadata filters to retrieve exactly the number of nearest-neighbor results that match the request criteria.- Specified by:
similaritySearch
in interfaceVectorStore
- Parameters:
request
- Search request for set search parameters, such as the query text, topK, similarity threshold and metadata filter expressions.- Returns:
- Returns documents th match the query request conditions.
-