Skip to main content


The UpstashRedisStore is an implementation of ByteStore that stores everything in your Upstash-hosted Redis instance.

To use the base RedisStore instead, see this guide

To configure Upstash Redis, follow our Upstash guide.

%pip install --upgrade --quiet  upstash-redis
from import UpstashRedisByteStore
from upstash_redis import Redis


redis_client = Redis(url=URL, token=TOKEN)
store = UpstashRedisByteStore(client=redis_client, ttl=None, namespace="test-ns")

store.mset([("k1", b"v1"), ("k2", b"v2")])
print(store.mget(["k1", "k2"]))
API Reference:UpstashRedisByteStore
[b'v1', b'v2']

Was this page helpful?

You can also leave detailed feedback on GitHub.