EchoBot is the ultimate framework for AI Agents to go live. It is a powerful, microservices-based platform that enables AI personas to autonomously host dynamic YouTube live streams, managing everything from content generation to OBS studio controls.
Check out a working example of EchoBot in action:
- XyLumira YouTube Channel - A live streaming agent powered by EchoBot
- Microservices Architecture: A scalable and maintainable architecture with dedicated services for each core functionality.
- Dynamic Scheduling: Control your broadcast in real-time by editing a
schedule.jsonfile. - OBS Automation: Seamlessly switch scenes, manage media, and control your stream via OBS WebSockets.
- Autonomous Agent Content: The AI Agent automatically generates news reports, voiceovers, and music to keep the stream fresh and engaging.
- Unified Media Management: A centralized media directory simplifies content management and ensures consistent access across all services.
- Live Agent Interaction: The AI Agent engages with your audience in real-time via YouTube chat, answering questions and reacting to comments.
- API Service: Exposes an API for managing the streaming agent and its services.
- Chat YouTube Service: Manages YouTube chat interaction and AI-powered responses.
- Music Service: Handles music generation, downloads, and playback.
- News Service: Aggregates news and generates scripts for the AI persona.
- OBS Stream Service: Controls OBS and manages the live stream.
- Event Notifier Service: Receives events from other services and forwards them to configured webhook URLs (e.g., your website).
- Python 3.13+
- Docker and Docker Compose
- OBS Studio with the WebSocket plugin enabled
uvpackage manager
If you don't have uv installed, you can install it with the following command:
curl -LsSf https://astral.sh/uv/install.sh | shgit clone <repository-url>
cd echobotFirst, create a virtual environment and install the required dependencies:
uv sync
source .venv/bin/activateNext, copy the example environment file and update it with your credentials:
cp .env.example .envYou will need to fill in your API keys for Google, ElevenLabs, and any other services you plan to use.
You also need to configure the paths for the unified media directory in your .env file. Set MEDIA_HOST_DIR to the absolute path of the app/media directory within your project. MEDIA_CONTAINER_DIR should be left as /app/media.
# .env
MEDIA_HOST_DIR=/path/to/your/project/echobot/app/media
MEDIA_CONTAINER_DIR=./app/media- In OBS, go to Tools -> WebSocket Server Settings.
- Enable the WebSocket server and set a password.
- Update your
.envfile with your OBS host, port, and password.
If you want to receive event notifications (e.g., when news sections start) on your website or external service:
-
Add your webhook URL(s) to your
.envfile:EVENT_WEBHOOK_URLS=https://your-hub.example.com/api/agents/generic/event
Or multiple URLs (comma-separated):
EVENT_WEBHOOK_URLS=https://your-hub.example.com/api/agents/generic/event,https://dev.example.com/api/agents/generic/event
-
Your webhook endpoint should accept POST requests with JSON payloads like:
{ "event": "news_section_started", "timestamp": "2024-01-15T14:30:00Z", "scene": "ai_robotics_news", "audio_file": "audio_ai_robotics_20240115_143000.mp3", "duration_seconds": 180.5 } -
The event_notifier service runs on port
8002by default (configurable viaEVENT_NOTIFIER_PORT).
The platform uses a unified media directory to manage all content. To set it up, run the following script:
./scripts/setup_media_dirs.shThis will create the app/media directory inside your project root, along with all the necessary subdirectories.
You can run all the services at once using Docker Compose:
docker-compose up -d --buildTo run services, you can use the start_services.py script. Make sure your virtual environment is activated (see Setup step 3):
source .venv/bin/activateTo launch all services:
python start_services.py --launchTo launch a specific service:
python start_services.py --launch <service-name>To launch multiple specific services:
python start_services.py --launch <service-name1> <service-name2> ...Note: If the python command is not found, use python3 instead.
For example, to launch the OBS service:
python start_services.py --launch obsTo launch all services except music:
python start_services.py --launch youtube obs news api event_notifierAvailable services: youtube, obs, music, news, api, event_notifier.
The start_services.py script also allows you to stop and restart services:
- Stop all services:
python start_services.py --stop - Stop a specific service:
python start_services.py --stop <service-name> - Restart all services:
python start_services.py --launch --force - Restart a specific service:
python start_services.py --launch <service-name> --force
Examples:
# Restart the YouTube service
python start_services.py --launch youtube --force
# Restart the OBS service
python start_services.py --launch obs --force
# Restart the event_notifier service (useful after changing EVENT_WEBHOOK_URLS)
python start_services.py --launch event_notifier --force
# Restart multiple services
python start_services.py --launch obs event_notifier --forceNote: After changing configuration (like EVENT_WEBHOOK_URLS in .env), you need to restart the affected service(s) for changes to take effect.
To test the event notifier service:
-
Start the service:
python start_services.py --launch event_notifier
-
Test the health endpoint:
curl http://127.0.0.1:8002/health
-
Send a test event to the local event_notifier service (which will forward it to configured webhooks):
curl -X POST http://127.0.0.1:8002/events \ -H "Content-Type: application/json" \ -d '{ "event": "news_section_started", "data": { "scene": "ai_robotics_news", "audio_file": "test.mp3", "duration_seconds": 180.5 } }'
This will forward the event to
https://your-hub.example.com/api/agents/generic/eventif configured in your.envfile. -
Test the webhook endpoint directly (to verify the hub endpoint is working):
curl -X POST https://your-hub.example.com/api/agents/generic/event \ -H "Content-Type: application/json" \ -d '{ "event": "news_section_started", "timestamp": "2024-01-15T14:30:00Z", "scene": "ai_robotics_news", "audio_file": "test.mp3", "duration_seconds": 180.5 }'
Note: This tests the external webhook endpoint directly. If you get a 404, verify the endpoint path is correct on the hub server.
-
Test with a webhook testing service (like webhook.site):
- Get a unique webhook URL from webhook.site
- Add it to your
.env:EVENT_WEBHOOK_URLS=https://webhook.site/your-unique-id - Restart the service and send a test event to see it forwarded to your webhook
EchoBot uses a unified media structure to simplify content management. All media files are stored in a single host directory, which is mounted into the container at /app/media.
{PROJECT_ROOT}/app/media/
βββ news/
βββ voice/generated_audio/
βββ music/
β βββ soundcloud_songs/
β βββ google_drive_songs/
βββ state/
βββ memory/
βββ videos/
- Host Directory: All media is stored in
{PROJECT_ROOT}/app/mediaon your local machine. - Container Mount: This directory is mounted to
/app/mediain the container. - Path Conversion: The application provides helper functions to convert between host and container paths, ensuring seamless integration with OBS.
- Command 'python' not found: If you see this error, use
python3instead ofpython, or ensure your virtual environment is activated (runsource .venv/bin/activate). - ModuleNotFoundError when using
python -m start_services.py: Don't usepython -mwith the script. Run it directly aspython start_services.py(orpython3 start_services.py). - OBS Connection Failed: Ensure OBS is running and your WebSocket settings are correct.
- Container Can't Write Files: Check that the
{PROJECT_ROOT}/app/mediadirectory has the correct permissions. - Path Conversion Not Working: Verify that
MEDIA_HOST_DIRandMEDIA_CONTAINER_DIRare set correctly in your.envfile.
This project is under active development. Community contributions are welcome via pull requests.
Before running EchoBot:
- Make sure Docker is installed
- Copy
.example.envto.env - Fill required API keys
Thanks to all contributors supporting EchoBot development.