Modeling
Oxygen has a built-in SQL modeling layer that understands dbt project conventions. You can define, compile, and execute layered SQL models directly against any database already connected inconfig.yml — with no separate dbt CLI or Python environment required.
Models live alongside your agents, automations, and apps in the same workspace. Like everything else in Oxygen, they are version-controlled YAML + SQL files that can be edited in the IDE, validated with oxy validate, and deployed through the standard Git workflow.
Project Layout
Place each modeling project in a subdirectory ofmodeling/:
modeling/ that contains a dbt_project.yml.
Configuration
oxy.yml (required)
Create oxy.yml alongside dbt_project.yml to map each dbt target to an Oxygen database:
- Key — the dbt target name as defined under
outputs:inprofiles.yml. - Value — the database name from
config.yml.
profiles.yml must have an entry in mappings. Oxygen reports a clear error listing any unmapped targets on startup.
profiles.yml
Standard dbt profiles work unchanged. Oxygen reads the profile referenced by dbt_project.yml and uses the target: field to select the active output. Place profiles.yml in the project directory or in ~/.dbt/.
type: field must match the Oxygen database type for the mapped target (see Supported Databases).
Supported Databases
Not supported: DuckDB directory sources (
file_search_path), DuckLake, and Domo. DuckDB directory sources are read-only and cannot be used as a model output — use a DuckDB file database (path: /path/to/file.db) instead.
Using Models in Agents
Expose modeling operations to an agent via tool configuration in your.agentic.yml:
dbt_run
Executes models against the configured database. Supports dbt node selectors:
dbt_compile
Resolves Jinja templates and ref()/source() calls to plain SQL without executing anything. Useful for previewing generated SQL before a run.
Available Operations
Initialising a New Project
oxy.yml and a matching database entry in config.yml:
Troubleshooting
oxy.yml not found — oxy.yml must be present next to dbt_project.yml when running models through Oxygen. Run oxy airform debug to confirm it is detected.
Unmapped dbt target — Every key under outputs: in profiles.yml must appear in oxy.yml mappings. The error message lists which targets are missing.
Database type mismatch — The type: in profiles.yml must match the Oxygen database type for the mapped target (e.g. a postgres profile target mapped to a BigQuery Oxygen database will be rejected).
DuckDB directory sources — DuckDB databases configured with file_search_path are read-only and cannot be used as model output. Switch to a file-based DuckDB database (path: /path/to/file.db).
Profiles not found — Oxygen searches for profiles.yml in the project directory first, then in ~/.dbt/. Ensure at least one exists.