Upstash Redis is the clean fix for Lucia’s current fragile in-memory continuity/session state problem.
Runbook phase mapping
- Phase 1 — account access and secret references
- Phase 6 — add shared short-lived continuity/session state for hosted Lucia
Primary runbook page: 08 - Live Transition Runbook
Why Redis is being added
Lucia’s current continuity/session behavior is not fully launch-safe if it only lives in-process.
Redis gives us a practical bridge:
- short-lived shared session state
- continuity across deploys/instances more cleanly
- fast read/write for operational memory that should not live only in Node memory
- minimal setup pain
Lucia role
Use Redis for:
- session continuity
- distress continuity state
- short-lived operator memory
- temporary action coordination
- low-latency ephemeral state
Lucia role not to force onto Redis
Do not turn Redis into Lucia’s permanent memory brain.
Use Redis for:
- fast
- temporary
- shared
- expiring
Use Postgres for:
- durable
- auditable
- structured
- long-horizon
Candidate Redis keys / concepts
| Key Pattern | Purpose | TTL |
|---|
lucia:session:{id} | operator session continuity | 15m–60m |
lucia:distress:{id} | distress streak + stage | short-lived |
lucia:focus:{id} | pending follow-up context | short-lived |
lucia:action:{id} | temporary action coordination | short-lived |
lucia:rate:{id} | optional lightweight rate controls | short-lived |
Setup checklist
Stage 1 — account and DB
Stage 2 — Lucia integration
Stage 3 — guardrails
Credentials + account reference
Account access
| Item | Value |
|---|
| Account email | |
| Dashboard URL | |
| Team / org | |
| MFA method | |
Database references
| Item | Value |
|---|
| Redis database name | |
| Region | |
| REST URL | |
| TCP endpoint (if used) | |
| Read region(s) | |
Keys and secrets
| Secret / Token | Value or 1Password Reference | Notes | Rotated |
|---|
| REST URL | | | |
| REST token | | | |
| password / auth token | | if applicable | |
Environment variable tracker
| Variable | Value / Reference | Used In |
|---|
UPSTASH_REDIS_REST_URL | | Engine |
UPSTASH_REDIS_REST_TOKEN | | Engine |
REDIS_URL | | optional |
REDIS_TOKEN | | optional |
Key design notes
TTL policy
- session continuity TTL:
- distress continuity TTL:
- pending follow-up TTL:
- fallback behavior if expired:
Failure behavior
- If Redis is down:
- Lucia should:
- Operator impact:
- Alerting path:
Notes / gotchas
- Redis is the bridge, not the cathedral.
- It solves a real problem right now: shared short-lived continuity.
Related pages