❄️Snowflake Intelligence

Introduction to Snowflake Cortex Agents

Snowflake Cortex Agents are AI-powered orchestration systems that work across both structured and unstructured data sources to deliver insights. They operate through a sophisticated workflow of planning tasks, executing them through various tools (such as Cortex Analyst for SQL generation, Cortex Search for unstructured data, and custom functions), reflecting on results, and generating intelligent responses based on your enterprise data.

Agents eliminate the need for client-side context management by persisting conversation threads, and they can be configured with custom tools to extend their capabilities. In this setup, we're creating an agent that integrates with the Euno.ai platform to provide comprehensive data pipeline intelligence directly within your Snowflake environment.

What We're Setting Up

This setup script creates a complete Snowflake Intelligence Agent that integrates with Euno.ai's data pipeline platform. Specifically, it configures:

  1. Network Access & Security

    • External network rule for secure API communication with Euno.ai

    • Encrypted secrets storage for API credentials

    • External access integration for controlled egress traffic

  2. Core API Functions

    • euno_api_caller: Generic HTTP client for secure Euno.ai API communication

  3. Four Specialized Euno Tools

    • euno_search_data_pipeline_resources: Search for tables, dashboards, schemas, and other pipeline resources

    • euno_ask_data_pipeline: Ask natural language questions about your data infrastructure

    • euno_sql_planner: Get intelligent SQL query planning assistance

    • euno_impact_analysis: Analyze downstream impacts of schema changes

  4. Snowflake Intelligence Agent

    • Pre-configured agent (EUNO_AGENT) with all four tools

    • Custom instructions optimized for data pipeline queries

    • Budget controls and orchestration settings

  5. Access Control

    • Role-based permissions (EUNO_AGENT_USER) for team access

    • Proper grants for databases, schemas, functions, and warehouses

Required Customizations

Before running this setup script, you MUST customize the following values:

1. Euno Account ID (Line 17) - REQUIRED

Replace <YOUR_ACCOUNT_ID> with your actual Euno.ai account identifier. You can find this in your Euno.ai dashboard or contact your Euno.ai administrator.

2. Warehouse Name (Lines 197, 204, 211, 218, 237) - CONDITIONAL

The script uses a warehouse named CORE for executing the Euno functions. If you don't have a warehouse named CORE, or if you want to use a different warehouse for cost or performance reasons, update all occurrences to your preferred warehouse name.

To check available warehouses, run:

3. User Grants (Line 240) - REQUIRED FOR END USERS

Uncomment this line and replace your_user_name_here with the actual Snowflake username(s) who should have access to the Euno agent. You can add multiple grant statements for different users:

Optional Customizations

4. Agent Budget & Limits (Lines 126-128) - OPTIONAL

Adjust these values based on your use case:

  • seconds: Maximum execution time per agent request (default: 300 seconds / 5 minutes)

  • tokens: Maximum token budget per request (default: 16,000 tokens)

5. Agent Profile Customization (Lines 115-119) - OPTIONAL

Customize the agent's appearance in Snowsight:

  • display_name: The name shown to users

  • avatar: Icon style (options include CirclesAgentIcon, HexagonAgentIcon, etc.)

  • color: Visual color theme (purple, blue, green, red, etc.)

While you can change these, it's recommended to keep the standard SNOWFLAKE_INTELLIGENCE.AGENTS naming convention as it aligns with Snowflake's Intelligence suite conventions.

Step-by-Step Setup Instructions

Step 1: Prerequisites Check

Before running the setup script, ensure you have:

  1. Account Permissions: You must have the ACCOUNTADMIN role or equivalent privileges to create network rules, secrets, and external access integrations.

  2. Cortex Access: Verify that your Snowflake account has access to Cortex features:

  3. Warehouse Availability: Confirm you have an available warehouse (the script uses CORE by default):

  4. Euno Account Details: Obtain your Euno.ai account ID and API key.

    To obtain an API token, head to Euno -> Click the user card in the bottom of the sidebar -> "Personal API Keys"

Step 2: Prepare the Script

  1. Download or copy the SETUP.sql script.

  2. Open the script in your preferred SQL editor (Snowsight, SnowSQL, or any SQL IDE).

  3. Make the required customizations outlined in the previous section:

    • Line 17: Set your Euno account ID

    • Lines 197, 204, 211, 218, 237: Update warehouse name if needed

    • Line 240: Add user grants

Step 3: Execute the Setup Script

  1. Connect to Snowflake with an account that has ACCOUNTADMIN privileges.

  2. Run the entire script in a single execution. The script is designed to run top-to-bottom without interruption.

    Via Snowsight (Recommended):

    • Sign in to your Snowflake account and access Snowsight

    • In the navigation menu, select Projects Β» Worksheets

    • Click the + button and select SQL Worksheet to create a new worksheet, or use Create Worksheet from SQL File to import the SETUP.sql file directly

    • If you created a blank worksheet, paste the entire customized SETUP.sql script into the editor

    • In the worksheet context selector (top right), ensure you're using a role with ACCOUNTADMIN privileges

    • Select a warehouse to use for execution (any warehouse will work, as the script switches roles internally)

    • Click Run All (or press Cmd/Ctrl + Enter to run all statements)

    • Monitor the results pane at the bottom for successful execution messages

    Via SnowSQL CLI:

  3. Verify Execution: You should see successful completion messages for:

    • Network rule creation

    • Secret creation

    • External access integration

    • Function definitions (5 functions total)

    • Agent creation

    • Role and permission grants

Step 4: Verify Installation

Run the following verification queries:

  1. Check the agent exists:

  2. Verify functions are created:

    You should see: euno_api_caller, euno_impact_analysis, euno_sql_planner, euno_ask_data_pipeline, and euno_search_data_pipeline_resources.

  3. Test basic connectivity:

    This should return a JSON response from the Euno.ai API.

Step 5: Grant Access to Users

  1. Switch to ACCOUNTADMIN role:

  2. Grant the agent role to specific users (if not already done in the script):

  3. Verify user access: Have a user log in and run:

Step 6: Interact with the Agent

Users can now interact with the Euno agent through multiple interfaces:

Option 1: Snowsight UI

  1. Navigate to AI & ML οΏ½ Agents in Snowsight

  2. Select EUNO_AGENT from the list

  3. Start asking questions like:

    • "What tables are in my production database?"

    • "Show me dashboards that use the users table"

    • "Help me write a SQL query to get monthly revenue"

    • "What would be impacted if I rename the customer_id column?"

Option 2: SQL Interface

Option 3: Direct Function Calls

Troubleshooting

Error: "Network rule validation failed"

Cause: Your Snowflake account may not have egress access enabled or there's a firewall blocking outbound connections.

Solution: Contact your Snowflake account administrator to enable external network access. Verify that api.app.euno.ai is allowed in your organization's network policies.

Error: "Object does not exist, or operation cannot be performed"

Cause: Missing permissions or incorrect role assignment.

Solution:

  1. Verify you're using the correct role: USE ROLE EUNO_AGENT_USER;

  2. Check grants: SHOW GRANTS TO ROLE EUNO_AGENT_USER;

  3. Ensure ACCOUNTADMIN granted the necessary permissions

Error: "HTTP 401" or "HTTP 403" in function responses

Cause: Invalid or missing Euno.ai API credentials.

Solution:

  1. Verify your account ID is correct in the secret

  2. Contact Euno.ai support to confirm your API key is active

Error: "Warehouse not found"

Cause: The CORE warehouse doesn't exist in your account.

Solution: Update the warehouse name in all tool_resources sections (lines 197, 204, 211, 218) to an existing warehouse in your account.

Agent responses are slow or timing out

Cause: Warehouse size may be too small, or budget limits are too restrictive.

Solution:

  1. Use a larger warehouse for the agent functions

  2. Increase the seconds budget in the agent specification (line 127)

  3. Increase the tokens budget if responses are being truncated (line 128)

Cannot see the agent in Snowsight

Cause: Database role SNOWFLAKE.CORTEX_USER not granted.

Solution: The script includes this grant (lines 225-226), but verify with:

If missing, run:

Additional Resources

For more information about Snowflake Cortex Agents, refer to the official documentation:

For Euno.ai-specific support:

  • Contact your Euno.ai account representative

  • Visit the Euno.ai documentation portal

  • Email [email protected] for technical assistance

Sources

Last updated