Class GemFireVectorStore

java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.vectorstore.gemfire.GemFireVectorStore
All Implemented Interfaces:
Consumer<List<Document>>, DocumentWriter, VectorStore, VectorStoreRetriever, org.springframework.beans.factory.InitializingBean

public class GemFireVectorStore extends AbstractObservationVectorStore implements org.springframework.beans.factory.InitializingBean
A VectorStore implementation backed by GemFire. This store supports creating, updating, deleting, and similarity searching of documents in a GemFire index.
Author:
Geet Rawat, Christian Tzolov, Thomas Vitale, Soby Chacko, Sebastien Deleuze
  • Field Details

  • Constructor Details

    • GemFireVectorStore

      protected GemFireVectorStore(GemFireVectorStore.Builder builder)
      Protected constructor that accepts a builder instance. This is the preferred way to create new GemFireVectorStore instances.
      Parameters:
      builder - the configured builder instance
  • Method Details

    • builder

      public static GemFireVectorStore.Builder builder(EmbeddingModel embeddingModel)
    • getIndexName

      public String getIndexName()
    • getBeamWidth

      public int getBeamWidth()
    • getMaxConnections

      public int getMaxConnections()
    • getBuckets

      public int getBuckets()
    • getVectorSimilarityFunction

      public String getVectorSimilarityFunction()
    • getFields

      public String[] getFields()
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Initializes the GemFireVectorStore after properties are set. This method is called after all bean properties have been set and allows the bean to perform any initialization it requires.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • indexExists

      public boolean indexExists()
      Checks if the index exists in the GemFireVectorStore.
      Returns:
      true if the index exists, false otherwise
    • getIndex

      @Nullable public String getIndex()
    • doAdd

      public void doAdd(List<Document> documents)
      Description copied from class: AbstractObservationVectorStore
      Perform the actual add operation.
      Specified by:
      doAdd in class AbstractObservationVectorStore
      Parameters:
      documents - the documents to add
    • doDelete

      public void doDelete(List<String> idList)
      Description copied from class: AbstractObservationVectorStore
      Perform the actual delete operation.
      Specified by:
      doDelete in class AbstractObservationVectorStore
      Parameters:
      idList - the list of document IDs to delete
    • doSimilaritySearch

      public List<Document> doSimilaritySearch(SearchRequest request)
      Description copied from class: AbstractObservationVectorStore
      Perform the actual similarity search operation.
      Specified by:
      doSimilaritySearch in class AbstractObservationVectorStore
      Parameters:
      request - the search request
      Returns:
      the list of documents that match the query request conditions
    • createIndex

      public void createIndex() throws com.fasterxml.jackson.core.JsonProcessingException
      Creates a new index in the GemFireVectorStore using specified parameters. This method is invoked during initialization.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if an error occurs during JSON processing
    • deleteIndex

      public void deleteIndex()
    • createObservationContextBuilder

      public VectorStoreObservationContext.Builder createObservationContextBuilder(String operationName)
      Description copied from class: AbstractObservationVectorStore
      Specified by:
      createObservationContextBuilder in class AbstractObservationVectorStore
      Parameters:
      operationName - the operation name
      Returns:
      the observation context builder