Beyond a Reasonable dbt

Trustworthy pipelines for AI agents. How to manage the full Cortex Agent lifecycle (semantic views, agent specs, evaluations, and scheduling) as version-controlled, tested, reproducible code with dbt Projects on Snowflake.

The Case

An AI agent is only as trustworthy as the data and the process behind it. Yet most agents are assembled by click-ops in a UI: no version history, no peer review, no tests, and no reliable way to promote the same thing from dev to prod. When the agent gives a wrong answer, there is nothing to diff and nothing to roll back.

The charge: click-ops agents

  • No version control: changes live only in the UI
  • No peer review: nobody signs off before prod
  • No tests: accuracy is a vibe, not a metric
  • No reproducibility: dev and prod drift apart
  • No promotion path: rebuilding by hand per environment

The defense: agents as code

  • Git-backed: every change diffed and reviewable
  • PR review + CI: builds on dev before merge
  • Measured: evaluations gate on ≥95% correctness
  • One codebase: env.yml targets dev / staging / prod
  • One command: EXECUTE DBT PROJECT rebuilds it all

Exhibits, entered into evidence

5
Phases from questions to production
3
Environments, one codebase
≥95%
Answer-correctness bar to ship
0
Click-ops steps
1
EXECUTE DBT PROJECT to rebuild

The lifecycle, at a glance

1. Sources sources.yml 2. Staging stg_*.sql 3. Semantic View Exhibit A 4. Agent Exhibit B 5. Evaluations The Verdict Ship SI / Teams iterate: inspect trace → fix the right layer → re-run
One dbt project builds every box. The feedback loop is where evaluation scores drive the next improvement cycle.

The proceedings & the exhibits

The Proceedings
The Full Build, Phase by Phase
The five-phase runbook from business questions to a shipped agent (orientation, semantic view, orchestration, response, tools, and the evaluation verdict) with the exact dbt commands to run live.
Enter the courtroom
Exhibit A
The Semantic View
Where accuracy is won or lost: business names, KPIs as metrics, verified queries, the additive AI_SQL_GENERATION and AI_QUESTION_CATEGORIZATION clauses, and the enforced clause order.
Examine the evidence
Exhibit B
The Agent Spec
The three-layer model (orchestration, response, and tool descriptions) plus the four-part tool-description formula that drives routing accuracy, and the failure patterns to watch for.
Examine the evidence
Exhibit C
Cortex Agent Evaluations
How the verdict is reached: the Goal-Plan-Action metrics, the ground-truth dataset, running an evaluation, and iterating to the ≥95% ship bar.
Examine the evidence
Visual
Drop an opening screenshot here, e.g. the Snowsight Workspace with the dbt project open, or the finished agent answering a question in Snowflake Intelligence.

About this deck

Built from the cortex-agents-dbt-project-template (see dbt Projects on Snowflake). The walkthrough mirrors the project's WORKING-SESSION.md runbook; the exhibits draw on its README.md best practices.