MindfulChat
A mindful conversation, whenever you need one.
Created on 8th March 2026
•
MindfulChat
A mindful conversation, whenever you need one.
The problem MindfulChat solves
Finding immediate and affordable mental health support is often inaccessible for many. While AI chatbots offer a promising alternative for round-the-clock companionship, standard LLMs run the critical risk of "hallucination"—providing well-intentioned but potentially harmful or unverified medical advice during a user's vulnerable moments.
MindfulChat solves this by bridging the gap between empathetic conversational AI and clinically structured advice. It is designed to:
Provide a Grounded Safe Space: We built a custom Retrieval-Augmented Generation (RAG) pipeline encompassing over 50 structured therapy techniques and coping strategies. This ensures the AI's responses are anchored strictly in verified, helpful data rather than made-up suggestions.
Understand Real Emotions: By utilizing a BERT transformer for continuous sentiment analysis, MindfulChat dynamically adapts its tone. If a user is expressing high anxiety, the system doesn't just respond generically; it alters its RAG retrieval focus to retrieve specific grounding and breathing exercises.
Make Mental Health Care Safer: It acts as a reliable first line of support bridging the gap when users are unable to access a human professional, making day-to-day emotion management safer and more accessible.
Challenges we ran into
Building a mental wellness application requires a zero-tolerance policy for bad AI advice, which introduced significant technical hurdles.
Integrating TF-IDF RAG with a live BERT Model:
The Hurdle: We needed to retrieve specific therapeutic contexts from our knowledge base in real-time. Our initial challenge was injecting a lightweight TF-IDF retrieval system directly into our existing Python sentiment analysis microservice without causing bottlenecks or breaking the heavy BERT transformer processes.
The Fix: We decoupled the heavy BERT inference from the RAG retrieval logic, processing sentiment first and then passing the sentiment state as a structured query parameter to our fast TF-IDF indexer to fetch the optimal therapy context.
Taming the LLM Prompting:
The Hurdle: Early on, the Gemini API would sometimes ignore our verified clinical snippets and default to its own generalized advice. Instructing the Node.js backend to safely merge the user prompt, the sentiment score, and the retrieved clinical context was tricky.
The Fix: We underwent rigorous prompt engineering. We modified the Node.js backend to inject a strict system-level preamble forcing the Gemini model to exclusively use the retrieved snippets for its actionable advice, effectively eliminating harmful hallucinations.
Cross-Service Communication:
The Hurdle: Ensuring seamless data flow between the Node.js backend, the Python analysis service, and the external LLM API led to some asynchronous timing issues where users would wait too long for a response.
The Fix: We optimized the API calls by processing the RAG retrieval and sentiment analysis concurrently before hitting the Gemini API, significantly dropping the latency and making the chat feel natural and supportive
