Help4Good is an interactive AI chatbot designed as a neutral second opinion to help caregivers and care recipients navigate emotional struggles and improve their relationship. By acting as a bridge for communication, it ensures care is provided in a mutually respectful, meaningful, and joyful way.
Develop a solution that improve relationships between caregiver and the care recipient so that caregivers can provide the care that the care recipients want/need in a mutually respectful, meaningful, and joyful way?
- Caregiver Uncertainty and Pride: Caregivers often struggle with a recipient's unique needs or may resist external advice due to the belief they already know what is best.
- Recipient Loss of Autonomy: Recipients (typically individuals over 40 requiring daily assistance) often feel like a "managed" object rather than a person, leading to resistance and withheld emotions.
- Hidden Struggles: Emotional issues often fester because they are not articulated, straining the bond between both parties.
- Judgment-Free Environment: It provides a safe, private space for recipients to express deeper emotional struggles they might not feel comfortable sharing directly with their caregiver.
- Clarity and Articulation: The bot helps recipients process their feelings, enabling them to return to the caregiver with better clarity on what they actually need.
- Reducing Mental Load: It serves as a confidential platform to work through difficult situations without the caregiver having to admit uncertainty to others.
- Evidence-Based Guidance: The bot offers coaching using reflective listening, empathy, and evidence-based strategies to improve how caregivers approach difficult conversations.
- Increased Confidence: By providing curated strategies, it helps caregivers feel more confident in their care decisions.
- Contextual Memory: The bot refers to previous conversations to understand the care receiver's ongoing situation, saving time and ensuring continuous, accurate support.
- Retrieval-Augmented Generation (RAG): Using RAG and curated datasets from HuggingFace, the bot provides informed conversation strategies rather than "guessing," which builds user trust.
- Accessible Tech Stack: Built with a user-friendly Streamlit interface and powered by the Google GenAI SDK (Gemma), it offers a scalable way for seniors to live happily at home.
- Safety First (Singapore Localized): Detects distress signals and suggests local crisis resources (Mindline, SOS, Care Hotline) when necessary.
- Dual Interface: Includes both a rich Web UI (Streamlit) and a lightweight Terminal CLI.
Aligned with the philosophy of organizations like the Tsao Foundation, Help4Good ensures that aging is a positive experience rather than just a medical one. It focuses on the psychological and social health of both stakeholders, treating them with the respect and gratitude they deserve.
mental-health-bot/
├── app.py # Main Streamlit Web Application
├── main.py # Alternative CLI Chat Interface
├── chatbot.py # Core Logic (RAG, Gemini Client, Memory)
├── ingest.py # Script to build/update the knowledge base
├── memory.py # Conversation History Manager
├── requirements.txt # Project Dependencies
├── .env.example # Template for environment variables
├── chroma_db/ # Local Vector Database (Created after ingestion)
└── ARCHITECTURE.md # Detailed Technical Documentation
- Python 3.10 or higher.
- Google Gemini API Key: Get one for free at Google AI Studio.
-
Clone the Repository
git clone https://github.com/yourusername/mental-health-bot.git cd mental-health-bot -
Create a Virtual Environment (Recommended)
# Windows python -m venv venv .\venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Configure API Keys
- Create a
.envfile in the root directory. - Add your Google API Key:
GOOGLE_API_KEY=your_actual_api_key_here
- Create a
Before running the bot, you must build the vector database. This downloads the dataset and creates the embeddings.
python ingest.pyWait for the "Ingestion complete" message.
Start the Streamlit dashboard for the full experience.
streamlit run app.py- URL: Opens automatically at
http://localhost:8501 - Features: Real-time chat, downloadable history, sidebar controls.
Run the lightweight CLI version for quick testing.
python main.py- Type your message and press Enter.
- Type
quitorexitto stop.
| Issue | Solution |
|---|---|
| "GOOGLE_API_KEY not found" | Ensure you created .env and it contains GOOGLE_API_KEY=AIza.... |
| "ModuleNotFoundError" | Make sure you activated your virtual environment (venv). |
| "Chroma components invalid" | Delete the chroma_db folder and run python ingest.py again to rebuild. |
| Slow Responses | The first query might be slow as models load into memory. Subsequent queries will be faster. |
For a deep dive into how the RAG pipeline and memory system works, please read ARCHITECTURE.md.
This is an AI prototype, not a doctor. It is not designed to handle life-threatening emergencies. If you or someone you know is in immediate danger, please call emergency services (999/995 in SG) or a suicide hotline immediately.