Context
The current chat endpoint in �ackend/routers/chat.py uses an in-memory Python dict (_SESSION_STORE) with a 60-minute TTL. This means:
- Chat history is lost on every process restart
- History is not shared across multiple backend instances
Proposed Solution
Replace _SESSION_STORE with Redis-backed sessions using the existing
edis_client.py:
- Store each session as a Redis key: chat:session:{session_id}
- Use Redis TTL (60 min) instead of manual cleanup task
- Serialize messages as JSON in Redis values
- Remove the cleanup_expired_sessions() coroutine and lifespan task
Acceptance Criteria
Notes
Redis is already available in the stack (
edis_client.py handles the connection). P2 item carried over from �ugfix-code-review.
Context
The current chat endpoint in �ackend/routers/chat.py uses an in-memory Python dict (_SESSION_STORE) with a 60-minute TTL. This means:
Proposed Solution
Replace _SESSION_STORE with Redis-backed sessions using the existing
edis_client.py:
Acceptance Criteria
Notes
Redis is already available in the stack (
edis_client.py handles the connection). P2 item carried over from �ugfix-code-review.