WS Gateway:
- WebSocket lifecycle handler with RS256 JWT auth
- Redis bridge: device registry, frame publishing, tool_result routing
- Inbound routing: tool_result→LPUSH, home/floating→chat pub/sub
- Outbound: subscribes to ws:out:{user_id}, forwards to Electron
- Single-worker Dockerfile (long-lived WS connections)
Chat Service:
- Redis consumer: subscribes to chat:request:* pattern
- Redis-based ws_context: tool_call→publish, BRPOP tool_result (30s timeout)
- deep_agent: single-agent runner with home/floating/stream variants
- memory_middleware: core/associative/episodic/proactive memory with Fernet
- Domain agents: task (8 tools), note (5), project (6), timeline (4)
- LLM factory via LiteLLM (100+ providers)
- Output formatter (StreamFormatter)
- POST /chat REST fallback with Traefik header auth
- Multi-worker Dockerfile with 120s timeout for LLM calls
WS Gateway
Stateless WebSocket proxy. Accepts Electron connections, authenticates JWT, routes frames to Chat/Batch services via Redis pub/sub.
No business logic
This service does NOT know what tasks, notes, or agents are. It only routes JSON frames between Electron and downstream services.
Scaling
Sticky sessions on user_id (Traefik consistent hashing).
Redis channels used
- Subscribe:
ws:out:{user_id}(frames to send to client) - Publish:
chat:request:{user_id},batch:request:{user_id} - LPUSH:
tool:result:{call_id}(from client tool_result frames) - HSET/HDEL:
ws:devices:{user_id}(device registry)