A comprehensive, safety-first, and scalable platform leveraging machine learning and generative AI to detect, respond to, and manage mental health risks—while also providing journaling and mood-tracking capabilities.
- Overview
- Features
- System Architecture
- Tech Stack
- Key Modules
- Installation
- Usage
- Data Privacy & Compliance
- Contributing / Journal
- License
- Disclaimer
- Acknowledgments
- Contact
This system is designed to identify and respond to potential suicide risks in real-time using advanced machine learning classification (TF-IDF and Logistic Regression) and Retrieval Augmented Generation (RAG), integrated with generative models (e.g., GitHub Models API with GPT-4, Claude) to provide empathetic, context-aware responses. In addition to AI-based direct support, it offers a journal and mood tracking feature set for users to record personal reflections and monitor their emotional well-being over time.
-
Automatic Suicide Risk Detection
Uses a Machine Learning Classification Pipeline (MCP) with TF-IDF and logistic regression to flag concerning user-generated text. -
Keyword Screening
Real-time filter for suicide/self-harm keywords to initially flag content for review. -
RAG (Retrieval Augmented Generation)
Integration of curated resources and knowledge bases to enhance AI responses with relevant context. -
Generative AI Support
Empathetic and context-rich conversations powered by GitHub Models API with access to GPT-4, Claude, and other state-of-the-art models. -
Admin Dashboard
A React-based interface for administrators to:- Review flagged messages
- Escalate urgent cases
- Annotate conversation histories
- View mood/journal summaries (according to user consent)
-
Mood & Journal Tracking
Enables users to log daily/weekly moods and maintain private journals with optional sentiment analysis and personal progress charts. -
Compliance & Audit Logging
Facilitates compliance with data privacy regulations (GDPR, HIPAA-like requirements for health data).
- FastAPI Backend
- Hosts the classification model, manages user data, handles API routes.
- GitHub Models API Integration
- Powers generative responses using state-of-the-art models like GPT-4 and Claude.
- React Admin Dashboard
- Allows moderators or mental health professionals to review and manage flagged content.
- Backend: Python, FastAPI, Scikit-learn, SQLite/PostgreSQL
- Frontend: React, Material-UI
- AI APIs: GitHub Models API (GPT-4, Claude, o1)
- Others: Docker (optional), JWT-based Auth, RESTful Services
-
MCP Model
- Preprocessing: Text cleaning & tokenization
- Feature Extraction: TF-IDF
- Classifier: Logistic Regression
- Keyword Matching for initial detection
-
Mood & Journal Tracking
- Users can log their mood on a daily/weekly schedule (numeric scale, emoji-based, etc.).
- A journal for personal reflections—can optionally run sentiment analysis.
- Trend charts to visualize emotional patterns.
-
RAG Pipeline
- Combines AI knowledge retrieval with generative models for context-aware responses.
- Ideal for referencing relevant mental health resources/articles.
-
Generative Response Integration
- Uses GitHub Models API with GPT-4, Claude, and other advanced models to generate empathetic, context-tuned messages.
- Automatic escalation triggers for high-risk user statements.
-
Admin Dashboard
- Secure login for mental health professionals or moderators.
- Flagged messages review, risk assessment, and escalation.
- Oversees mood/journal entries (with the user’s permission).
- Maintains audit logs for compliance.
- Clone the Repository
git clone https://github.com/your-org/ai-mental-health-support.git cd ai-mental-health-support



