
Bruin Academy
Guide
dbt + Bruin AI Data Analyst
Layer Bruin context on top of an existing dbt + warehouse setup so an AI agent can navigate your models, understand your columns, and run real SQL - without touching the dbt project itself.

What
- Add a self-contained Bruin "context layer" alongside an existing dbt project
- Generate one asset YAML per materialized table - staging, marts, and raw - straight from the warehouse
- Give an AI agent the ability to navigate your dbt outputs and run SQL against them with confidence
How
bruin import databaseintrospects the warehouse and creates skeleton asset filesbruin ai enhancefills in descriptions, tags, and quality checks per table and columnbruin query+ Bruin MCP let agents read context and execute SQL using your existing credentials- Reference implementation: contoso-dbt
The dbt half of the stack is treated as a prerequisite - this guide is about the context layer, the piece that turns an already-running dbt + warehouse setup into something an AI agent can use without hallucinating.
Before you start
- A working dbt project with models materialized in a warehouse (BigQuery, Redshift, ClickHouse, or Postgres)
- Bruin CLI installed (
curl -LsSf https://getbruin.com/install/cli | sh) - An AI coding tool installed (Claude Code, Cursor, or Codex)
- Read access to your warehouse (BigQuery
Data Viewer, Postgres/RedshiftSELECT, etc.)
Guide overview
- 1Start From an Existing dbt PipelineA quick recap of the dbt setup this guide assumes - staging models, mart models, and a warehouse already loaded with data.
- 2Create an Isolated Bruin ContextAdd a self-contained context/ directory with its own .bruin.yml and pipeline.yml - so the documentation layer for your dbt project never collides with other Bruin pipelines in the same repo.
- 3Import Your dbt Schemas as AssetsUse bruin import database to introspect every materialized dbt schema and write one .asset.yml per table - raw, staging, and reports - in a single command.
- 4AI-Enhance and Validate the ContextUse bruin ai enhance to fill every asset with descriptions, tags, and quality checks - then bruin validate to make sure nothing got corrupted along the way.
- 5Wire Up the AI AgentAdd Bruin MCP, point your agent at context/assets/, and use bruin query to run SQL with the same credentials your dbt project already uses.
Resources
Get help & contribute