A local voice assistant powered by ElevenLabs Conversational AI. Speak to it, and it speaks back using an AI agent you configure on the ElevenLabs dashboard.
- Python 3.12+
- An ElevenLabs account
- A configured ElevenLabs Agent (see setup below)
Create and activate a virtual environment:
bash
python3 -m venv venv
source venv/bin/activateThen install dependencies:
bash
pip install elevenlabs python-dotenv certifiTo deactivate the virtual environment when done:
bash
deactivate- Go to ElevenLabs → Conversational AI → Agents
- Click Start from blank to create a new agent
- Set your desired System prompt and First message in the agent settings
- Go to the Security tab and enable the System prompt and First message overrides if you want to control them from code
- Copy your Agent ID from the agent page
- Go to your profile → API Keys and create a new key with at minimum:
- Text to Speech → Access
- ElevenAgents → Write
- Voices → Read
- Models → Access
Create a .env file in the project root:
AGENT_ID=your_agent_id_here
API_KEY=your_api_key_here
bash
python3 voice_assistant.pyThe assistant will start listening immediately. Press Ctrl+C to stop.
- On macOS, if you encounter SSL certificate errors, run:
bash
/Applications/Python\3.12/Install\ Certificates.command