Agent context
Intercom models
6 SQL models that turn the raw Intercom 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
- 5Raw tables
- 6Core
- 6Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- Monthly Conversations By Team Extracts monthly conversation data by team from the Intercom integration. It selects the month, team ID, team name, and ticket count from the conversation table. It then joins the conversation table with the team table and groups the results by month, team ID, and team name, ordering them by month and ticket count in descending order.2 raw tables
- Monthly Tickets By TeamExtracts monthly ticket data for each team, including the team ID, team name, and the count of tickets. It uses the Intercom integration and joins the ticket and team tables based on the team assignee ID. The results are grouped by month, team ID, and team name, and ordered by month and ticket count in descending order.2 raw tables
- Monthly Ticket Resolution TimeExtracts the monthly ticket resolution time for a specific integration (intercom). It selects the month, team ID, team name, and average resolution time in days. It joins the ticket and team tables, filters for resolved tickets, groups the results by month and team, and sorts them in descending order by month and ascending order by average resolution time.2 raw tables
- Monthly Tags By ConversationThis SQL template extracts monthly tags by conversation from the Intercom integration. It uses a common table expression (CTE) to join the conversation and conversation_tag tables, and then retrieves the month, tag name, and tag count for each conversation. The results are grouped by month and tag name, and ordered by month in descending order.3 raw tables
- Monthly Average Conversations RatingExtracts the monthly average rating for conversations from the Intercom integration. It selects the truncated month and calculates the average rating for conversations that have a non-null rating value. The results are grouped by month and ordered in descending order.1 raw table
- Count of Tickets By State Extracts the count of tickets grouped by month and ticket state from the Intercom integration. It uses the `date_trunc` function to truncate the `created_at` column to the month level. The result is then ordered by month in descending order, followed by the ticket count in descending order.1 raw table
- 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 Intercom's own reports first. Each model's notes say what the synced data can and can't support.
Connect Intercom.
Your agents start with context.
Sync Intercom to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.