Overview
This guide walks you through the complete process of integrating Snowflake Cortex Agents into your Elementum Apps. By connecting Cortex Agents, you enable AI-powered automation that runs directly on your Snowflake data warehouse, maintaining data security while leveraging advanced AI capabilities. Cortex Agents are configured at the App level through the Intelligence settings, allowing each App to discover and use external agents available through its CloudLink connection. What You’ll Accomplish:- Configure an App’s Intelligence settings to discover Cortex Agents
- Connect external Snowflake Cortex Agents to Elementum
- Integrate external agents into App automations
- Understand the technical architecture and APIs
Prerequisites
Before beginning this setup, ensure you have the following in place:1. Elementum Requirements
App Access
Snowflake AI Provider
2. Snowflake Requirements
Your Snowflake environment must have:- Snowflake Edition: Enterprise or higher
- Cortex AI Features: Enabled on your account
- Cortex Agents: At least one Cortex Agent configured in your Snowflake account
- Permissions: Service account with USAGE privileges on:
- Cortex functions
- Agent resources
- Target database and schema
3. Verify Your Snowflake AI Provider
Before proceeding, verify you have a Snowflake AI Provider configured:Navigate to Organization Settings
Check Snowflake Provider
Test Provider
Step 1: Prepare Snowflake Cortex Agents
Before connecting to Elementum, ensure your Cortex Agents are properly configured in Snowflake.Verify Cortex Agents in Snowflake
- Using Snowflake UI
- Using SQL
- Log into your Snowflake account
- Navigate to AI & ML → Cortex Agents
- Verify your agents are listed and active
- Note the database and schema where agents are located
Required Permissions
Ensure your service account has the necessary permissions:Step 2: Configure Intelligence in Your App
Now you’re ready to discover and configure Snowflake Cortex Agents through your App’s Intelligence settings.Access Intelligence Settings
Navigate to Your App
Open App Admin
Select Intelligence
Add External Agent
Add Agent
Select External
Select Snowflake AI Provider
- Only Snowflake providers with key-pair authentication appear
- The provider must have access to Cortex features
- Multiple providers can be available if you have different Snowflake environments
Discover Agents
- Elementum connects to Snowflake using the provider’s CloudLink credentials
- Queries the Snowflake Cortex REST API for available agents
- Lists all agents accessible through the provider’s service account
Select Cortex Agent
- Agent name
- Agent description
- Database and schema location
- Available capabilities
Configure Agent Settings
Save Configuration
What Happens During Discovery
When you add an external agent, Elementum:- Selects Provider: Uses the selected Snowflake AI Provider’s connection
- Authenticates: Authenticates with Snowflake using the provider’s CloudLink credentials
- Discovers Agents: Queries the Cortex REST API for available agents
- Retrieves Metadata: Gets agent capabilities, schemas, and configuration
- Registers Agent: Makes the agent available for use in App automations
- Monitors Status: Tracks agent availability through the provider connection
Step 3: Understanding Cortex REST APIs
Elementum leverages three primary Snowflake Cortex APIs for agent integration:1. Agent Discovery API
Discovers available agents accessible through your CloudLink. Snowflake Documentation: Cortex Agents REST API What Elementum Retrieves:- Agent names and identifiers
- Agent capabilities and descriptions
- Input/output schemas
- Required permissions
- Configuration metadata
2. Agent Run API
Executes agent tasks and retrieves results. Snowflake Documentation: Cortex Agents Run Used For:- Invoking agents from automations
- Passing input parameters
- Receiving agent responses
- Monitoring execution status
- Handling errors and timeouts
3. Threads API
Manages conversational threads for stateful agent interactions. Snowflake Documentation: Cortex Agents Threads REST API Capabilities:- Create conversation threads
- Maintain context across interactions
- Retrieve conversation history
- Resume interrupted conversations
- Manage thread lifecycle
Step 4: Integrate Agents into Automations
With your Cortex Agent configured in Intelligence, you can now use it in App automations.Using External Agents in Automation Actions
Navigate to Automation Configuration
Add Agent Action
Select Your External Agent
Configure Parameters
- Use field values from the current record
- Reference previous automation action outputs
- Include static values or formulas
- Map agent outputs to record fields
- Store results for later automation actions
- Set error handling behavior
Set Execution Options
- Continue automation with default values
- Halt automation and alert user
- Escalate to human review
Test Integration
Example: Data Analysis Automation
Scenario: Automatically analyze sales data when a monthly report is requestedUsing Agents in Multiple Automations
External agents configured in Intelligence can be used across multiple automations within the same App:Automation Example: Anomaly Detection
Automation Example: Anomaly Detection
-
Call External Agent
- Agent: Fraud Detection Agent (Cortex)
- Input: Transaction details and customer history
- Output: Risk score and explanation
-
Conditional Logic
- If risk_score > 75: Flag for review and notify security team
- If risk_score 50-75: Request additional verification
- If risk_score < 50: Auto-approve transaction
-
Log Results
- Record analysis in audit log
- Update transaction status based on outcome
Step 5: Monitor and Maintain
Monitoring Agent Performance
Automation Logs
- Invocation frequency
- Response times
- Success/failure rates
- Error messages
Intelligence Dashboard
- Active agent connections
- Last successful execution
- Configuration changes
- CloudLink status
Provider Connection Health
Since external agents depend on the Snowflake AI Provider:- Monitor Provider Status: Ensure the provider and its CloudLink remain active
- Check Connectivity: Regularly test Snowflake connectivity through the provider
- Review Permissions: Verify service account permissions haven’t changed
- Update Credentials: Rotate provider CloudLink keys according to your security policy
Maintenance Tasks
- Regular Maintenance
- Updating Agents
- Scaling Considerations
- Review automation logs for agent errors
- Monitor agent performance metrics
- Check for timeout or failure patterns
- Review agent usage and optimization opportunities
- Audit permissions and access patterns
- Test agent functionality after Snowflake updates
- Rotate provider CloudLink credentials
- Review and optimize automation integrations
- Evaluate new Cortex Agent capabilities
Configuration Best Practices
Security Best Practices
Access Control
Credential Management
Performance Optimization
-
Warehouse Sizing
- Use appropriately sized warehouses for agent complexity
- Consider multi-cluster warehouses for concurrent agent calls
- Enable auto-suspend to minimize costs
-
Provider Management
- Provider connections are reused across multiple agent invocations
- Monitor provider connection performance metrics
- Configure appropriate timeout values
-
Timeout Configuration
- Set realistic timeouts based on agent complexity
- Implement progressive timeout strategies
- Consider async patterns for very long-running operations
-
Caching Strategies
- Cache agent responses for identical inputs
- Implement time-based cache invalidation
- Use Snowflake result caching when appropriate
Error Handling Patterns
Retry Logic
Retry Logic
Fallback Strategies
Fallback Strategies
Troubleshooting
Discovery Issues
No Agents Discovered
No Agents Discovered
- Snowflake AI Provider not configured or inactive
- Provider’s CloudLink has wrong permissions
- No Cortex Agents configured in Snowflake
- Service account lacks USAGE privileges
- Verify Snowflake AI Provider is configured in Organization Settings → Providers
- Check that provider uses a CloudLink with key-pair authentication
- Run
SHOW CORTEX AGENTSin Snowflake to verify agents exist - Verify service account has USAGE privileges on Cortex
- Check database and schema permissions
- Test provider connection in Provider settings
Provider Authentication Failed
Provider Authentication Failed
- Provider CloudLink not configured with key-pair authentication
- Expired or invalid credentials
- Network connectivity issues
- Snowflake account unavailable
- Verify provider uses CloudLink with key-pair authentication (not password)
- Test provider connection in Organization Settings → Providers
- Check for expired credentials and refresh provider if needed
- Verify network connectivity to Snowflake
- Confirm Snowflake account is active and accessible
- Review provider configuration and CloudLink settings
Permission Denied Errors
Permission Denied Errors
- Missing USAGE grant on Cortex
- Insufficient privileges on agent
- Role not properly assigned
- Database or schema access missing
Runtime Issues
Agent Timeout
Agent Timeout
- Agent task too complex for timeout setting
- Insufficient Snowflake warehouse resources
- Network latency issues
- Agent accessing large datasets
- Increase timeout value in automation configuration
- Scale up Snowflake warehouse for agent workload
- Optimize agent queries and data access
- Consider splitting complex tasks into multiple automation actions
- Use async invocation for long-running operations
Agent Returns Unexpected Results
Agent Returns Unexpected Results
- Input parameters incorrect or malformed
- Agent configuration changed in Snowflake
- Schema version mismatch
- Data quality issues in source data
- Validate input parameters match agent expectations
- Test agent directly in Snowflake with same inputs
- Check for recent agent updates or schema changes
- Review agent logs in Snowflake for execution details
- Verify data quality and completeness
High Latency
High Latency
- Undersized Snowflake warehouse
- Network latency between Elementum and Snowflake
- Agent querying large datasets inefficiently
- Cold warehouse startup time
- Use larger warehouse for agent operations
- Keep warehouse running during peak usage (disable auto-suspend temporarily)
- Optimize agent queries and data access patterns
- Consider warehouse dedicated to agent workloads
- Implement result caching for repeated queries
Multi-App Configurations
Using Agents Across Multiple Apps
Each App configures its own external agents through Intelligence:Configure Per App
Provider Selection
- The same Snowflake AI Provider (shared access)
- Different providers (isolated access or different Snowflake environments)
Independent Configuration
- Select different providers pointing to different Snowflake accounts
- Use different agents from the same provider
- Configure the same agent differently
- Have unique timeout and error handling settings
Monitor Separately
Multi-Environment Setup
For organizations with multiple environments (dev, staging, production):Environment-Specific Providers
Configure Agents Per Environment
Test Thoroughly
Promotion Process
- Test agent connectivity in target environment
- Verify provider configuration is correct for the environment
- Validate automation configurations
- Monitor closely after deployment
Example Use Cases
Use Case 1: Automated Data Quality Checks
Scenario: Automatically validate data quality when new datasets are loaded Implementation:- Create Cortex Agent in Snowflake for data profiling and quality analysis
- In your Data Management App, configure the agent through Intelligence
- Set up automation trigger on data load completion
- Agent analyzes dataset and returns quality metrics
- Automation creates alerts or blocks further processing based on results
- Immediate data quality feedback
- Prevents downstream issues from bad data
- Reduces manual validation effort
- Maintains audit trail of quality checks
Use Case 2: Intelligent Customer Support
Scenario: L1 support agent with direct access to customer data warehouse Implementation:- Create Cortex Agent trained on support knowledge base and customer data
- Configure agent in Support App through Intelligence
- Integrate agent into support automation
- Customer inquiry triggers agent to analyze history and suggest resolution
- Agent creates ticket with context and recommended actions
- Faster response times for customers
- Consistent support quality
- Reduces escalations to L2 support
- Data stays secure in Snowflake environment
Use Case 3: Financial Reporting Automation
Scenario: Generate executive reports with natural language insights Implementation:- Create Cortex Agent for financial analysis and narrative generation
- Configure agent in Finance App through Intelligence
- Schedule monthly report generation automation
- Agent analyzes trends, generates insights, and creates narrative
- Report distributed automatically with executive summary
- Consistent reporting schedule
- Natural language insights for non-technical stakeholders
- Reduces analyst workload
- Real-time access to latest data
Next Steps
Agent Orchestration Center
Agent Architecture
Automation System
Snowflake Cortex Docs
By integrating Snowflake Cortex Agents through your App’s Intelligence configuration, you create a powerful automation ecosystem that combines the flexibility of AI with the security of keeping your data in your own warehouse. This architecture ensures compliance, performance, and scalability for enterprise deployments.