Overview
Interfaces transform your agents into interactive bots that can:- Respond to messages in real-time
- Maintain conversation context
- Handle media (images, documents, audio)
- Apply access control (whitelists)
- Process webhooks securely
- Slack - Team messaging and collaboration
- Gmail - Email automation and responses
- Telegram - Messaging with rich media support
- WhatsApp - Business messaging integration
Quick Start
Basic Interface Setup
Using with CLI
Create amain.py that returns an InterfaceManager:
Operating Modes
All interfaces support two operating modes:Task Mode (Default)
Each message is processed as an independent task - no conversation history.- Command execution
- Stateless queries
- High-volume request processing
Chat Mode
Messages from the same user continue a conversation session with full history.- Persistent conversation history
- Context-aware responses
- User-specific sessions
- Reset command support
- Customer support
- Personal assistants
- Multi-turn interactions
Slack Interface
Setup
-
Create Slack App:
- Go to api.slack.com/apps
- Create new app
- Add bot token scopes:
chat:write,app_mentions:read,channels:history - Install app to workspace
- Configure environment:
Basic Usage
Advanced Configuration
Webhook Setup
- Expose your server:
- Configure Slack webhook:
- Event Subscriptions → Enable Events
- Request URL:
https://your-domain.ngrok-free.app/slack/events - Subscribe to:
app_mention,message.im
Features
- Signature verification - Validates all webhook requests
- Event deduplication - Prevents duplicate processing
- Thread support - Replies in threads
- Typing indicators - Shows bot is typing
- Message streaming - Progressive message updates
- Whitelist control - Restrict access by user ID
Gmail Interface
Setup
-
Enable Gmail API:
- Go to Google Cloud Console
- Create project
- Enable Gmail API
- Create OAuth 2.0 credentials
- Download
credentials.json
- Authenticate:
Basic Usage
Processing Emails
Trigger Email Check
Features
- Smart email triage - Agent decides to reply or ignore
- Structured responses - Uses Pydantic models for decisions
- Thread handling - Maintains email conversations
- Whitelist control - Restrict by email address
- Mark as read - Automatic email management
Response Format
In task mode, the agent receives:Telegram Interface
Setup
-
Create bot:
- Message @BotFather on Telegram
- Send
/newbot - Follow prompts to get bot token
- Configure environment:
Basic Usage
Advanced Configuration
Media Handling
Telegram interface supports:- Text messages - Standard text processing
- Photos - Automatic download and vision processing
- Documents - PDF, Office files, text files
- Audio - Voice messages and audio files
- Video - Video file processing
- Stickers - Emoji extraction
- Location - GPS coordinates
- Contacts - vCard data
Webhook Management
Features
- All message types - Text, media, location, contacts
- Inline keyboards - Callback query support
- Typing indicators - Shows bot is typing
- Message streaming - Real-time updates
- File downloads - Automatic media retrieval
- Whitelist control - User ID restrictions
WhatsApp Interface
Setup
-
Create WhatsApp Business App:
- Go to Facebook Developers
- Create app → WhatsApp → Business
- Get phone number ID and access token
- Configure environment:
Basic Usage
Advanced Configuration
Media Support
- Images - JPG, PNG, GIF, WebP
- Documents - PDF, Office documents
- Audio - Voice messages, audio files
- Video - Video messages
Webhook Setup
- Configure webhook URL:
- WhatsApp Settings → Configuration
- Callback URL:
https://your-domain.ngrok-free.app/whatsapp/webhook - Verify token: Your verification token
- Subscribe to:
messages
Features
- Webhook verification - Meta/Facebook validation
- Signature validation - HMAC SHA-256 verification
- Media processing - Images, documents, audio, video
- Image generation - Send generated images
- Typing indicators - Read receipts
- Whitelist control - Phone number restrictions
Multi-Interface Setup
Run multiple interfaces simultaneously:/slack/events- Slack webhook/telegram/webhook- Telegram webhook/gmail/check- Gmail processor/health- Health check
Access Control
Whitelist by User/Email/Number
Security Best Practices
- Use environment variables:
- Enable signature validation:
- Use HTTPS in production:
- Implement whitelists:
Health Monitoring
All interfaces expose health endpoints:Troubleshooting
Webhook not receiving events:- Verify webhook URL is publicly accessible
- Check signature/token validation
- Review server logs for errors
- Test with webhook testers (e.g., webhook.site)
- Slack: Check bot token scopes
- Gmail: Re-authenticate with correct scopes
- Telegram: Verify bot permissions
- WhatsApp: Check Business API access
- Ensure storage backend is configured
- Verify storage connection
- Check storage credentials
- Verify agent model supports media types
- Check file size limits
- Review download permissions
Next Steps
- Learn about CLI deployment
- Deploy with AgentOS
- Configure storage backends
- Implement safety policies