Snowflake Cortex AI Functions for Customer Feedback

Snowflake Cortex AI Functions let you classify, score and summarise customer feedback in SQL, inside your Snowflake account. AI_REDACT strips personal data first, AI_CLASSIFY tags topics, AI_SENTIMENT scores tone and AI_AGG summarises across rows. Snowflake marks some functions as preview, so check each one's status, and pilot on a sample before you scale.

Key Takeaways

  • Run the functions in this order: redact, classify, score sentiment and summarise last.
  • Check each function's preview or generally available status on Snowflake's own pages before you use it in production.
  • AI_CLASSIFY works best with distinct categories: accuracy may drop beyond twenty, and every label and description counts as input tokens on every row.
  • Arabic is not on AI_SENTIMENT's documented language list, so test a labelled sample of your own comments.
  • AI_REDACT is best-effort and documents US PII and some UK and Canadian PII, so test Gulf formats yourself.
  • Store the scored table, and report the NULL share next to every chart.

What are Cortex AI Functions, and which ones suit customer feedback?

Snowflake describes Cortex AI Functions as SQL functions, also available in Python, that run unstructured analytics on text and images. Its overview lists use cases close to marketing work. They include aggregating insights across customer tickets, filtering and classifying content, and sentiment analysis for service improvement.

Four functions do most of the work on a feedback table. Snowflake says some individual functions are Preview Features. It asks you to check each function's status before production use, so check all four before you commit to a design.

FunctionJob in a feedback pipelineDocumented limit to design around
AI_REDACTReplace personal data with placeholders such as [NAME]Supports only US PII and some UK and Canadian PII; input and output together up to 4,096 tokens
AI_CLASSIFYAssign each comment to a topicAt least two categories; accuracy may drop beyond twenty; descriptions up to 25 words
AI_SENTIMENTScore overall tone and tone per aspectUp to ten aspects, each up to 30 characters; 2,048-token context window
AI_AGGSummarise a whole column from one instructionNot subject to context window limits

In what order should the functions run?

Redact first, classify second, score sentiment third and summarise last. We recommend this order because every later step copies whatever is in the text. If a customer's name and phone number reach the classifier, they can also reach the summary that goes into a slide.

Summarising last has a second benefit. You can group the comments by topic and summarise each group. That gives the product team one short read per theme instead of one vague paragraph.

How should I design categories for AI_CLASSIFY?

The function takes your text and an array of categories, and returns an object with a labels array. Single-label output is the default, and setting output_mode to 'multi' allows more than one label per comment. Snowflake says categories are case sensitive and recommends mutually exclusive, descriptive labels.

Overlap is the design fault we would look for first. A comment about a late parcel that then took several emails to resolve belongs to both delivery and support. Either allow multi-label output, or write each label description so it says what the neighbouring labels exclude.

Descriptions can run to 25 words, and a task description can run to 50. Our suggestion is to treat the category list as a versioned asset, because labels and descriptions feed the model on every row. A reworded description can move comments between topics, so re-run a sample whenever the list changes.

When is AI_SENTIMENT the better tool?

Use it when the question is how people felt, not what they wrote about. It returns an overall result, and if you pass up to ten aspects you also get one for each: positive, negative, neutral, mixed or unknown. Unknown means the aspect was not mentioned.

Keep unknown out of your averages. It is missing data, and counting it as neutral drags every aspect towards the middle. The function is optimised for inputs of 2,048 tokens, and longer inputs return an error, so very long survey answers need splitting first.

Does it work on Arabic feedback?

The documented language list for AI_SENTIMENT is English, French, German, Hindi, Italian, Spanish and Portuguese. Arabic is not on it, and the AI_CLASSIFY page advises plain English text and avoiding non-English text. The AI_REDACT page says it works best with well-formed English.

We do not have a verified source on how any of these functions perform on Arabic. For a Gulf brand, measure a labelled sample of real Arabic comments before you promise anyone a dashboard. The AI_REDACT page also says performance may vary with many spelling or grammatical errors, which describes a lot of phone messages.

How do I summarise a large column of comments with AI_AGG?

AI_AGG reduces a column of text using a natural language instruction. Snowflake says it supports datasets larger than the model's context window, which is what makes it usable on a full feedback table. It also works with GROUP BY.

The instruction decides the quality. Snowflake's guidance is to write a declarative instruction, describe the text and describe the intended use. "Summarise the most common complaints in these customer feedback comments for the product team" does all three, while a bare "summarise" does none and may return a note that the data does not contain the answer.

What should I redact before the model sees feedback?

AI_REDACT replaces detected personal data with placeholders such as [NAME] and [ADDRESS]. Snowflake calls it best-effort and says to always review the output against your organisation's privacy policies. It also has a detect mode, which returns the location of each match so you can keep names on an allowlist.

The documented address, passport and licence categories name US, UK and Canadian formats. The national ID entry names US Social Security numbers, and we have not tested Gulf formats, so do not assume they are caught.

Run the function on a sample of your own comments and read the output line by line. Record the miss rate before the table reaches a dashboard.

What does a full feedback pipeline look like in SQL?

This is a worked example with invented table and column names. It shows the order from the previous section and uses only syntax from the Snowflake pages listed in Sources. Run it in a sandbox first.

-- Illustrative names. Sandbox first, then review against current Snowflake docs.
CREATE OR REPLACE TABLE feedback_scored AS
WITH cleaned AS (
  SELECT feedback_id,
         AI_REDACT(feedback_text) AS feedback_clean
  FROM raw_feedback
)
SELECT feedback_id,
       feedback_clean,
       AI_CLASSIFY(
         feedback_clean,
         [
           {'label': 'delivery', 'description': 'late, lost or damaged orders'},
           {'label': 'billing', 'description': 'charges, refunds and invoices'},
           {'label': 'product quality', 'description': 'faults and how well the product works'},
           {'label': 'support', 'description': 'contact with the service team'}
         ],
         {'task_description': 'Assign the main topic of a customer feedback comment'}
       ):labels AS topic_labels,
       AI_SENTIMENT(feedback_clean, ['price', 'delivery', 'support']) AS sentiment
FROM cleaned;

SELECT topic_labels::STRING AS topic,
       AI_AGG(feedback_clean,
              'Summarise the most common complaints in these customer feedback comments for the product team') AS complaint_summary
FROM feedback_scored
GROUP BY topic_labels::STRING;

Error handling differs: by default AI_CLASSIFY returns NULL for a row it cannot process and the query carries on. AI_REDACT raises an error and the whole query fails. Snowflake documents a session parameter, AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERROR, that you can set to FALSE so errors return NULL instead.

What does it cost, and how do I keep it in check?

Snowflake says Cortex AI functions incur compute cost based on tokens processed, and for AI_CLASSIFY and AI_AGG both input and output tokens are billable. The functions add their own prompt, so the billed count is higher than the text you supply. For AI_CLASSIFY, labels, descriptions and examples count as input tokens for each record, not once per call.

That makes label design a cost decision, because a description is repeated on every row. Write the shortest description that separates the labels. Snowflake recommends a warehouse no larger than MEDIUM for these calls, and the CORTEX_FUNCTIONS_USAGE_HISTORY view shows per-call credit and token use.

We recommend storing the scored table and pointing dashboards at it, because a dashboard that calls the functions on every refresh would pay the token cost each time. Score once, on a schedule, and read the stored results. CustomerIK's marketing analytics service covers BI layer design and executive dashboards for that reporting layer.

How does this go wrong in practice?

Four failure modes are worth naming before you build.

  • NULL drift. Rows that fail classification come back as NULL and the query still succeeds. A topic report can under-count without any visible error, so report the NULL share next to every chart.
  • Taxonomy drift. Edit a label or description and last month's topics no longer compare with this month's. Version the category list and re-score history when it changes, the same discipline we describe in our post on managing prompts and context like code.
  • Treating output as ground truth. These are model outputs. Hand-label a sample, compare it with the function results, and agree an acceptable disagreement rate with the team that will act on the numbers, as we cover in what to check before trusting a natural-language analytics answer.
  • Mixed as noise. A mixed sentiment on delivery often means the product was good and the parcel was late. Read a few before you fold the category into neutral.

Do other platforms offer the same functions?

Databricks documents a comparable set of built-in AI Functions that run on data stored on Databricks. Its task-specific list includes ai_classify, ai_analyze_sentiment, ai_mask and ai_summarize. The ai_classify page takes labels with optional descriptions and supports multi-label output, and says the function is only available in some regions.

If your data lives in Databricks, the same design questions apply. Redact or mask first, keep categories distinct and test language coverage on real comments. The Databricks page for ai_analyze_sentiment says it is in Public Preview and tuned for English, so the same status check applies there.

What should Gulf teams check before they start?

Feedback text is personal data whenever it identifies a customer. Before you build, confirm the legal basis, retention period and cross-border transfer rules for your customers. We have no verified source here on which law applies to you, so ask your privacy counsel.

Snowflake says Cortex AI Functions are available to accounts in select regions. Its AI_CLASSIFY table names Oregon, N. Virginia, Frankfurt, Ireland, Sydney, Tokyo, East US 2 and West Europe, plus a cross-region column. None of the named regions is in the Gulf, so check your account and whether any setting moves data between regions.

Snowflake also states that its LLMs are deployed within the Snowflake Service perimeter, which your security team should read in full. CustomerIK's customer data management service covers data architecture and governance, including the rules for how data enters, moves through and exits a business.

This is not legal advice. Send the design to your privacy counsel and security team before customer feedback goes through these functions.

Frequently Asked Questions

1. Are Cortex AI Functions generally available?

Snowflake says functions not marked as preview features are generally available and can be used in production. Some individual functions are Preview Features, so check each function's own page before you rely on it.

2. What privileges do I need to call them?

Snowflake's overview says your role needs the USE AI FUNCTIONS account-level privilege and one of the CORTEX_USER or AI_FUNCTIONS_USER database roles.

3. Can AI_CLASSIFY give a comment more than one label?

Yes. Set output_mode to 'multi' in the configuration object. The default is single-label.

4. Does AI_SENTIMENT support Arabic?

Arabic is not in the documented language list. We do not have a verified source on its performance on Arabic, so test a labelled sample of your own comments.

5. Does AI_REDACT guarantee that personal data is removed?

No. Snowflake describes it as best-effort and says to review the output against your organisation's privacy policies.

Sources

CustomerIK works across marketing analytics and customer data management.

If you are scoring customer feedback in Snowflake and want a second opinion on the categories and data flow, let's talk.

Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website.

Accept all cookies
Accept all cookies

These items are required to enable basic website functionality.

Always active

These items are used to deliver advertising that is more relevant to you and your interests.

These items allow the website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features.

These items help the website operator understand how its website performs, how visitors interact with the site, and whether there may be technical issues.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.