Get startedGet started for free

Creating Your Agent

1. Creating Your Agent

You've built semantic views for structured metrics. You've built a search service for conversation transcripts. Now, we create the agent that orchestrates these tools. This is where everything comes together. I'm in Snowflake. Navigate to AI and ML, then Agents. This is the Agents tab where we build and manage agents. Click Create Agents in the top right. Select Sales Intelligence for our database and Data for our schema. Let's make the agent object name and display name Sales Intelligence Agent. Click Create Agent. For description, type a sales intelligence agent that analyzes B2B sales data by combining structured deal metrics with unstructured sales conversation insights. This tells users what the agent does. For an example question, let's add, what are the main concerns in the TechCorp discovery call? Now, let's add tools. Click the plus sign to add a Cortex Analyst tool. For database, we'll use our Sales Intelligence and for schema, we'll select Data. Then we select the Sales Metrics view. For the name, we're going to go ahead and call it the Sales Metrics view. Then we're going to generate the description with Cortex. The rest, we'll leave as default. This connects the agent to structured data. Click Add. Next, we're going to add a Cortex Search tool. Click Add. Again, our database will be Sales Intelligence and for schema, we're going to select Data. Let's leave the max result as is. For the ID column, we'll select Conversation ID. For the title column, we will use Customer Name. We'll name the search Sales Conversations Search. And for the description, we'll say this search tool contains all of our sales conversations with our customers. This connects the agent to conversation transcripts. Click Add. Then we're going to click Save on the top right. Your agent now has both tools configured. You will autonomously decide which one to use based on the question. Now, the most important part, orchestration instructions. This teaches the agent when to use each tool. Type, you are a sales intelligence agent designed to help sales teams make data-driven decisions. You have access to both structured sales metrics and unstructured sales conversation transcripts. Then we'll continue with, when users ask about quantitative metrics like win rate, deal values, or sales performance, use the Sales Metrics semantic view. When users ask about conversation content, customer concerns, or what is discussed in calls, use the Sales Conversations Search service. For complex questions requiring both, use both tools. Use both tools. Then let's add, if a question is ambiguous, ask a clarifying question instead of guessing. Always cite your sources. When you use the semantic view, mention you queried sales metrics. When you use search, mention which conversations you found. Provide actionable insights, not just raw data. These instructions are the agent's operating system. They guide every decision it makes. For now, we will leave the response instructions blank and let's click Save on the top right-hand corner. Now let's give it a test. We will try out our example question. You probably know this answer as much as the agent does. It reports that integration timeline concerns with legacy system X, potential disruptions during migration, API compatibility questions, and mentions Q2 budget allocation. Now the real test, a question needing both tools. Type which deals are most likely to close next quarter and why. Watch what happens. First, it queries metrics to find deals in late stages. First, we have the upgrade now corp for 65,000. And then we have growth startup for 100,000. Third, we see health tech solutions for 120,000. As you can see, it pointed out the key risk factors as well as any follow-up that we need. Now, let's take a look at the results. It pointed out the key risk factors as well as any follow-up that we need. The follow-up that is pending is with the compliance team that's still needed. Finally, we see the agent synthesizes both into a prioritized recommendation. First, for bringing upgrade now corps for the easiest close. Then, while ensuring health tech's compliance documentation is being prioritized given the tight January timeline. Now your results might look slightly different from mine. Agents can take different paths to reach an answer, and that's completely normal. The underlining language models are non-deterministic, which means you might see some variances in how the agents orders its tool calls or structure these responses. If you want more consistent behavior for specific scenarios, you can add more detailed orchestration instructions to guide the agent's decision-making process. But for now, what matters is your agent is using both tools to answer complex questions. This is autonomous behavior. It didn't tell it to use both tools. The agent figured out based on your instructions and the question. Let's now test the multi-turn context. Type, what's our average deal size for enterprise suites? The average deal size is 85,000. Now type, which conversations mention the product we talked about? Without starting a new conversation, the agent understands the product we talked about means enterprise suite. It searches and finds three conversations. One with TechCorp, one with Growth Startup, as well as Global Trade. And now let's type, are those deals typically won or lost? The agent queries metrics for enterprise suite. The win rate is 100%. Of two deals, two deals were won. It maintains complete context across the three questions. Your agent is working. It selects the right tools based on the question type. It combines tools when needed. It maintains context across multiple turns, and it provides insight, not just data. In the next video, we'll look at optimizing agent performance through instruction refinement.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.