Wrapper around Redis vector database.
Check if the correct Redis modules are installed.
Get a redis client from the connection url given. This helper accepts urls for Redis server (TCP with/without TLS or UnixSocket) as well as Redis Sentinel connections.
Redis Cluster is not supported.
Before creating a connection the existence of the database driver is checked an and ValueError raised otherwise
To use, you should have the redis python package installed.
Calculate maximal marginal relevance.
Check if Redis index exists.
Logical expression of RedisFilterFields.
RedisFilterExpressions can be combined using the & and | operators to create complex logical expressions that evaluate to the Redis Query language.
This presents an interface by which users can create complex queries without having to know the Redis Query language.
Filter expressions are not initialized directly. Instead they are built by combining RedisFilterFields using the & and | operators.
Examples:
>>> from langchain_community.vectorstores.redis import RedisTag, RedisNum
>>> brand_is_nike = RedisTag("brand") == "nike"
>>> price_is_under_100 = RedisNum("price") < 100
>>> filter = brand_is_nike & price_is_under_100
>>> print(str(filter))
(@brand:{nike} @price:[-inf (100)])
Schema for Redis index.
Retriever for Redis VectorStore.
Redis vector database.