SnowPro Specialty: Gen AI Question 152
Single answerCortex AnalystA retail company is building a conversational analytics assistant for business users. The team wants users to ask questions such as "What were online sales in the Northeast last quarter?" and have the application return trustworthy SQL-generated answers from Snowflake. During testing, the team notices that the assistant sometimes uses the wrong revenue field and occasionally joins to the wrong geography table because similar column names exist across multiple schemas. They want to improve accuracy without giving the model unrestricted access to all database objects. Which approach should the team take when implementing Cortex Analyst?
- A
Create a semantic model that explicitly defines the business metrics, dimensions, relationships, and allowed tables for the analyst to use
- B
Grant the application role access to every table and view in the database so Cortex Analyst has more context to choose from
- C
Replace Cortex Analyst with Cortex Search so the system can retrieve matching rows instead of generating SQL from natural language questions
- D
Store table descriptions in a prompt and rely on a larger LLM to infer the correct joins and measures at runtime
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use a semantic model that constrains and describes how Cortex Analyst should interpret business questions against structured data. In practice, Cortex Analyst works best when teams curate the available tables and define business semantics such as measures, dimensions, and relationships so the service can generate accurate SQL. This is especially important when multiple schemas contain similar columns or overlapping entities, because unrestricted object access can lead to incorrect joins or field selection. From a governance and accuracy standpoint, the recommended pattern is to expose only the relevant data objects, model the business logic explicitly, and let Cortex Analyst generate SQL within that controlled semantic layer. This aligns with Snowflake guidance for using Cortex Analyst for natural-language-to-SQL analytics rather than relying on broad database access or generic prompting.
- A. Correct.
Correct. Cortex Analyst is designed to answer natural language questions over structured data using a semantic model. Defining metrics, dimensions, joins/relationships, and the approved data objects in that model reduces ambiguity and guides SQL generation toward the intended business logic. This is the recommended way to improve reliability and governance for conversational analytics use cases.
- B. Incorrect.
Incorrect. Expanding access to every table and view usually increases ambiguity rather than reducing it. More similarly named objects make it easier for the system to select the wrong source. It also weakens governance by exposing unnecessary data. Best practice is to limit the model to curated, relevant objects through the semantic model and appropriate privileges.
- C. Incorrect.
Incorrect. Cortex Search is intended for retrieval over unstructured or text-centric content, not for governed semantic SQL generation over structured analytics models. The scenario requires users to ask business questions and receive answers based on generated SQL, which is the purpose of Cortex Analyst.
- D. Incorrect.
Incorrect. While prompt engineering and descriptive metadata can help in some AI workflows, relying primarily on a free-form prompt and model inference is less robust than using Cortex Analyst's semantic modeling layer. This approach does not provide the same level of structured control over metrics, relationships, and approved query paths.