Redis
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 redis
To run Redis locally, you can use Docker:
docker run --name langchain-redis -d -p 6379:6379 redis redis-server --save 60 1 --loglevel warning
To stop the container:
docker stop langchain-redis
And to start it again:
docker start langchain-redis