An emotion-aware AI journaling companion that listens, detects what you’re feeling, and responds with supportive, grounded reflection—adapting the entire UI theme to match your mood.
Live app: https://mindmirror.streamlit.app/
MindMirror is a Streamlit chat-based journal designed to help you pause, reflect, and feel understood.
When your message contains emotional content, MindMirror:
- Detects your emotion (≈ 90% accuracy) with a trained emotion classifier
- Retrieves relevant guidance from an internal knowledge base (RAG-style retrieval)
- Generates a thoughtful journaling response using an LLM
- Visually reflects your mood by shifting the app’s theme colors based on the detected emotion
- Shows an Emotion Timeline in the sidebar (recent emotions + confidence)
If you’re just saying “hi” or chatting casually, it switches to a light conversational mode without over-analyzing.
- Emotion detection (≈ 90% accuracy) with confidence scoring
Detects:sadness,joy,anger,fear,love,surprise(plus a neutral fallback) - Dynamic emotion-based UI themes
Background, accent colors, and chat styling shift based on mood - Emotion Timeline
Recent emotional messages are summarized in the sidebar (with confidence %) - RAG-style guidance sources
When in emotional mode, the app shows the retrieved “Guidance sources” used to respond - Casual-message filtering
Greetings and short messages skip emotion detection to keep interactions natural
- Frontend / App: Streamlit
- Emotion Model: TensorFlow / Keras - A Custom BiLSTM Model
- Embeddings + Retrieval: sentence-transformers + FAISS
- LLM Provider: Groq
- Utilities: python-dotenv, numpy, scikit-learn
app.py— Streamlit application (UI, emotion flow, theme injection, chat loop)core/— core logic (emotion detector, retriever, LLM wrapper)artifacts/— trained model + tokenizer + label classesemotion_behaviour_data/— retrieval knowledge base used for guidancenotebooks/— experimentation / training notebookskaggle_dataset/— dataset assets (if included)pipeline_test.py— pipeline sanity checks / testsrequirements.txt— Python dependencies
MindMirror first checks whether the message looks like a greeting / small talk (or is very short).
If so, it responds conversationally.
For meaningful journal-style text, the emotion detector predicts:
- the emotion label
- the confidence score
If confidence is below a threshold, it stays in casual mode.
In emotional mode, relevant guidance snippets are retrieved from emotion_behaviour_data/ and displayed under Guidance sources.
The LLM generates a supportive, journaling-style reply conditioned on:
- your message
- the detected emotion
- retrieved guidance chunks
The UI theme changes based on the current emotion, making the experience feel more immersive and emotionally “in sync.”
git clone https://github.com/javin1106/MindMirror.git
cd MindMirrorpython -m venv .venv
# macOS/Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activatepip install -r requirements.txtThis project uses Groq. Create a .env file in the repo root:
GROQ_API_KEY=your_key_hereIf your
core/llm.pyexpects different variable names, update the.envaccordingly.
streamlit run app.pyThis project uses the Emotions Dataset for NLP from Kaggle for emotion classification training/evaluation:
MindMirror is a reflection tool—not a substitute for professional mental health care.
If you’re in crisis or may be at risk of harm, please seek help from a qualified professional or local emergency resources.
Contributions are welcome—ideas, bug fixes, UI improvements, prompt tuning, or better retrieval data.
- Fork the repo
- Create a feature branch:
git checkout -b feature/my-change - Commit:
git commit -m "Add my change" - Push:
git push origin feature/my-change - Open a pull request
Add a license file if you plan to distribute/accept contributions publicly (e.g., MIT, Apache-2.0).
Built by @javin1106
Live demo: https://mindmirror.streamlit.app/