diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app.png b/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app.png new file mode 100644 index 0000000000..08b7998ecf Binary files /dev/null and b/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app.png differ diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app_main.png b/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app_main.png new file mode 100644 index 0000000000..2c74f7c089 Binary files /dev/null and b/site/sfguides/src/getting-started-with-cortex-analyst/assets/create_streamlit_app_main.png differ diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/assets/staged_files.png b/site/sfguides/src/getting-started-with-cortex-analyst/assets/staged_files.png deleted file mode 100644 index 98b147b5a4..0000000000 Binary files a/site/sfguides/src/getting-started-with-cortex-analyst/assets/staged_files.png and /dev/null differ diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/assets/switch_role.png b/site/sfguides/src/getting-started-with-cortex-analyst/assets/switch_role.png new file mode 100644 index 0000000000..7152a29e1c Binary files /dev/null and b/site/sfguides/src/getting-started-with-cortex-analyst/assets/switch_role.png differ diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/assets/vqr_app.png b/site/sfguides/src/getting-started-with-cortex-analyst/assets/vqr_app.png deleted file mode 100644 index 5dc1eb1aae..0000000000 Binary files a/site/sfguides/src/getting-started-with-cortex-analyst/assets/vqr_app.png and /dev/null differ diff --git a/site/sfguides/src/getting-started-with-cortex-analyst/getting-started-with-cortex-analyst.md b/site/sfguides/src/getting-started-with-cortex-analyst/getting-started-with-cortex-analyst.md index 201293afe3..091cb03c8a 100644 --- a/site/sfguides/src/getting-started-with-cortex-analyst/getting-started-with-cortex-analyst.md +++ b/site/sfguides/src/getting-started-with-cortex-analyst/getting-started-with-cortex-analyst.md @@ -4,12 +4,12 @@ categories: snowflake-site:taxonomy/solution-center/certification/quickstart, sn language: en summary: Through this quickstart guide, you will learn how to use Cortex Analyst to provide natural-language query interfaces to structured data in Snowflake using GenAI environments: web -status: Published +status: Published feedback link: https://github.com/Snowflake-Labs/sfguides/issues # Getting Started with Cortex Analyst: Augment BI with AI -## Overview +## Overview Through this quickstart guide, you will explore how to get started with [Cortex Analyst](https://docs.snowflake.com/user-guide/snowflake-cortex/cortex-analyst), which is a fully managed service in Snowflake that provides a conversational interface to interact with structured data in Snowflake. @@ -20,11 +20,11 @@ Cortex Analyst is a fully managed service in [Cortex AI](/en/data-cloud/cortex) ![cortex analyst gif](./assets/cortex.png) ### Why use Cortex Analyst? -Historically, business users have primarily relied on BI dashboards and reports to answer their data questions. However, these resources often lack the flexibility needed, leaving users dependent on overburdened data analysts for updates or answers, which can take days. Cortex Analyst disrupts this cycle by providing a natural language interface with high text-to-SQL accuracy. With Cortex Analyst organizations can streamline the development of intuitive, conversational applications that can enable business users to ask questions using natural language and receive more accurate answers in near real time +Historically, business users have primarily relied on BI dashboards and reports to answer their data questions. However, these resources often lack the flexibility needed, leaving users dependent on overburdened data analysts for updates or answers, which can take days. Cortex Analyst disrupts this cycle by providing a natural language interface with high text-to-SQL accuracy. With Cortex Analyst organizations can streamline the development of intuitive, conversational applications that can enable business users to ask questions using natural language and receive more accurate answers in near real time. This quickstart will focus on getting started with Cortex Analyst, teaching the mechanics of how to interact with the Cortex Analyst service and how to define the Semantic Model definitions that enhance the precision of results from this conversational interface over your Snowflake data. -### What you will learn +### What you will learn - How to construct and configure a Semantic Model for your data - How to call the Cortex Analyst REST API to use your Semantic Model to enable natural-language question-asking on top of your structured data in Snowflake via Streamlit in Snowflake (SiS) application - How to integrate Cortex Analyst with Cortex Search to enhance SQL queries generated @@ -32,14 +32,10 @@ This quickstart will focus on getting started with Cortex Analyst, teaching the - How to enable multi-turn conversations ### Prerequisites -- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed - - > - >Download the [git repo](https://github.com/Snowflake-Labs/sfguide-getting-started-with-cortex-analyst) -- (Optional) [Python >= 3.9, <= 3.11 installed](https://www.python.org/downloads/) to run the OSS Semantic Model Generator + - A [Snowflake account login](https://signup.snowflake.com/) with a role that has the ability to create database, schema, tables, stages, user-defined functions, and stored procedures. If not, you will need to register for a free trial account from any of the supported cloud regions or use a different role. -### What You’ll Build +### What You’ll Build - A Semantic Model over sample financial data - A Streamlit in Snowflake (SiS) app with a conversational interface to Cortex Analyst @@ -48,232 +44,70 @@ This quickstart will focus on getting started with Cortex Analyst, teaching the ## Set up the Snowflake environment +Create a blank SQL worksheet by navigating to *Projects -> Workspaces -> + Add New -> SQL File*. Call it `create_snowflake_objects.sql`. Copy the contents of [**create_snowflake_objects.sql**](https://github.com/Snowflake-Labs/sfguide-getting-started-with-cortex-analyst/blob/main/create_snowflake_objects.sql) into your new file. Then click *Run All*. -> -> MAKE SURE YOU'VE DOWNLOADED THE [GIT REPO](https://github.com/Snowflake-Labs/sfguide-getting-started-with-cortex-analyst). - -Open up the [create_snowflake_objects.sql](https://github.com/Snowflake-Labs/sfguide-getting-started-with-cortex-analyst/blob/main/create_snowflake_objects.sql) file in a SQL worksheet in Snowsight. - -Run the following SQL commands in a SQL worksheet to create the [warehouse](https://docs.snowflake.com/en/sql-reference/sql/create-warehouse.html), [database](https://docs.snowflake.com/en/sql-reference/sql/create-database.html) and [schema](https://docs.snowflake.com/en/sql-reference/sql/create-schema.html). - -```SQL -/*-- -• Database, schema, warehouse, and stage creation ---*/ - -USE ROLE SECURITYADMIN; - -CREATE ROLE cortex_user_role; -GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE cortex_user_role; - -GRANT ROLE cortex_user_role TO USER ; +When the script has finished running, you should see: -USE ROLE sysadmin; +|TYPE|CREATED_OBJECT| +|---|---| +|Git Repository|GETTING_STARTED_WITH_CORTEX_ANALYST| +|Search Service|PRODUCT_LINE_SEARCH_SERVICE| +|Table|DAILY_REVENUE| +|Table|PRODUCT_DIM| +|Table|REGION_DIM| +|Table rows: Products|5| +|Table rows: Regions|25| +|Table rows: Revenue days|730| --- Create demo database -CREATE OR REPLACE DATABASE cortex_analyst_demo; --- Create schema -CREATE OR REPLACE SCHEMA cortex_analyst_demo.revenue_timeseries; +