HaloStack Docs
Open App
Packages

Redis

The thin server-side Redis client used for resumable AI chat streams.

@halostack/redis is a small server-side wrapper around ioredis. It reads the validated REDIS_URL from @halostack/env and creates clients for consumers that need Redis.

Why it exists

The current primary consumer is the resumable AI chat stream. Pub/sub and stream buffering let a browser reconnect to an in-flight assistant response after a page reload.

Importing

Pub/sub code should create separate publisher and subscriber clients because a subscribed Redis connection cannot issue arbitrary commands.

Local and production

Local development uses the redis:7-alpine service in tools/docker/compose.yaml on localhost:6379. Production uses the Railway Redis plugin and injects ${{Redis.REDIS_URL}} into services that need it.