원클릭으로
cortex-classify-notebook
// Deploy the Cortex CLASSIFY_TEXT tutorial notebook to the user's Snowflake account and provide a link to open it in Snowsight. Use when user wants to learn text classification through a Jupyter notebook experience.
// Deploy the Cortex CLASSIFY_TEXT tutorial notebook to the user's Snowflake account and provide a link to open it in Snowsight. Use when user wants to learn text classification through a Jupyter notebook experience.
| name | cortex-classify-notebook |
| description | Deploy the Cortex CLASSIFY_TEXT tutorial notebook to the user's Snowflake account and provide a link to open it in Snowsight. Use when user wants to learn text classification through a Jupyter notebook experience. |
| compatibility | Requires Snowflake account with Cortex AI and Notebooks enabled. Prefers SNOWFLAKE_LEARNING environment. |
| metadata | {"author":"Snowflake","version":"1.0","type":"deployment"} |
You are deploying the Cortex CLASSIFY_TEXT tutorial notebook to the user's Snowflake account. This skill uploads the notebook and provides a direct link to open it in Snowsight.
Welcome the user briefly, then proceed through the steps efficiently while keeping them informed. Do NOT ask for confirmation at each step - deploy smoothly and report results.
Before starting deployment, use web_fetch to retrieve the current official documentation:
https://docs.snowflake.com/en/sql-reference/functions/classify_text-snowflake-cortex
https://docs.snowflake.com/en/user-guide/ui-snowsight/notebooks
This ensures your explanations and any troubleshooting advice are current. If the docs show new parameters or syntax, inform the user.
Run these two queries in parallel:
-- Query 1: Check if SNOWFLAKE_LEARNING environment exists
SHOW ROLES LIKE 'SNOWFLAKE_LEARNING_ROLE';
-- Query 2: Read the notebook file from assets/classify_unstructured_customer_reviews.ipynb
If SNOWFLAKE_LEARNING_ROLE exists (preferred):
USE ROLE SNOWFLAKE_LEARNING_ROLE;
USE DATABASE SNOWFLAKE_LEARNING_DB;
USE WAREHOUSE SNOWFLAKE_LEARNING_WH;
If NOT available (fallback):
USE ROLE ACCOUNTADMIN; -- or appropriate role with CREATE DATABASE privilege
CREATE DATABASE IF NOT EXISTS CORTEX_TUTORIALS_DB;
USE DATABASE CORTEX_TUTORIALS_DB;
CREATE WAREHOUSE IF NOT EXISTS CORTEX_TUTORIALS_WH WITH WAREHOUSE_SIZE = 'XSMALL';
USE WAREHOUSE CORTEX_TUTORIALS_WH;
-- Create a schema for the notebook (named after current user)
SET schema_name = CONCAT(CURRENT_USER(), '_CORTEX_TUTORIALS');
CREATE SCHEMA IF NOT EXISTS IDENTIFIER($schema_name);
USE SCHEMA IDENTIFIER($schema_name);
-- Create internal stage for notebook files
CREATE STAGE IF NOT EXISTS notebook_stage
DIRECTORY = (ENABLE = TRUE)
ENCRYPTION = (TYPE = 'SNOWFLAKE_SSE');
IMPORTANT: After setting up the environment, you MUST query the actual values to use in subsequent steps. Do NOT guess or assume schema names based on the local username.
SELECT
CURRENT_USER() as current_user,
CURRENT_SCHEMA() as current_schema,
CURRENT_DATABASE() as current_database,
CURRENT_ROLE() as current_role
Store these values for use in the upload and notebook creation steps.
Use the snow stage copy CLI command with fully qualified stage path:
snow stage copy <local_notebook_path> @<DATABASE>.<SCHEMA>.notebook_stage --overwrite --connection <connection_name>
Example (substitute actual values from Step 3):
snow stage copy /path/to/assets/classify_unstructured_customer_reviews.ipynb @{DATABASE}.{SCHEMA}.notebook_stage --overwrite --connection {CONNECTION}
IMPORTANT:
assets/classify_unstructured_customer_reviews.ipynb relative to this skill's base directory--overwrite flag to handle re-deploymentsUse fully qualified names for the notebook creation:
CREATE OR REPLACE NOTEBOOK <DATABASE>.<SCHEMA>.CLASSIFY_CUSTOMER_REVIEWS
FROM '@<DATABASE>.<SCHEMA>.notebook_stage'
MAIN_FILE = 'classify_unstructured_customer_reviews.ipynb'
COMMENT = 'Tutorial: Classify customer reviews with Cortex AI';
Example (substitute actual values from Step 3):
CREATE OR REPLACE NOTEBOOK {DATABASE}.{SCHEMA}.CLASSIFY_CUSTOMER_REVIEWS
FROM '@{DATABASE}.{SCHEMA}.notebook_stage'
MAIN_FILE = 'classify_unstructured_customer_reviews.ipynb'
COMMENT = 'Tutorial: Classify customer reviews with Cortex AI';
Get the account identifier for the URL:
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() as account_identifier
Build the Snowsight URL:
https://app.snowflake.com/{ORG}/{ACCOUNT}/#/notebooks/{DATABASE}.{SCHEMA}.CLASSIFY_CUSTOMER_REVIEWS
Where {ORG} and {ACCOUNT} come from splitting the account_identifier on -.
After successful deployment, provide this summary:
Open your notebook: Click here to open in Snowsight
Location: {DATABASE}.{SCHEMA}.CLASSIFY_CUSTOMER_REVIEWS
cortex.classify_text() on single strings and DataFramesSNOWFLAKE.CORTEX.CLASSIFY_TEXT() directly in queriesIf you get "Schema does not exist" errors:
CURRENT_SCHEMA() after setup to get the actual schema nameIf snow stage copy fails:
@DATABASE.SCHEMA.stage_nameThe skill uses CREATE OR REPLACE NOTEBOOK by default, which handles existing notebooks automatically.
If user can't create notebooks:
If Cortex functions aren't available in the region:
assets/classify_unstructured_customer_reviews.ipynb - The notebook file to deployInteractive tutorial teaching Snowflake Cortex Agents. Guide users step-by-step through building AI agents that orchestrate across structured and unstructured data using Cortex Analyst, Cortex Search, and custom tools. Use when user wants to learn cortex agents, build AI agents, create intelligent assistants, or understand agent orchestration.
Advanced tutorial teaching Snowflake Cortex Agents with custom tools. Extends the base tutorial by adding stored procedure-based tools (inventory lookup, price calculator, product summary) alongside Cortex Analyst and Cortex Search. Use when user wants to build agents with custom business logic, stored procedures as tools, or multi-tool orchestration.
Interactive tutorial that teaches Cortex Code CLI from scratch. Guides non-technical users step-by-step through slash commands, skills, special syntax, sessions, and more. Use when the user wants to learn Cortex Code, get started with the CLI, or understand how skills and commands work.
Interactive tutorial teaching Snowflake Cortex Search for building semantic search and RAG applications. Guide users through creating search services and querying them using SQL and Python. Use when user wants to learn Cortex Search, semantic search, hybrid search, RAG, or build AI-powered search applications.
Interactive tutorial teaching Snowflake Cortex CLASSIFY_TEXT for categorizing unstructured text. Guide users through classifying customer reviews using Python and SQL. Use when user wants to learn text classification, Cortex LLM functions, or analyze unstructured feedback data.
Interactive tutorial that teaches Snowflake Dynamic Tables hands-on. The agent guides users step-by-step through building data pipelines with automatic refresh, incremental processing, and CDC patterns. Use when the user wants to learn dynamic tables, build a DT pipeline, or understand DT vs streams/tasks/materialized views.