MindMate: A Modular Emotion-Aware Mental Health Chatbot Using Flask and Affective Computing
Bincy Babu1, Dr. S.D. Prabu Ragavendiran1 , Gobinath S1
1Department of Computer Science & Engineering, Kangeyam Institute of Technology, Nathakadaiyur, Tiruppur, India.
Abstract
Human beings fracture quietly under the weights of their own mind. Most never reach for anyone until they reach thir breaking point. MindMate is designed to intervene in those silent interval — a Flask-based intelligent mental health chatbot that is a fusion of computational linguistics, affective computing, and psychological response modelling to offer structured emotional support and guided self-reflection.The system analyses user text, detect emotional states such as sadness, anxiety, anger, hopelessness, and cognitive overwhelm using natural language processing. This is a multi-layered response engine which generates context-appropriate support using psychologically-informed heuristics, including CBT-based reframing, grounding prompts, and behavioral activation cues. For high-risk content like suicidal ideation and acute distress — the chatbot activates a dedicated safety pipeline with de-escalation messages and region-specific helpline recommendations. The backend is implemented using a modular Flask architecture, with separate modules for routing, emotional analysis, conversation management, and database logging. Chat histories, mood patterns, and conversation metrics are securely stored to help users track emotional trends over time. A lightweight machine-learning sentiment classifier augments rule-based logic, enabling the system to adapt to user tone and context. MindMate is not positioned as a replacement for therapy; its purpose is more precise — to function as a daily companion, offering instant support, structured reflection, and a private space to process emotions. The project aims to demonstrate how accessible AI tools can contribute to mental-health scaffolding in settings with limited psychological support, while preserving ethical boundaries, user autonomy, and data privacy.MindMate ultimately reflects a fusion of engineering and empathy: a system designed to listen, analyse, and guide — quietly, consistently, and without judgement — in a world where most people suffer unheard.
Keywords—
Affective Computing, Mental Health Chatbot, Flask Architecture, Emotion Recognition, Suicide Prevention, Machine Learning, Human–Computer Interaction, Natural Language Processing.