Building AI Agents in Copilot Studio
Speaker

SUMMARY
Learn how to build an AI agent in Microsoft Copilot Studio, from designing effective instructions to configuring knowledge, tools, and automation. This video explains the difference between AI assistants and AI agents, demonstrates how to create an agent using the DIRECT prompting framework, and walks through connecting data sources, enabling actions, testing with the Activity view, and monitoring usage. It concludes with a real-world example of an autonomous content audit agent that researches documentation, identifies outdated resources, and posts prioritized recommendations to Slack.
TRANSCRIPT
00:00 Hello everyone and welcome to today's video where we're going to be learning how to build an AI agent using Microsoft Copilot Studio.
00:10 So before we dive in, I want to just clarify the distinction between AI assistants and AI agents. And this is really significant in Microsoft Copilot specifically, because in the agent builder within M365 Copilot, even though the terminology is listed as agents.
00:32 Right here. You're actually just creating an AI assistant. So, what is the key distinction between agents and assistants? Well, AI assistants are grounded in knowledge.
00:45 They can answer questions, they can be great thought partners, but they can't go and take actions on your behalf. They're not autonomous.
00:55 AI agents, on the other hand, they have a persona built into them with skills, experience, and expertise, but they also have the ability to go and take actions on your behalf.
01:07 For example, they can send a Slack message to your actual Slack account, or they can send an email on your behalf.
01:15 AI agents have that read and write capability. AI assistants, however, are read only.
01:23 Alright, so here we are in Copilot Studio. Just something fun, little side note before we begin, is if you want to customize this banner up here, you can do so by clicking in the upper right-hand corner.
01:37 There's a settings wheel, and then choosing the theme. Just makes this process more fun before we get started. So, jumping right into it.
01:49 In Copilot Studio, you can either be on the Home tab or the Agents tab. Both will have this prompt box.
01:55 For you to enter the prompt to create your agent. Additionally, you have on the Home tab the option to create an agent or a workflow.
02:05 So, a workflow, you would use that if you have lots of things that need to be connected that are triggered.
02:11 By a specific event, but an agent is where you can bake more of that personality, more of the knowledge, background experience, and skills into.
02:22 So, we're creating an agent together, and what I encourage you to do before you begin is just think about thinking through the direct prompting framework, kind of as a checklist for the things that you want your agent to know.
02:33 And so, in my case, I'm thinking through, what do I D, what do I want my agent to be doing for me?
02:39 This includes the frequency of how often I want it to perform the task. And so, that's where you see I mention Monday at 9 a.m., and then I explain the process of what I want it to do.
02:50 You really want to think through the information, both in terms of knowledge that you want it to have, and where you want it to pull knowledge, and what types of websites are okay versus not okay, and what tools, perhaps, do you want it to connect to, because with these agents, let's say I want it to
03:07 have all of my SharePoint site information, that's knowledge that I want it to have, but then that is a tool that I actually need to connect, so that it has access to all of that knowledge.
03:17 So, think through each of those elements, and also be specific. For example, I mention, for each resource that you research, scan the content and perform web-based research on each,
03:31 to compare the existing context with the most updated documentation for the resource topic. so I have stated that I wanted to find the most updated information, but how is that defined?
03:43 And so for anything that's very precise, just define it. You see, I told it by most updated, the documentation should have been posted or updated within the last seven dates.
03:54 And so any time you're going to further clarify and define some, some information. Just put it in quotes and then refer to it later.
04:04 Same thing with knowledge that you're uploading. So another example is that I have uploaded a ClickUp Educate Tasks document. and in my instructions, I'm going to reference that document using quotes and explain how I want the agent to use that knowledge.
04:24 So, that's just a tip, anytime you're clarifying some ambiguous term, or you are referencing specific files and documentation that you're going to upload in the knowledge section of your agent.
04:40 So, like I said, think through each element of direct, you see, for example, I've defined the output tone and color.
04:47 In style, and then once you've thought through those, you can then articulate them here in the prompt box and just kind of feel free to word vomit here.
04:57 Basically, once you send this to CoPilot Studio, it is going to use its agent skill ability. To actually put this in an instruction set that the agent will be able to comprehend and work with.
05:09 . But it is important on the front end that you really think through all of the important things. And that's why direct is a very nice even checklist to go with.
05:19 So you see, because we created an agent, it's now put us in that Agents tab. And basically, it has, like I said, created those instructions for us in the format.
05:38 You see, this is the Markdown style, so I didn't have to do anything. I just put my instructions in via natural language.
05:44 And then, here on the back end, Copilot Studio has configured the instructions, read over those, but it shouldn't be making up anything.
05:53 It should be very close to what you have put with your prompt. That looks good to me. Now, something else you can do is upload an image, if you want to change the icon for your agent.
06:07 You can do so here, just uploading that, PNG. The description is what you're going to read when you access this agent.
06:16 So, I like to think of this as a short description of what this agent does. Let's see, it says, every Monday at 8 a.m.
06:23 PT, audits gradual site resources for accuracy against official vendor documentation and flags outdated content for review. That's a good summary of what this agent does.
06:33 Another cool thing with agents is that you can actually select the model that it uses, and so this is important, uh, because Copilot Studio is consumer-based, so you want to use a model that optimizes for the capability that you need, but also isn't too costly.
06:51 For that, I may change to GPT five Chat, because Claude tends to be on the more pricey side.
07:02 The next thing that we're going to go over is this knowledge section. And this is where you can upload all of those specific files that you referenced in your instructions.
07:13 And so, like I mentioned, I referenced a ClickUp document. Right here, ClickUp Educate Tasks in my instruction set. You'll notice here that that PDF is labeled exactly as I referenced in the quotes in my instructions.
07:30 Other types of knowledge that you may want to upload are specific public websites. So, I have links to the official documentation I wanted to use for research.
07:40 I have links to our internal site for LearnAIR. So, any public websites you want to add, just upload those there.
07:49 As well as any actions that you want your agent always to have access to. So, if I connect my agent to any of these apps down here, whether it's SharePoint or Salesforce, whatever my Microsoft account has access to, by connecting these apps, the agent will also have readability access.
08:06 So, my to any of If you only want to upload very specific files, so you don't want it to access your entire SharePoint site, you only want it to access specific files within SharePoint, you can upload them here.
08:20 So, if you click on this SharePoint button, the one in this blue box, you can upload specific files only, and it won't have access to your entire SharePoint site.
08:31 So, that's for the knowledge section. I have definitely enabled web search because my agent always needs to stay updated with the latest.
08:38 release notes. So, you can choose to enable or disable the web search here. And then moving on to tools. And and this is really powerful because this is where the AI assistant truly becomes an AI agent.
08:54 This does require some more technical capability here, and most likely approval by your, ah, AI or IT team. However, this is where you can connect specifically.
09:06 So there are a few built-in by Microsoft, but then through Model Context Protocol, there's a lot here that you can do.
09:15 So using the example I did is I connected Slack, and Slack connection, there's actually several different functions that you can do.
09:26 What you do is you just click on what you want it to do. So in my case, I wanted it to send a message on my behalf, or postMessage v2.
09:35 The previous version was deprecated, so we'll go with this. And then what you have to do is create a connection.
09:41 in. And, This is the step that you'll likely need approval for, but it's just a matter of having your IT team evaluate it and giving you that approval if they so allow it.
09:52 Do keep in mind, though, when you enable this connection, you are giving your agent write ability on your behalf. So, I have mine connected here, as you can see, it'll show that it's connected using this connector button, and then that is what actually allows it to post to Slack on my behalf.
10:14 Next is triggers. Triggers are super cool because this is another feature that is very specific to agents. Setting up a trigger means that the agent can operate completely autonomous, autonomously.
10:27 It doesn't need to be triggered by me or in Slack. Through a chat or it can just run on a schedule that you define, maybe an email, a certain type of email is what triggers the event to start, but.
10:39 but adding the trigger here, your agent becomes autonomous. Completely autonomous. Now, it is worth noting that this is a billable feature, so that's why I don't have mine enabled yet, or perhaps at all, because right now I'm still iterating with this and playing with this agent until I have perfected
10:58 its entire instruction set, and then I'll, I'll think about the ROI and whether it's worth putting this on a recurring basis, but that is super cool and very unique in Copilot 365 Agent Builder.
11:13 This is not an option. Another interesting, unique feature to Copilot is this sub-agents ability. So if you think of my gradual content audit bot as my parent agent, I can actually assign different child or sub-agents.
11:30 that perform that perform isolated intermediate tasks that are necessary for completing the overall goal. So, in this case, most of my steps are pretty sequential.
11:41 But if I had any tasks that needed to occur re- simultaneously to my main task, I would create a sub-agent for that.
11:50 Or, in this case, I could have created a sub-agent that goes and performs the research for me. And the benefit of creating a sub-agent is the fact that it doesn't take up the context window from the main agent.
12:03 So, if I have a sub-agent that performs research, it'll go follow all my research instructions, and then whatever output it finds, it will send that key information back to the main agent, not wasting all of the research process as context window.
12:20 And context window is important because once that context window is reached for your agent, it will hit a certain threshold and start forgetting information.
12:28 But in this case, it's not such a big task, performing the research, so I'm just gonna keep it all under my main content audit bot agent.
12:40 But it's cool to know that that is a possibility of creating sub-agents. And then of course, I definitely put this suggested prompt because probably 90% of the times I'm using this agent, it's just gonna be to go and audit my current gradual content.
12:55 So, so, because I'm gonna be using that prompt so often, I've made it a permanent suggested prompt here, to where whenever I'm interacting with the agent, I just click that prompt, and it goes and performs that audit for me.
13:10 So, up here in these tabs, you'll see the same column. It's displaying that I just went over. It's displaying the same exact information, just in an isolated view.
13:19 But another interesting tab here is this activity tab, because this is where you can come, test your agent within this platform, which I, it's super important that you do.
13:34 And then it shows a very visual, so if we look at this flow, I love the visibility that we have on actually what happened in this flow.
13:44 So it says it loaded up, it initialized the work IQ, got that information loaded in, and then I was interacting with it, I sent that message, and then you can see all of the tools that it's pulling in, you can actually see how long it took to perform each step.
14:00 And, in my case, it took quite a while, so it was interesting to see where that breakdown occurs and, and how much each step is using.
14:09 And then this is what showed up here, and actually, this is the same message that got posted to Slack, and we can see that that connected.
14:16 Next year action occurred successfully, which it's just very nice for troubleshooting to have this visual view of what's actually occurring.
14:26 So I highly recommend exploring, testing the agent out here with different test cases, and if something goes wrong, investigating here in that activity tab.
14:36 It's also good just for optimizing the agent, looking at and having visibility into where it's spending most of its time, and making mistakes potentially.
14:47 You can also do a bachelor's. Test evaluation in this tab, so you can create a set test, upload 10 questions at once, and then see how that the agent performs.
14:58 And the other cool tab is this monitor tab. because agents are billed based on consumption, it is interesting to have this visibility.
15:08 And so I just published this agent, which is why you see no usage yet, but what, the way agents work is they run on these co-pilot credits, which different features take more credits, and so it's nice to have visibility into how much you've consumed, and where all of that consumption is specifically
15:29 coming from. So this is a nice page, and you can actually get an AI-generated summary based on your use. So, this is a nice tab just to have insight into.
15:40 And this is what I actually love about Bitbucket. CoPilot, even compared to other agent-building platforms right now, is all of the visibility, the sub-agent capability, the activity monitoring, and the visual that it provides.
15:54 I just think CoPilot has really good visibility into how the agent is operating. So, this is it for agent-building, but before we conclude this video, I would love to just show you how this works in my Slack channel, and just talk about how the agent really does its not only save me time, but actually
16:18 improve my day-to-day process so that the output can just be taken up to the next level, so we can stay on top of our content, and this is just a really cool use case of an agent not only saving me time, but truly adding value.
16:35 So, here is how the agent actually operates within the Slack channel. Obviously, the goal here is that, this will be triggered every week.
16:44 So, you can see- It starts, and it gives us a little warning that it starts the audit of the gradual site resources.
16:51 And then, you can see that it actually returns specific resources. And tells me the specific changes that it needs. And actually provides the supporting documentation for those changes.
17:06 And so, for me, this is going to be huge because it takes away a lot of the manual time that I spend.
17:13 Just having to read through documentation, read through our current resources. Whether they're created by me or another Educate team member.
17:22 And I love how it prioritizes them. Because that just helps me order my priorities a lot quicker. So, this is a super exciting use case.
17:33 And know that when you create agents, it doesn't need to be so complex. You should be thinking about what is the low-hanging fruit that will inspire you.
17:42 It is important that you start with quick wins to familiarize yourself and then as you start building, I am sure that you will get new ideas, new inspiration, as you see what is possible with AI Agents.
17:57 And so I encourage you to keep building. the more that you build and the more that you're in this technology, the more you will learn and become familiar with how to use it to get value for your day-to-day work.
18:11 So thank you so much for watching and feel free to comment on this resource if you have any questions related to building agents in Copilot Studio.

