The Mental Health Chatbot is an AI-powered support tool designed to provide empathetic, personalized, and evidence-based guidance for mental health concerns. Built using cutting-edge technologies like Streamlit, FAISS, and Google's Generative AI, this chatbot delivers a secure and tailored experience for users seeking mental well-being support.
- Personalized Support: Tailored responses based on user age group and specific concerns (e.g., work stress, anxiety, sleep).
- Secure Data Handling: Uses encryption to securely store user concerns and maintains HIPAA-level privacy compliance.
- Context-Aware Responses: Integrates previous user interactions and "Your Previous Concerns" to provide consistent, context-driven replies.
- Few-Shot Learning: Leverages examples to improve chatbot accuracy and understand nuanced questions.
- FAQ Integration: Includes a dynamic FAQ section for quick answers to common mental health queries.
- User Data Management: Users can save their concerns and delete their data at any time, ensuring complete control over personal information.
mental_health_chatbot/
│
├── app/ # Application code
│ ├── chatbot_logic.py # Core chatbot logic and processing
│ ├── config.py # Configuration and prompt definitions
│ ├── data_loader.py # Resource loading and setup
│ └── main.py # Streamlit interface
│
├── data/ # Data files and resources
│ ├── counselchat_with_embeddings.pkl
│ ├── faiss_index.bin
│ ├── faqs.csv
│ ├── encryption_key.key
│ └── user_memory.json
│
├── setup.py # Setup script for easy installation
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── README.md # Project documentation
└── .gitignore # Ignored files
- Streamlit: User-friendly web interface for real-time chatbot interactions.
- FAISS: Fast and efficient retrieval of contextually similar responses.
- Sentence Transformers: For generating embeddings from user input.
- Google Generative AI (Gemini): To generate empathetic and helpful responses.
- Encryption (Fernet): Ensures secure storage of sensitive user data.
- Few-Shot Learning: Enhances the chatbot's performance with example-based learning.
- Users provide their name, age group, and specific concerns.
- Previous interactions are retrieved for context.
- User input is processed and embedded using Sentence Transformers.
- FAISS retrieves relevant responses from a dataset of mental health exchanges.
- A tailored prompt is constructed using user details, retrieved responses, and few-shot examples.
- Google Generative AI generates a context-aware, empathetic response.
- Encrypted Data: User concerns are encrypted before storage.
- Data Access: Data is easily accessible and deletable by the user.
- Python 3.9 or later
- Required Python libraries (in
requirements.txt)
- Clone the repository:
git clone https://github.com/yourusername/mental_health_chatbot.git
cd mental_health_chatbot- Install dependencies:
pip install -r requirements.txt- Set up your environment variables in a
.envfile:
GEMINI_API_KEY=your_api_key_here
DATA_PATH=data/- Run the chatbot:
streamlit run app/main.py- Encrypted Data: User concerns are encrypted using the Fernet symmetric encryption mechanism.
- Data Deletion: Users can delete their data via the chatbot interface.
- Compliance: Designed to follow privacy best practices and HIPAA-level compliance.
