Skip to content

Email Triage

AI-powered email categorization, prioritization, and response drafting.

Port 8102
Container hai-email-triage
Use case Inbox management, support ticket routing, executive email filtering
Compliance GDPR, CCPA, HIPAA (if processing healthcare communications), SOC 2, ISO 27001

How it works

Submit an email (sender, subject, body) and receive:

  • Category: urgent, action_required, informational, follow_up, spam, newsletter
  • Priority: high, medium, low
  • Summary: 1-2 sentence digest
  • Suggested action: reply, delegate, archive, etc.
  • Draft reply: professional response (when action is required)

API

Triage a single email

curl -X POST http://localhost:8102/api/v1/triage \
  -H "X-API-Key: hai_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "sender": "client@acme.com",
    "subject": "Re: Project timeline update needed",
    "body": "Hi, we need the updated project timeline by Friday. The board meeting is Monday and we need to present current status. Can you send it over?"
  }'

Response:

{
  "category": "action_required",
  "priority": "high",
  "summary": "Client needs updated project timeline by Friday for a Monday board meeting.",
  "suggested_action": "Reply with timeline or ask for clarification on scope",
  "draft_reply": "Hi,\n\nThanks for the heads up on the board meeting. I'll have the updated timeline to you by Thursday EOD so you have time to review before Friday.\n\nIs there a specific format the board prefers, or should I use our standard project tracker?\n\nBest,\n[Your name]",
  "latency_ms": 1456,
  "model": "claude-sonnet-4-20250514"
}

Batch triage

Process up to 50 emails in one request:

curl -X POST http://localhost:8102/api/v1/triage/batch \
  -H "X-API-Key: hai_your_key" \
  -H "Content-Type: application/json" \
  -d '{"emails": [{"sender": "...", "subject": "...", "body": "..."}, ...]}'

Integration patterns

  • IMAP polling: Periodically fetch unread emails and submit to the triage API
  • Webhook: Forward incoming emails from your email provider to the API
  • Manual: Paste emails into a frontend connected to the API

HIPAA considerations

If triaging healthcare-related emails containing PHI:

Protected Health Information

  • Use Ollama (air-gapped) provider to prevent PHI from reaching cloud LLMs
  • Enable encryption at rest (ENCRYPTION_KEY must be set)
  • Restrict access to authorized healthcare staff via RBAC
  • Ensure your deployment infrastructure has a BAA with the cloud provider