Class ExtendedMariaDBVectorStore

java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore
com.logicaldoc.ai.embedding.store.ExtendedMariaDBVectorStore
All Implemented Interfaces:
ExtendedVectorStore, Consumer<List<org.springframework.ai.document.Document>>, org.springframework.ai.document.DocumentWriter, org.springframework.ai.vectorstore.VectorStore, org.springframework.beans.factory.InitializingBean

public class ExtendedMariaDBVectorStore extends org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore implements ExtendedVectorStore
Extended implementation of the standards MariaDBVectorStore that makes use of vectorial capabilities of MariaDB
Since:
9.2.2
Author:
Marco Meschieri - LogicalDOC
  • Nested Class Summary

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

    org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore.MariaDBBuilder, org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore.MariaDBDistanceType, org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore.MariaDBDocument

    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>>
  • Field Summary

    Fields inherited from class org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore

    DEFAULT_COLUMN_CONTENT, DEFAULT_COLUMN_EMBEDDING, DEFAULT_COLUMN_ID, DEFAULT_COLUMN_METADATA, DEFAULT_SCHEMA_VALIDATION, DEFAULT_TABLE_NAME, filterExpressionConverter, INVALID_EMBEDDING_DIMENSION, MAX_DOCUMENT_BATCH_SIZE, OPENAI_EMBEDDING_DIMENSION_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtendedMariaDBVectorStore(MariaDBEmbeddingScheme scheme, org.springframework.jdbc.core.JdbcTemplate jdbc, org.springframework.ai.embedding.EmbeddingModel model)
     
    ExtendedMariaDBVectorStore(org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore.MariaDBBuilder builder, String table, org.springframework.jdbc.core.JdbcTemplate jdbc)
     
  • 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
    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.mariadb.MariaDBVectorStore

    afterPropertiesSet, builder, createObservationContextBuilder, doAdd, doDelete, doSimilaritySearch, getDistanceType, getNativeClient

    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

    • ExtendedMariaDBVectorStore

      public ExtendedMariaDBVectorStore(MariaDBEmbeddingScheme scheme, org.springframework.jdbc.core.JdbcTemplate jdbc, org.springframework.ai.embedding.EmbeddingModel model)
    • ExtendedMariaDBVectorStore

      public ExtendedMariaDBVectorStore(org.springframework.ai.vectorstore.mariadb.MariaDBVectorStore.MariaDBBuilder builder, String table, org.springframework.jdbc.core.JdbcTemplate jdbc)
  • Method Details

    • 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
    • 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
    • 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
    • clear

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