SQL-first AI: bringing BigQuery AI into your dbt project
Google Cloud on wiring BigQuery's AI SQL functions into dbt pipelines, from sentiment scoring to LLM-generated product briefings.
Overview
Demonstrates integrating BigQuery AI functions directly into dbt projects (AI.GENERATE, AI.CLASSIFY, AI.SCORE) to turn unstructured logs into actionable insights within SQL workflows, covering cost optimization, data quality via dbt tests, and managing LLM latency.
What you'll take away
- 01
BigQuery's AI.GENERATE and its managed functions (AI.IF, AI.CLASSIFY, AI.SCORE, AI.AGG) let a dbt model call an LLM directly from a SQL SELECT statement, no separate Python pipeline required.
- 02
The first rule for production: never run an AI function inside a full refresh — wrap the logic in an is_incremental() block so only new rows get sent to the model.
- 03
Pairing BigQuery's output_schema parameter with standard dbt tests like not_null and accepted_values catches bad AI output in staging before it reaches a mart.
Session speakers
Alicia Williams
GoogleJobin George
Google