A comprehensive Android application designed to provide mental health support, wellness tracking, and AI-powered assistance. Built with modern Android development practices and a Python backend server with RAG (Retrieval Augmented Generation) capabilities.
Help Yourself (also known as Custom AI Assistant) is an intelligent mental health companion app that combines:
- AI-Powered Conversations: Chat with an empathetic AI assistant powered by local Ollama models with RAG
- Mental Health Assessments: Self-assessment tests for depression, anxiety, and stress
- Wellness Tracking: Track and monitor your mental health metrics over time
- Resource Discovery: Find nearby therapy centers and mental health resources using Google Maps
- Educational Resources: Access curated mental health and academic resources
- Crisis Support: Built-in crisis detection and helpline information for India
- AI Chat Assistant: Conversational AI with context-aware responses using RAG
- Mental Health Assessments:
- Depression Test (PHQ-9 based)
- Anxiety Test (GAD-7 based)
- Stress Test
- Wellness Tracking: Track depression, anxiety, and stress levels over time
- Nearby Resources: Find therapy centers and mental health facilities using Google Maps
- Resource Library: Access mental health and academic resources
- Breathing Exercises: Guided breathing exercises for stress relief
- Personalized Reviews: AI-generated personalized mental health reviews using Google Gemini
- Web Search Integration: Tavily API integration for real-time information retrieval
- Firebase Authentication: Secure user authentication with Google, Email, and Phone sign-in
- Modern Android Architecture: MVVM pattern with Jetpack Compose
- Dependency Injection: Dagger Hilt for clean architecture
- Local AI Processing: Ollama integration for privacy-focused AI responses
- RAG Implementation: Retrieval Augmented Generation for context-aware responses
- Real-time Data: Firebase Realtime Database for data synchronization
- Offline Support: Local caching and offline capabilities
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM (Model-View-ViewModel)
- Dependency Injection: Dagger Hilt
- Networking: Retrofit + OkHttp
- Database: Room Database (local) + Firebase Realtime Database (cloud)
- Authentication: Firebase Auth
- Framework: Flask (Python)
- AI Model: Ollama (Qwen2.5, Nomic Embed)
- Vector Database: ChromaDB
- RAG: LangChain with Ollama embeddings
- CORS: Enabled for cross-origin requests
- Android Studio Hedgehog (2023.1.1) or later
- JDK 17 or later
- Android SDK (API 24+)
- Gradle 8.0+
- Python 3.10 or later
- Ollama installed and running locally
- Required Python packages (see
server/requirements.txt)
- Firebase: For authentication and database
- Google Maps API: For location services
- Google Gemini API: For personalized reviews
- Tavily API: For web search integration
git clone <repository-url>
cd final- Create a Firebase project at Firebase Console
- Add an Android app to your Firebase project
- Download
google-services.json - Place it in:
app/compose-chatgpt-kotlin-android-chatbot/app/google-services.jsonapp/compose-chatgpt-kotlin-android-chatbot/app/src/main/google-services.json
-
Create
local.propertiesfile inapp/compose-chatgpt-kotlin-android-chatbot/:sdk.dir=/path/to/your/android/sdk GEMINI_API_KEY=your_gemini_api_key_here TAVILY_API_KEY=your_tavily_api_key_here
-
Create
secrets.xmlinapp/compose-chatgpt-kotlin-android-chatbot/app/src/main/res/values/:<?xml version="1.0" encoding="utf-8"?> <resources> <string name="google_maps_api_key">your_google_maps_api_key_here</string> </resources>
cd app/compose-chatgpt-kotlin-android-chatbot
./gradlew assembleDebugOr open the project in Android Studio and run it.
# Visit https://ollama.ai/ for installation instructions
# Pull required models
ollama pull qwen2.5:latest
ollama pull nomic-embed-textcd server
pip install -r requirements.txtUpdate the server URL in NetworkModule.kt if needed:
- For emulator:
http://10.0.2.2:5002/ - For physical device: Update
LOCAL_DEVICE_URLwith your computer's IP
cd server
python server.py
# Server runs on http://localhost:5002final/
├── app/
│ └── compose-chatgpt-kotlin-android-chatbot/
│ ├── app/
│ │ ├── src/main/
│ │ │ ├── java/com/helpyourself/com/
│ │ │ │ ├── data/ # Data layer (repositories, API services)
│ │ │ │ ├── di/ # Dependency injection modules
│ │ │ │ ├── ui/ # UI components (Compose screens)
│ │ │ │ │ ├── conversations/ # Chat screens
│ │ │ │ │ ├── screens/ # Feature screens
│ │ │ │ │ └── resources/ # Resource screens
│ │ │ │ └── utils/ # Utility classes
│ │ │ └── res/ # Resources (layouts, drawables, etc.)
│ │ └── build.gradle
│ ├── build.gradle
│ ├── local.properties # API keys (excluded from Git)
│ └── README.md
├── server/
│ ├── server.py # Main Flask server
│ ├── app.py # Alternative server implementation
│ ├── direct_ollama.py # Direct Ollama integration
│ ├── requirements.txt # Python dependencies
│ └── chroma_db/ # Vector database storage
├── ollama_rag/
│ ├── app.py # RAG Flask app
│ ├── modelrag.py # RAG model implementation
│ └── simple_rag.py # Simple RAG implementation
├── fine_tuned/ # Fine-tuned model files
├── .gitignore # Git ignore rules
└── README.md # This file
The app uses local.properties for sensitive configuration. This file is excluded from version control. Create it with:
# Android SDK location
sdk.dir=/path/to/android/sdk
# API Keys
GEMINI_API_KEY=your_gemini_api_key
TAVILY_API_KEY=your_tavily_api_key-
Enable Authentication providers in Firebase Console:
- Google Sign-In
- Email/Password
- Phone Authentication
-
Set up Firebase Realtime Database rules (see
database.rules.json) -
Configure OAuth clients for Google Sign-In
- Jetpack Compose: Modern declarative UI framework
- Kotlin Coroutines: Asynchronous programming
- Dagger Hilt: Dependency injection
- Retrofit: HTTP client
- Room: Local database
- Firebase: Authentication, Realtime Database
- Google Maps SDK: Location services
- Material Design 3: UI components
- Flask: Python web framework
- Ollama: Local LLM inference
- LangChain: RAG framework
- ChromaDB: Vector database
- Tiktoken: Tokenization
- Google Gemini API: AI-powered reviews
- Tavily API: Web search
- Google Maps API: Location services
- All API keys are stored in
local.properties(excluded from Git) - Firebase security rules implemented
- No sensitive data in source code
- See
SECURITY.mdfor more details
The backend server must be running for the app to function properly. Default port is 5002.
- Unit tests:
./gradlew test - Instrumented tests:
./gradlew connectedAndroidTest
./gradlew assembleReleaseContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Kanishq Gandharv
- Email: kanishqgandharv@gmail.com
This app includes mental health resources and crisis helplines for India:
- Tele-Manas: 14416 (24×7 Government helpline)
- Kiran: 1800-599-0019 (National Mental Health Rehab Helpline)
- Aasra: +91-22-27546669 (24×7 Suicide Prevention)
This app is not a replacement for professional mental health care. If you're experiencing a mental health crisis, please contact a licensed mental health professional or emergency services immediately.
- Never commit API keys to version control
- All sensitive keys are stored in
local.propertieswhich is excluded via.gitignore - Create your own API keys from respective providers
For issues, questions, or contributions:
- Open an issue on GitHub
- Contact: kanishqgandharv@gmail.com
Made with ❤️ for mental health awareness and support