Class RedisEmbeddingStore

java.lang.Object
io.quarkiverse.langchain4j.redis.RedisEmbeddingStore
All Implemented Interfaces:
dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>

public class RedisEmbeddingStore extends Object implements dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RedisEmbeddingStore(io.quarkus.redis.datasource.ReactiveRedisDataSource ds, RedisSchema schema)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(dev.langchain4j.data.embedding.Embedding embedding)
     
    add(dev.langchain4j.data.embedding.Embedding embedding, dev.langchain4j.data.segment.TextSegment textSegment)
     
    void
    add(String id, dev.langchain4j.data.embedding.Embedding embedding)
     
    addAll(List<dev.langchain4j.data.embedding.Embedding> embeddings)
     
    addAll(List<dev.langchain4j.data.embedding.Embedding> embeddings, List<dev.langchain4j.data.segment.TextSegment> embedded)
     
     
    void
    Deletes all keys with the prefix that is used by this embedding store.
    List<dev.langchain4j.store.embedding.EmbeddingMatch<dev.langchain4j.data.segment.TextSegment>>
    findRelevant(dev.langchain4j.data.embedding.Embedding referenceEmbedding, int maxResults, double minScore)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface dev.langchain4j.store.embedding.EmbeddingStore

    findRelevant, findRelevant, findRelevant, search
  • Field Details

  • Constructor Details

    • RedisEmbeddingStore

      public RedisEmbeddingStore(io.quarkus.redis.datasource.ReactiveRedisDataSource ds, RedisSchema schema)
  • Method Details

    • builder

      public static RedisEmbeddingStore.Builder builder()
    • add

      public String add(dev.langchain4j.data.embedding.Embedding embedding)
      Specified by:
      add in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • add

      public void add(String id, dev.langchain4j.data.embedding.Embedding embedding)
      Specified by:
      add in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • add

      public String add(dev.langchain4j.data.embedding.Embedding embedding, dev.langchain4j.data.segment.TextSegment textSegment)
      Specified by:
      add in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • addAll

      public List<String> addAll(List<dev.langchain4j.data.embedding.Embedding> embeddings)
      Specified by:
      addAll in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • addAll

      public List<String> addAll(List<dev.langchain4j.data.embedding.Embedding> embeddings, List<dev.langchain4j.data.segment.TextSegment> embedded)
      Specified by:
      addAll in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • findRelevant

      public List<dev.langchain4j.store.embedding.EmbeddingMatch<dev.langchain4j.data.segment.TextSegment>> findRelevant(dev.langchain4j.data.embedding.Embedding referenceEmbedding, int maxResults, double minScore)
      Specified by:
      findRelevant in interface dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
    • deleteAll

      public void deleteAll()
      Deletes all keys with the prefix that is used by this embedding store.