Cortex AISQL reimagines SQL into an AI query language for multimodal data, bringing powerful AI capabilities directly into Snowflake's SQL engine. It enables users to build scalable AI pipelines across text, images, and audio (coming soon) using familiar SQL commands. With native support for multimodal data through a new FILE datatype, Cortex AISQL seamlessly integrates AI operators with traditional SQL primitives like AI_FILTER and AGGREGATE, allowing analysts to process diverse data types more efficiently and cost-effectively while maintaining enterprise-grade security and governance.

What is Cortex AISQL?

Cortex AISQL bridges the traditional divide between structured and unstructured data analysis, eliminating the need for separate tools and specialized skills.

It delivers three key benefits:

By unifying all data types in a single platform with zero setup required, Cortex AISQL democratizes AI-powered analytics across the enterprise.

Cortex AISQL

Use Cases

Cortex AISQL benefits organizations across industries dealing with diverse data types including:

Business analysts can extract insights without AI expertise, data engineers can build simpler pipelines, and data scientists can create richer feature sets, all using familiar SQL.

Prerequisites

What You Will Learn

You'll learn how to use powerful operators of Cortex AISQL to analyze multimodal data within Snowflake using natural language.

What You Will Build

Snowflake Notebook that helps you get started with using Cortex AISQL with multimodal data

Step 1. In Snowsight, create a SQL Worksheet and open setup.sql to execute all statements in order from top to bottom.

Step 2. Download sample images files and use Snowsight » Data » Add Data » Load files into a Stage to upload them to @DASH_DB.DASH_SCHEMA.DASH_IMAGE_FILES stage created in step 1.

Step 3. In Snowsight, create a SQL Worksheet and open images.sql to execute all statements in order from top to bottom.

Step 4. Click on cortex_aisql.ipynb to download the Notebook from GitHub. (NOTE: Do NOT right-click to download.)

Step 5. In Snowsight:

Step 6. Open Notebook

Here's the code walkthrough of the cortex_aisql.ipynb notebook that you downloaded and imported into your Snowflake account.

Import_Libraries

Import libraries required for running cells in the notebook.

AI_COMPLETE

Identify customer issues across text and image data using AI_COMPLETE() and see how the SQL operators work seamlessly across all modalities.

Consolidated_Data

Notice that native FILE datatype allows for consolidating all data formats into one table.

AI_FILTER

Semantically "JOIN" customer issues with existing solutions using JOIN ... ON AI_FILTER()

AI_AGG

Get aggregated insights across multiple rows using AI_AGG()

AI_CLASSIFY

Classification of labels that can be used in downstream applications using AI_CLASSIFY(). For example, to train ML models.

Congratulations! You've successfully created a Snowflake Notebook that helps you get started with using Cortex AISQL with multimodal data.

What You Learned

You've learned how to use powerful operators of Cortex AISQL to analyze multimodal data within Snowflake using natural language.

Related Resources