dbt + Bruin AI Data Analyst
Import warehouse schemas
1. Identify your dbt schemas
You need the actual warehouse schema names. If you used the reference contoso project's schema convention, they're:
contoso_dbt_raw- what dlt loadscontoso_dbt_staging-stg_*modelscontoso_dbt_reports-rpt_*models
If you're not sure what your dbt project lands as, check dbt_project.yml. The full schema name is <target.schema>_<+schema> by default, or just <+schema> if you've overridden generate_schema_name (the contoso project does).
2. Run the import
From the dbt project root, point the import at your context/ pipeline folder. The --schemas flag is repeatable for BigQuery - pass it once per schema:
bruin import database \
--config-file context/.bruin.yml \
--connection contoso_dbt_bq \
--schemas contoso_dbt_raw \
--schemas contoso_dbt_staging \
--schemas contoso_dbt_reports \
context
For Postgres, Redshift, or ClickHouse, use --schema (singular) once per run:
bruin import database \
--config-file context/.bruin.yml \
--connection contoso_dbt_pg \
--schema contoso_dbt_staging \
context
Note: The trailing positional argument is the pipeline path, not the project root. That's
contextin our setup - the directory containingpipeline.yml.
3. Inspect what was generated
ls context/assets/
You should see one folder per schema, each containing one .asset.yml per table:
context/assets/
├── contoso_dbt_raw/
│ ├── customers.asset.yml
│ ├── orders.asset.yml
│ └── ...
├── contoso_dbt_staging/
│ ├── stg_customers.asset.yml
│ └── ...
└── contoso_dbt_reports/
├── rpt_revenue_by_segment.asset.yml
└── ...
Open one - they look like this:
name: contoso_dbt_reports.rpt_revenue_by_segment
type: bq.source
columns:
- name: segment_id
type: STRING
- name: category_name
type: STRING
- name: year
type: INT64
- name: revenue_usd
type: NUMERIC
No descriptions, no tags, no checks yet - just structure. That's by design. The AI enhance step in the next chapter is what fills in the meaning.
4. Filter out loader-internal tables
If your raw schema was loaded by dlt, Fivetran, or Airbyte, the import will include their bookkeeping tables. They're not useful as agent context - drop them before enhancing so Claude doesn't waste time describing _dlt_pipeline_state:
# dlt
find context/assets -name "_dlt_*.asset.yml" -delete
# Airbyte
find context/assets -name "_airbyte_*.asset.yml" -delete
# Fivetran
find context/assets -name "fivetran_*.asset.yml" -delete
Run only the one(s) that match your loader. The contoso project uses dlt, so the first command applies.
5. (Optional) Validate the structure
Even before enhancement, you can sanity-check the YAMLs:
bruin validate --config-file context/.bruin.yml context
You should see one line per asset and a summary like:
✓ Successfully validated 40 assets across 1 pipeline, all good.
If you see parse errors, re-run the import for that schema - partial files can occasionally be left behind if the introspection is interrupted.