Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
colorFrom: pink
|
| 5 |
-
colorTo: blue
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.33.0
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: apache-2.0
|
| 11 |
-
short_description: 'A Voice Support Agent '
|
| 12 |
-
---
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
+
# ๐ค Voice Agent with MCP - Gradio Hackathon
|
| 2 |
+
|
| 3 |
+
**Hackathon Submission**: Gradio Agents & MCP Hackathon
|
| 4 |
+
|
| 5 |
+
A lightweight voice agent that combines Gradio, ElevenLabs, and MCP (Model Context Protocol) to create an intelligent assistant capable of answering questions and scheduling calendar appointments.
|
| 6 |
+
|
| 7 |
+
## ๐ Features
|
| 8 |
+
|
| 9 |
+
- **๐ฃ๏ธ Voice Input/Output**: Natural speech interaction using speech recognition and ElevenLabs TTS
|
| 10 |
+
- **๐
Calendar Management**: Schedule appointments with natural language
|
| 11 |
+
- **โ Question Answering**: Handle general inquiries and provide helpful responses
|
| 12 |
+
- **๐ง MCP Integration**: Uses Model Context Protocol for intelligent request processing
|
| 13 |
+
- **โก Lightweight**: Optimized for Hugging Face Spaces deployment
|
| 14 |
+
|
| 15 |
+
## ๐ ๏ธ Technology Stack
|
| 16 |
+
|
| 17 |
+
- **Gradio**: Web interface and app framework
|
| 18 |
+
- **ElevenLabs API**: High-quality text-to-speech synthesis
|
| 19 |
+
- **MCP**: Model Context Protocol for intelligent processing
|
| 20 |
+
- **Speech Recognition**: Voice-to-text conversion
|
| 21 |
+
- **Python**: Backend processing and API integration
|
| 22 |
+
|
| 23 |
+
## ๐ฏ Use Cases
|
| 24 |
+
|
| 25 |
+
### Voice Interactions
|
| 26 |
+
- "Hello, how are you today?"
|
| 27 |
+
- "What time is it right now?"
|
| 28 |
+
- "Schedule a doctor appointment for tomorrow at 3pm"
|
| 29 |
+
- "Book a meeting with the team next Monday"
|
| 30 |
+
|
| 31 |
+
### Calendar Management
|
| 32 |
+
- Natural language appointment scheduling
|
| 33 |
+
- Time and date extraction
|
| 34 |
+
- Meeting type detection
|
| 35 |
+
- Automatic event creation (demo mode)
|
| 36 |
+
|
| 37 |
+
## ๐ง Setup Instructions
|
| 38 |
+
|
| 39 |
+
### Environment Variables
|
| 40 |
+
Set these in your Hugging Face Space settings:
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
|
| 44 |
+
GOOGLE_CALENDAR_CREDENTIALS=your_google_credentials_json (optional)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
### Local Development
|
| 48 |
+
1. Clone the repository
|
| 49 |
+
2. Install dependencies: `pip install -r requirements.txt`
|
| 50 |
+
3. Set environment variables
|
| 51 |
+
4. Run: `python app.py`
|
| 52 |
+
|
| 53 |
+
## ๐ Requirements
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
gradio==4.44.0
|
| 57 |
+
speechrecognition==3.10.0
|
| 58 |
+
requests==2.31.0
|
| 59 |
+
aiohttp==3.9.1
|
| 60 |
+
python-dateutil==2.8.2
|
| 61 |
+
pyaudio==0.2.11
|
| 62 |
+
pydub==0.25.1
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## ๐ฎ How to Use
|
| 66 |
+
|
| 67 |
+
1. **Voice Mode**:
|
| 68 |
+
- Click the microphone to record your voice
|
| 69 |
+
- Speak your question or appointment request
|
| 70 |
+
- Listen to the AI response
|
| 71 |
+
|
| 72 |
+
2. **Text Mode**:
|
| 73 |
+
- Type your message in the text box
|
| 74 |
+
- Use quick action buttons for common requests
|
| 75 |
+
- View the AI's text response
|
| 76 |
+
|
| 77 |
+
## ๐ Architecture
|
| 78 |
+
|
| 79 |
+
The agent uses a simple but effective architecture:
|
| 80 |
+
|
| 81 |
+
1. **Input Processing**: Speech-to-text or direct text input
|
| 82 |
+
2. **Intent Detection**: Determines if request is calendar-related or general Q&A
|
| 83 |
+
3. **MCP Processing**: Routes requests through appropriate handlers
|
| 84 |
+
4. **Response Generation**: Creates contextual responses
|
| 85 |
+
5. **Output**: Text-to-speech or text display
|
| 86 |
+
|
| 87 |
+
## ๐ Future Enhancements
|
| 88 |
+
|
| 89 |
+
- Integration with real Google Calendar API
|
| 90 |
+
- Advanced NLP for better appointment extraction
|
| 91 |
+
- Multi-language support
|
| 92 |
+
- Voice activity detection
|
| 93 |
+
- Persistent conversation memory
|
| 94 |
+
- Integration with additional calendar providers
|
| 95 |
+
|
| 96 |
+
## ๐ Hackathon Goals
|
| 97 |
+
|
| 98 |
+
This project demonstrates:
|
| 99 |
+
- **Gradio Integration**: Clean, intuitive web interface
|
| 100 |
+
- **Voice Interaction**: Natural speech input/output
|
| 101 |
+
- **MCP Implementation**: Intelligent request routing
|
| 102 |
+
- **Practical Application**: Real-world calendar management
|
| 103 |
+
- **Lightweight Design**: Optimized for cloud deployment
|
| 104 |
+
|
| 105 |
+
## ๐ค Contributing
|
| 106 |
+
|
| 107 |
+
This is a hackathon project, but feedback and suggestions are welcome!
|
| 108 |
+
|
| 109 |
+
## ๐ License
|
| 110 |
+
|
| 111 |
+
MIT License - Feel free to use and modify for your own projects.
|
| 112 |
+
|
| 113 |
---
|
| 114 |
+
|
| 115 |
+
**Built for the Gradio Agents & MCP Hackathon** ๐
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|