AIEmail Module Overview (aiemail)
The aiemail package serves as the primary ingress point for email-based automation and support ticketing.
Key Features
- IMAP Ingestion: Connects to configured mailboxes to read incoming emails.
- Support Agent Integration: Routes customer support emails to specialized agents (e.g., the "SupportAgent" persona).
- NOC Alert Extraction: Acts as the feeder for
noc_intelligence.goby identifying infrastructure alerts from monitoring systems. - Email Summarization: Triggers the
aiemailsummarypackage to create daily digests of inbox activity.
Key Files
aiemail/aiemail.go: IMAP connection and initial parsing logic.aiemailsummary/aiemailsummary.go: Logic for batch processing and summarizing emails.
Integration Flow
- Polling: The module periodically polls the IMAP server.
- Parsing: Extracts headers, sender, subject, and body (handling text/html and multipart).
- Routing:
- If the sender matches a known monitoring tool, it calls
assistant.RecordNOCAlert. - Otherwise, it may package the email and send it to the
assistantmodule to draft a reply or summarize the content.
- If the sender matches a known monitoring tool, it calls
Guidance for AI Agents
- NOC Alerts: You will rarely interact directly with this module. Instead, you will receive the processed output of this module via the
noc_intelligencesystem. - Email Drafting: When asked to draft an email response, ensure the tone matches the corporate persona (e.g., Sysafe or Delicious) and do not include markdown formatting, as standard emails are plain text or HTML.