used as a distributed, in-memory key‚Äìvalue database, cache and message broker, with optional durability.
Because it holds all data in memory and because of its design, Redis offers low-latency reads and writes,
making it particularly suitable for use cases that require a cache. Redis is the most popular NoSQL database,
and one of the most popular databases overall.This page covers how to use the Redis ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific Redis wrappers.Installation and Setup‚ÄãInstall the Python SDK:pip install redisWrappers‚ÄãAll wrappers need a redis url connection string to connect to the database support either a stand alone Redis server
or a High-Availability setup with Replication and Redis Sentinels.Redis Standalone connection url‚ÄãFor standalone Redis server, the official redis connection url formats can be used as describe in the python redis modules
"from_url()" method Redis.from_urlExample: redis_url = "redis://:secret-pass@localhost:6379/0"Redis Sentinel connection url‚ÄãFor Redis sentinel setups the connection scheme is "redis+sentinel".
This is an unofficial extensions to the official IANA registered protocol schemes as long as there is no connection url
for Sentinels available.Example: redis_url = "redis+sentinel://:secret-pass@sentinel-host:26379/mymaster/0"The format is  redis+sentinel://[[username]:[password]]@[host-or-ip]:[port]/[service-name]/[db-number]
with the default values of "service-name = mymaster" and "db-number = 0" if not set explicit.
The service-name is the redis server monitoring group name as configured within the Sentinel. The current url format limits the connection string to one sentinel host only (no list can be given) and
booth Redis server and sentinel must have the same password set (if used).Redis Cluster connection url‚ÄãRedis cluster is not supported right now for all methods requiring a "redis_url" parameter.
Redis (Remote Dictionary Server) is an open-source in-memory storage,
Redis (Remote Dictionary Server) is an open-source in-memory storage, ->: used as a distributed, in-memory key‚Äìvalue database, cache and message broker, with optional durability.
Because it holds all data in memory and because of its design, Redis offers low-latency reads and writes,
making it particularly suitable for use cases that require a cache. Redis is the most popular NoSQL database,
and one of the most popular databases overall.This page covers how to use the Redis ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific Redis wrappers.Installation and Setup‚ÄãInstall the Python SDK:pip install redisWrappers‚ÄãAll wrappers need a redis url connection string to connect to the database support either a stand alone Redis server
or a High-Availability setup with Replication and Redis Sentinels.Redis Standalone connection url‚ÄãFor standalone Redis server, the official redis connection url formats can be used as describe in the python redis modules
"from_url()" method Redis.from_urlExample: redis_url = "redis://:secret-pass@localhost:6379/0"Redis Sentinel connection url‚ÄãFor Redis sentinel setups the connection scheme is "redis+sentinel".
This is an unofficial extensions to the official IANA registered protocol schemes as long as there is no connection url
for Sentinels available.Example: redis_url = "redis+sentinel://:secret-pass@sentinel-host:26379/mymaster/0"The format is  redis+sentinel://[[username]:[password]]@[host-or-ip]:[port]/[service-name]/[db-number]
with the default values of "service-name = mymaster" and "db-number = 0" if not set explicit.
The service-name is the redis server monitoring group name as configured within the Sentinel. The current url format limits the connection string to one sentinel host only (no list can be given) and
booth Redis server and sentinel must have the same password set (if used).Redis Cluster connection url‚ÄãRedis cluster is not supported right now for all methods requiring a "redis_url" parameter.