HOPEO AI is a specialized AI-based SaaS platform engineered to support drug addiction recovery and rehabilitation. Aligned with UN Sustainable Development Goal 3.5, this application leverages low-latency neural interfaces and voice-driven automation to provide personalized emotional support and recovery guidance.
HOPEO AI is built on a decoupled full-stack architecture designed for high-availability and real-time interaction.
The "HopeAI Assistant" is governed by a strict Domain-Specific Logic Layer. It is fine-tuned to act exclusively as a recovery concierge, prioritizing user safety and substance abuse prevention.
- Deterministic Guardrails: The assistant utilizes system-prompt constraints to ensure all responses are strictly relevant to recovery, preventing off-topic halluncinations.
- Multimodal Interaction: Supports both asynchronous REST-based text chat and synchronous Realtime Voice streaming.
The platform implements the OpenAI Realtime API via WebRTC, allowing for a "human-like" conversational experience:
- Direct Audio Streaming: Uses a short-lived token system from the backend to establish a secure, low-latency browser-to-OpenAI connection.
- VAD (Voice Activity Detection): Engineered to handle natural interruptions and emotional nuances in user speech.
| Layer | Technology |
|---|---|
| Frontend | React (Vite), WebRTC Interface, Tailwind CSS |
| Backend | FastAPI (Asynchronous Python 3.11+), Poetry |
| AI Model | GPT-4o Realtime Preview |
| Voice Protocol | SDP (Session Description Protocol) via WebRTC |
| Dependency Mgmt | Poetry (Python), NPM (Node.js) |
cd backend
cp .env.example .env # Add your OPENAI_API_KEY
poetry install
poetry run uvicorn app.main:app --reload --port 8000
cd frontend
cp .env.example .env.development # Set VITE_API_URL=http://localhost:8000
npm install
npm run dev
📡 API Reference
Text Chat Endpoint
URL: POST /chat
Payload: { "message": "string" }
Response: { "reply": "string" }
Realtime Voice Implementation
The voice module bypasses traditional API bottlenecks by using an SDP (Session Description Protocol) offer/answer exchange. This allows the browser to stream mic data directly to the neural engine, reducing latency by ~60% compared to traditional Whisper-to-Text-to-GPT flows.
⚖️ Ethical Governance & Safety
HOPEO AI is designed with a Safety-First principle. The assistant is strictly prohibited from providing medical prescriptions or non-recovery-related advice. It serves as a supplemental tool to professional rehabilitation, not a replacement.
🤝 Project Leadership
Lead Developer: Shikhar Pandey
Goal: Advancing UN SDG 3.5 through accessible technology.
Developed with ❤️ to support global mental health and recovery.