Overview
Implement comprehensive email monitoring for AgentMail and Gmail with urgent item detection.
Requirements
AgentMail Integration
Account: jsirish@agentmail.to
Features:
- Check for new messages every 30 minutes
- Summarize new messages
- Flag action items
- Auto-categorize (urgent, normal, newsletter, notifications)
- Thread tracking
API:
from agentmail import Client
client = Client()
messages = client.inboxes.messages.list(inbox_id='jsirish@agentmail.to')
Gmail Integration
Features:
- Monitor Jason's Gmail for urgent items
- Search queries:
is:unread newer_than:1h is:important
from:client@domain.com newer_than:4h
label:urgent newer_than:1d
- Sender priority list (clients, partners, family)
- Keyword detection (urgent, asap, emergency, deadline)
API:
gog gmail search 'is:unread newer_than:1h is:important' --json
Urgent Email Detection
Priority Senders:
- Clients (from CRM)
- Team members
- Family/contacts
- Service providers
Priority Keywords:
- urgent, asap, emergency, deadline, today, tomorrow
- meeting, call, review, approval needed
- invoice, payment, contract
Alert Thresholds:
- Priority sender + unread > 15 min → Alert immediately
- Keyword match + unread > 30 min → Alert
- Normal email → Batch in next briefing
Email Triage Workflow
- Fetch new emails since last check
- Categorize by sender and content
- Score urgency (0-100)
- Alert if score > threshold
- Summarize in next briefing
- Track in memory for follow-up
Deliverables
Acceptance Criteria
Technical Notes
- Use
agentmail Python SDK
- Use
gog CLI for Gmail
- Store state in
memory/email-state.json
- Cache sender priorities
- Log all alerts for review
Relates to #182
Overview
Implement comprehensive email monitoring for AgentMail and Gmail with urgent item detection.
Requirements
AgentMail Integration
Account:
jsirish@agentmail.toFeatures:
API:
Gmail Integration
Features:
is:unread newer_than:1h is:importantfrom:client@domain.com newer_than:4hlabel:urgent newer_than:1dAPI:
gog gmail search 'is:unread newer_than:1h is:important' --jsonUrgent Email Detection
Priority Senders:
Priority Keywords:
Alert Thresholds:
Email Triage Workflow
Deliverables
Acceptance Criteria
Technical Notes
agentmailPython SDKgogCLI for Gmailmemory/email-state.jsonRelates to #182