Build Your First Snowflake Agent: From Concept to Prototype in 3 steps!

Build Your First Snowflake Agent: From Concept to Prototype in 3 steps!

Agentic AI is more than just the latest buzzword — it’s a game changer! 

Imagine a world where your data doesn’t just sit there waiting for you to ask the right question. Instead, it’s constantly working for you. An intelligent agent that proactively scans your Snowflake data warehouse, identifies drops in key performance metrics like revenue or customer engagement, and autonomously sends real-time alerts to your team — all without waiting for a specific query. 

It’s the difference between reacting to data and interacting with it in a way that drives decisions before problems even surface. Whether you’re in retail, finance, or healthcare, agentic AI makes this level of automation and insight a reality.


Article content

Why Agentic AI?

The traditional workflow for data analysis is reactive: ask a question, write a query, analyze the result. Agentic AI flips that model. Now, intelligent agents can plan multi-step tasks, query data directly, analyze results, and even take follow-up actions — all automated and without human intervention.

This opens the door to endless possibilities including but not limited to:

  • Analytics agents that deliver comprehensive insights by automatically augmenting answers with researched context.
  • Decision-making copilots that model and present the potential outcomes and trade-offs for any "what if" scenario.
  • Intelligent data workflows that automatically diagnose the root cause of any failure and provide a recommended, step-by-step solution.

In this post, we’ll walk you through how to build a simple but functional Snowflake-connected AI agent — from design to prototype.  

If you don’t have a Snowflake account yet, no worries! You can sign up for a free trial here and get instant access to a fully featured Snowflake environment. This is the perfect way to follow along and build your own AI-powered agent hands-on.


What is an Agent (and What Makes It Different)?

A simple definition of an agent in the AI world, is an LLM-powered system that can:

  • Interpret goals (e.g. "Find Clinical trials for X drug in my area")
  • Plan multi-step actions to reach those goals
  • Invoke tools like Cortex Search (Document Retrieval with RAG) or Cortex Analyst (Structured Data Retrieval) to gather data in Snowflake
  • Evaluate results and decide on follow-up actions
  • Adapt and iterate based on feedback

This is very different from a simple LLM query that performs a single task based on a prompt.  The single prompt has limited or no memory of previous interactions, nor the ability to take further actions.   Agents on the other hand, use memory, reasoning loops to think, and sometimes external APIs to accomplish various tasks and processes.


Architecture of a Snowflake Agent

Here’s a basic view of what a prototype agent might look like:

[User Prompt(s)]
     ↓
[Agent Brain (LLM + Planner)]
     ↓
[Tool Execution Layer → Document Retrieval with RAG]
     ↓
[Result Interpreter]
     ↓
[Next Action Decision or Final Output]        

Tools the agent can access:

  • A function like document_retrieval_tool against Snowflake
  • A way to parse and format results
  • APIs, dashboards, or other business systems


Building Your First Agent - Step-by-Step

Let’s build an agent using Snowflake.  For example, we will build a health agent that can look through a database and provide answers to questions pertaining to clinical trials for example.

Step 1: Set Up Your Environment 

For the Agent to operate, we need to give it some knowledge to work from which we will provide in the form of a database access.  To keep things simple, navigate to “Marketplace” on the left panel and search for “Clinical Trials Research Database” and download the data.  This database includes public and private funded clinical trials for a wide range of diseases and conditions.  

Requirements:

  • Snowflake Account: Access to Snowflake with sufficient privileges to create databases, schemas, tables, and get data from the Snowflake Marketplace.
  • Cortex Agents Access: You will need access to Snowflake Cortex service, Cortex Agents, Cortex Search, and Cortex Analyst features.
  • Catalog > Database Explorer Add a new Database named “Data_Dispatch_agent”  to store your agent

Step 2: Create your agent

Navigate to AI&ML and click on Agents to start building your agent.

Click on “create agent”.

Uncheck the “Create this agent for Snowflake Intelligence” for now.  We will cover this at a later time.  For now, lets just make the agent look through the database we just downloaded.

In the dropdown for “Database and Schema”, select the Database name you just created and give your agent a name.  In my case I called my agent “Synapse” to play with the medical term referring to a quick transfer of information.

Click on the agent name and click “Edit” to provide it with some more details like a description of what your agent does!

Modify agent details

In order for your agent to work, you  need to give it specific tools that it will use to respond to queries.  So in our case, we will select “Clinical Trials Research Database” for the database and CT (for clinical trials) as the schema. Next select the “Clinical Trials Search service.” 

Article content

I selected “STUDY_URL” as the ID Column and the Title Column and click “Add”.  Once on the main screen, save your agent. The agent will use the URL in this column as the unique key to identify and retrieve each row of data. When the agent finds relevant information to respond to your query, it uses this ID to pinpoint the exact source document.  The Title column is the text you see on screen, which in this case will be the complete URL instead of plain english text that links to the URL.  You can always modify this response style.

Another database that can be relevant for your agent would be the “PubMed Biomedical Research Corpus” database, also available for free within Snowflake. I personally like researching medical related content, so I went ahead and added that to my agent as well. The process would be similar to what we did for the Clinical Trials database earlier in this step.

Step 3: Try It Out

Your agent is now ready and able to answer queries you may ask.

To test it out, lets give one of the following sample queries like:

  • What clinical trials for diabetes are currently enrolling patients?
  • Which type of GLP 1 clinical trials are ongoing?
  • What types of studies exist to measure general trends and data around diabetes?
  • What percentage of adults are affected with Uveitis?

Notice the “Show Traces” button on the top right.  Click on that to reveal the various steps the agent took to provide you with the response. Notice how it was not a simple prompt/response interaction, but it used various searches, planned a process to improve the response and then generated a response.

Article content

Now, click on your agent name and see the right side of the window show you details of the process your agent went through to fetch your answer.  The “thought” process of the agent before it provides you with a relevant response and the response are both visible.

Article content

Tools

Want to make your agent smarter? All you need to do is edit your agent, go to “Tools” to provide more Cortex Search Services or Cortex Analyst models.

Cortex Search Service: Connect your agent to a search service to allow it to retrieve information from unstructured data sources, such as documents or conversations.

Cortex Analyst (via Semantic View): Add a semantic view to enable the agent to query structured data in your tables.

A semantic model defines the business context and relationships within your data, typically in a YAML file, while a semantic view is a Snowflake database object that implements that semantic model, making the business logic queryable by AI and BI tools. 
A Semantic view stores metrics, dimensions, and facts directly in the database, providing a business-friendly semantic layer for agents and analysts without needing complex SQL.

Remember, when building an agent, you can provide it with specific instructions to control its behavior, tone, and response style to match your preference or the style you prefer.  For example, your agent can respond in a friendly way, or in a more medical expert tone of voice!  


Controlling Agent Behavior

Even a simple agent can go rogue without constraints. Set clear context and tone to guide the agent on its identity and provide context on the application.

Provide negative constraints by telling the agent what not to do. For example, instruct it to never discuss certain topics or access specific types of data.

There are always more ways to make your agents stay safe but these will likely require some experimentation and familiarity with Snowflake. 


What Comes Next?

This is just the beginning. From here, you can diverge in various directions, depending on the time you want to put in to make your agent smarter or more sophisticated. Some ideas include:

  • Add a frontend (e.g. Streamlit or chatbot)
  • Build domain-specific agents for marketing, ops, finance, etc.
  • Fine-tune your agent with retrieval-augmented generation (RAG)

Agentic AI is changing how we work with data. As a Snowflake developer, partner, or data leader you now have the tools to go beyond dashboards and build autonomous, intelligent data systems.

Have questions or want to dive deeper? 

Join the conversation and reach out on our AI Agents forum!

Whether you’re building a copilot for your team or a 24/7 anomaly detector for your pipelines, the foundations are already here.

So build. Experiment. Share. The agents are ready,  are you?


Getting Started with Cortex Agents Build an agent that leverages Snowflake's capabilities for analyzing sales conversations and metrics.

Getting Started with Cortex Agents and Slack Learn and build Cortex Agents that integrate with Slack

Build an Agentic Application with Snowflake Build Data Agents using Snowflake Cortex AI that can intelligently respond to questions by reasoning over both structured and unstructured data.


GET READY FOR SNOWFLAKE BUILD 2025

Roll up your sleeves and deep dive to learn how to build apps, data pipelines and AI models on Snowflake.  Join us November 4-7, 2025 for [BUILD], our global Dev Conference for AI & Apps.

We can’t wait to see what you [BUILD] with AI!


This Month's Highlights:

Interesting, setting up my new snowflake AI Agent

Like
Reply

That’s the leap we’ve been waiting for.

Thanks for the message. I tried to implement the solution by following your post and succeeded. Below are a few challenges I faced and how I resolved them. I wanted to bring these to your attention: Semantic Views on Imported Databases: I was unable to create semantic views directly on top of an imported database. To work around this, I created a local copy of the imported data and used that for building semantic views. Search Engine Setup: The instructions suggested creating a search engine directly. However, in my case, it only worked after I created a Cortex Analyst and linked the search engine to it. This step was crucial for enabling the assistant to return results from the dataset.

Like
Reply

To view or add a comment, sign in

More articles by Snowflake

Others also viewed

Explore content categories