A design pattern called 'PowerOf2' (PO2) is presented for using dbt as the core deployment engine for Snowflake Cortex AI services — specifically Cortex Agents, Cortex Search, and Semantic Views. The pattern leverages dbt models (with a new 'semantic_view' materialization) and dbt macros to manage AI service creation and modification alongside data objects in a single project. Key advantages include decoupling agent specs from DDL, parameterized deployments, Create-vs-Alter branching logic via Jinja, version control of all assets in one place, and reduced CI/CD complexity. The pattern is positioned as a third alternative to direct SQL scripts or REST API approaches, with concrete code examples and links to a reference GitHub repo.

14m read timeFrom medium.com
Post cover image
Table of contents
‘PowerOf2’Get Chinmayee Lakkad’s stories in your inboxAdvantagesConclusion

Sort: