Agent skill · mindrally
snowflake-cortex-ai
Reference for Snowflake Cortex AI Functions (AI_COMPLETE, AI_CLASSIFY, AI_EXTRACT, AI_FILTER, etc.) and Cortex Search for building RAG applications entirely inside Snowflake. Use when writing SQL that calls an LLM, classifying or extracting structured data from text, building a natural-language WHERE filter, or setting up hybrid vector+keyword search for retrieval-augmented generation.
What it needs
About 5k tokens when loaded.
What this skill does
Snowflake Cortex AI This skill covers Snowflake Cortex — the SQL-callable AI layer of Snowflake, including Cortex AI Functions for LLM/ML tasks and Cortex Search for managed hybrid (vector + keyword) search — all running inside Snowflake with no data leaving the platform. Workflow for Building a Cortex-Powered Feature 1. Pick the narrowest function for the task — Use AICLASSIFY for categorization, AIFILTER for natural-language row filtering, AIEXTRACT for structured field pulls, and reserve AICOMPLETE for open-ended generation — narrower functions are cheaper and more reliable than routing everything through AICOMPLETE. 2. Check token cost before batch jobs — Run AICOUNTTOKENS(model, text) on a sample before running a function over a large table. 3. Prototype in SQL — Call the function on a small LIMIT-ed sample and inspect results before running it over a full table. 4. Structure prompts explicitly — Use PROMPT('template {0}', arg) for parameterized prompts and cast JSON output to VARIANT when you need structured fields back. 5. For RAG, stand up Cortex Search — Create a CORTEX SEARCH SERVICE over the source table, query it via the Python or REST API to retrieve context, then pass that context into AICOMPLETE. 6. Use dedicated compute — Size Cortex Search's backing warehouse no larger than MEDIUM, and separate it from other pipeline warehouses. 7. Guard against failures — Use TRYCOMPLETE in place of AICOMPLETE for batch jobs where a single failure shouldn't fail the whole run; it returns NULL instead of raising an error. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills mindrally/snowflake-cortex-ai