Snowflake Cortex and ML Features

Snowflake Architecture

Emily Melhuish

Technical Curriculum Developer, Snowflake

Snowflake Cortex Overview

Snowflake Cortex Overview.png

1 * SNowflake Learning Material
Snowflake Architecture

The problem with unstructured data

cortex_diagram.png

Snowflake Architecture

What is Snowflake Cortex?

cortex_full_overview.png

Snowflake Architecture

Parsing Documents

  • Parsing turns file bytes into structured values SQL can work with (for example, text in a VARIANT column)

SQL

SELECT SNOWFLAKE.CORTEX.PARSE_DOCUMENT(
  @snowy_peak_files_stage,
  'patrol_report.pdf',
  {'mode': 'LAYOUT'}
):content::STRING AS report_text;
  • Result = Structured output (often a VARIANT): Extract text with : and ::
  • PARSE_DOCUMENT = Typical first step for anything that starts with a file
Snowflake Architecture

Cortex SQL Functions: Classify and Translate

CLASSIFY_TEXT

SELECT SNOWFLAKE.CORTEX.CLASSIFY_TEXT(
    'High wind slab observed on north face, area closed',
    ['low', 'moderate', 'high', 'extreme']
) AS severity;

TRANSLATE

SELECT SNOWFLAKE.CORTEX.TRANSLATE(review_text, 'fr','en') AS review_english
FROM snowy_peak_reviews;
Snowflake Architecture

Cortex SQL Functions: Complete and Summarize

COMPLETE

SELECT SNOWFLAKE.CORTEX.COMPLETE(
    'claude-3-5-sonnet',
    'Summarise this patrol report and flag any safety actions required:'
    || report_text
) AS summary;

SUMMARIZE

SELECT SNOWFLAKE.CORTEX.SUMMARIZE(report_text) AS report_digest
FROM snowy_peak_patrol_reports;
Snowflake Architecture

Cortex Search and Cortex Analyst

Cortex Search

  • Runs semantic similarity over text
  • Finds content that means something similar
  • i.e Surface incident reports relating to visibility

Cortex Analyst

  • Translates plain-english into SQL
  • i.e Product manager can ask "Which resorts had the most incidents last year"
Snowflake Architecture

Snowflake ML Lifecycle

Screenshot 2026-05-12 at 1.40.02 pm.png

  • Create a forecast model with CREATE OR REPLACE SNOWFLAKE.ML.FORECAST
  • Call the trained model with CALL my_model!FORECAST() to generate future periods
  • Always check the Snowflake docs for the latest syntax: ML function signatures update regularly
Snowflake Architecture

Let's practice!

Snowflake Architecture

Preparing Video For Download...