Snowflake Cortex AI is a managed AI platform that lets you run LLM inference, translation, summarization, data extraction, and time-series forecasting directly from SQL. You don't need to manage external API keys or build infrastructure — you get AI capabilities inside Snowflake's existing governance and access controls. This article walks through the four pillars — LLM Functions, ML Functions, Cortex Search, and Document AI — with hands-on SQL examples.
Cortex AI is Snowflake's native AI/ML platform and consists of the following four major feature groups.
| Feature Group | Use Case | Invocation |
|---|---|---|
| LLM Functions | Text generation, translation, summarization, extraction | SQL function |
| ML Functions | Time-series forecasting, anomaly detection, classification | SQL function |
| Cortex Search | Hybrid search (keyword + semantic) | Service object |
| Document AI | Data extraction from unstructured documents | Model object |
LLM Functions are built-in functions you can call from a SQL SELECT statement. They all live in the SNOWFLAKE.CORTEX schema and run on Snowflake's serverless compute rather than your warehouse.
Generates text from a prompt using the specified LLM model. There are two invocation styles: chat format (an array of messages) and plain text input.
-- Simple text generation
SELECT SNOWFLAKE.CORTEX.COMPLETE(
'llama3.1-70b',
'List three benefits of Snowflake micro-partitions'
) AS response;
-- Chat format (system / user roles)
SELECT SNOWFLAKE.CORTEX.COMPLETE(
'mistral-large2',
[
{'role': 'system', 'content': 'You are a Snowflake expert.'},
{'role': 'user', 'content': 'Explain the criteria for choosing a clustering key'}
],
{'temperature': 0.3, 'max_tokens': 1024}
) AS response;Translates text into the specified language. If you omit the source language, it is auto-detected.
SELECT SNOWFLAKE.CORTEX.TRANSLATE(
'Snowflake decouples storage and compute for elastic scaling.',
'en', 'ja'
) AS translated;
-- -> Snowflakeは弾力的なスケーリングのためにストレージとコンピュートを分離しています。Automatically summarizes long text. You can run batch summarization across a document column in a table.
SELECT
doc_id,
SNOWFLAKE.CORTEX.SUMMARIZE(content) AS summary
FROM support_tickets
WHERE created_at >= DATEADD(day, -7, CURRENT_DATE());Extracts an answer to a specific question from text. Useful for RAG pipeline post-processing and automatic FAQ generation.
SELECT SNOWFLAKE.CORTEX.EXTRACT_ANSWER(
'Snowflake was founded in 2012 by Benoit Dageville, Thierry Cruanes, and Marcin Zukowski.',
'Who founded Snowflake?'
) AS answer;
-- -> [{"answer": "Benoit Dageville, Thierry Cruanes, and Marcin Zukowski", "score": 0.95}]Returns a sentiment score for text in the range -1 (negative) to 1 (positive).
SELECT
review_text,
SNOWFLAKE.CORTEX.SENTIMENT(review_text) AS score
FROM product_reviews
ORDER BY score ASC
LIMIT 10; -- Top 10 most negative reviewsComparison of the main models available with Cortex AI LLM Functions. Availability varies by region.
| Model | Provider | Parameters | Primary Use Case |
|---|---|---|---|
| llama3.1-405b | Meta | 405B | High-accuracy reasoning, complex tasks |
| llama3.1-70b | Meta | 70B | General-purpose text generation and analysis |
| llama3.1-8b | Meta | 8B | Low-latency processing, classification |
| mistral-large2 | Mistral AI | 123B | Multilingual, code generation |
| mistral-7b | Mistral AI | 7B | Lightweight tasks, real-time |
| snowflake-arctic | Snowflake | MoE 480B | SQL generation, enterprise use cases |
| jamba-1.5-large | AI21 Labs | 398B | Long-context processing |
| gemma-7b | 7B | Lightweight inference, research |
ML Functions are built-in features that let you run time-series forecasting and anomaly detection with SQL alone. Model training and inference happen entirely inside Snowflake — no external tools required.
-- Create a forecasting model
CREATE OR REPLACE SNOWFLAKE.ML.FORECAST sales_forecast(
INPUT_DATA => SYSTEM$REFERENCE('TABLE', 'daily_sales'),
TIMESTAMP_COLNAME => 'sale_date',
TARGET_COLNAME => 'revenue'
);
-- Forecast 30 days ahead
CALL sales_forecast!FORECAST(
FORECASTING_PERIODS => 30,
CONFIG_OBJECT => {'prediction_interval': 0.95}
);-- Create an anomaly detection model
CREATE OR REPLACE SNOWFLAKE.ML.ANOMALY_DETECTION sensor_anomaly(
INPUT_DATA => SYSTEM$REFERENCE('TABLE', 'sensor_readings'),
TIMESTAMP_COLNAME => 'reading_time',
TARGET_COLNAME => 'temperature',
LABEL_COLNAME => '' -- Unsupervised
);
-- Detect anomalies on new data
CALL sensor_anomaly!DETECT_ANOMALIES(
INPUT_DATA => SYSTEM$REFERENCE('TABLE', 'new_sensor_readings'),
TIMESTAMP_COLNAME => 'reading_time',
TARGET_COLNAME => 'temperature'
);Cortex Search is a hybrid search service that combines keyword search with semantic search. You build the search index with CREATE CORTEX SEARCH SERVICE and query it from the REST API or a Python client. The main use case is acting as the retriever in a RAG pipeline.
Document AI extracts structured data from unstructured documents such as invoices, contracts, and forms. You create the model in the Snowsight UI and define the values (fields) to extract. Under the hood, it combines OCR with LLMs, and because data is processed entirely inside Snowflake, it's easy to satisfy security requirements.
-- Document AI model usage example
SELECT
invoice!PREDICT(
GET_PRESIGNED_URL(@docs_stage, 'invoice_001.pdf')
):vendor_name::STRING AS vendor,
invoice!PREDICT(
GET_PRESIGNED_URL(@docs_stage, 'invoice_001.pdf')
):total_amount::NUMBER(10,2) AS amount
FROM DUAL;Privilege design for Cortex AI breaks down as follows.
| Action | Required Privilege | Notes |
|---|---|---|
| Invoking an LLM function | SNOWFLAKE.CORTEX_USER database role | Requires access to the shared SNOWFLAKE database |
| Creating an ML Functions model | CREATE SNOWFLAKE.ML.FORECAST, etc. | CREATE privilege on the schema |
| Creating a Cortex Search service | CREATE CORTEX SEARCH SERVICE | CREATE privilege on the schema |
| Creating a Document AI model | CREATE SNOWFLAKE.ML.DOCUMENT_INTELLIGENCE | Managed in the Snowsight UI |
Every Cortex AI capability runs on Snowflake's service layer or serverless compute. For exam prep, it's important to distinguish LLM functions (which don't consume your warehouse resources) from ML Functions (which do require a warehouse).
Query execution flow:
[User SQL]
|
+- LLM Functions ----> Serverless compute (no WH)
| +- Billing: token-based
|
+- ML Functions -----> User warehouse (WH required)
| +- Billing: credit consumption
|
+- Cortex Search ----> Serverless compute (no WH)
+- Billing: serverless creditsCortex AI
問題 1
Which statement about Snowflake Cortex AI LLM functions is correct?
正解: C
All Cortex AI LLM functions (COMPLETE, TRANSLATE, SUMMARIZE, etc.) live in the SNOWFLAKE.CORTEX namespace and run on Snowflake's serverless compute rather than the user's warehouse. A is wrong because no warehouse is needed; B is wrong because the source language can be omitted (auto-detected); D is wrong because SENTIMENT returns a continuous score between -1 and 1.
Do Cortex AI LLM functions send data outside Snowflake?
No. LLM functions in the SNOWFLAKE.CORTEX namespace (COMPLETE, TRANSLATE, SUMMARIZE, etc.) are all processed inside Snowflake's infrastructure. Data is never sent to external services, and Snowflake's data governance and access controls apply as is. Note, however, that model availability varies by region.
Do I need ML experience to use ML Functions (FORECAST / ANOMALY_DETECTION)?
No. ML Functions are invoked through a SQL interface, so you don't need to tune model hyperparameters or know any ML frameworks. Just point it at a table containing time-series data and Snowflake automatically trains and runs inference. All you need is the CREATE SNOWFLAKE.ML.* privilege and warehouse compute resources.
How should I choose between the available Cortex AI LLM models?
Pick based on the balance between use case and cost. Llama 3.1 405B and Mistral Large suit high-accuracy reasoning and complex tasks. Llama 3.1 8B and Mistral 7B are better for low-latency real-time processing. Snowflake Arctic offers strong cost performance for text generation and shines at enterprise-grade SQL and code generation. Run SHOW CORTEX SEARCH MODELS to see which models are available.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...