Skip to content

TalkHeal is an empathetic, intelligent, and interactive mental health support assistant built using Python and Streamlit. Designed with compassion and care at its core, it offers 24/7 support, emotional journaling, resource guidance, and AI-powered conversations powered by Google’s Gemini Pro.

License

Notifications You must be signed in to change notification settings

eccentriccoder01/TalkHeal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Animated decorative line divider
TalkHeal Logo - AI-Powered Mental Health Companion

TALKHEAL

Animated decorative line divider

🧠 Your AI-Powered Mental Health Companion

TalkHeal is an empathetic, intelligent, and interactive mental health support assistant. Built with Python and Streamlit, it provides a safe, non-judgmental space for users to track their emotional well-being, learn coping strategies, and access professional guidance when needed. It offers 24/7 support, emotional journaling, resource guidance, and AI-powered conversations powered by Google’s Gemini.


Vision: A Compassionate Path to Mental Well-being

Mental health is a fundamental component of overall health and well-being, underpinning our ability to cope with life's stresses, realize our potential, and contribute to our communities. In today's fast-paced world, challenges such as economic downturns, social isolation, and rapid lifestyle changes can undermine mental health. Many people face serious conditions like depression and anxiety, which are increasingly common globally and can lead to significant distress and impairment in daily functioning.

The vision for TalkHeal is to address these challenges by providing accessible, precise, and personalized mental health support through the seamless integration of technology and human-centric design. We believe that every individual deserves a safe space to explore their emotions and access tools that empower their wellness journey. TalkHeal is more than just a chatbot; it is a holistic mental health companion designed to fill a crucial gap in care and support.

The TalkHeal Difference

  • Empathetic Conversations, Anytime, Anywhere: Many people are reluctant to talk about their feelings due to stigma or embarrassment. TalkHeal offers a private, non-judgmental space where users can engage in supportive conversations 24/7. The ability to choose an AI personalityβ€”from a "Compassionate Listener" to a "Motivating Coach"β€”ensures that the interaction is tailored to what the user needs most at that moment. This personalized approach helps build trust and encourages users to be open and honest about their experiences.

  • Proactive Self-Management: TalkHeal empowers users to take an active role in their well-being. The Mood Dashboard helps them identify patterns and triggers in their emotional life, providing insights that can inform healthier choices. Tools like the Focus Session, Breathing Exercises, and Yoga Recommendations offer practical coping strategies to manage stress, anxiety, and frustration in real-time. The goal is to move beyond simply reacting to distress and instead build psychological resilience and proactive wellness habits.

  • Connecting to Real-World Support: While TalkHeal provides a valuable first step, it is not a substitute for professional care. Our vision includes acting as a bridge to professional help. The platform includes a Doctor Specialist Recommender to help users understand potential symptoms and find a suitable professional, as well as a Crisis Help page that provides immediate access to local and international hotlines in case of a mental health emergency. This two-pronged approach ensures that users are always supported, whether through our digital tools or by connecting with human professionals.

In essence, TalkHeal aims to destigmatize mental health, promote self-awareness, and make evidence-based support accessible to everyone. By integrating compassionate AI with a comprehensive toolkit of wellness resources, TalkHeal seeks to become a trusted companion on the journey toward a healthier and more balanced life.

πŸš€ Live Demo

Experience TalkHeal live here: πŸ‘‰ TalkHeal

Open Source Love svg1 PRs Welcome Visitors GitHub Forks GitHub Repo Stars GitHub Contributors GitHub Last Commit GitHub Repo Size Github GitHub Issues GitHub Closed Issues GitHub Pull Requests GitHub Closed Pull Requests

TalkHeal main dashboard interface with pink theme showing welcome message and navigation options

✨ Features

Animated features showcase divider

πŸ—£οΈ Conversational AI Support

  • Gemini-powered chatbot: The core of the app is an AI companion built on Google's Gemini models (gemini-2.5-pro and gemini-2.0-flash).
  • Chatbot Personality Tone Selector: You can personalize the AI's approach by choosing from five distinct tones: Compassionate Listener, Motivating Coach, Wise Friend, Neutral Therapist, and Mindfulness Guide.
  • Session Management: The app allows you to create, title, and manage multiple chat sessions, which are saved in JSON files for persistence and privacy via IP-based isolation.
  • Session Feedback & Emotional Closure: After a chat session, you can provide feedback on your experience and receive an emotional closure message.
TalkHeal chat interface showing AI conversation with personality tone selector and message history

πŸ’– Mood Tracking, Journaling & Insights

  • Interactive Mood Dashboard: Track your emotional state with a five-level mood scale and visualize your mood history, trends, and patterns over time with interactive charts. The dashboard analyses mood by day of the week, time of day, and common contexts or activities.
  • Personal Journaling: Write and save private journal entries to a secure SQLite database. The app analyzes the sentiment of each entry (Positive, Neutral, Negative) and allows you to filter and review past thoughts.
  • AI-Assisted Coping Tips: Based on your selected mood, the app provides instant coping tips and micro-journaling prompts to guide your reflection.

🧘 Self-Help & Wellness Tools

  • Yoga Recommendations: An innovative tool that analyzes your emotional state and generates tailored yoga pose recommendations with step-by-step instructions in a structured JSON format.
Yoga recommendations page displaying personalized yoga poses with instructions based on emotional state
  • Focus Sessions: Use a customizable timer for a Pomodoro session or a mindful break. Sessions come with a visual breathing animation, motivational quotes, and optional calming background audio.
Self-help tools page featuring focus sessions, timers, and mindfulness exercises
  • Breathing Exercises: A simple and guided exercise with a visual animation to help you relax and regulate your breathing.
Guided breathing exercise interface with visual animation and breathing pattern instructions
  • Quick Coping Cards: Instantly generate randomized coping strategies for grounding, mindfulness, movement, reflection, and creative expression. You can save your favorites for later use.
Quick coping cards feature showing randomized coping strategies for stress management
  • Wellness Hub: A central hub providing simple wellness tips across five categories: Mind, Body, Nutrition, Sleep, and Stress Relief. It also includes a quick self-check, a daily planner, and a mood tracker.
Wellness resource hub displaying tips for mind, body, nutrition, sleep, and stress relief

πŸ“˜ Resource & Crisis Help

  • Emergency Help: An "Emergency Help" page provides immediate access to local crisis support by dynamically searching for resources based on your location. It also lists a comprehensive directory of global crisis hotlines.
Emergency help page showing crisis support resources and global mental health hotlines
  • Doctor Specialist Recommender: This tool uses multiple machine learning models (e.g., Logistic Regression, SVM, Random Forest) to suggest potential diseases based on user-input symptoms and recommends a suitable medical specialist.
Doctor specialist recommender tool showing symptom input and medical specialist suggestions
  • Mental Health Quizzes: Integrated PsyToolkit-verified quizzes (GAD-7, PHQ-9, WHO-5) for self-evaluation of anxiety, depression, and overall well-being.
Mental health assessment quizzes including GAD-7, PHQ-9, and WHO-5 self-evaluation tools

🎨 Themes & UI

  • Dynamic Theme System: Choose from multiple soothing color palettes and switch between Light and Dark modes with a single click.
  • Glassmorphic Design: The UI features a 3D-inspired glassmorphic style with blurred, translucent containers and smooth transitions for a visually calming experience.
  • Customizable User Profile: Create a user profile with a name and profile picture, and set your preferred font size for the entire application.
TalkHeal interface in dark theme mode TalkHeal interface in blue theme variation TalkHeal interface in mint green theme variation

πŸ—„οΈ Database Setup

The application uses SQLite databases for user management and journaling. These databases are automatically created when you first run the application, but you can also set them up manually:

Automatic Setup (Recommended)

The databases will be created automatically when you run the application for the first time.

Manual Setup (Optional)

If you want to set up the databases manually, run:

python setup_database.py

This will create:

  • users.db - User authentication and profile data
  • journals.db - User journal entries and mood tracking data

Note: Database files (.db) are automatically ignored by git to prevent conflicts and protect user data.

πŸ“Ί Video Explanation

For a detailed walkthrough of TalkHeal's features and how to use them, check out this video:

[Video Coming Soon]


πŸ“ Project Structure

πŸ—‚οΈ Click to view detailed project architecture
TalkHeal/
β”œβ”€β”€ .devcontainer/               # Dev container configuration (for VS Code)
β”œβ”€β”€ .github/                     # GitHub workflows and issue templates
β”œβ”€β”€ .streamlit/
β”‚   └── secrets.toml             # Streamlit secrets (API keys, credentials)
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ pink.png
β”‚   └── yoga_animation.json
β”œβ”€β”€ audio/
β”œβ”€β”€ audio_files/
β”œβ”€β”€ auth/
β”‚   β”œβ”€β”€ auth_utils.py            # Authentication functions (login, register)
β”‚   └── users.yaml               # User credentials and roles (YAML format)
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Breathing_Exercise.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ chat_interface.py
β”‚   β”œβ”€β”€ emergency_page.py
β”‚   β”œβ”€β”€ focus_session.py
β”‚   β”œβ”€β”€ header.py
β”‚   β”œβ”€β”€ login_page.py
β”‚   β”œβ”€β”€ mood_dashboard.py
β”‚   β”œβ”€β”€ profile.py
β”‚   β”œβ”€β”€ sidebar.py
β”‚   └── theme_toggle.py
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ config.py                # Central app configuration
β”‚   β”œβ”€β”€ theme.py
β”‚   └── utils.py                 # Common helper functions
β”œβ”€β”€ css/
β”‚   └── styles.py
β”œβ”€β”€ data/
β”‚   └── Yoga.json                # Yoga session data (poses, flows)
β”œβ”€β”€ favicon/
β”‚   β”œβ”€β”€ apple-touch-icon.png
β”‚   β”œβ”€β”€ favicon-96x96.png
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ favicon.svg
β”‚   β”œβ”€β”€ site.webmanifest
β”‚   β”œβ”€β”€ web-app-manifest-192x192.png
β”‚   └── web-app-manifest-512x512.png
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ About.py
β”‚   β”œβ”€β”€ Journaling.py           # Journaling UI page
β”‚   β”œβ”€β”€ Yoga.py                 # Yoga activity page
β”‚   └── selfHelpTools.py        # Tools/resources for self-help
β”œβ”€β”€ .gitignore                   # Files/folders ignored by Git
β”œβ”€β”€ Background.jpg
β”œβ”€β”€ Background_Dark.jpg
β”œβ”€β”€ CODE_OF_CONDUCT.md          # Contribution behavior guidelines
β”œβ”€β”€ CONTRIBUTING.md             # Instructions for contributing
β”œβ”€β”€ LICENSE                     # License for the project (e.g., MIT)
β”œβ”€β”€ MOOD_TRACKING_README.md     # Info about the mood tracking feature
β”œβ”€β”€ README.md                   # Main project documentation
β”œβ”€β”€ TalkHeal.pptx               # Presentation for TalkHeal
β”œβ”€β”€ TalkHeal.py                 # πŸ”· Main app entry point (Streamlit)
β”œβ”€β”€ TalkHealLogo.png
β”œβ”€β”€ blue.png
β”œβ”€β”€ blue_ss.jpg
β”œβ”€β”€ dark.png
β”œβ”€β”€ dark_ss.jpg
β”œβ”€β”€ generate_audio.py           # Script to convert text to speech/audio
β”œβ”€β”€ journals.db                 # Database of user journal entries
β”œβ”€β”€ lav_ss.jpg
β”œβ”€β”€ lavender.png
β”œβ”€β”€ light_ss.jpg
β”œβ”€β”€ mint.png
β”œβ”€β”€ requirements.txt            # Python package dependencies
β”œβ”€β”€ streamlit.toml              # Streamlit configuration
β”œβ”€β”€ test_mood_dashboard.py      # Test cases for mood dashboard
└── users.db                    # Database for user authentication

πŸ› οΈ Technologies Used

Python CSS SQLite Gemini Streamlit Pandas Pygame Scikit-learn LangChain Plotly Bcrypt


βš™οΈ Installation and Setup

Clone and run locally using Python and Streamlit.

  1. Clone the repository:

    git clone https://github.com/eccentriccoder01/TalkHeal.git
    cd TalkHeal
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up API key: Go to your Streamlit Secrets Settings and add:

    GEMINI_API_KEY = "YOUR_GOOGLE_GEMINI_API_KEY"
  4. Run the app:

    streamlit run TalkHeal.py

Issue Creation ✴

Report bugs and issues or propose improvements through our GitHub repository.

Contribution Guidelines πŸ“‘

Animated contribution guidelines divider
  • Firstly Star(⭐) the Repository

  • Fork the Repository and create a new branch for any updates/changes/issue you are working on.

  • Start Coding and do changes.

  • Commit your changes

  • Create a Pull Request which will be reviewed and suggestions would be added to improve it.

  • Add Screenshots and updated website links to help us understand what changes is all about.

  • Check the CONTRIBUTING.md for detailed steps...

Contributing is fun🧑

We welcome all contributions and suggestions! Whether it's a new feature, design improvement, or a bug fix β€” your voice matters πŸ’œ

Your insights are invaluable to us. Reach out to us team for any inquiries, feedback, or concerns.

πŸ‘₯ Contributors

Thanks to these wonderful people for contributing πŸ’–

Contributors

πŸ“„ License

This project is open-source and available under the MIT License.

πŸ“ž Contact

Developed by Eccentric Explorer

Feel free to reach out with any questions or feedback! Thanks for reading, here's a cookiepookie:

Cat

About

TalkHeal is an empathetic, intelligent, and interactive mental health support assistant built using Python and Streamlit. Designed with compassion and care at its core, it offers 24/7 support, emotional journaling, resource guidance, and AI-powered conversations powered by Google’s Gemini Pro.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 39

Languages