Lang.ai's Snowflake AI Agents empower data teams to create custom agents that derive actionable priorities from customer interactions, driving retention and growth.

This quickstart is a guide to installing and running your first Lang AI Agent for data analysis in your own Snowflake infrastructure.

Snowflake and Lang logos

Prerequisites

What You'll Learn

What You'll Need

What You'll Build

In this step we will be creating a sample database and a sample view. We will be using this data in the following steps to create our first AI Agent.

Sign in to your Snowflake account and create a new SQL Worksheet.

Creating a new SQL Worksheet

To start, copy the SQL Script and paste it into the SQL Worksheet, then click on the Run All button to execute the script.

Running the script

This script will:

After the script has successfully executed, you will see a LANG_AI_DEMO database with the following tables:

Database created

The tables created by the script already include the required fields to create AI Agents:

The last column Customer_Spend is not mandatory, but it is included as we will configure the agent to use it to group the insights by the customer monthly spending.

You may include additional columns that may be used by the AI Agent to aggregate the insights generated.

Log in to Snowsight as an ACCOUNTADMIN and follow these steps to install the Lang.ai Native App:

1. Install the application

Go to the Snowflake Marketplace and install the Lang.ai Native Application: Snowflake AI Agents.

Once installed, click on the name of the application to open the app.

2. Grant privileges

Click Grant to grant the application the necessary privileges:

Account-level Privileges

Grant Account Level Privileges

3. Launch the app

Click Activate to activate the application.

Navigate back to the Data Products > Apps page and wait for the spinner in the INSTALLED column to stop running. When it's done you'll see "1 minute ago" in that column. Then click Launch App to start the application.

Learn to run your first AI Agent on top of Snowflake data.

Add your company information

Add basic information about your organization to help the AI Agent understand your business context. For this quickstart guide, we'll use Zoom as an example company.

Add company information

Select Your AI Agent

Select a predefined agent or create a custom one to meet your needs. For this quickstart guide using Zoom's synthetic data, we'll analyze survey responses to understand cancellation reasons. You'll see a preview of potential insights the AI Agent might discover, like pricing concerns or platform usability issues.

Select Your AI Agent

Connect Your Snowflake Data

For this quickstart using Zoom's synthetic data, we'll analyze cancellation data by following two steps:

Connect Your Snowflake Data

Step 1: Paste your SQL Query Select the data you want the AI Agent to analyze. For this demo, paste this query to combine cancellation reasons with user data:

SELECT m.ID, m.CANCELLATION_REASON as TEXT, m.DATE as CREATION_DATE, u.PLAN_TYPE as PLAN_TYPE
FROM lang_ai_demo.public.zoom_cancellations m
JOIN lang_ai_demo.public.zoom_users u WHERE u.ID = m.USER_ID;

Required fields:

Step 2: Grant Table Access

A Snowflake admin needs to run these commands to give Lang.ai secure access to your data:

-- Customize the app name "LANGAI_APP" to your own if different
GRANT USAGE ON DATABASE lang_ai_demo TO APPLICATION LANGAI_APP;
GRANT USAGE ON SCHEMA lang_ai_demo.public TO APPLICATION LANGAI_APP;
GRANT SELECT ON TABLE lang_ai_demo.public.zoom_cancellations TO APPLICATION LANGAI_APP;
GRANT SELECT ON TABLE lang_ai_demo.public.zoom_users TO APPLICATION LANGAI_APP;

For this demo, we're connecting to the following tables:

Use the "Check Permissions" button to verify access or "Share with Snowflake admin" to send these commands to your admin.

Once access is granted, click on Next to continue.

Learn how to set up table access and permissions in this 2-minute video here.

Run Your AI Agent for the First Time

Review your agent's configuration before launch. For this quickstart using Zoom's synthetic data, we'll analyze 1,131 cancellation documents from February to August 2024.

Click "Create Agent" to start the analysis. The AI Agent will process your data and discover patterns in cancellation reasons across different user segments.

Run Your AI Agent

Navigate Your Agent Insights

Once the agent has finished processing, click on the table to see the generated insights. In the insights view, you can navigate through the data by sorting and searching.

Navigate Your Agent Insights

Review the Data Associated with the Insights

To view the unstructured text that was analyzed to generate an insight, simply click on the specific insight.

Additionally, you have the option to download the data from your active filters by clicking on Download CSV.

Review Data Associated with Insights

By following this guide, you have successfully set up an AI Agent running on Snowflake to automate your data analysis tasks.

Related Resources

What You Learned