The AI Avalanche: How Snowflake’s Cortex is Reshaping Enterprise Intelligence

Ashish Agarwal
3 min readJan 17, 2025

--

Introduction

The convergence of cloud data platforms and artificial intelligence is revolutionizing how enterprises build and deploy AI solutions. Snowflake’s AI capabilities, integrated with their robust data cloud platform, represents a significant leap forward in making AI development more accessible and efficient for organizations. By combining secure data management with AI development tools, companies can now streamline their entire AI workflow from data preparation to model deployment.

Architecture

Example Real-World Applications

Financial Services — Fraud Detection

By leveraging the integrated data and AI capabilities, financial companies can implement a platform to develop and deploy fraud detection models. It has numerous benefits-

  • Reduction in model development time from months to weeks
  • Improvement in fraud detection accuracy by a significant percentage

Telecom — Predict customer churn

Telecom companies can utilize customer support cases & telecom network metrics to identify the probability of customer churn.

Example Snowflake queries

Here are examples of some of the oft-used cortex functions

  1. CLASSIFICATION of Data

create or replace temp table t as
select * from values
(‘212–555–1212’), (‘Denver’), (‘123 Main St.’) t(thing);

select
thing,
snowflake.cortex.CLASSIFY_TEXT(thing, [‘address’,’phone’,’city’])
from t;

2. SENTIMENT Analysis

create or replace temp table t as
select * from values
(‘I hate this movie’), (‘The weather is gloomy today’), (‘What a relief’) t(thing);

select thing, snowflake.cortex.SENTIMENT(thing) from t;

A value > 0 indicates positive sentiment, < 0 indicates negative sentiment & 0 indicates neither positive nor negative

3. TRANSLATION of Text

The following query translates GERMAN to ENGLISH

SELECT
SNOWFLAKE.CORTEX.TRANSLATE(
$$
Zu meiner Familie gehören vier Personen. Die Mutter bin ich und dann gehört natürlich mein Mann dazu. Wir haben zwei Kinder, einen Sohn, der sechs Jahre alt ist und eine dreijährige Tochter.

Wir wohnen in einem kleinen Haus mit einem Garten. Dort können die Kinder ein bisschen spielen. Unser Sohn kommt bald in die Schule, unsere Tochter geht noch eine Zeit lang in den Kindergarten. Meine Kinder sind am Nachmittag zu Hause. So arbeite ich nur halbtags.

Eigentlich gehören zu unserer Familie auch noch die Großeltern. Sie wohnen nicht bei uns. Sie haben ein Haus in der Nähe. Die Kinder gehen sie oft besuchen
$$,
‘de’,
‘en’
);

4. ANSWER EXTRACTION from Text

SELECT
SNOWFLAKE.CORTEX.EXTRACT_ANSWER(
$$
Mary had a little lamb. Her name was Sweety. It had white colored fur & long ears. Sweety loves to eat fresh grass & to play in fields.
$$,
‘What is the name of Marys lamb’
);

As you can see, Cortex AI correctly gave the answer to the question with sufficient confidence score.

5. COMPLETION

SELECT SNOWFLAKE.CORTEX.COMPLETE(‘snowflake-arctic’, ‘What are top 2 free public email services?’);

First parameter → name of the model. Currently following are supported

Second parameter → Prompt question

That’s it for this tutorial. If you find these articles useful, consider giving multiple claps. You can also share the article with your friends.

Consider following me on Linkedin to get more updates.

Contact me for consulting roles/job positions.

--

--

Ashish Agarwal
Ashish Agarwal

Written by Ashish Agarwal

Engineer and Water Color Artist @toashishagarwal

No responses yet