AI emotional-companion backend
People turning to an AI companion during an emotionally difficult moment need more than a chatbot wrapped around an LLM — they need the system around it to behave responsibly. ECHOE is built on the idea that the hard part isn't the conversation model, it's everything around it: recognizing when someone might be in crisis and surfacing help automatically, keeping sensitive session history behind a PIN-protected vault with retention the user controls, and protecting anonymous sessions from token theft.
Every request passes through IP-based rate limiting and quota enforcement, then anonymous JWT authentication — sessions don't require a personal account, but refresh tokens are rotated on use and checked for theft. From the core API, requests branch into the DeepSeek-powered conversation engine, the Sarvam AI voice pipeline (STT/TTS with emotion-aware tone mapping), real-time crisis-keyword detection that can trigger automated helpline surfacing, and a PIN-protected vault for session history with tier-based retention. Data lives in PostgreSQL/Supabase; the service is containerized with Docker and deployed on Render.
fig. 1 — request flow, sketched on a whiteboard
The first two are the point of the project: crisis detection is wired to act automatically rather than just log, and the vault gives users a second layer of control over their own sensitive history.