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¶
- Git installed
- 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:
-
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:
- Optionally, run the following SQL statement to enable cross-region inference:
- 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 semantic view for use with Cortex Analyst.
- In the navigation menu, select AI & ML » Cortex Analyst.
- Select Create new, then select Create new Semantic View.
- For the location to store the semantic view, select DASH_DB_SI.RETAIL.
- For the name, enter
SALES_AND_MARKETING_DATA. - For the description, enter
Semantic view for sales and marketing data analysis across campaigns, products, transactions, and social media engagement.. - Select Next.
- Select Skip.
- Select the DASH_DB_SI.RETAIL schema.
- For the tables, select the MARKETING_CAMPAIGN_METRICS, PRODUCTS, SALES, and SOCIAL_MEDIA tables.
- Select Next.
- For the columns, select all available columns for the selected tables.
- Select Next.
- Review and accept all of the relationship and metric suggestions.
- Select Save.
- Wait for the semantic view to be created.
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 view.
-
For the database and schema, select DASH_DB_SI.RETAIL.
-
For the semantic view, select
SALES_AND_MARKETING_DATA. -
For the name, use
SALES_AND_MARKETING_DATA. -
For the description, use the following:
-
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:
- 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?”