“Show me a demo where an AI agent queries data and sends an email.”
Every vendor has one. The real question is: Does it work in production?
Snowflake Cortex Agents reached General Availability in November 2025. Three months in, we’re seeing the first wave of production deployments—and the results are worth examining.
Features change from time to time with new features being added regularly, it is recommended that you review the documentation ↗ for the latest on what specific features are included with any of the Editions.
The Numbers That Matter#
Before we dive into architecture, let’s look at actual reported outcomes:
- RNDC (wine distributor): 20% reduction in forecasting errors
- Mid-sized retail chain: 25% reduction in overstock during peak seasons
- Toyota Motor Europe: Agent deployment time reduced from months to weeks
- Snowflake’s AI revenue: Hit $100M run rate one quarter earlier than anticipated
- Adoption: 1,000+ customers and 15,000+ agents on Snowflake Intelligence
These aren’t lab results. They’re production metrics from regulated enterprises.
What Makes Cortex Agents Different#
The Architecture#
Cortex Agents aren’t just LLM wrappers. They’re an orchestration layer that combines:
- Cortex Analyst: Text-to-SQL with semantic model grounding
- Cortex Search: Vector-based retrieval for unstructured data
- Tool Orchestration: Multi-step reasoning with governed actions
┌─────────────────────────────────────────────────────────────┐
│ Cortex Agent │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Planner │→ │ Tool Caller │→ │ Responder │ │
│ │ (LLM) │ │ (Router) │ │ (LLM) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ ↓ ↓ ↓ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Cortex │ │ Cortex │ │ External │ │
│ │ Analyst │ │ Search │ │ Functions │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘plaintextWhy This Works Better#
Traditional LLM-to-SQL (ChatGPT + database):
- Hallucinates table names
- Generates syntactically correct but semantically wrong queries
- No governance boundary
Cortex Agent with Semantic Models:
- Constrained by your semantic layer (business definitions)
- Grounded in actual schema metadata
- Operates within Snowflake’s RBAC and masking policies
Building a Production Agent: Step by Step#
Step 1: Define Your Semantic Model#
The semantic model is the foundation. It maps business terms to SQL logic:
# semantic_model.yaml
name: sales_analytics
description: Sales performance metrics for the retail division
tables:
- name: fact_sales
description: Transaction-level sales data
base_table: ANALYTICS.MARTS.FCT_SALES
dimensions:
- name: region
description: Geographic sales region (EMEA, APAC, AMER)
expr: region_code
sample_values: ['EMEA', 'APAC', 'AMER']
- name: product_category
description: Product category hierarchy level 1
expr: category_l1
measures:
- name: revenue
description: Total revenue in USD
expr: SUM(order_total_usd)
aggregation: sum
- name: units_sold
description: Count of units sold
expr: SUM(quantity)
aggregation: sum
- name: average_order_value
description: Average order value (revenue / order count)
expr: SUM(order_total_usd) / COUNT(DISTINCT order_id)
aggregation: derivedyamlCritical: Invest time here. The quality of your semantic model determines the accuracy of agent responses. Treat it like code—version control it, review changes, test it.
Step 2: Create the Cortex Search Service (Unstructured Data)#
If your agent needs to query documents (support tickets, contracts, product specs):
CREATE OR REPLACE CORTEX SEARCH SERVICE support_ticket_search
ON support_tickets
WAREHOUSE = analytics_wh
TARGET_LAG = '1 hour'
AS (
SELECT
ticket_id,
customer_id,
ticket_text,
resolution_notes,
created_at
FROM raw.support.tickets
WHERE status IN ('resolved', 'closed')
);sqlStep 3: Deploy the Agent#
CREATE OR REPLACE CORTEX AGENT sales_assistant
SEMANTIC_MODEL = '@models/sales_analytics.yaml'
SEARCH_SERVICES = (support_ticket_search)
DEFAULT_MODEL = 'claude-3-5-sonnet'
SYSTEM_PROMPT = $$
You are a sales analytics assistant for Acme Corp.
When asked about revenue, always clarify the time period.
If data seems anomalous, flag it for human review.
Never expose individual customer PII in responses.
$$;sqlStep 4: Test with Representative Queries#
-- Test structured data query
SELECT SNOWFLAKE.CORTEX.AGENT(
'sales_assistant',
'What was our MoM revenue growth in EMEA for Q4 2025?'
);
-- Test unstructured data query
SELECT SNOWFLAKE.CORTEX.AGENT(
'sales_assistant',
'What are the top complaints about our premium product line?'
);
-- Test combined query
SELECT SNOWFLAKE.CORTEX.AGENT(
'sales_assistant',
'Which regions had declining revenue AND increasing support tickets?'
);sqlReal-World Use Cases#
Use Case 1: Inventory Optimisation (Retail)#
Problem: Buyers over-order during peak seasons “just in case.”
Agent Implementation:
- Semantic model includes historical sales, inventory levels, lead times
- Agent analyses demand patterns and recommends order quantities
- Integrates weather data (external) and promotional calendar (internal)
Result: 25% reduction in overstock, freeing millions in working capital.
Use Case 2: Sales Forecasting (Distribution)#
Problem: Regional forecasts vary wildly in accuracy.
Agent Implementation:
- Combines structured data (orders, shipments) with unstructured (sales rep notes)
- Identifies leading indicators (e.g., “customer mentioned expansion plans”)
- Generates weekly forecasts with confidence intervals
Result: 20% reduction in forecasting errors.
Use Case 3: Executive Self-Service (Cross-Industry)#
Problem: Executives wait days for ad-hoc analysis from BI team.
Agent Implementation:
- Executive-facing Streamlit app with natural language interface
- Agent queries across finance, sales, and operations domains
- Governance ensures executives only see data appropriate to their role
Result: Time-to-insight reduced from days to minutes.
Governance: The Non-Negotiable#
Row-Level Security Applies Automatically#
If a user has RLS policies on a table, the agent respects them:
-- User A (EMEA region) asks: "Show me all sales"
-- Agent generates: SELECT * FROM sales
-- Snowflake applies RLS: WHERE region = 'EMEA' (automatically)sqlMasking Policies Apply Automatically#
-- User B (non-Finance role) asks: "Show me employee data"
-- Agent returns masked salary: '***MASKED***'sqlAudit Everything#
-- Query agent activity
SELECT
query_id,
user_name,
query_text,
agent_name,
start_time
FROM snowflake.account_usage.query_history
WHERE query_tag LIKE '%CORTEX_AGENT%'
ORDER BY start_time DESC;sqlCommon Pitfalls#
Pitfall 1: Vague Semantic Models#
Problem: Agent generates plausible but wrong queries because “revenue” isn’t clearly defined.
Solution: Be explicit. “Revenue” should specify: gross vs. net, currency, exclusions (returns, discounts).
# Bad
measures:
- name: revenue
expr: SUM(amount)
# Good
measures:
- name: net_revenue_usd
description: Net revenue in USD, excluding returns and discounts, converted at daily FX rate
expr: SUM(order_total_usd) - SUM(discount_usd) - SUM(return_amount_usd)yamlPitfall 2: No Guardrails on Agent Actions#
Problem: Agent triggers expensive queries or modifies data unexpectedly.
Solution: Use read-only roles for agents. Set query timeouts and resource monitors.
-- Create a restricted role for the agent
CREATE ROLE agent_reader;
GRANT SELECT ON SCHEMA analytics.marts TO ROLE agent_reader;
-- No INSERT, UPDATE, DELETE
-- Use this role in agent configuration
CREATE CORTEX AGENT ... QUERY_ROLE = 'agent_reader';sqlPitfall 3: Ignoring the Feedback Loop#
Problem: Agent quality degrades over time as data and business logic change.
Solution: Implement a feedback mechanism. Log agent responses, flag errors, retrain semantic models.
The Anthropic Partnership#
Snowflake’s $200M deal with Anthropic means Claude is now a first-class citizen in Cortex. In practice:
- Claude 3.5 Sonnet is the default model for Cortex Agents
- Fine-tuning on proprietary data is available (within governance boundaries)
- Joint go-to-market means better support and faster feature development
What’s Next: 2026 Predictions#
Based on the current trajectory:
-
Protocol Standardisation: Snowflake CEO Sridhar Ramaswamy predicts an “HTTP moment” for agent collaboration—a dominant protocol for agents to communicate.
-
Write-Capable Agents: Currently, production agents are read-only. Expect governed write operations (e.g., “Update the forecast for Q2”) by mid-2026.
-
Cross-Platform Agents: Agents that span Snowflake, Salesforce, and Slack—triggered by business events, not just user queries.
Conclusion#
Cortex Agents are past the demo stage. The enterprises deploying them are seeing real ROI: reduced forecasting errors, optimised inventory, faster executive insights.
The key to success isn’t the AI—it’s the foundation:
- Semantic models that accurately reflect business logic
- Governance that ensures agents respect your access policies
- Feedback loops that keep agents accurate over time
Key Takeaways:
- Cortex Agents combine Analyst (structured), Search (unstructured), and LLM orchestration
- Semantic models are the foundation—invest in them
- Governance is automatic (RLS, masking) but audit everything
- Real production results: 20-25% improvements in forecasting and inventory
Features change from time to time with new features being added regularly, it is recommended that you review the documentation ↗ for the latest on what specific features are included with any of the Editions.