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…
от Mindrally★ 323 звезды на GitHubОб этом скилле
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
- Pick the narrowest function for the task — Use
AI_CLASSIFYfor categorization,AI_FILTERfor natural-language row filtering,AI_EXTRACTfor structured field pulls, and reserveAI_COMPLETEfor open-ended generation — narrower functions are cheaper and more reliable than routing everything throughAI_COMPLETE. - Check token cost before batch jobs — Run
AI_COUNT_TOKENS(model, text)on a sample before running a function over a large table. - Prototype in SQL — Call the function on a small
LIMIT-ed sample and inspect results before running it over a full table. - Structure prompts explicitly — Use
PROMPT('template {0}', arg)for parameterized prompts and cast JSON output toVARIANTwhen you need structured fields back. - For RAG, stand up Cortex Search — Create a
CORTEX SEARCH SERVICEover the source table, query it via the Python or REST API to retrieve context, then pass that context intoAI_COMPLETE. - Use dedicated compute — Size Cortex Search's backing warehouse no larger than MEDIUM, and separate it from other pipeline warehouses.
- Guard against failures — Use
TRY_COMPLETEin place ofAI_COMPLETEfor batch jobs where a single failure shouldn't fail the whole run; it returnsNULLinstead of raising an error.
Cortex AI Functions
Available functions (use these current names — do not use deprecated names like COMPLETE or CLASSIFY_TEXT):
| Function | Purpose |
|---|---|
AI_COMPLETE |
General-purpose LLM completion over text, images, or documents |
AI_CLASSIFY |
Classify text/images into user-defined categories (multi-label supported) |
AI_FILTER |
Returns TRUE/FALSE for text/image input — usable directly in WHERE |
AI_AGG |
Aggregate insights across many rows of text, no context-window limit |
AI_EMBED |
Generate embedding vectors for similarity search or clustering |
AI_EXTRACT |
Extract structured fields from text, images, or documents |
AI_SENTIMENT |
Sentiment score from text, ranging -1 to 1 |
AI_SUMMARIZE_AGG |
Summarize across many rows, no context-window limit |
AI_SIMILARITY |
Embedding similarity between two inputs |
AI_TRANSCRIBE |
Transcribe audio/video files from a stage |
AI_PARSE_DOCUMENT |
OCR or text+layout extraction from documents in a stage |
AI_REDACT |
Redact PII from text |
AI_TRANSLATE |
Translate text between supported languages |
Helper functions:
TO_FILE('@stage', 'filename')— build a file reference for document/image processing.AI_COUNT_TOKENS(model, text)— check token count before calling a model, especially before large batch jobs.PROMPT('template {0}', arg)— build parameterized prompt objects forAI_COMPLETE.TRY_COMPLETE— likeAI_COMPLETEbut returnsNULLon failure instead of raising an error.
AI_COMPLETE — the primary function
Supported models include claude-4-opus, claude-4-sonnet, claude-sonnet-4-5, claude-opus-4-5, claude-haiku-4-5, gemini-3-pro, llama3.1-70b, llama3.1-8b, llama3.3-70b, mistral-large2, mistral-small2, and deepseek-r1. Model availability varies by region — do not hardcode a model name without checking regional availability.
-- Text completion
SELECT AI_COMPLETE(MODEL => 'claude-4-sonnet', PROMPT => 'Summarize: ' || review_text) FROM reviews;
-- Document processing
SELECT AI_COMPLETE(
MODEL => 'claude-4-sonnet',
PROMPT => PROMPT('Extract the invoice total from {0}', TO_FILE('@docs', 'invoice.pdf'))
);
-- Structured JSON output
SELECT AI_COMPLETE(MODEL => 'claude-4-sonnet',
PROMPT => 'Extract name, email, company as JSON: ' || raw_text)::VARIANT AS extracted
FROM contacts;
Classification, filtering, and aggregation
-- AI_CLASSIFY: cheaper than AI_COMPLETE for categorization tasks
SELECT AI_CLASSIFY(ticket_text, ['billing', 'technical', 'account', 'other']) AS category FROM tickets;
-- Multi-label: AI_CLASSIFY(input, categories, {'output_mode': 'multi'})
-- AI_FILTER: natural-language predicate directly in WHERE
SELECT * FROM reviews WHERE AI_FILTER(review_text, 'mentions product quality issues');
-- AI_AGG: cross-row aggregation with no context-window limit
SELECT AI_AGG(feedback_text, 'What are the top 3 themes?') FROM customer_feedback;
-- AI_EXTRACT: pull named fields out of free text
SELECT AI_EXTRACT(email_body, 'meeting date', 'attendees', 'action items') FROM emails;
Other functions
SELECT review_text, AI_SENTIMENT(review_text) AS sentiment FROM product_reviews;
SELECT AI_EMBED(description) AS embedding FROM products;
SELECT AI_PARSE_DOCUMENT(TO_FILE('@docs', 'contract.pdf'), MODE => 'LAYOU
Установить snowflake-cortex-ai в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл 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.
Как установить скилл snowflake-cortex-ai?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл snowflake-cortex-ai запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic