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.
Click on the image to watch the project demo on YouTube:
-
🎤 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 libraryis used for text-to-speech.
-
📜 Chat History:
- Remembers the context of previous interactions.
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:
-
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.
-
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.
-
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.
User Input (Audio) 🎙️
│
├──► Speech-to-Text 🎧
│
└──► Analysis Agent 🔍
│
└──► Intervention Agent 🛠️
│
└──► Support & Feedback Agent 💬
│
├──► Text-to-Speech 🎧
│
└──► User Receives Audio Response 🎙️
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.
📂 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 AgentsThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For questions or suggestions, please open an issue or contact me directly:
- Email: adnanbarwaniwala7@gmail.com
Thank you for spending time on my repo. Hope you enjoyed it!
