The Email Triage Problem
Businesses receive hundreds of emails daily through catchall addresses. Manually sorting emails into support tickets, sales leads, purchase orders, and HR inquiries wastes hours. An AI classification agent automates this routing in Odoo.
How Email Classification Works
# AI Email Classification Pipeline:
# 1. Email arrives at [email protected]
# 2. Odoo fetchmail retrieves from IMAP
# 3. AI agent analyzes subject + body + sender
# 4. Classifies into category:
# - Support request → Helpdesk ticket
# - Sales inquiry → CRM lead
# - Purchase/vendor → Purchase order note
# - HR/recruitment → Recruitment application
# - Invoice/billing → Accounting inbox
# - Spam/irrelevant → Archive
# 5. Routes to correct Odoo model + teamClassification Prompt
# System prompt for email classifier:
"""
You are an email classifier for a business using Odoo ERP.
Classify each email into exactly one category:
- SUPPORT: customer complaints, bug reports, how-to questions
- SALES: pricing inquiries, demo requests, product questions
- PURCHASE: vendor quotes, supplier communications, procurement
- HR: job applications, employee inquiries, leave requests
- BILLING: invoice disputes, payment questions, account statements
- SPAM: marketing, newsletters, irrelevant
Also extract:
- Priority: low, medium, high, urgent
- Sentiment: positive, neutral, negative
- Language: detected language code
Respond in JSON format.
"""Odoo Integration
# Automated action on mail.message create:
# Model: mail.message
# Trigger: On Creation
# Filter: message_type = 'email'
# Python code:
for record in records:
body = record.body or ''
subject = record.subject or ''
sender = record.email_from or ''
classification = ai_classify(subject, body, sender)
if classification['category'] == 'SUPPORT':
env['helpdesk.ticket'].create({
'name': subject,
'description': body,
'partner_id': find_partner(sender),
'priority': map_priority(classification['priority']),
})
elif classification['category'] == 'SALES':
env['crm.lead'].create({
'name': subject,
'description': body,
'email_from': sender,
'type': 'lead',
})Accuracy Improvement
# Improve classification accuracy:
# 1. Include sender history (existing customer? vendor?)
# 2. Check partner tags and categories
# 3. Use thread context (reply to existing ticket?)
# 4. Domain-specific keywords for your industry
# 5. Feedback loop: log corrections for fine-tuning
# Confidence threshold:
# > 0.9: auto-route silently
# 0.7-0.9: route + flag for review
# < 0.7: send to manual triage queueBenefits
# Impact of AI email classification:
# - 80-90% emails auto-routed correctly
# - Response time reduced (immediate routing)
# - No emails lost or forgotten
# - Consistent categorization (no human bias)
# - Multilingual support built-in
# - Scales with email volumeDeployMonkey AI
DeployMonkey's AI agent can configure email classification rules and routing in your Odoo instance. Automate email triage from day one.