AI-Powered Mental Wellness Assistant for Early Intervention Using Hybrid Semantic Retrieval and Safety-Aware Response Generation
Abstract
Stress, anxiety, and loneliness are on the rise, but timely access to mental health care is limited due to social stigma, high costs of treatment, and the lack of qualified specialists. Artificial intelligence can provide a scalable, accessible avenue of mental wellness intervention at an early stage. This paper introduces a more advanced mental wellness chatbot that builds on classical TF-IDF and supervised classification to add sentence transformer embeddings for deep semantic retrieval, a hybrid multi-stage filtering and safety layer to ensure quality of responses, and a context-awareness module to monitor emotional patterns throughout a conversation. The system is built on a Python and Flask client-server architecture with an HTML/CSS/JS frontend, trained on approximately $\mathbf{6 1, 5 0 0}$ conversational samples. The system is assessed based on 38 manually designed test cases rated by human assessors on three dimensions-relevance, empathy, and safety-on a 1-5 Likert scale. The proposed system achieved average scores of 3.6, 3.7, and 4.7 for relevance, empathy, and safety, respectively, representing improvements of 33%, 54%, and 14% over the TFIDF baseline. These results demonstrate that hybrid semantic retrieval combined with safety-aware filtering improves response quality, emotional appropriateness, and reliability for early mental wellness support.