![]() |
International Journal of Scientific Research and Engineering Development( International Peer Reviewed Open Access Journal ) ISSN [ Online ] : 2581 - 7175 |

π Paper Information
| π Paper Title | A Privacy-Preserving AI Chatbot for Real-Time Stress Detection and Personalized Mental Health Support |
| π€ Authors | Prajakta N. Sardar, Rashmi Tale |
| π Published Issue | Volume 9 Issue 4 |
| π Year of Publication | 2026 |
| π Unique Identification Number | IJSRED-V9I4P52 |
π Abstract
Mental health data is among the most sensitive information a user can share, yet most deployed chatbots route user messages through external cloud APIs with no guarantee of confidentiality. The Gentle Sanctuary addresses this directly: all stress classification β keyword matching and transformer inference alike β runs locally on the application server, so no user message ever leaves the system boundary. Catching user stress in real time is one of the most safety-critical jobs a mental wellness chatbot has to do, yet most deployed systems still lean on basic keyword matching β and nobody has properly measured how badly that approach breaks down when users do not type the "right" words. This paper describes how we built, tested, and evaluated a hybrid keywordβtransformer stress detection system inside The Gentle Sanctuary, a privacy-preserving FastAPI mental wellness chatbot. The system pairs a fast, rule-based 16- term keyword checker that responds in under a millisecond with a DistilBERT model fine-tuned on the DAIR-AI/Emotion dataset, running in the background so it never slows down the chat. We tested all three classifiers β keyword-only, DistilBERT-only, and the hybrid β on a 120-message dataset that covered six different ways people express distress: direct keyword use, compound stress phrases, implied distress, idioms, code-switched Hindi/English, and cultural metaphors. Two independent raters labelled every message (Cohen's kappa = 0.91). The keyword approach got 70.0% accuracy (binary F1 = 0.714) and never raised a false alarm, but it completely missed implicit, idiomatic, and code-switched messages β 0% detection on those. DistilBERT pushed accuracy to 90.83% (binary F1 = 0.929), catching 66.7% of implied distress, 100% of idioms, and 85.7% of cultural metaphors. The hybrid came out on top at 91.67% accuracy (binary F1 = 0.936) with only 17.2 ms latency per message β a 21.67 percentage point jump over keyword-only, while keeping the immediate-response speed guarantee of the keyword layer. Beyond detection accuracy, the system delivers personalized mental health support through a per-user rolling stress index and an adaptive crisis escalation pathway that surfaces tailored resources only when an individual user's session signals genuine distress. The numbers make a clear case: combining both layers closes the gap that keyword matching leaves wide open, without hurting the real-time performance or the privacy guarantee that production mental health chatbots need.
π How to Cite
Prajakta N. Sardar, Rashmi Tale, "A Privacy-Preserving AI Chatbot for Real-Time Stress Detection and Personalized Mental Health Support" International Journal of Scientific Research and Engineering Development, V9(4): Page(461-470) May-June 2026. ISSN: 2581-7175. www.ijsred.com. Published by Scientific and Academic Research Publishing.
π Other Details
