Snowflake for Gen AI · Topic 9 of 13
Cortex Analyst Capabilities: Semantic Views, Autopilot, YAML, Verified Queries and Instructions
Cortex Analyst capabilities: semantic views, Semantic View Autopilot, the YAML specification, verified queries and custom instructions for accuracy.
- 4 min
- Semantic view = logical tables, relationships, facts, dimensions, metrics; schema level object.
- Autopilot builds a view from a description plus optional example SQL, Tableau, Power BI or YAML.
- Verified query = question plus SQL; custom instructions = rules for SQL generation and categorization.
What it is
Cortex Analyst is only as good as the semantic layer behind it. This page covers how that layer is built and tuned: the semantic view itself, the Autopilot wizard that drafts one, the YAML that describes it, verified queries that pin known good answers, and custom instructions that steer the model.
How it works
Semantic views
A semantic view is a schema level object that stores business concepts next to the physical data. Its parts are:
| Part | Meaning |
|---|---|
| Logical tables | Business entities such as customers or orders, mapped to physical tables |
| Relationships | Joins between logical tables on shared keys |
| Facts | Row level attributes, often the building blocks of metrics |
| Dimensions | Categories used to group and filter |
| Metrics | Aggregated measures such as total revenue |
You create one with CREATE SEMANTIC VIEW, and manage it with ALTER, DESCRIBE, DROP and SHOW SEMANTIC VIEWS. Because it is a schema object, ordinary grants, sharing and RBAC apply, which the older stage file could not offer. You can query a semantic view with SELECT, use it from the Cortex Analyst REST API, or add it as a tool for a Cortex Agent. Semantic Studio in Workspaces, with Cortex Code assistance, is the place to refine and deploy views.
Semantic View Autopilot
Autopilot is an AI assisted wizard in Snowsight (Workspaces, Add new, Semantic View). You give a location, a name, a description of the view's purpose and at least one table or view with its columns. It then generates logical tables, relationships and metrics so you do not write the YAML by hand.
- Optional context: example questions with SQL, a Tableau file, a Power BI file, or an existing YAML or legacy semantic model YAML.
- Options: include sample column values and AI generated descriptions.
- Sizing guidance: fewer than 10 tables or views to start and no more than 50 columns.
- Privileges: CREATE SEMANTIC VIEW on the schema, USAGE on the database and schema, SELECT on the sources.
Autopilot covers creation only. You refine and deploy the result afterward in Semantic Studio or by editing the YAML.
A scenario where analysts already have a Tableau or Power BI model and want Analyst fast points to Autopilot, which can ingest those files.
YAML specification
The semantic layer can be described in YAML. In the legacy semantic model format, the file sits on a stage and Cortex Analyst reads it through the semantic_model_file parameter, so the caller needs READ on the stage. A semantic view has its own YAML specification that mirrors the same parts: logical tables, relationships, facts, dimensions and metrics. YAML is useful for version control and for moving a design between environments, and Autopilot can accept it as input.
The stage based semantic model YAML is legacy. New work should use a semantic view.
Verified queries
A verified query is a trusted pair: a natural language question and the exact SQL that answers it. When a user asks the same or a similar question, Analyst can reuse the verified answer, and the response reports which verified query was used in its confidence information. Use them for the questions that matter most or that Analyst gets wrong, such as a metric with a tricky filter. They are the strongest tool for fixing a repeated wrong answer because you control the SQL.
Custom instructions
Custom instructions are text rules inside the semantic view that guide SQL generation and question categorization. Typical rules are business conventions such as "fiscal year starts in February" or "treat cancelled orders as excluded unless asked". Use them for general rules, and use verified queries for specific questions.
| Need | Use |
|---|---|
| Define a metric or relationship | Semantic view |
| Draft a view quickly from existing assets | Autopilot |
| Fix one recurring wrong answer | Verified query |
| Apply a rule to all questions | Custom instructions |
| Keep the model in source control | YAML specification |
Common mistakes
Adding verified queries for rules. A general convention belongs in custom instructions.
Starting with every table. Autopilot guidance is fewer than 10 tables and no more than 50 columns.
Expecting Autopilot to maintain the view. It creates; refinement happens in Semantic Studio or YAML.
Keeping new work in stage YAML. Semantic views have native RBAC and sharing.
Forgetting the privilege. CREATE SEMANTIC VIEW is needed on the schema.
What to remember for the exam
- Semantic view = logical tables, relationships, facts, dimensions, metrics; schema level object.
- Autopilot builds a view from a description plus optional example SQL, Tableau, Power BI or YAML.
- Verified query = question plus SQL; custom instructions = rules for SQL generation and categorization.
- Stage YAML is legacy; semantic views are recommended.
Check yourself
How do you fix one question that Analyst keeps answering wrongly?
Add a verified query with the correct SQL for that question.
Which feature drafts a semantic view from a Power BI file?
Semantic View Autopilot.
Why prefer a semantic view over a stage YAML file?
It is a schema object with native RBAC, sharing and derived metrics.
Topic 9 of 13 in Snowflake for Gen AI
Test yourself on Snowflake for Gen AI
The full Snowflake GES-C02 question bank has 585 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.