RedisConfig

org.llm4s.vectorstore.redis.RedisConfig
See theRedisConfig companion object
final case class RedisConfig

What RedisVectorStore needs to reach one search index of a Redis server with the Redis Query Engine (Redis Stack, or Redis 8 and later), or of a Valkey server with the valkey-search module.

Load it from configuration with org.llm4s.config.RedisVectorStoreConfigLoader, which reads llm4s.vectorstore.redis, or build one in code:

val config = RedisConfig("redis.example.com")
 .withTls(true)
 .withPassword("secret")
 .withIndex("docs")

The store checks it with RedisConfig#validate when it is built. toString never prints the password.

Value parameters

algorithm

the vector index structure the index is created with

database

the logical database (SELECT); Redis Query Engine indexes only database 0 on most servers

dimensions

the vector size the index is created with; when unset, the size of the first record upserted. A record of another size is refused before it is sent.

distanceMetric

the distance the index is created with

host

the server's host name or address

index

the search index's name (FT.CREATE)

keyPrefix

the prefix of every record's hash key; unset means "<index>:". Two stores must not share a prefix.

password

the password (AUTH); unset means no authentication

port

the server's port

timeout

how long connecting and each command may take

tls

whether to connect over TLS. Without it the password crosses the network in clear text, which is acceptable only on a trusted network.

username

the ACL user; unset means the default user

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def effectivePrefix: String

The prefix of every record's key: keyPrefix, or "<index>:".

The prefix of every record's key: keyPrefix, or "<index>:".

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Checks the config; the first problem is reported, naming the setting.

Checks the config; the first problem is reported, naming the setting.

Attributes

def withDatabase(database: Int): RedisConfig
def withDimensions(dimensions: Int): RedisConfig
def withDimensions(dimensions: Option[Int]): RedisConfig
def withHost(host: String): RedisConfig
def withIndex(index: String): RedisConfig
def withKeyPrefix(keyPrefix: String): RedisConfig
def withKeyPrefix(keyPrefix: Option[String]): RedisConfig
def withPassword(password: String): RedisConfig
def withPassword(password: Option[String]): RedisConfig
def withPort(port: Int): RedisConfig
def withTimeout(timeout: FiniteDuration): RedisConfig
def withTls(tls: Boolean): RedisConfig
def withUsername(username: String): RedisConfig
def withUsername(username: Option[String]): RedisConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product