echoe — README.md
README.md
diagram.svg

#ECHOE

AI emotional-companion backend

##Problem

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.

##Architecture / How it works

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.

Hand-sketched whiteboard diagram of ECHOE's request flow: client through rate limiting, anonymous JWT auth, core API, fanning out to conversation engine, voice pipeline, crisis detection and vault

fig. 1 — request flow, sketched on a whiteboard

##Tech Stack

yaml
1
2
3
4
5
6
7
8
stack:
language: java21
framework: spring-boot
containerized: docker
database: postgresql # supabase-hosted
llm: deepseek
voice: sarvam-ai
deploy: render

##Key Engineering Decisions

md
1
2
3
4
5
- [x] anonymous auth: refresh-token rotation + theft detection
- [x] crisis-keyword detection -> automated helpline surfacing
- [x] PIN-protected vault: tier-based retention
- [x] IP-based rate limiting & quota enforcement
- [x] emotion-aware tone mapping in the voice pipeline (STT/TTS)

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.

##Links

⎇ main ECHOE · Spring Boot · Java 21 UTF-8