.env file at runtime.
Setup
- Copy the example file:
- Fill in your credentials in
.env - The config.yaml file references these variables using
${VAR_NAME}syntax
Required Variables
These environment variables must be set for Agentic AI to function properly.Twilio Configuration
Your Twilio Account SID, found in the Twilio Console.Format:
ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (34 characters starting with “AC”)Your Twilio Auth Token for authenticating API requests.
The Twilio phone number to make calls from.Format:
+1XXXXXXXXXX (E.164 format with country code)Example: +15551234567Gemini Configuration
Your Google Gemini API key for AI intent analysis.Get your key from Google AI Studio.
OpenAI Configuration
Your OpenAI API key for Realtime API and Whisper STT.Get your key from OpenAI Platform.Format:
sk-proj-... or sk-...Telegram Configuration
Your Telegram bot token for sending live transcripts and updates.Get this from @BotFather on Telegram.Example:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyzThe Telegram chat ID where transcripts will be sent.How to find your Chat ID:
- Message your bot on Telegram (say “hi”)
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Find
"chat":{"id":123456789}- that number is your Chat ID
123456789Optional Variables
These variables are optional and used for specific features.Ngrok Configuration
Your ngrok authentication token for creating tunnels.Get your token from ngrok Dashboard.Only needed if using ngrok for tunneling. You can also use the CLI directly:
A fixed ngrok URL if you have a paid plan with reserved domains.Example:
https://myapp.ngrok.ioIf not set, ngrok will generate a random URL each time.Example .env File
Environment Variable Expansion
Inconfig.yaml, environment variables are referenced using ${VAR_NAME} syntax:
Default Values
You can provide default values using the syntax${VAR_NAME:default}:
TWILIO_PHONE_NUMBER is not set, it will use +1XXXXXXXXXX as the default.
The config loader automatically expands environment variables at runtime. See
config.py:113-134 for implementation details.Security Best Practices
- Never commit
.env- It’s in.gitignoreby default - Use strong API keys - Rotate them regularly
- Restrict permissions - Use API keys with minimal required permissions
- Keep tokens secret - Don’t share them in logs, screenshots, or chat
- Use environment-specific files -
.env.production,.env.development, etc. - Set file permissions -
chmod 600 .envto restrict access
Troubleshooting
Missing Environment Variables
If you see errors about missing variables:Wrong .env Location
The config loader looks for.env in:
- Current working directory
- Project root (parent of
src/agenticai/core/config.py)
config.py:13-15 for the loading logic.
Variables Not Expanding
If${VAR_NAME} appears literally in your config:
- Check that the variable is set in
.env - Verify the syntax:
${VAR_NAME}or${VAR_NAME:default} - Check for typos in variable names (case-sensitive!)