Google Cloud Memorystore for Redis is a fully-managed service that is powered by the Redis in-memory data store to build application caches that provide sub-millisecond data access. Extend your database application to build AI-powered experiences leveraging Memorystore for Redisβs Langchain integrations.This notebook goes over how to use Google Cloud Memorystore for Redis to store chat message history with the
MemorystoreChatMessageHistory
class.
Learn more about the package on GitHub.
langchain-google-memorystore-redis
package, so we need to install it.
gcloud config list
.gcloud projects list
.MemorystoreMessageHistory
class you need to provide only 2 things:
redis_client
- An instance of a Memorystore Redis.session_id
- Each chat message history object must have a unique session ID. If the session ID already has messages stored in Redis, they will can be retrieved.