chatHistory
that backs chat memory classes like BufferMemory
for an Upstash Redis instance.
Setup
You will need to install @upstash/redis in your project:npm
Usage
Each chat history session stored in Redis must have a unique id. You can provide an optionalsessionTTL
to make sessions expire after a give number of seconds.
The config
parameter is passed directly into the new Redis()
constructor of @upstash/redis, and takes all the same arguments.