Class PineconeVectorStore

java.lang.Object
com.google.genkit.plugins.pinecone.PineconeVectorStore

public class PineconeVectorStore extends Object
Pinecone vector store implementation.

This class provides indexing and retrieval of documents using Pinecone vector database for similarity search.

  • Constructor Details

    • PineconeVectorStore

      public PineconeVectorStore(io.pinecone.clients.Pinecone pinecone, PineconeIndexConfig config, Embedder embedder)
      Creates a new PineconeVectorStore.
      Parameters:
      pinecone - the Pinecone client
      config - the index configuration
      embedder - the embedder for generating vectors
  • Method Details

    • initialize

      public void initialize()
      Initializes the vector store by connecting to or creating the index.
    • retrieve

      public RetrieverResponse retrieve(ActionContext context, RetrieverRequest request)
      Retrieves documents similar to the query.
      Parameters:
      context - the action context
      request - the retriever request
      Returns:
      the retriever response with matching documents
    • index

      public IndexerResponse index(ActionContext context, IndexerRequest request)
      Indexes documents into the vector store.
      Parameters:
      context - the action context
      request - the indexer request
      Returns:
      the indexer response
    • deleteByIds

      public void deleteByIds(List<String> ids)
      Deletes documents by their IDs.
      Parameters:
      ids - the document IDs to delete
    • deleteAll

      public void deleteAll()
      Deletes all documents in the namespace.
    • getConfig

      public PineconeIndexConfig getConfig()
      Gets the index configuration.
    • getIndex

      public io.pinecone.clients.Index getIndex()
      Gets the Pinecone index connection.