Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎙️🧠 CBT Voice Agent

CBT Voice Agent is a voice-enabled assistant that provides personalized support using Cognitive Behavioral Therapy (CBT). It allows users to express their feelings verbally, processes the input using an agentic workflow powered by the Deepseek-R1 LLM and LangGraph library, and delivers supportive, actionable advice through audio responses.


Project Demo:

Click on the image to watch the project demo on YouTube: Watch the video


🚀 Features

  • 🎤 Voice Interaction:

    • Speak directly to the app to express your feelings or concerns.
    • 📝 Speech is transcribed to text using the OpenAI Whisper model.
  • 🤖 AI-driven CBT Support:

    • Uses a structured, agentic workflow to provide targeted CBT interventions.
  • 🗣️ Natural Conversational Responses:

    • Delivers empathetic and human-like audio replies.
    • 🔊 The ElevenLabs library is used for text-to-speech.
  • 📜 Chat History:

    • Remembers the context of previous interactions.

⚙️ Understanding the Agentic Workflow:

The workflow is created using the LangGraph library. It uses three specialized AI agents. Each agent is powered by the Deepseek-R1 LLM. They work in this sequence:

1️⃣ Analysis Agent 🔍

  • Functionality:

    • Processes the transcribed user query.
    • Identifies underlying emotions, cognitive distortions, and thought patterns.
  • Output:
    Provides a structured analysis of the user's emotional state.

2️⃣ Intervention Agent 🛠️

  • Functionality:

    • Receives analysis from the Analysis Agent.
    • Designs targeted CBT interventions (e.g., cognitive restructuring, behavioral activation).
    • Uses structured Socratic questioning or CBT activities to guide the user.
  • Output:
    Generates a clear, actionable CBT strategy for the user's specific issue.

3️⃣ Support & Feedback Agent 💬

  • Functionality:

    • Receives the intervention from the Intervention Agent.
    • Adds empathetic validation, encouragement, and supportive feedback.
    • Prompts the user for reflection on their emotional state and intervention effectiveness.
  • Output:
    Delivers a supportive, empathetic, and complete audio response to the user.


🗃️ Agentic Workflow Structure

User Input (Audio) 🎙️
      │
      ├──► Speech-to-Text 🎧
      │
      └──► Analysis Agent 🔍
                  │
                  └──► Intervention Agent 🛠️
                              │
                              └──► Support & Feedback Agent 💬
                                          │
                                          ├──► Text-to-Speech 🎧
                                          │
                                          └──► User Receives Audio Response 🎙️

🧠 Why CBT?

Cognitive Behavioral Therapy (CBT) helps people change negative thought patterns and develop healthier ways of thinking. This app uses CBT to:

  • 🧐 Recognize Negative Thinking: Identifies unhelpful thoughts that may be affecting your emotions.
  • 🔄 Challenge and Replace Them: Helps you question if those thoughts are true and guides you to a more balanced perspective.
  • 🏆 Provide Practical Coping Strategies: Suggests real actions you can take to improve your mood and manage stress.
  • 🤗 Offer Encouragement and Support: Gives positive feedback and motivation to help you feel better.

By following CBT techniques, the app helps you think more healthily and take steps toward feeling more in control.


📁 Project Structure

📂 CBT_Voice_Agent
│
├── 📄 LICENSE              # License information
├── 📄 README.md            # Project overview and documentation
├── 📄 requirements.txt     # Python dependencies
├── 📄 cbt_voice_agent.py   # Main application script (Streamlit app & agentic workflow)
└── 📄 prompts.py           # Prompt definitions for Analysis, Intervention, and Support Agents

📜 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Contact

For questions or suggestions, please open an issue or contact me directly:


🙏 Thank You

Thank you for spending time on my repo. Hope you enjoyed it!

About

An AI voice agent that helps you navigate thoughts and emotions using Cognitive Behavioural Therapy. Project Demo: www.youtube.com/watch?v=jS7HKRbxa8o

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages