> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake Agent

A simple Snowflake subject-matter expert agent that answers business questions, runs SQL against Snowflake, explains results in plain English, and helps users explore operational data without writing queries manually.

### **Tutorial Summary**

> * **Goal**: Build a Snowflake SME agent that can query support-ticket data and explain insights clearly.
> * **Estimated Time:** 10-15 minutes
> * **What you’ll build:** A Snowflake-connected agent that understands your default database context, answers operational questions, and summarizes results from the SUPPORT\_TICKETS table.

### **Key Features**

> * Native Snowflake Integration
> * Natural-language Snowflake Q\&A
> * Business-friendly summaries with tables and takeaways
> * SLA-risk ticket analysis, Resolution-time and team workload reporting

### Prerequisites

> * [xpander.ai](http://app.xpander.ai) account
> * Snowflake Warehouse
> * Snowflake Programmatic Access Token
> * Database and table created in Snowflake

## **Step-by-Step Implementation**

### **Step 1 - Create the Snowflake Agent**

In xpander.ai, create a new agent and name it: **Snowflake Agent**

This agent acts as a lightweight Snowflake SME for answering data questions over support-ticket data.

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/Jj5WnSeXuOnCK75K/images/image-38.png?fit=max&auto=format&n=Jj5WnSeXuOnCK75K&q=85&s=1bcc7edb1275108184ec97a46393a5e3" alt="Image" width="2366" height="1506" data-path="images/image-38.png" />
</Frame>

### **Step 2 - Connect Snowflake**

Add the Snowflake connector and configure it using API Key authentication.

Use:

> * Auth: API Key
> * Scheme: Bearer
> * API Key: Your Snowflake Programmatic Access Token
> * Snowflake URL: https\://\<your-account-identifier>.snowflakecomputing.com

### **Step 3 - Add SME Instructions**

Use these instructions to make the agent answer like a business-focused Snowflake SME:

> You are a Snowflake SME agent.
>
> Your job is to help users answer business questions using Snowflake data.
>
> Use the default Snowflake context:
>
> * Role: \<your-snowflake-role>
> * Warehouse: \<your-snowflake-warehouse>
> * Database: \<your-database-name>
> * Schema: \<your-schema-name>
>
> Primary table:
>
> `<your-database-name>.<your-schema-name>`

## **Example Questions**

SLA-risk ticket analysis:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-12.00.54-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=7a4e95eccfa762b305da8450b5e1317f" alt="Screenshot 2026 05 26 At 12 00 54 PM" width="2218" height="1674" data-path="images/Screenshot-2026-05-26-at-12.00.54-PM.png" />
</Frame>

The agent compares average resolution time across products:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-12.04.18-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=138cb83eeb15dce46870db9a7018988b" alt="Screenshot 2026 05 26 At 12 04 18 PM" width="2220" height="1680" data-path="images/Screenshot-2026-05-26-at-12.04.18-PM.png" />
</Frame>

The agent summarizes product-level ticket health and support trends:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-12.08.26-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=0a09dd48d72fb827751512e0d4e2d16d" alt="Screenshot 2026 05 26 At 12 08 26 PM" width="2214" height="1684" data-path="images/Screenshot-2026-05-26-at-12.08.26-PM.png" />
</Frame>

## **Troubleshooting**

> 1. Wrong Snowflake URL: Use the full Snowflake account URL, not just the short account name.
> 2. Invalid or expired token: Generate a new Programmatic Access Token and update the connector.
> 3. Missing network policy: Grant temporary access for the token or configure a valid Snowflake network policy.
> 4. Agent asks for database details: Add the default role, warehouse, database and schema to the agent instructions.
> 5. Permission error: Make sure the connected Snowflake user has access to the warehouse, database, schema, and tables.
> 6. Query does not run: Confirm the warehouse is active and the selected role has permission to use it.

## Conclusion

In this tutorial, you built a Snowflake SME Agent that connects to Snowflake, understands a default database context, and answers support-ticket questions in plain English. The agent can identify SLA-risk tickets, calculate resolution-time metrics, summarize team workload, and explain results with business-friendly takeaways.

Although this example uses a small demo table, the same pattern can be extended to larger Snowflake environments by adding more schemas, richer business rules, and specialized instructions for different data domains.
