EvoAI Integration
EvoAI is Evolution API’s native AI agent platform designed specifically for WhatsApp automation. It provides intelligent conversation handling, context awareness, and seamless integration with the Evolution API ecosystem.What is EvoAI?
EvoAI offers:- Native integration with Evolution API
- Intelligent conversation routing
- Context-aware responses
- Multi-language support
- Custom agent configuration
- Advanced NLU capabilities
- Seamless session management
- Built-in analytics and insights
Enable EvoAI Integration
Add this environment variable to your.env file:
Configuration Settings
Create Default Settings
Before creating EvoAI agents, configure default behavior settings for your instance.Settings Parameters
Session expiration time in seconds. Default: 300 (5 minutes)
Keyword to terminate the bot session. Example: “#EXIT”, “bye”
Delay in milliseconds between messages. Default: 1000
Message sent when agent encounters an error or cannot respond
Whether agent responds to messages sent by the instance owner
Whether instance owner can stop the agent session
Keep session open after completion. Default: false
Seconds to wait before processing rapid messages. Default: 10
List of JIDs (phone numbers) to ignore
Fallback EvoAI agent ID to use when primary agent fails
Create an EvoAI Agent
Request Parameters
Enable or disable this agent
Description of the agent purpose
EvoAI agent endpoint URL
Your EvoAI API key for authentication
Trigger type: “all”, “keyword”, or “advanced”
For keyword triggers: “equals”, “contains”, “startsWith”, “endsWith”, “regex”
The keyword or regex pattern to trigger this agent
Trigger Types
All Messages
Respond to every message (only one “all” trigger allowed per instance):Keyword Trigger
Trigger based on specific keywords:equals- Exact matchcontains- Contains the keywordstartsWith- Message starts with keywordendsWith- Message ends with keywordregex- Regular expression match
Advanced Trigger
Use regex for complex pattern matching:Update EvoAI Agent
Modify an existing EvoAI agent configuration:Delete EvoAI Agent
Remove an EvoAI agent from your instance:Fetch EvoAI Agents
Retrieve all EvoAI agents configured for your instance:Session Management
Change Session Status
Update the status of an active EvoAI session:Fetch Sessions
Get all active EvoAI sessions:EvoAI Features
Native Evolution API Integration
EvoAI is built specifically for Evolution API:- Seamless authentication and authorization
- Optimized for WhatsApp message formats
- Native support for Evolution API events
- Integrated session management
- Built-in Evolution API context awareness
Intelligent Conversation Handling
Advanced conversation capabilities:- Context retention across messages
- Intent recognition and classification
- Entity extraction from messages
- Sentiment analysis
- Multi-turn conversation support
- Conversation history tracking
Multi-Language Support
Global reach with language detection:- Automatic language detection
- Multi-language response generation
- Language-specific knowledge bases
- Translation capabilities
- Localized conversation flows
Analytics and Insights
Built-in monitoring and analytics:- Conversation metrics and KPIs
- User engagement tracking
- Agent performance monitoring
- Error and exception tracking
- Custom event logging
Use Cases
Intelligent Customer Support
Intelligent Customer Support
Deploy smart support agents:
- Automated issue resolution
- Intelligent ticket routing
- FAQ automation
- Escalation to human agents
- Follow-up and feedback collection
Sales Automation
Sales Automation
Enhance sales processes:
- Lead qualification and scoring
- Product recommendations
- Order processing and tracking
- Upsell and cross-sell automation
- Customer journey optimization
Appointment Scheduling
Appointment Scheduling
Automate booking processes:
- Availability checking
- Appointment booking and confirmation
- Reminder notifications
- Rescheduling and cancellations
- Calendar integration
Information Delivery
Information Delivery
Provide instant information:
- Knowledge base queries
- Product information
- Service status updates
- Account information
- Personalized recommendations
Best Practices
EvoAI agents are optimized for WhatsApp’s conversational format. Keep responses concise and actionable.
- Design clear conversation flows: Map out expected user journeys
- Set appropriate timeouts: Balance responsiveness with session management
- Use fallback agents: Configure fallback options for error handling
- Monitor performance: Track metrics and optimize based on insights
- Test thoroughly: Validate agent behavior with various scenarios
- Update regularly: Keep agent knowledge and responses current
- Handle edge cases: Plan for unexpected inputs and errors
Troubleshooting
Agent not responding
Agent not responding
- Verify
EVOAI_ENABLED=truein environment - Check that the agent is enabled (
enabled: true) - Ensure trigger conditions match the incoming message
- Verify EvoAI agent URL is accessible
- Check API key is valid and has proper permissions
- Review EvoAI platform logs for errors
Slow response times
Slow response times
- Check EvoAI platform performance
- Verify network latency between Evolution API and EvoAI
- Optimize agent configuration for faster processing
- Monitor concurrent session load
- Review agent complexity and simplify if needed
Context not maintained
Context not maintained
- Increase
expiretime for longer sessions - Set
keepOpen: truefor persistent conversations - Verify session IDs are being tracked correctly
- Check EvoAI conversation memory settings
- Review session management configuration
Authentication errors
Authentication errors
- Verify API key is correct and active
- Check API key permissions in EvoAI platform
- Ensure agent URL is properly configured
- Test authentication with curl or Postman
- Review EvoAI platform access logs
Advanced Configuration
Multiple Agents
Deploy specialized agents for different purposes:Fallback Configuration
Configure fallback agents for error handling:Integration with Evolution API Features
Webhook Events
EvoAI agents work seamlessly with Evolution API webhooks:- Receive all message events
- Access full message context
- Integrate with other Evolution API features
- Subscribe to custom events
Multi-Instance Support
Deploy agents across multiple instances:- Instance-specific configurations
- Shared agent resources
- Centralized management
- Isolated sessions per instance
Session Persistence
Manage long-running conversations:- Persistent session storage
- Context preservation across restarts
- Session recovery mechanisms
- Custom session attributes
Performance Optimization
Response Time
Optimize for fast responses:- Use edge locations for EvoAI deployment
- Cache frequently accessed data
- Implement request batching
- Optimize agent logic
Scalability
Handle high volumes:- Load balancing across agent instances
- Horizontal scaling capabilities
- Queue management for peak loads
- Resource allocation optimization
Monitoring
Track performance metrics:- Response time monitoring
- Success rate tracking
- Error rate analysis
- Resource utilization metrics
Security
API Key Management
- Rotate API keys regularly
- Use environment-specific keys
- Implement key expiration policies
- Monitor API key usage
Data Privacy
- Encrypt sensitive data in transit and at rest
- Implement data retention policies
- Comply with privacy regulations (GDPR, LGPD, etc.)
- Anonymize personal information when possible
Access Control
- Implement role-based access control
- Audit agent access and usage
- Restrict agent permissions
- Monitor unauthorized access attempts