Google GenAI - MentalChatbot is a cutting-edge mental health chatbot designed to offer personalized emotional support and guidance. Built with Streamlit, this application provides insightful responses based on real-time user interactions, simulating conversations with various mental health professionals. Our tool aims to deliver immediate assistance for those seeking mental health support, emotional guidance, or simply a listening ear.
This project showcases our commitment to leveraging AI for mental health awareness and support using Google's advanced AI capabilities.
Technical Feasibility: Yes, the solution is technically feasible, as it fully integrates Gemini APIs to deliver personalized AI-driven conversations. The main technical challenge—achieving consistent, high-quality responses—was solved through rigorous testing and optimization of model parameters.
Scalability: The solution is highly scalable, designed to serve a large number of users simultaneously. Potential bottlenecks, such as API rate limits or database load, can be addressed by optimizing server resources and implementing load balancing.
User Experience: The solution offers an intuitive and user-friendly interface, ensuring easy navigation. Its seamless interactions, instant responses, and multilingual support contribute to a positive and engaging user experience.
The chatbot offers five distinct virtual therapist personas to cater to different user needs:
- Counsellor: Compassionate listener providing general mental health support.
- Cognitive Behavioral Therapist (CBT): Focuses on identifying negative thoughts and promoting behavioral changes.
- Student Counsellor: Specialized support for academic, social, and emotional challenges faced by students.
- Clinical Psychologist: Offers psychological assessments and clinical therapy.
- Best Friend: A casual, friendly persona for users seeking companionship.
Supports conversations in multiple languages, including:
- English
- Spanish
- French
- German
- Chinese
- Hindi
This feature ensures that users from around the world can receive support in their native language.
The chatbot engages in continuous, context-aware conversations, helping users feel understood and validated. The AI remembers previous exchanges within a session, providing a more human-like experience.
Each persona has a unique communication style to align with user expectations. The responses are based on predefined templates tailored for each therapist type, ensuring consistent and high-quality interaction.
You can interact with our Mental Health Chatbot through the following platforms:
- Hugging Face Space: Access the chatbot directly at MindMate on Hugging Face for a user-friendly experience.
- Local Deployment: Follow the installation guide below to run the chatbot on your local machine.
To begin, clone the project repository to your local machine:
git clone https://github.com/your-repo/Google-GenAI-MentalChatbot.git
cd Google-GenAI-MentalChatbot
It's best practice to use a virtual environment to manage dependencies. You can set up a virtual environment with the following commands:
python -m venv .venv
.venv\Scripts\activate
python3 -m venv .venv
source .venv/bin/activate
With the virtual environment activated, install the necessary dependencies using:
pip install -r requirements.txt
Once the dependencies are installed, launch the chatbot by running:
streamlit run app.py
- Python 3.7+: The core programming language for backend development.
- Streamlit: A fast, easy way to build custom ML/AI web applications.
- Natural Language Processing (NLP): AI-powered responses to simulate mental health therapy.
- Multilingual NLP: To facilitate conversations in various languages.
- Google GenAI: Advanced AI models for enhanced natural conversations and therapeutic support.
- User Interaction: The user starts interacting with the chatbot by selecting their preferred virtual therapist persona.
- Language Choice: The user can select their preferred language for communication.
- Contextual Conversations: The chatbot engages in a back-and-forth conversation, providing personalized responses based on the therapist persona.
- Therapeutic Suggestions: Based on the user’s inputs, the chatbot suggests actionable steps, resources, and motivational insights.
- Immediate mental health support for users in distress.
- Personalized guidance for students facing academic or emotional challenges.
- A safe space for users to express their feelings and receive emotional validation.
- Multilingual therapy for a global audience.
- Voice Integration: Allowing users to speak with the chatbot for a more interactive experience.
- Sentiment Analysis: Advanced tracking of user mood over time, providing more tailored responses.
- Appointment Scheduler: Integration with mental health professionals for scheduling follow-up sessions.
- Expanded Multilingual Support: Adding more languages to reach a broader audience.
We welcome contributions from the open-source community. Please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Submit a pull request.
For major changes, please open an issue to discuss what you’d like to implement.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Mental health professionals who helped guide the chatbot's therapeutic direction.
- Open-source libraries and tools used in the development of this project.
- Google for providing the AI infrastructure and models used in this chatbot.