Skip to main content

Execute DBT

ekai executes the generated DBT project directly in your connected data warehouse. Approve builds through the chat experience, then materialize models and run tests.

Prerequisites

Complete the AI Modeling & Build step to generate the DBT project artifacts.


DBT Project Tab​

The DBT PROJECT tab in AI MODELING & BUILD shows:

  • File tree — Navigate project structure
  • Code view — SQL and YAML with syntax highlighting
DBT project view

Running DBT​

Execution happens through the chat experience — not a separate re-run button. The agent scaffolds the project, proposes a materialisation plan, and asks you to approve a real dbt build against your warehouse.

Approve dbt build in the chat experience

Approve in chat​

When marts pass the schema gate, the agent prompts you to proceed. Typical choices:

OptionWhat it does
ApproveRuns dbt build in the connected warehouse (materialize models + run tests)
Decline — skipSkips materialisation and notes the deferral
DeferLeaves the decision open without declining
Something elseFree-text guidance for the agent

Execution process​

Once approved, ekai runs the build in your warehouse:

  1. Compile — Generate SQL from models
  2. Execute — Materialize transformations
  3. Test — Run data validation tests
  4. Report — Surface results, then continue toward publish via chat

The Tasks list in chat tracks progress (inventory → scaffold → build marts → approve → run → validate → publish).


Execution Status​

Success​

When the build finishes, the agent reports that materialization is complete:

Materialization complete

Chat then continues toward publishing for the connected platform.

Summary in chat​

Models built:
✓ stg_tpch__line_items
✓ stg_tpch__orders
✓ fct_line_items
✓ fct_orders
✓ dim_customers
✓ dim_parts

Tests passed: 89/89

Chat progress during execution​

While the build runs, the agent shows live task status and tool activity (commands, file writes, test triage). You can steer with follow-up messages if something needs adjustment before publish.


Handling Errors​

Common Error Types​

ErrorCauseResolution
Compilation ErrorSQL syntax issueAI auto-fixes and retries
Test FailureData quality issueReview test results in chat
Permission ErrorMissing warehouse accessCheck connection credentials
TimeoutLarge data volumeIncrease warehouse size

Auto-Fix Capability​

ekai's AI Agent can automatically fix common errors:

"I encountered a compilation error in stg_customers.sql. The issue was a missing comma in the column list. I've fixed the error and re-running the build."


Incremental Execution​

For subsequent runs (requested through chat):

ModeCommandWhen to Use
Full Refreshdbt run --full-refreshFirst run, schema changes
Incrementaldbt runRegular updates
Specific Modeldbt run -s model_nameTesting single model

Results Storage​

After successful execution:

ArtifactLocation
Transformed TablesYour warehouse (configured schema)
Execution Logsekai logs directory
Test ResultsDBT test artifacts
DocumentationData catalog updated

Warehouse Requirements​

Ensure your connected warehouse has:

RequirementDetails
Write AccessSchema where models will be created
ComputeSufficient warehouse size for transformations
StorageSpace for materialized tables
Read vs Write Access

Schema Agents only need read access. Semantic Models need write access to execute DBT and create tables.


Next Steps​

  • Code Sync — Push to Git repository
  • Publish — Publish via chat to Cortex Analyst, Genie, or BigQuery Data Agent