The challenge
What the system needed to solve
Surface high-value opportunities from a busy inbox without giving an AI system unrestricted authority to send messages or mutate mail.
The build
Engineering decisions
Implemented incremental Gmail synchronization using provider IDs and bounded scopes.
Created classification, deduplication, status, follow-up, reminder, and action-history workflows.
Added AI summaries and suggested responses while retaining explicit human review before external action.
Protected the public interface with two-factor authentication and kept OAuth credentials and message content out of Git.
Architecture
How the pieces connect
- 1Gmail API
- 2Incremental synchronization
- 3Opportunity store and rules
- 4AI summary/draft assistance
- 5Human-reviewed action
Results
What changed
- Actionable messages are separated from inbox noise and retain a durable follow-up state.
- Synchronization can resume safely without reprocessing the full mailbox.
- The design makes model assistance replaceable while preserving deterministic workflow data.
