Pro · Lesson 12 of 13

Cortex AI

AISQL functions, Cortex Search, Cortex Analyst, and Cortex Agents, with region and preview limits.

Sign in to save your place.

Picture it this way

Cortex is a specialist sitting next to the warehouse. AISQL functions are sticky notes you can call from SQL, such as summarize this review. Cortex Search is a librarian for unstructured text. Cortex Analyst writes SQL from a question, using a semantic model you curate so it does not guess your column names. An agent is a coordinator that can ask the analyst and the librarian, then answer. None of them are available just because the account exists.

AISQL functions

Snowflake Cortex AI Functions are SQL functions, also callable from Python, for tasks such as completing a prompt, summarizing, translating, sentiment, and embeddings. The AISQL page says they are available in select regions. Functions that are not marked Preview are generally available. Preview functions are Preview AI Features. Check each function before you put it in a pipeline.

The role needs the USE AI FUNCTIONS privilege and a database role such as CORTEX_USER or AI_FUNCTIONS_USER. The docs say the functions are built for throughput over many rows. For one interactive call, Snowflake points you at the REST API instead.

AI features bill AI Credits, which are separate from Platform Credits and do not follow the same edition discount. Warehouses, storage, and data transfer stay on Platform Credits. Read the current consumption table. Do not reuse an example price from the docs as your contract price.

SELECT SNOWFLAKE.CORTEX.SENTIMENT('The load finished and the dashboard matched.');

Cortex Search and Cortex Analyst

Cortex Search is a managed search service over text you already store in Snowflake. The edition matrix lists it for every edition, and the service still has to be available in your region. A search service has a target lag because it refreshes an index. It is not a result cache.

Cortex Analyst answers natural-language questions about structured data through a REST API. You give it a semantic model so table and column meaning is explicit. Snowflake's Analyst page says to move applications to Cortex Agents, which include Analyst's abilities. Analyst is natively available in a short region list that includes AWS us-east-1, us-west-2, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-2, AWS US East Commercial Gov, Azure East US 2, and Azure West Europe. Other regions need cross-region inference, which you turn on. The docs suggest AWS US regions when you have a choice.

Cortex Agents, and what is still limited

Cortex Agents became generally available on 4 November 2025. An agent plans a task, calls tools, and answers. The documented tools include Cortex Analyst for structured data and Cortex Search for unstructured data. Agents are still subject to region availability and to the privileges above.

Analytical search is a separate agent capability for questions that need counts or trends across many documents. It is off unless you set it on that agent. The analytical-search page is the availability note to read before you enable it. Do not describe it as generally available unless that page currently says so.

If a function or an agent call fails with a region error, the lesson is the error. Cross-region inference is the documented switch for several Cortex features. It sends the request to a region where the model exists. Turn it on only if that data movement is allowed for the table you are querying.

Preview means preview

A function without a Preview label can be used in production. A function, region, or agent option that the docs still mark as preview can change or disappear. This course will not list a model name as the one you should fine-tune. Model menus move.

Three ways to use AI on your data

Run a model on each row, search documents, or let an agent choose which of those to use.

  1. Your tablesTickets, reviews, documents
  2. AI SQL functionsA model applied row by row
  3. Cortex SearchAn index over text
  4. Cortex AgentChooses a tool per question

Step 1 of 3AI SQL functions such as AI_CLASSIFY run a model on each row straight from SQL. You pay for the tokens processed.

SELECT AI_CLASSIFY(ticket_text, ['billing', 'bug', 'other']) FROM tickets;

Lab: one AISQL call, then stop if the region says no

Run this only after the role can use AI functions. If Snowflake returns a region or privilege error, stop. That is a real result. Do not route the column to another region until you know the data is allowed to move. There is nothing to install with pip for this statement.

USE WAREHOUSE LEARN_WH;
SELECT SNOWFLAKE.CORTEX.SENTIMENT(
  'The warehouse suspended and the trial balance survived.'
) AS mood;

Concept summary

Knowledge check

Are Cortex AI Functions in every Snowflake region?

What became generally available on 4 November 2025?

How are Cortex calls billed relative to a warehouse?

Official sources

Checked against Snowflake documentation in October 2026. Product behavior still depends on your edition, cloud, and region.