Agent context
Google Gmail models
4 SQL models that turn the raw Google Gmail tables into the reports people ask about. Deploy them in Weld and your agent queries the definitions behind every number.
How the set is built
- 4Raw tables
- 4Staging
- 5Core
- 4Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- Correspondents monthlyWho the mailbox talks to, per month: messages received from and sent to each address.grain: one row per month x correspondent address · 4 raw tables
- Email volume dailyHow much mail the mailbox sends and receives per day, and with how many people.grain: one row per day (UTC) x direction (sent, received) · 4 raw tables
- MessagesOne row per email with what every report needs: direction, sender, recipients, subject and position in its thread. The base for the other Gmail models, and useful on its own.grain: one row per message (drafts excluded) · 4 raw tables
- Response timesHow long received email waits for a reply from this mailbox.grain: one row per received message that opens a wait: the first received message in a thread after the start or after the mailbox's last reply · 4 raw tables
- Weld or dbt
- The same SQL in both dialects. Sync the folder with GitHub Sync, or copy the dbt models into your project.
- Check before you rely on it
- Reconcile a month against Google Gmail's own reports first. Each model's notes say what the synced data can and can't support.
Connect Google Gmail.
Your agents start with context.
Sync Google Gmail to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.