Class PineconeVectorStore

java.lang.Object
org.springframework.ai.vectorstore.PineconeVectorStore
All Implemented Interfaces:
Consumer<List<Document>>, DocumentWriter, VectorStore

public class PineconeVectorStore extends Object implements 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
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public void add(List<Document> documents, String namespace)
      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

      public void add(List<Document> documents)
      Adds a list of documents to the vector store.
      Specified by:
      add in interface VectorStore
      Parameters:
      documents - The list of documents to be added.
    • delete

      public Optional<Boolean> delete(List<String> documentIds, String namespace)
      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

      public Optional<Boolean> delete(List<String> documentIds)
      Deletes a list of documents by their IDs.
      Specified by:
      delete in interface VectorStore
      Parameters:
      documentIds - The list of document IDs to be deleted.
      Returns:
      An optional boolean indicating the deletion status.
    • similaritySearch

      public List<Document> similaritySearch(SearchRequest request, String namespace)
    • similaritySearch

      public List<Document> similaritySearch(SearchRequest request)
      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 interface VectorStore
      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.