Maintain chat history in generative AI apps with Valkey
Integrate Valkey with LangChain
brew install valkey
. You should now be able to use the Valkey CLI (valkey-cli
).
List
: keys *
in production - its just for demo purposes
schema.ChatMessageHistory
interface methods in langchaingo
and uses List
data structure behind the scenes. Starting the application creates a new "chat session" is associated with a List
- each new instance will be backed by a separate List
.AddMessage
- Stores a conversation message, using LPUSHMessages
- Retrieves all the messages in a conversation using LRANGEClear
- Deletes all messages in a conversation using DEL
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.