AI for Business

From analytics engineer to context engineer: dbt Labs cuts AI token costs by 98%

Most companies are taking shortcuts in their enterprise AI rollouts, falling into a classic trap that data teams already know well. Wiring AI directly to vendor-provided MCPs and source data...

Share:

Most companies are taking shortcuts in their enterprise AI rollouts, falling into a classic trap that data teams already know well. Wiring AI directly to vendor-provided MCPs and source data providers is collectively costing billions in token consumption, vendor API charges, and lost data ownership and portability.

At dbt Labs, the team initially did the same. They used vendor MCPs until they discovered how significant the hidden costs were. That's when they realized the most efficient, scalable way to connect AI to data was to centralize data and engineer context directly within their data warehouse. This gave them a massive opportunity to own their AI's context layer and expand their data team's remit.

When Claude rolled out, one of the top user groups was sales connecting to Gong, Salesforce, and other rich context sources to analyze deals. When GTM teams requested customer insights to prevent churn and identify high-value accounts, the company allowed them to analyze Gong data by connecting AI agents directly via the native MCP. With hundreds of salespeople using this data many times a day, costs added up quickly. Analyzing a single call consumed up to 50,000 tokens - $0.25 in token cost just for AI to read a single transcript. With 500M+ tokens worth of Gong transcript data available, total AI spend went up significantly at scale.

The team decided to ingest raw Gong data into their data warehouse and use data modeling to summarize each call. By actively context engineering the transcript data to eliminate noise and extract signal, they shrank data volume by 20x and slashed token consumption on a 60-minute call from tens of thousands to just a few hundred tokens. Serving call transcripts from warehouse summaries dropped token costs by roughly 98% while maintaining or improving context quality.

Before AI, working with text data at meaningful scale required either simple and ineffective regex techniques or advanced statistics and data science. Maintaining complex transformations for qualitative data sources like call recordings or support tickets was not feasible. Now, previously ignored data sources can form some of the most useful agent context.

The approach follows four principles: compress data to the smallest relevant form, enrich it by joining related information, describe what it means and when it's applicable, and govern what each agent can see. The data team models the context once, and every tool and agent reads from the same trusted context layer. The analytics engineer is now the context engineer.

This happens without materially changing the data stack. Fivetran moves data into the warehouse, and dbt handles transform logic. Warehouse-native AI functions like Snowflake Cortex, BigQuery, and Databricks equivalents can be executed as part of dbt models. Raw text fields, spreadsheets, and unstructured files like PDFs become queryable, retrievable context.

Best practices emerging include: don't aggregate context - generate it using warehouse-native AI; use one shared, structured, governed context layer; read once and write many - do the expensive LLM read once in batch; and maintain context incrementally so agents have current information. The data team now owns AI and becomes the mission-critical team for the next era of businesses.

Source: dbt Labs Blog

Ready to Modernize Your Business?

Get your AI automation roadmap in minutes, not months.

Analyze Your Workflows →