SnowPro Specialty: Gen AI Question 26
Single answerCortex LLM FunctionsA retail company stores customer support tickets in a Snowflake table and wants to generate a short summary for each ticket directly in SQL so analysts can query the results in downstream dashboards. The solution must minimize custom infrastructure and keep data processing inside Snowflake. Which approach best meets this requirement using Cortex LLM Functions?
- A
Use the AI_SUMMARIZE_AGG function in a SELECT statement grouped by ticket_id to generate one summary per ticket from the ticket text stored in Snowflake.
- B
Export the ticket text to an external Python service, call a third-party LLM API for summarization, and write the summaries back into Snowflake because Cortex LLM Functions cannot be invoked from SQL.
- C
Create a JavaScript stored procedure that downloads a local open-source model into the warehouse and runs inference on each ticket row.
- D
Use COMPLETE to generate embeddings for each ticket and then convert those embeddings into summaries with a SQL UDF.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use a Cortex LLM Function directly in SQL for summarization so the workflow stays within Snowflake and avoids unnecessary external services. Snowflake Cortex provides SQL-accessible LLM functions for common AI tasks, including text summarization and text generation. For a summarization use case over data already stored in Snowflake tables, built-in summarization functions are the most practical and operationally efficient choice. This matches Snowflake best practices of reducing data movement, simplifying architecture, and using native platform capabilities where possible. By contrast, exporting data to external services increases latency, governance risk, and operational overhead. It is also important to distinguish among Cortex function types: summarization functions are for summaries, COMPLETE is for prompt-based generation, and embedding functions produce vectors for semantic search and similarity use cases rather than natural-language summaries.
- A. Correct.
Correct. Cortex LLM Functions are designed to be called directly from SQL and support common generative AI tasks inside Snowflake. For summarization of text already stored in Snowflake, a built-in summarization function is the most direct and operationally simple approach. Using AI_SUMMARIZE_AGG in SQL aligns with the requirement to minimize custom infrastructure and keep processing inside Snowflake. Grouping by ticket_id is appropriate when the ticket content may be represented by multiple rows or needs aggregation at the ticket level.
- B. Incorrect.
Incorrect. This adds unnecessary external infrastructure and data movement, which conflicts with the stated requirement. A common misconception is that LLM inference must be orchestrated outside Snowflake, but Cortex LLM Functions are available directly in SQL for supported tasks such as summarization and completion.
- C. Incorrect.
Incorrect. Snowflake warehouses do not work by downloading arbitrary local models into the warehouse for custom inference in this way. This option also introduces significant operational complexity and does not reflect how Cortex LLM Functions are intended to be used. Candidates might pick this if they assume Snowflake compute behaves like a generic VM environment.
- D. Incorrect.
Incorrect. COMPLETE is used for text generation from prompts, not for generating embeddings. Embeddings are handled by separate embedding functions. In addition, embeddings are vector representations and cannot simply be converted into summaries with a SQL UDF. This option combines two misunderstandings: misuse of COMPLETE and misuse of embeddings.