Interface RedisEmbeddingStoreConfig


@ConfigRoot(phase=RUN_TIME) @ConfigMapping(prefix="quarkus.langchain4j.redis") public interface RedisEmbeddingStoreConfig
Configuration of the Redis embedding store.
  • Method Summary

    Modifier and Type
    Method
    Description
    The dimension of the embedding vectors.
    io.quarkus.redis.datasource.search.DistanceMetric
    Metric used to compute the distance between two vectors.
    Name of the index that will be used in Redis when searching for related embeddings.
    Names of extra fields that will be stored in Redis along with the embedding vectors.
    Prefix to be applied to all keys by the embedding store.
    Name of the key that will be used to store the embedded text.
    io.quarkus.redis.datasource.search.VectorAlgorithm
    Algorithm used to index the embedding vectors.
    Name of the key that will be used to store the embedding vector.
  • Method Details

    • dimension

      Long dimension()
      The dimension of the embedding vectors. This has to be the same as the dimension of vectors produced by the embedding model that you use. For example, AllMiniLmL6V2QuantizedEmbeddingModel produces vectors of dimension 384. OpenAI's text-embedding-ada-002 produces vectors of dimension 1536.
    • indexName

      @WithDefault("embedding-index") String indexName()
      Name of the index that will be used in Redis when searching for related embeddings. If this index doesn't exist, it will be created.
    • metadataFields

      Optional<List<String>> metadataFields()
      Names of extra fields that will be stored in Redis along with the embedding vectors. This corresponds to keys in the `dev.langchain4j.data.document.Metadata` map. Storing embeddings with metadata fields unlisted here is possible, but these fields will then not be present in the returned EmbeddingMatch objects.
    • distanceMetric

      @WithDefault("COSINE") io.quarkus.redis.datasource.search.DistanceMetric distanceMetric()
      Metric used to compute the distance between two vectors.
    • vectorFieldName

      @WithDefault("vector") String vectorFieldName()
      Name of the key that will be used to store the embedding vector.
    • scalarFieldName

      @WithDefault("scalar") String scalarFieldName()
      Name of the key that will be used to store the embedded text.
    • prefix

      @WithDefault("embedding:") String prefix()
      Prefix to be applied to all keys by the embedding store. Embeddings are stored in Redis under a key that is the concatenation of this prefix and the embedding ID.

      If the configured prefix does not ends with :, it will be added automatically to follow the Redis convention.

    • vectorAlgorithm

      @WithDefault("HNSW") io.quarkus.redis.datasource.search.VectorAlgorithm vectorAlgorithm()
      Algorithm used to index the embedding vectors.