Class InMemoryVectorStore

java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.vectorstore.SimpleVectorStore
com.logicaldoc.ai.embedding.store.InMemoryVectorStore
All Implemented Interfaces:
ExtendedVectorStore, Consumer<List<org.springframework.ai.document.Document>>, org.springframework.ai.document.DocumentWriter, org.springframework.ai.vectorstore.VectorStore

public class InMemoryVectorStore extends org.springframework.ai.vectorstore.SimpleVectorStore implements ExtendedVectorStore
Extended implementation of the standards SimpleVectorStore
Since:
9.2.2
Author:
Marco Meschieri - LogicalDOC
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.ai.vectorstore.SimpleVectorStore

    org.springframework.ai.vectorstore.SimpleVectorStore.EmbeddingMath, org.springframework.ai.vectorstore.SimpleVectorStore.SimpleVectorStoreBuilder

    Nested classes/interfaces inherited from interface org.springframework.ai.vectorstore.VectorStore

    org.springframework.ai.vectorstore.VectorStore.Builder<T extends org.springframework.ai.vectorstore.VectorStore.Builder<T>>
  • Constructor Summary

    Constructors
    Constructor
    Description
    InMemoryVectorStore(org.springframework.ai.embedding.EmbeddingModel embeddingModel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Remove all embeddings
    boolean
    exists(long docId, String fileVersion)
    Checks the existence of a specific entry in the vector store
    org.springframework.ai.embedding.EmbeddingModel
    Returns the EmbeddingModel used by this store
    void
    load(File file)
     
    void
    updateMetadata(com.logicaldoc.core.document.Document document)
    Updates the metadata of all the entries that refer to the given document

    Methods inherited from class org.springframework.ai.vectorstore.SimpleVectorStore

    builder, createObservationContextBuilder, doAdd, doDelete, doSimilaritySearch, load, save

    Methods inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore

    add, delete, delete, similaritySearch

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface org.springframework.ai.document.DocumentWriter

    write

    Methods inherited from interface org.springframework.ai.vectorstore.VectorStore

    accept, add, delete, delete, delete, getName, getNativeClient, similaritySearch, similaritySearch
  • Constructor Details

    • InMemoryVectorStore

      public InMemoryVectorStore(org.springframework.ai.embedding.EmbeddingModel embeddingModel)
  • Method Details

    • load

      public void load(File file)
      Overrides:
      load in class org.springframework.ai.vectorstore.SimpleVectorStore
    • exists

      public boolean exists(long docId, String fileVersion)
      Description copied from interface: ExtendedVectorStore
      Checks the existence of a specific entry in the vector store
      Specified by:
      exists in interface ExtendedVectorStore
      Parameters:
      docId - Identifier of the document
      fileVersion - Optional version specification
      Returns:
      True only if there is at least one matching entry
    • updateMetadata

      public void updateMetadata(com.logicaldoc.core.document.Document document)
      Description copied from interface: ExtendedVectorStore
      Updates the metadata of all the entries that refer to the given document
      Specified by:
      updateMetadata in interface ExtendedVectorStore
      Parameters:
      document - The document to extract metadata from
    • getEmbeddingModel

      public org.springframework.ai.embedding.EmbeddingModel getEmbeddingModel()
      Description copied from interface: ExtendedVectorStore
      Returns the EmbeddingModel used by this store
      Specified by:
      getEmbeddingModel in interface ExtendedVectorStore
      Returns:
      the embedding model
    • clear

      public int clear()
      Description copied from interface: ExtendedVectorStore
      Remove all embeddings
      Specified by:
      clear in interface ExtendedVectorStore
      Returns:
      number of removed embeddings