Agora Conversational AI Agent service built with FastAPI.
Follow Get started with Agora to get the App ID and App Certificate and enable the Conversational AI service.
cp .env.example .env.localEdit .env.local and fill in your Agora credentials:
APP_ID- Your Agora App ID (Required)APP_CERTIFICATE- Your Agora App Certificate (Required)- Agora managed provider access should be enabled for this project
Note: The service uses Token007 authentication generated from APP_ID and APP_CERTIFICATE. Third-party vendor keys are not required in this default managed setup. The current default chain matches the Next.js quickstart: DeepgramSTT (nova-3) + OpenAI (gpt-4o-mini) + MiniMaxTTS (speech_2_6_turbo / English_captivating_female1).
Option A: Using Virtual Environment (Recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtOption B: Global Installation (Not Recommended)
pip install -r requirements.txt# If using virtual environment, make sure it's activated first
python src/server.pyThe service will start on port 8000 (or the port specified in .env.local).
# Test config generation
curl http://localhost:8000/get_config
# Test agent start
curl -X POST http://localhost:8000/v2/startAgent \
-H "Content-Type: application/json" \
-d '{"channelName": "test_channel", "rtcUid": "123456", "userUid": "789012"}'
# Test agent stop (use agent_id from start response)
curl -X POST http://localhost:8000/v2/stopAgent \
-H "Content-Type: application/json" \
-d '{"agentId": "your_agent_id"}'GET /get_config- Generate connection configurationPOST /v2/startAgent- Start an agentPOST /v2/stopAgent- Stop an agent
- Python >= 3.8
- Dependencies listed in
requirements.txt
This project uses agora-agent-server-sdk:
- Package:
agora_agent - Agent builder:
agora_agent.agentkit.Agentwith fluent.with_llm()/.with_tts()/.with_stt()API - Default vendors:
DeepgramSTT,OpenAI,MiniMaxTTSfromagora_agent.agentkit.vendors - Optional BYOK examples in
src/agent.py:DeepgramSTT,OpenAI(api_key=...),ElevenLabsTTS - Token:
agora_agent.agentkit.token.generate_convo_ai_token