Inspiration

Most mental wellness apps. Ask you to pick a mood from a 1-5 scale or give you a chatbot that gives the same reply every time no matter what you've said before. That doesn't help you see your patterns. The kind of things a real journal or a real friend might notice over time. We wanted to build something in the middle: a journal that actually listens.

What it does

You write a journal entry just like you normally would. Behind the scenes MindMirror figures out your mood using a machine learning model we trained ourselves along with sentiment analysis. It saves your entry to your history and then looks back at your recent entries to spot patterns. Which days feel hardest for you and whether your mood has been getting better or worse over the past week. An AI agent then replies, using observations about you instead of generic advice.

If an entry seems to suggest a crisis the AI response is skipped entirely. Instead you see a fixed message with information. This way you get support when you need it most.

We also made a choice about how we label moods. Our original training data included labels like Depression, Bipolar, Suicidal and so on.. A text classifier isn’t a diagnostic tool. Showing those labels based on one journal entry felt wrong. Too risky. So we mapped them down to four non-diagnostic categories: Feeling Good, A Bit Overwhelmed Going Through a Tough Time and You're not Alone.

How we built it

  • Mood detection: A Logistic Regression classifier trained on TF-IDF features from a mental health text dataset, combined with VADER sentiment analysis in an approach. Sentiment severity determines the broad category and our trained model handles finer distinctions within that range.

  • Database: MySQL, storing users and their journal history.

  • AI agent: LangChain with Google Gemini generating CBT-inspired responses that include the user’s detected mood and recent patterns.

  • Pattern detection: A Pandas-based module that analyzes a users history to find their day of the week and whether their mood trend is improving, declining or stable.

  • Frontend: Streamlit.

Challenges we ran into

Getting mood detection to work well on sentences people actually write turned out to be harder than we thought. A model built on TF-IDF is sensitive to exact wording. Two sentences that mean the same thing could end up in different categories because the model matches word patterns instead of understanding meaning. For an app dealing with wellness that kind of inconsistency wasn’t acceptable.

We had to change our approach. Of letting the ML model make all the decisions we built a tiered system. First VADER sentiment analysis decides the category. Like "low," "medium," or "high" severity. Then our trained model steps in only to make adjustments within a more limited range. That meant our custom model does heavy lifting than we originally planned but it made the whole system much more predictable.. Predictability mattered more than showing off a perfect end-to-end model in isolation.

Accomplishments that we're proud of

Getting the safety layer right feels like our achievement. When an entry shows signs of crisis the AI never gets involved. It’s always a fixed tested response with helpline information. No chance of an unpredictable AI reply in a moment that matters. We’re also proud of building the pipeline ourselves. From cleaning and preparing the dataset to training and tuning the model designing the database creating the pattern-detection logic and connecting it all with the AI agent. We didn’t just call an API. Call it done. We built it step by step.

What we learned

We learned that an impressive pure-ML solution isn’t always the best engineering decision. Especially in areas where safety matters. In this case a simpler explainable hybrid system that we could understand and trust was better than a fancier model that acted unpredictably on real input. We also learned a lot about handling class imbalance and making trade-offs. Like choosing to accept lower overall accuracy to reduce the risk of missing a crisis situation.

What's next for Mind-Mirror Project

We’d want to move toward authentication instead of the simplified profile picker we used for the demo. We’d also look into text representations like sentence embeddings so the model can make better more consistent decisions.. We’d expand pattern detection to identify recurring themes in someone’s entries. Not just trends, by day of the week or overall mood but specific thoughts, feelings or situations that keep coming up.

Built With

Share this project:

Updates

Submission history