🧠 Inspiration

Mental health care is essential but still inaccessible to many. We wanted to explore whether AI could gently guide users toward emotional wellbeing — not with generic tips, but through personalized, learned support. Reinforcement learning gave us a way to model helpful decision‑making, while GPT enabled rich emotional understanding.


💬 What it does

Our chatbot listens to the user, detects their mood using GPT‑3.5, and selects a wellness strategy using a PPO‑trained reinforcement learning agent. It also:

  • Maintains conversation context across turns
  • Tracks mood score trends visually
  • Remembers suggestions given to avoid repetition
  • Runs live on Hugging Face Spaces with an intuitive Gradio UI

🔧 How we built it

  1. Created a custom Gym environment to simulate emotional state and reward improvements
  2. Trained a PPO agent using stable‑baselines3
  3. Used OpenAI GPT‑3.5 to classify mood from natural text input
  4. Mapped moods to scores (e.g., sadness = 0.3, joy = 0.9)
  5. Integrated everything into a Gradio chatbot interface
  6. Deployed publicly via Hugging Face Spaces

🧱 Challenges we ran into

  • Git LFS issues while pushing trained models
  • GPT’s mood classification sensitivity required prompt tuning
  • PPO agent needed careful reward shaping to perform well
  • Visualizing mood charts in Gradio without crashes
  • Handling multi‑turn conversations and maintaining session memory

🏆 Accomplishments that we’re proud of

  • Built and deployed a live mental health agent powered by reinforcement learning
  • Achieved real‑time mood detection + PPO suggestion integration
  • Created a meaningful use case combining language models and RL
  • Made the interface user‑friendly and expressive with emoji, charts, and chat history

📚 What we learned

  • How to design a Gym environment for non‑game, human‑centered goals
  • Best practices for deploying ML apps on Hugging Face Spaces
  • How GPT can be used not just for generation, but semantic classification
  • Combining symbolic reward learning with fuzzy language input

🚀 What’s next for RL‑Powered Mental Health Support Bot

  • Add 👍 / 👎 feedback for learning from real users
  • Use GPT‑3.5 to generate full empathetic responses
  • Store and visualize long‑term mood history per user
  • Add offline fallback using a local Hugging Face model
  • Integrate external wellness APIs like Calm or Headspace
  • Open‑source the project for research and community use

Built With

  • gradio
  • gymnasium
  • huggingface
  • numpy
  • openai-api
  • python
  • stable-baselines3
Share this project:

Updates