This QuickStart demonstrates how to build conversational AI applications using Sigma's chat element and Sigma agents, powered by Snowflake Cortex for advanced analytics.
You'll learn how to create an intelligent retail data assistant that can answer natural language questions, perform complex analysis, and take actions based on user interactions.
A key aspect of AI applications is controlling data access. Semantic views act as a governance layer, ensuring your AI agents only access approved, curated data—not your entire data warehouse.
But access control is only part of the picture. Sigma is the governed runtime around AI: audit logs, permissions, cost controls, collaboration, and version management all come with the platform — regardless of which AI provider you've configured.
For more information, see AI usage dashboard
In this QuickStart, we'll build an agent that helps users analyze retail order data from Snowflake's TPCH_SF1 sample dataset. The agent will:
For more information on Sigma's product release strategy, see Sigma product releases
If something doesn't work as expected, here's how to contact Sigma support
This QuickStart is designed for:

Before we start building, it's important to understand the relationship between Sigma agents and chat elements.
A Sigma agent is the "brain" of your conversational AI application. It:
Think of the agent as the orchestrator that decides how to answer each question.
A chat element is the user interface component that displays on a workbook page. It:
Think of the chat element as the visible UI, while the Sigma agent is the invisible brain behind it.
The chat element and the Sigma agent are two separate things, not interchangeable:
In this QuickStart, the complete flow works like this:

To enable advanced analytical capabilities, we'll configure Snowflake Cortex. This section keeps the setup minimal—just what's needed to get Cortex working.
A semantic view consists of two components:
We'll create both using Snowflake's UI-based workflow.
In Snowflake, navigate to Projects and create a new SQL worksheet.
Run the following SQL to create the base data view:
USE ROLE ACCOUNTADMIN;
USE WAREHOUSE COMPUTE_WH;
CREATE DATABASE IF NOT EXISTS QUICKSTARTS;
CREATE SCHEMA IF NOT EXISTS QUICKSTARTS.CORTEX_DEMO;
CREATE OR REPLACE VIEW QUICKSTARTS.CORTEX_DEMO.RETAIL_DATA_VIEW AS
SELECT
o.O_ORDERKEY,
o.O_CUSTKEY,
o.O_ORDERSTATUS,
o.O_TOTALPRICE,
o.O_ORDERDATE,
o.O_ORDERPRIORITY,
l.L_QUANTITY,
l.L_EXTENDEDPRICE,
l.L_DISCOUNT
FROM SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.ORDERS o
JOIN SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.LINEITEM l
ON o.O_ORDERKEY = l.L_ORDERKEY;

Now we'll create a Semantic View using the Snowflake UI. This will add business context and metadata to our SQL view.
In Snowflake, navigate to AI & ML > AI Studio > Cortex Analyst and click Try.

On the Semantic views tab, select the QUICKSTARTS.CORTEX_DEMO database and then click Create with Autopilot. This opens the Semantic View Autopilot wizard.

Wizard step 1: Provide context (Optional)
The wizard can seed the semantic view, but we'll skip this for the QuickStart — click Skip.
Wizard step 2: Name your semantic view
First, change the permission to ACCOUNTADMIN using the drop select list in the upper right corner.
Set the name to:
RETAIL_SEMANTIC_VIEW

Click Next.
Wizard step 3: Select tables
Navigate to QUICKSTARTS > CORTEX_DEMO and check the box next to RETAIL_DATA_VIEW (under "1 View").

Click Next.
Wizard step 4: Select columns
Select all columns:
Keep both checkboxes selected:

Click Create.
While Snowflake works, you'll see a warning: This process may take up to 10 minutes. Please don't close the window.
Once the processing is done, we can use the Playground and ask Cortex to explain it:
Explain the dataset

If all is configured correctly, Cortex will respond with a brief explanation:

You've now created the complete semantic view. The semantic view references your SQL view (RETAIL_DATA_VIEW) as its base table, and Cortex can now understand your data structure with business-friendly terms.
Now we'll create a Cortex Agent — the Snowflake component that uses the semantic view to answer analytical questions.
Navigate to AI & ML > Agents (in the left sidebar under AI & ML).
Click the blue button to Create agent:

For Database and schema we will restrict Cortex to only QUICKSTARTS.CORTEX_DEMO.
Set the Agent object name to:
RETAIL_ASSISTANT
We can override the Display name to be more specific if we want. Use:
QuickStart Cortex Demo Retail Assistant

Click Create agent.
Open the Tools tab.
Snowflake organizes Cortex Agent tools into a few categories: Web search, Query structured data, Search documents and unstructured data, and Custom tools. We only need the structured-data path for this QuickStart.
Under Query structured data, click + Add semantic view:

Configure the tool:
QUICKSTARTS.CORTEX_DEMO.RETAIL_SEMANTIC_VIEWRETAIL_SEMANTIC_VIEWTool name:
retail_data_analysis
Description:
Use this tool for all questions about orders, customers, revenue, and sales patterns

Click Add.
On the Orchestration tab, enter these instructions:
You are a helpful retail data analyst.
Always use the retail_data_analysis tool for any questions about:
- Orders, order status, order dates
- Customers and customer behavior
- Revenue, sales, prices
- Product quantities and trends
Provide clear, concise answers. When showing data, include relevant context.

Click Save to save the agent, but we have a few more permission steps to complete.
Grant access to your Sigma service role so Sigma can use the Cortex Agent and access the underlying data.
The underlying SQL view must be accessible to your Sigma role. Run this in a Snowflake SQL worksheet:
USE ROLE ACCOUNTADMIN;
-- Grant Cortex database role
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE SIGMA_SERVICE_ROLE;
-- Grant database usage
GRANT USAGE ON DATABASE QUICKSTARTS TO ROLE SIGMA_SERVICE_ROLE;
-- Grant schema usage
GRANT USAGE ON SCHEMA QUICKSTARTS.CORTEX_DEMO TO ROLE SIGMA_SERVICE_ROLE;
-- Grant SELECT on semantic view
GRANT SELECT ON VIEW QUICKSTARTS.CORTEX_DEMO.RETAIL_SEMANTIC_VIEW TO ROLE SIGMA_SERVICE_ROLE;
Replace SIGMA_SERVICE_ROLE with the actual role used in your Sigma connection (see the note at the top of Step 4 for how to find it).
Now grant access to the Cortex Agent itself. Return to the RETAIL_ASSISTANT agent and click Edit.
Access tabAdd roleSIGMA_SERVICE_ROLE — or whatever name your connection uses) and select USAGE
Save or confirm the additionAI & ML > AI Studio > Cortex AnalystQUICKSTARTS.CORTEX_DEMO databaseRETAIL_SEMANTIC_VIEW Semantic viewShare or Access buttonSIGMA_SERVICE_ROLE), as the role is not always listed in the dropdownSave
Your Cortex setup is complete! You've created:
RETAIL_DATA_VIEWRETAIL_SEMANTIC_VIEWRETAIL_ASSISTANT
Now that Cortex is configured in Snowflake, we need to enable it in Sigma.
Log into Sigma as an Administrator.
Navigate to Administration > AI settings.
Under AI provider section:
Data warehouse hosted model (recommended)Connection: Choose your Snowflake connection (e.g., Snowflake)Save
Sigma Assistant needs explicit authorization for any data source it queries — even when Snowflake already permits access through a Cortex Agent. Adding the semantic view here is Sigma's governance layer at work: the administrator decides exactly which sources Assistant can reach, independent of whatever the underlying warehouse role allows.
Navigate to Administration > AI > Assistant.
Click Add source, drill into your Snowflake connection > QUICKSTARTS > CORTEX_DEMO, and select RETAIL_SEMANTIC_VIEW. Click Add.

Your Sigma environment is now ready to use Snowflake Cortex. The RETAIL_ASSISTANT Cortex Agent is discoverable in Sigma's data catalog after connection sync, and the semantic view is authorized for Sigma Assistant. In the next sections we'll build a Sigma agent in a workbook that calls this Cortex Agent as a warehouse tool.

Before building a full workbook, let's verify the Cortex Agent is working correctly by asking it a simple question through Sigma Assistant.
From your Sigma home page, open Sigma Assistant. In the data source selector, choose RETAIL_SEMANTIC_VIEW (the semantic view you authorized for Sigma Assistant in the previous section).

In the Sigma Assistant text box, type:
What is the total revenue from all orders?

Press Enter to send.
The agent will:
Sigma Assistant should return a specific revenue total along with context (the metric it used, currency, etc.) drawn from the semantic view's Facts:

Sigma shows the SQL Cortex Analyst generated to answer your question. Click the SQL indicator below the response to expand it.

Reviewing the SQL helps you verify Cortex translated the question correctly and lets you copy the query into Snowflake to validate the result.

Now that we've verified the Cortex Agent works through Sigma Assistant, let's wrap it in a workbook with a chat element for a richer interactive experience.
In Sigma, click the Create New button and select Workbook.
In the top left click Save as and name the workbook :
Retail Assistant - QuickStart
To give the workbook a place to inspect the source data alongside the chat element, add RETAIL_DATA_VIEW to a dedicated Data page. This keeps the source table out of the way of the main page where the chat element will live.
+ next to the existing page tab and add a new page. Set the page type to Data and name the page Data.Data page, add a Table from the Data group on the element bar. Select your Snowflake connection.QUICKSTARTS > CORTEX_DEMO and add RETAIL_DATA_VIEW.Data page:
Switch back to the main page — that's where the chat element will live.
From the element bar at the bottom, you can add a Text element from the UI group, with a title like:
Retail Data Assistant
Ask questions about orders, revenue, customers, and sales patterns.
This helps users understand what the chat element can do.

Before adding the chat element, we need to create a Sigma agent that will power it.
In the workbook, look at the right side panel. You'll see tabs: Settings, Format, Actions, and Agents.
Click on the Agents tab.

You'll see "No agents have been created yet."
Click the + button to create a new agent.
The agent configuration panel opens with several options including Data sources, Tools, and Instructions.
Double-click on the Agent 1 name and change it to:
Retail Data Assistant
In the instructions editor, copy/paste the following to guide the agent's behavior:
You are a friendly retail data analyst assistant. Your role is to help users understand their retail order data by answering questions about orders, revenue, customer patterns, and order priorities.
When responding:
- Be concise and actionable
- Provide specific numbers and trends
- Highlight key insights that could drive business decisions
For analytical questions about orders, customers, revenue, or sales patterns, use the RETAIL_ASSISTANT Cortex Agent — it has direct access to the semantic view in Snowflake.
Always maintain a helpful, professional tone.

Click on the + next to Data sources and select the RETAIL_ASSISTANT warehouse agent:

The RETAIL_ASSISTANT Cortex Agent is available because you configured it in Sigma's AI settings earlier.
Click Save to save your Sigma agent configuration.
The Retail Data Assistant agent now appears in the Agents panel and is ready to use!

Now that we've created the agent, let's add a chat element to the workbook and connect it to our agent.
From the element bar at the bottom of your workbook, click UI > Chat.
A chat element appears on your canvas.
Click on the chat element to select it.
In the left panel (or configuration area), you'll see an option to select which agent powers this chat element.
Select: Retail Data Assistant (the agent we just created)

The chat element is now connected to your agent and ready to use!
Let's test the chat element in the workbook to verify it's working correctly.
Click Publish in the top right corner to publish the workbook.
In the published view, use the chat element to ask:
What is the total revenue from all orders in the most recent full year?

You should see:

If you received a comprehensive response with revenue data, your chat element is properly connected to the Cortex Agent and can query the semantic view successfully!

Let's add the ability for the agent to write insights to an input table. This demonstrates how agents can take actions, not just answer questions.
For setup details, see Set up write access
From the element bar, click Input > Empty.
Select your Snowflake connection.
Configure the input table columns:
Rename the table to:
Customer Insights
Delete the pre-populated rows so the table is empty.

Click on the Customer Insights input table.
Set the permission to: Only editable in published version
Click Publish.

Click any blank area of the workbook to deselect any elements.
In the right panel, click the Agents tab.
Use the 3-dot menu to edit the Retail Data Assistant agent.
In the Configure agent modal, click on the + next to Tools and select Action:

Configure the action:
Step type: Run an action
Action: Insert row
Into: Customer Insights
With values:

Click on the Instructions tab and replace the entire instruction content with (the formatting will not matter but adjust for readability if preferred):
You are a friendly retail data analyst assistant helping users analyze TPCH retail order data.
## Insight Logging Workflow
When users ask you to analyze a specific customer (e.g., "analyze customer 3451"), follow this workflow:
1. Analyze the customer's data using the RETAIL_ASSISTANT Cortex Agent
2. Provide the analysis to the user
3. Offer to log the insight by saying: "Would you like me to save this insight to the Customer Insights table?"
4. If the user says yes, confirm what you'll write:
- "I'll log: [brief insight summary]"
- "Customer ID: [number]"
- "Should I proceed?"
5. Only after user confirms, use the "Insert row into Customer Insights" tool
## Example Interaction
User: "Analyze customer 3451"
You: [Provide analysis] "This customer has spent $28.8M over 6.5 years. Would you like me to save this insight?"
User: "Yes please"
You: "I'll log: 'High-value customer: $28.8M over 6.5 years, $182K avg order' with Customer ID: 3451. Proceed?"
User: "Yes"
You: [Use insert tool with insight_description and customer_id]
Always be concise and actionable. Ask for explicit confirmation before writing data.
Click Save and Publish
Switch the workbook to published view.
Step 1 — Ask for an analysis. Return to the chat element and ask:
Analyze customer 3451
The agent will:

Step 2 — Confirm you want to save (good manners never hurt!):
Yes please
The agent will:
Step 3 — Final confirmation:
Yes
The agent executes the "Insert row into ‘Customer Insights'" action, providing:
insight_description: The generated insight textcustomer_id: 3451You'll see a new row with:
You can still click Cancel to back out of the insert, or Save to commit it. We didn't instruct the agent to commit automatically:


In this QuickStart, you learned how to:
Sigma agents orchestrate, partner tools execute:
Semantic views make Cortex accurate:
Chat elements bring conversational AI to the workbook:
Explore more AI capabilities in Sigma:
For another use case that pairs a Sigma agent with unstructured text data, see Unlocking Insights from Unstructured Text with a Sigma Agent
Learn more about Snowflake Cortex:
Additional Resource Links
Blog
Community
Help Center
QuickStarts
Be sure to check out all the latest developments at Sigma's First Friday Feature page!
