config.yaml file is the main configuration file for Agentic AI. It defines all service connections, behavior settings, and integrations.
File Location
By default, the config file is loaded from:./config.yamlin your current directory- Or specify a custom path:
agenticai server --config /path/to/config.yaml
Configuration Structure
The config file is organized into logical sections for each service and feature.Twilio Configuration
Controls how Agentic AI connects to Twilio for phone calls.Your Twilio Account SID from environment variable.References:
${TWILIO_ACCOUNT_SID}Your Twilio Auth Token from environment variable.References:
${TWILIO_AUTH_TOKEN}The phone number to make calls from (E.164 format).References:
${TWILIO_PHONE_NUMBER:+1XXXXXXXXXX}Example: +15551234567Gemini Configuration
Controls the Gemini AI model for intent analysis and system instructions.Your Gemini API key from environment variable.References:
${GEMINI_API_KEY}The Gemini model to use for intent analysis.Available models:
models/gemini-2.5-flash-native-audio-latest(recommended)models/gemini-2.5-flash-preview-native-audio-dialog
The voice for Gemini TTS (when not using OpenAI Realtime).Available voices: Zephyr, Coral, Breeze, Nova
The system prompt that defines the AI’s behavior and personality.This is used for intent analysis and determining what actions to take.Example:
Telegram Configuration
Controls real-time transcript delivery to Telegram.Enable or disable Telegram integration.Set to
false to disable sending transcripts to Telegram.Your Telegram bot token from environment variable.References:
${TELEGRAM_BOT_TOKEN}The Telegram chat ID where transcripts will be sent.References:
${TELEGRAM_CHAT_ID}Gateway Configuration
Controls connection to the OpenClaw Gateway for ClawdBot integration.The WebSocket URL of the OpenClaw Gateway.Default assumes ClawdBot Gateway is running locally on port 18789.For remote gateways:
ws://remote-host:18789Maximum number of reconnection attempts if the gateway disconnects.Set to
-1 for unlimited attempts.Initial delay in seconds before first reconnection attempt.Uses exponential backoff:
base_delay * 2^attemptMaximum delay in seconds between reconnection attempts.Caps the exponential backoff to prevent extremely long waits.
Server Configuration
Controls the FastAPI server that handles Twilio webhooks and WebSocket connections.The host to bind the server to.
0.0.0.0- Listen on all interfaces (default)127.0.0.1- Listen only on localhost
The port to run the server on.Must match the port in your tunnel configuration.
The URL path for Twilio voice webhooks.Full webhook URL:
https://your-tunnel-url.com/twilio/voiceThe URL path for Twilio Media Streams WebSocket.Full WebSocket URL:
wss://your-tunnel-url.com/twilio/media-streamLogging Configuration
Controls logging output format and level.The log level to use.Options:
DEBUG- Very verbose, all detailsINFO- Standard operation logs (recommended)WARNING- Only warnings and errorsERROR- Only errorsCRITICAL- Only critical errors
The format for log output.Options:
json- Structured JSON logs (recommended for production)console- Human-readable console output (good for development)
Tunnel Configuration
Controls automatic tunnel setup for public webhook URLs.Enable automatic tunnel startup.Most users should start tunnels manually and set
enabled: false.The tunnel provider to use.Options:
ngrok- Use ngrok (most common)cloudflare- Use Cloudflare Tunnel
A fixed tunnel URL (if using paid plans with reserved domains).References:
${NGROK_URL:} (empty default if not set)Example: https://myapp.ngrok.ioIf empty, tunnel will generate a random URL each time.Whisper Configuration
Controls OpenAI Whisper for speech-to-text transcription.Enable standalone Whisper for accurate STT.Only needed if NOT using OpenAI Realtime API.
OpenAI API key for Whisper.References:
${OPENAI_API_KEY:} (optional)The Whisper model to use.Currently only
whisper-1 is available.OpenAI Realtime Configuration
Controls the OpenAI Realtime API for natural voice conversations.Enable OpenAI Realtime API as the primary voice engine.When enabled, this replaces Gemini Live for voice conversations.
Requires access to OpenAI Realtime API (gpt-4o-realtime)
OpenAI API key for Realtime API.References:
${OPENAI_API_KEY}The OpenAI Realtime model to use.Current available model:
gpt-4o-realtime-preview-2024-12-17
The voice to use for OpenAI TTS.See Voice Options for all available voices and their characteristics.
Complete Example
Here’s a completeconfig.yaml file with all sections:
Loading Configuration
Configuration is loaded automatically when you run:Configuration Validation
The configuration is validated using Pydantic models at startup. If any required fields are missing or invalid, you’ll see a clear error message. Seeconfig.py:18-111 for the validation schemas.
Troubleshooting
Config file not found
Environment variables not expanding
If you see${VAR_NAME} literally in error messages:
- Check that variables are set in
.env - Verify the
.envfile is in the correct location - Check for typos in variable names (case-sensitive)
Invalid configuration
If you see Pydantic validation errors:- Check that all required fields are present
- Verify data types (strings, numbers, booleans)
- Check YAML syntax (indentation, colons, quotes)