Getting started with Snowflake Intelligence¶
This topic provides information about getting started with Snowflake Intelligence with a simple example of creating an enterprise agent. This agent can be used with Snowflake Intelligence to respond to questions by reasoning over both structured and unstructured data. For a more detailed guide, see Getting Started with Snowflake Intelligence.
Prerequisites¶
A Snowflake account
Access to the ACCOUNTADMIN role
Create a database, schema, and tables and load data from AWS S3¶
To create the building blocks for the enterprise agent, you must create a database, schema, tables, and load data from AWS S3.
Clone the Getting Started with Snowflake Intelligence GitHub repository to your local machine:
git clone https://github.com/Snowflake-Labs/sfguide-getting-started-with-snowflake-intelligence.git
Sign in to Snowsight.
In the navigation menu, select Projects » Workspaces.
Select + Add new.
Select SQL File.
Enter a name for the file.
Open the file.
Copy the contents of the setup.sql file to the workspace.
Run all statements in order.
Run the following SQL statements in the workspace:
USE ROLE ACCOUNTADMIN; CREATE SNOWFLAKE INTELLIGENCE SNOWFLAKE_INTELLIGENCE_OBJECT_DEFAULT; GRANT USAGE ON SNOWFLAKE INTELLIGENCE SNOWFLAKE_INTELLIGENCE_OBJECT_DEFAULT TO ROLE snowflake_intelligence_admin;
Optionally, run the following SQL statement to enable cross-region inference:
ALTER ACCOUNT SET CORTEX_ENABLED_CROSS_REGION = 'ANY_REGION';
Switch the user role in Snowsight to SNOWFLAKE_INTELLIGENCE_ADMIN.
Create tools for the agent to use¶
Create the tools that the agent will use.
Create a Cortex analyst tool by uploading a semantic model file.
In the navigation menu, select AI & ML » Cortex Analyst.
Select Create new, then select Upload your YAML file.
Upload
marketing_campaigns.yamlfrom your local machine.For the database and schema, select DASH_DB_SI.RETAIL.
For the stage, select SEMANTIC_MODELS.
Select Upload.
Create a Cortex search tool by creating a search service.
In the navigation menu, select AI & ML » Cortex Search.
Select Create.
For Service database and schema, select DASH_DB_SI.RETAIL.
For Service name, enter Support_Cases, and then select Next.
In the list of data sources, select the SUPPORT_CASES table, and then select Next.
In the list of search columns, select TRANSCRIPT, and then select Next.
For the attribute columns, select TITLE and PRODUCT, and then select Next.
For the columns to include, select Select all, and then select Next.
For the warehouse, select DASH_WH_SI (if that warehouse is not available, select COMPUTE_WH), and then select Create.
Create a Cortex Agent¶
To create the agent that will use the tools, follow these steps:
In the navigation menu, select AI & ML » Agents.
Select Create agent.
For the schema, use SNOWFLAKE_INTELLIGENCE.AGENTS.
For the agent object name, use
Sales_AI.For the display name, use
Sales AI.Select Create agent.
Add the tools to the agent¶
Add the Cortex Analyst tool to the agent.
From the agent page, select the Tools tab.
Navigate to the Cortex Analyst entry.
Select + Add, then select Semantic model file.
For the database and schema, select DASH_DB_SI.RETAIL.
For the stage, select SEMANTIC_MODELS.
Select
marketing_campaigns.yamlfor the semantic model file.For the name. use
Sales_And_Marketing_Data.For the description, use the following:
The Sales and Marketing Data model in DASH_DB_SI.RETAIL schema provides a complete view of retail business performance by connecting marketing campaigns, product information, sales data, and social media engagement. The model enables tracking of marketing campaign effectiveness through clicks and impressions, while linking to actual sales performance across different regions. Social media engagement is monitored through influencer activities and mentions, with all data connected through product categories and IDs. The temporal alignment across tables allows for comprehensive analysis of marketing impact on sales performance and social media engagement over time.
For the warehouse, select Custom, then select DASH_WH_SI.
For the query timeout, use
60.Select Add.
Add the Cortex Search tool to the agent.
Navigate to the Cortex Search Services entry.
Select + Add.
For the database and schema, select DASH_DB_SI.RETAIL.
For the search service, select
DASH_DB_SI.RETAIL.Support_Cases.For the ID column, use
ID.For the title column, use
TITLE.For the name, use
Support_Cases.Select Add.
Select the Orchestration tab.
Add the following orchestration instructions:
Whenever you can answer visually with a chart, always choose to generate a chart even if the user didn't specify to.
Select Save.
Use Snowflake Intelligence¶
Interact with the agent from Snowflake Intelligence.
Navigate to Snowflake Intelligence using one of the methods described in Access the agent.
Select the newly created agent.
Enter the following prompts:
“What issues are reported with jackets recently in customer support tickets?”
“Show me the trend of sales by product category between June and August.”
“Why did sales of Fitness Wear grow so much in July?”