Getting started with Valkey using JavaScript
Run existing Redis apps with Valkey and learn how to use it with LangChain

brew install valkey
. You should now be able to use the Valkey CLI (valkey-cli
).ioredis
with Valkey as well. Lets write a publisher application:iovalkey
is a fork of ioredis
. I made the following changes to port the producer code to use iovalkey
:import Redis from 'ioredis';
- Added
import Redis from 'iovalkey';
- Installed
iovalkey
-npm install iovalkey
iovalkey
based publisher, and confirm that the subscriber is able to receive it:RedisChatMessageHistory
component.
List
:
node-redis
client, but I wanted to try out iovalkey
client. I am not a JS/TS expert, but it was simple enough to port the existing implementation.You can refer to the code on GitHub- Comment out
import { RedisChatMessageHistory } from "@langchain/redis";
- Add
import { ValkeyChatMessageHistory } from "./valkey_chat_history.js";
- Replace
RedisChatMessageHistory
withValkeyChatMessageHistory
(while creating thememory
instance)
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.