Snowflake Cortex Analyst — NL-to-SQL
As of 2026-10-05
What is Snowflake Cortex Analyst?
Cortex Analyst trades setup effort for determinism — a formal YAML semantic model means every question mapping to the same measure always produces the same SQL, which is a compliance property in regulated reporting.
What it is
Cortex Analyst is Snowflake's native text-to-SQL capability (Snowflake's documentation now recommends transitioning to Cortex Agents, which it says supports every Cortex Analyst capability with higher answer quality), designed so that every natural-language question a business user asks maps to SQL through a formally authored semantic model rather than through free-form inference by the underlying language model. That single architectural choice — a declared semantic model instead of loose hints — is both Cortex Analyst's core strength and the main source of the effort required to deploy it well.
Why it matters: the semantic model is typically a YAML file, or a Snowflake-hosted semantic model object, that explicitly declares the tables involved, the dimensions available for filtering and grouping with their business-facing labels, the measures with their exact aggregation formulas, the join relationships between tables, and any fiscal-calendar or time-intelligence rules the business needs. When a user asks a question such as what revenue looked like by region in the second quarter, Cortex Analyst does not ask the model to invent an interpretation; it matches the question against the declared measure, dimension, and time definitions and generates SQL that implements exactly those mappings. Because the model is not guessing at metric formulas or join paths, two different phrasings of the same underlying question reliably produce the same SQL and the same answer.
Why it matters
- Unlike Genie's free-text hints, Cortex Analyst forces the semantic-model author to declare exact aggregation formulas and join paths upfront.
- That determinism matters most for regulated finance/compliance reporting, where the same question phrased differently must return the same answer every time.
- The semantic model itself is the deployment bottleneck — accurately declaring every measure's formula for a replicated SAP GL dataset is the hard part.
Key points
- Cortex Analyst is Snowflake's native text-to-SQL: every question maps to SQL through a formally authored semantic model, not through free-form inference by the model.
- The semantic model (a YAML file or a Snowflake-hosted object) declares tables, dimensions with business labels, measures and their aggregation rules.
- It trades setup effort for determinism — the same question on the same measure always yields the same SQL, which is a compliance property in regulated reporting.
- Budget the semantic-model authoring as the main cost of the project; the query interface itself is the cheap part.
- The semantic model YAML spec is capped at 1 MB with a recommended ceiling of 50-100 columns — plan domain-scoped models rather than one enterprise-wide file.
- Snowflake is rolling out 'semantic views' as a native schema object, moving the semantic model toward a first-class, versionable database object rather than an external YAML upload.
- Unlike Joule's NL query in Datasphere, where the entity model and the semantic model are the same artefact, Cortex Analyst's semantic model is a separate build effort — the trade-off is a model that works over any Snowflake table, SAP-sourced or not.
- Run SNOWFLAKE.CORTEX.VALIDATE_SEMANTIC_MODEL against every model before deployment and gate any change to it through the same CI review a schema migration would get.
Terms used on this page
- Semantic model (Cortex Analyst)
- A YAML file, capped at 1 MB, declaring tables, dimensions, measures, aggregation formulas and join paths — the artefact Cortex Analyst maps every natural-language question against.
- Semantic view
- Snowflake's newer, native schema-object form of the semantic model, moving it toward a versionable, governed database object rather than an externally uploaded YAML file.
- VALIDATE_SEMANTIC_MODEL
- A Snowflake Cortex function that checks a semantic model YAML for broken joins, invalid SQL and structural errors before deployment — the recommended pre-launch and CI gate.
- Time intelligence rule
- An explicit declaration inside the semantic model mapping fiscal periods (e.g. 'Q1') to the correct posting-period boundaries, rather than defaulting to calendar-month logic that can silently diverge from an SAP fiscal calendar.
- Determinism (NL-to-SQL)
- The property that the same business question, phrased differently, always produces the same SQL and the same answer — guaranteed by a formally declared semantic model rather than free-form LLM inference.
- Row-level SCD filter
- A declared filter (e.g. valid_to = '9999-12-31') that tells the semantic model which rows of a slowly-changing-dimension table count as 'current', preventing double-counting on replicated SAP master data.
Sources
- Snowflake — Cortex Analyst docs
- Snowflake Docs — Cortex Analyst semantic model specification
- Snowflake Quickstarts — Semantic file generation for Cortex Analyst
- Snowflake Developers — Getting Started with Cortex Analyst
- Snowflake Docs — YAML specification for semantic views
- Snowflake Docs — Snowflake AI (Cortex) pricing
- Snowflake docs — Semantic views overview (native schema object; usable with Cortex Analyst REST API and Cortex Agents)
- Snowflake release note 30 Sep 2026 — Semantic Studio (General availability)
- Snowflake docs — Cortex Analyst REST API (how semantic views/models are referenced in requests)
- Snowflake docs — Cortex Analyst routing mode (selecting among semantic models/views at query time)
- Snowflake docs — Semantic view verified query repository (verified queries to improve accuracy)
- Snowflake docs — Semantic View Autopilot (assisted semantic view generation)
- Snowflake docs — About SAP and Snowflake (zero-copy SAP connector; relevance to SAP-sourced semantic models)
- Snowflake release note 16 Sep 2026 — Cortex Agents object enhancements (GA)
Full card available to members. What the full card adds: the full decision framework · the SAP vs Snowflake / Databricks / Fabric comparison · the common pitfalls and their fix · the cheat sheet · the architecture schemas · the code blocks · the facts worth quoting.