Bruin AI Step 4 of 4

Build an AI Context Layer

1. Run the enhancement

bruin ai enhance ai-analyst --model claude-sonnet-5

Pass --model on the first run rather than discovering you need it. The CLI's built-in default for Claude Code is claude-sonnet-4-20250514, which has reached end of life, so the bare command currently fails on every asset with There's an issue with the selected model. Name a current model and it works. On Codex or OpenCode use that provider's model name instead - --model gpt-5-codex, for example.

You can point it at a whole pipeline folder, one schema folder, or a single file:

bruin ai enhance ai-analyst/assets/ecommerce                    # one schema
bruin ai enhance ai-analyst/assets/ecommerce/orders.asset.yml   # one table

Start with a single file if you want to see the shape of the output before committing minutes of compute.

If several AI CLIs are installed and you want to choose, add --claude, --codex, --opencode, or --cursor.

Each asset moves through the same stages and the command narrates them:

[orders.asset.yml] Step 1/4: Filling columns from database...
[ecommerce.orders] Step 2/4: Enhancing asset with AI...
[ecommerce.orders] Step 3/3: Validating asset...
✓ Successfully validated 'ai-analyst/assets/ecommerce/orders.asset.yml', all good.
[ecommerce.orders] ✓ Enhanced 'ecommerce.orders'

(The step numbering in that output is inconsistent, which is cosmetic.) What actually happens per asset:

  1. Fill columns - re-read the schema and add any column missing from the file.
  2. AI enhancement - query the warehouse for column statistics, then hand schema plus statistics to your AI CLI to write descriptions, checks, and tags.
  3. Format - normalise the YAML.
  4. Validate - parse the result. If the AI produced something invalid, the file is reverted rather than left broken.

It prints a diff per asset as it goes, then a summary:

  ✓ customers.asset.yml
  ✓ orders.asset.yml
  ✓ order_items.asset.yml

Enhancement complete: 3/3 assets succeeded

Expect a few minutes for 15-20 tables and 10 minutes or more for 50+. Five assets are processed in parallel by default.

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Accept cookies to load it.