Skip to content

SepehrRezaee/omani_therapist

Repository files navigation

🇴🇲 Omani Voice Therapist

Privacy-First, AI-Powered, Voice-Only Mental Health Chatbot (Omani Arabic)


🌟 Project Overview

Omani Voice Therapist is a privacy-focused, AI-powered web application designed to provide empathetic, culturally relevant mental health support in Omani Arabic—using only voice.
The system enables users to speak naturally via their browser, receive real-time AI-powered therapeutic replies, and never requires text or file uploads.

  • Voice In, Voice Out: Speak your message, listen to the bot’s reply.
  • Omani Arabic: Culturally tuned prompts and responses.
  • Anonymous & Private: All data is stored locally unless otherwise configured.
  • NOT a replacement for professional medical advice or emergency services.

🧑‍💻 Features

  • 🎤 Microphone Input: Record directly in-browser (Streamlit or Gradio)
  • 🗣️ Speech-to-Text (STT): Converts voice to text using Gemini API
  • 💬 Empathetic LLM Response: Replies are generated by Google Gemini LLM, tailored for Omani dialect and empathy
  • 😌 Emotion & Crisis Detection: Analyzes speech for emotional state and flags possible crises
  • 🔊 Text-to-Speech (TTS): Bot replies are sent back as high-quality audio
  • 🗃️ Session Logging: Secure, local-only logging of all conversations and metadata
  • 🛡️ Consent Gate: User must accept privacy policy and consent for session logging
  • 🏗️ Containerized: Fully dockerized for easy deployment
  • 🧠 Self-Evolving Memory: Analyzes past sessions to build a long-term user profile, allowing the agent to remember preferences and recurring themes for more personalized therapy.

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/SepehrRezaee/omani_therapist.git
cd omani-voice-therapist

2. Set Up Environment Variables

Create a .env file in the backend/ directory (or as needed):

GEMINI_API_KEY=your_gemini_api_key_here
FRONTEND_URL=http://localhost:8501
ALLOWED_ORIGINS=["http://localhost:8501"]
DATA_DIR=data

3. Install Python Dependencies

Locally (for development)

pip install -r requirements.txt

Or use Docker Compose (recommended for production)

docker compose build
docker compose up
  • The backend (FastAPI) will be on http://localhost:8000
  • The frontend (Streamlit) will be on http://localhost:8501

🗂️ Project Structure

omani_therapist/
│
├── backend/
│   ├── main.py              # FastAPI app
│   ├── config.py
│   ├── db.py
│   ├── models.py
│   ├── speech_utils.py
│   ├── therapy_core.py
│   ├── evolution_core.py    # Self-evolution logic
│   ├── .env
│   └── ...
│
├── frontend/
│   └── app.py               # Streamlit UI
│
├── data/
│   ├── user_inputs/         # Saved user voice files
│   ├── bot_outputs/         # Saved bot replies
│   └── session_logs.db      # SQLite logs
│
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── README.md

🏗️ Deployment with Docker

  1. Build and Run (from project root):

    docker compose build
    docker compose up
  2. Access the app:


🔐 Privacy & Security

  • All sessions are anonymous and data is stored locally by default.
  • Consent is required to start any session.
  • No text or voice data is uploaded to any cloud except for inference via Gemini API.
  • This app is NOT a medical device and does not provide clinical diagnosis or emergency services.

🧭 Roadmap & Planned Improvements

  • Multi-turn conversational UI (chat bubbles)
  • WebRTC for true real-time streaming
  • Mobile App (Flutter/React Native)
  • Optional authentication for personal health logs
  • Improved Omani dialect detection and tuning
  • Advanced analytics (local only)
  • Better offline/edge deployment support
  • Customizable crisis escalation logic

🧑‍🔧 Contributions

PRs, issues, and suggestions are welcome! Please open an issue or submit a pull request.


📧 Contact & Credits


📜 License

MIT License. See LICENSE for details.


Made with ❤️ for the people of Oman.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •