Cortex Agents: Unifying Data Insights with Snowflake

In the modern enterprise environment, data exists across structured databases and unstructured textual sources — often distributed, siloed and challenging to query in unison. Users increasingly expect a single seamless experience that integrates structured analytics and unstructured search, allowing complex questions to be answered quickly and reliably.
In this blog, we will talk about some of the technical challenges in building Snowflake’s Cortex Agents, our powerful new agentic system that is built to combine Snowflake’s existing products for conversing with data. We do this by combining three separate services:
Cortex Search
Snowflake’s proven, low-latency hybrid (vector + keyword) search service that allows users to quickly set up reliable retrieval of text documents stored in Snowflake, currently in general availability. Enterprises primarily use Cortex Search to:
Provide contextual information to large language model (LLM) chatbots (retrieval-augmented generation).
Power robust enterprise search solutions without infrastructure maintenance and tuning.
Cortex Analyst
This API allows users to ask business questions about structured data in Snowflake in natural language, automatically translating these requests into SQL queries executed inside Snowflake, currently in general availability. With Cortex Analyst:
Nontechnical users can easily get reliable analytics from structured data.
API-first integration allows embedding natural language analytics directly into existing workflows.
Semantic models optionally ensure high precision by bridging user language with database structures.
Cortex Agents
Our tool (currently in private preview) combines these two robust tools into a single, streamlined, multi-turn conversational interface, empowering users to ask sophisticated questions involving both structured and unstructured data in a unified manner.
Background: Unified multitool conversations
Consider a customer service manager who needs comprehensive insights into ongoing issues:
Conversation example
User: “Show me recent support cases mentioning internet outages in North America.”
Behind the scenes: Cortex Agents recognizes the user is requesting unstructured content and routes to Cortex Search to retrieve relevant support transcripts.
- Agent: Here are recent support transcripts mentioning internet outages from North America:
- Transcript 102: 'My internet has been down since yesterday.'
- Transcript 109: 'Experiencing intermittent internet outages all week.'
Now, suppose the user follows up with a structured data analytics request:
User: “What percentage of our North America customers reported internet outages last month?”
Behind the scenes: Here, Cortex Agents automatically switches context, recognizing this query is about structured data analytics:
It uses Cortex Analyst to generate a precise SQL query.
The query is executed securely in Snowflake, respecting data governance and access controls.
Agent: “In the last month, 8.7% of North American customers reported an internet outage.”
By integrating both Cortex Search and Cortex Analyst into a single conversational flow, Cortex Agents delivers richer, context-aware responses across multiple queries seamlessly.
Why data tool calling isn’t just API calling
Calling into specialized data tools like Cortex Search and Cortex Analyst differs significantly from standard API function calls. While typical API functions have small, well-defined parameters, data tools can involve much larger, more complex specifications:
- Semantic richness: when working with data tools with rich underlying structure, the user is not just calling a function named
getData
. The user’s question may reference domain concepts that involve advanced metrics, relationships, and business logic. For example, consider a semantic model used by Cortex Analyst:
name: economics_indicators
description: >-
This semantic model represents economic indicators and FOMC policy decisions.
It enables querying and analysis of key macroeconomic metrics, monetary policy
changes, and their contextual relationships...
tables:
- name: economics_indicators_fomc_demo
description: Economic indicators and FOMC policy decisions.
base_table:
database: CORTEX_SEARCH_DB
schema: ANALYST
table: ECONOMICS_INDICATORS_FOMC_DEMO
dimensions:
- name: DATE
synonyms: ["record date"]
description: The date associated with the economic indicators...
expr: DATE
data_type: date
- name: REAL_GDP_GROWTH
synonyms: ["gdp growth", "economic growth"]
description: Real GDP growth rate as a percentage...
expr: REAL_GDP_GROWTH
data_type: number
...
time_dimensions:
- name: DATE
synonyms: ["record date", "event date"]
description: The date when the economic indicators and policy decisions...
expr: DATE
data_type: date
filters:
- name: DATE
synonyms: ["record date"]
description: Filter by the date of the record.
expr: DATE
- name: UNEMPLOYMENT_RATE
synonyms: ["jobless rate filter"]
description: Filter records by unemployment rate.
expr: UNEMPLOYMENT_RATE
This single YAML snippet already shows how complex and robust the specification is. The system needs to translate business-friendly queries into reliable references to UNEMPLOYMENT_RATE
, REAL_GDP_GROWTH
, or PCE_INFLATION
, often with synonyms like “jobless rate” or “price index.” This is more than a simple function call with five parameters — it’s a rich semantic layer of information.
2. Large specifications: These semantic models can be thousands of tokens long, containing columns, filters, relationships, synonyms, default aggregations and more. A typical function-call approach (like a simple JSON schema) often hits token or size limits.
3. Precision demands: A question such as, “How do FOMC policy changes correlate with inflation when GDP is above 3% growth?” requires:
- Understanding “policy changes” as a dimension in the semantic model (
KEY_POLICY_CHANGE
).
Correctly filtering on
REAL_GDP_GROWTH > 3.0
.Possibly aggregating or joining across time dimensions to find correlation with inflation.
Misinterpreting these steps leads to incorrect or misleading answers without the end user even knowing!
Hence, calling data services is less about “calling an endpoint” and more about combining advanced reasoning with semantic knowledge about what’s in a data source. This is highly non-trivial and something that standard function-call approaches do not address at scale. We will go so far as to say
No AI data agent can work accurately without a semantic specification of the underlying data.
Multi-semantic model routing
Adding semantic models for the data sources presents a new set of challenges. When organizations maintain multiple semantic models for different domains (e.g., one for economic indicators, another for customer service analytics and yet another for supply chain data), determining which semantic model best fits a user query can be a major challenge. Typical issues encountered in this context include:
Context limits: Simply dumping all model details into an LLM prompt risks exceeding token capacity — especially for LLMs that have strict prompt-size constraints.
Performance considerations: Analyzing large semantic models can be resource-intensive. Naïvely passing everything into an LLM might result in slow, expensive queries.
Accuracy: If the system picks the wrong semantic model, the user may receive an irrelevant or incorrect answer. For example, if the system used a marketing analytics model responding to a question about Fed funds rate changes rather than the economics_indicators_fomc_demo model, the user would likely get information about marketing campaign performance or customer segmentation instead of data on interest rate fluctuations.
To address these problems, we came up with a multistage routing approach that determines the relevant semantic model to call, using an efficient retrieval-backed pipeline.
Our multistage routing approach:
- Pruning: Each semantic model is scanned for key columns or verified queries that might align with the user’s prompt. Irrelevant details are filtered out.
- Retrieval: The pruned representations of all candidate models are embedded, and a similarity-based retrieval is performed to find the Top-K likely model matches.
- Final selection: A powerful LLM then “reads” these Top-K pruned models in more detail, deciding which single model (or combination of models) best fits the user’s query.

Snowflake’s multistage routing approach helps ensure an optimal balance of accuracy and speed:
Accuracy by focusing on relevant tables, columns and past queries.
Speed by filtering out irrelevant models before the final LLM call.
Scalability by structuring the entire routing pipeline around modern embedding and retrieval techniques.
Governance and security built in
Enterprise-grade governance is integral to Cortex Agents:
Data governance: All operations, including structured SQL queries and unstructured document retrieval, are performed subject to data governance standards you implemented in Snowflake, enabling secure handling of your data at all times.
Access control: Cortex Agents adheres strictly to Snowflake’s role-based access policies, helping protect sensitive data.
Auditing: Complete visibility into query execution and usage patterns enables transparent operations and easy debugging.
Conclusion
Snowflake’s Cortex Agents represents a leap forward in enterprise conversational intelligence, blending Snowflake’s proven Cortex Search and Cortex Analyst functionality into a single unified experience. Cortex Agents simplifies user interactions with complex data environments, enabling both structured analytics and unstructured search in one governed and intuitive API.
By handling intricate multi-turn and multi-tool conversations seamlessly, Cortex Agents empowers business teams to extract deep, reliable insights faster, enhancing productivity and decision-making without compromising governance or security standards.
And we’re not done yet. Cortex Search and Cortex Analyst are just two of the many data tools Snowflake supports. As we continue evolving Cortex Agents, we’re exploring ways to bring even more Snowflake native capabilities into a unified, conversational experience.
Visit these quickstart guides to explore Cortex Agents and begin to transform how your organization leverages data intelligence today: