--- title: Refeel emoji: 🔥 colorFrom: green colorTo: red sdk: gradio sdk_version: 5.33.1 app_file: app.py pinned: false license: cc-by-4.0 short_description: '📝 Refeel – Re-feel your emotions. Reframe your story: AI Di' --- # 📝 Refeel – Re-feel your emotions. Reframe your story: AI Diary & Smart Chat **A smart AI-powered diary web app for the Hugging Face MCP Hackathon.** Modern individuals often miss the opportunity to deeply reflect on their emotions and experiences in the midst of a rapidly changing environment. Although emotional journaling is a powerful tool for emotional stability and self-understanding, many people struggle to maintain a consistent writing habit or to analyze their own behavioral patterns. This project aims to build an AI-powered self-reflection journaling service that leverages Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) technology to help users easily write journal entries and identify recurring emotional patterns or cognitive traps in their thoughts. Refeel is a web app that allows users to write, search, and analyze their diary entries, and engage in meaningful conversations with an empathetic, psychologically-informed AI assistant. [▶️ Watch Demo (mp4)](./gradio-screen-recording-2025-06-10T03-00-19.mp4) --- ## 🌟 Features - **✏️ Write Diary**: Freely write down your thoughts and feelings each day. Each diary entry is vector-embedded and stored in Qdrant. - **🔍 Search Diary**: Search your past diary entries by keyword or semantic similarity. - **🧠 AI Analysis & Coaching**: After saving an entry, receive instant feedback and kind, realistic advice from the AI. *(Powered by LangChain + Groq LLM)* - **🤖 Smart Chat**: Have personalized conversations with the AI, which references your saved diary entries for context. - **🌍 Multilingual Embedding**: Diary entries are vectorized using a multilingual sentence transformer. --- ## 🛠️ Tech Stack | Component | Technology | |------------------|------------------------------------------------| | Frontend/Backend | [Gradio](https://gradio.app/) (Python) | | Vector DB | [Qdrant Cloud](https://qdrant.tech/) | | LLM | [Groq API](https://groq.com/) (OpenAI-compatible) | | Embeddings | `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2` | | LLM Framework | [LangChain](https://www.langchain.com/) | --- ## 🚀 Installation 1. **Clone the repository** ```bash git clone https://huggingface.co/spaces/thisispaperdoll/refeel . ``` 2. **Install required packages** ```bash pip install gradio qdrant-client sentence-transformers langchain langchain_groq ``` 3. **Set API keys** - Open `app.py` and set your Qdrant and Groq API keys. 4. **Run the app** ```bash python app.py ``` - To enable auto-reload on code changes: ```bash python app.py --reload ``` or ```python demo.launch(reload=True) ``` --- ## 💡 Usage Guide - **Write Diary** In the "✏️ Write Diary" tab, enter a title and content, then click "Save Diary". - **Get AI Feedback** After saving, the AI provides instant emotional analysis and coaching. - **Continue Chatting** Go to the "🤖 Smart Chat" tab to have a deeper conversation with the AI using your diary context. - **Search Diary** Use the "🔍 Search Diary" tab to find entries based on keywords. --- ## 💬 AI Prompt Example The AI assistant is designed to: - Empathize and give encouragement - Detect cognitive distortions and emotional patterns - Compare with similar past diary entries - Summarize psychological traps - Provide friendly and realistic advice suitable for your age --- ## 🏆 Hackathon Context This project was developed for the **Hugging Face MCP Hackathon**. #agent-demo-track It showcases a personalized, psychologically-aware coaching experience by combining vector search, LLMs, and user context.