hey everyone my name is Daniel and today I'll show you how to build an autonomous agent using co-pilot Studio we'll build a fully finished agent which has knowledge actions and triggers then we will test the agent as a conversation to make sure that it references all the knowledge sources grabs the information that we need and provides it then we will do the autonomous piece where we go ahead and fill in a Microsoft form the form will go ahead and Trigger all the knowledge that we have autonomously go ahead and send that back as an email
we will also confirm if the email actually has the information we asked so stick around because I'll show you how you can take your agent building skills to the next level using generative AI which is so much more easier but first here's my intro video [Music] so before we go and Leverage The autonomous feature we'll go ahead and build a brand new agent from scratch we'll go and add the knowledge we'll add actions then we will add the triggers for the autonomous effect so that you will get the overall experience make sense good now let's
get started in co-pilot Studio I go to the environment of my choice I select agents and now I click on new agent for this one I'll go and click on skip to configure and for the agent name I'm going to give it a very specific one which is coffee machine agent I'll change the icon and over here I'll click on the change icon this icon over here my coffee machine PNG I'll go and click on it uh just make sure that whatever is this icon file that you have has to be less than 30 kilobytes
I know it's a little small but this is what we have to work with so it is what it is I'll go and click on Save right now and at least we've got that piece done now the first thing I want to add is description and here's what I'm putting in it says this agent is used by end users to inquired about the different types of coffee devices available because that's all they're going to do users can come in and ask information about the coffee machines that we as a company sell and have available in
our inventory and that information will come from knowledge which you will see in a minute but now that I added the description over here you see on the right side it is also keeping track of everything that we are doing which is great all right so then now the next is a very important thing is providing our agents instructions basically the behavior of how this agent should perform now if you haven't watched the video that I released last week I humbly go ahead and ask you to go watch that because over there the out of
the boox agents has some great examples of the type of instructions you should add and everything that I'm going to show here is what I myself learned from the examples that I picked up so again I urge you to go watch that video first all right so in my instructions the first thing I'm going to do is just a description just giving an overview of what this agent is about and here it is it says you are a coffee machine agent who receives questions about the type of coffee machines available they can choose from users
can ask about the coffee machine names average cups per week average espressos per week color of the machine and the price now keep the last two in mind cuz we'll be using that information for our demos all right so this is just the overall description piece all right next I'm going to hit my shift button and go and click on enter enter cuz we can start in a new line and here is the next thing I'm going to put in this hashtag hashtag hashtag and say receive the coffee machine inquiry form information now what that
means is that we are telling this agent that hey somebody is going to fill out a Microsoft form and that form name is called as coffee machine inquiry form when that is done receive that information and when that receive that information basically means users will fill the coffee machine inquiry form with Fields such as your name your email and your question that is what we want to tell it right now all right so receive this information next is go ahead and search your knowledge what that means is search for answers review the question and this
question is actually the name of the question in the Microsoft form which you'll see in a minute it says review the question and search for the answer through the files in your knowledge this this is something that we're going to add right now in our knowledge when I say knowledge over here I'm actually referencing this knowledge is this starting to make sense now good because we have one more instruction to gift and that is this section over here I'm going scroll up a little bit so you actually see what's going on it is the respond
with email cuz we do want to respond back using the autonomous feature and that is using the email so the first item over there is send an email send an email using the Office 365 Outlook send an email V2 action with a polite tone now you might already be familiar with this one that send an email V2 action that is part of The Office 365 Outlook connection so I'm actually stating it as descriptively as possible that hey go ahead and do the send email but make sure that using the Office 365 Outlook function over there
all right just making sure you know that and just to be nice let's use a polite turn also item number two is provide detailed information now do you see this format that I'm following over here is that I have asterisk provide detailed information asterisk and then the colon again I got this idea from that template so I'm actually just following doing some reverse engineering and applying it over here and it seems to work so that's what I'm going to stick with so for this one it is send a detailed email providing detail information about the
coffee machine provide information such as price range machine names average expressos per week and the color of the machine and then finally the third item is provide response to no information because if there's there's no information we need to provide that as well and for that the instruction is if no information is available then send an email using the Office 365 Outlook D send an email V2 action stating no device can be found that matches their requirement however they can contact us again for additional information so this is the overall instructions I'm going to provide
to the agent all right so the next thing I want to do is actually give it some knowledge but I'm going to skip this one why because I am actually going to go and upload now and an Excel spreadsheet I want to keep that process a little bit simpler for this demo is let the knowledge be provided to it as files and in my case the Excel spreadsheet and right now since we haven't actually gone and saved this agent yet this part is grade out so what I'll do is I'll hit cancel for now I'm
going to go and click on create let the creation get completed it's going and setting up the agent once it is done we'll go back over there and we'll add our knowledge and while this is being done that knowledge is actually an Excel spreadsheet and it has all this information about all the different coffee machines that have available so we are in now you can actually see the entire instructions and the way it looks over here the orchestration piece for this example we need to turn that on so by default it is disabled but we
are going to use the generative AI so we actually have to go and click it enable once you do that it will take a minute to save it the saving is complete and so the changes are saved all right so in the knowledge piece I'm going to go ahead and now add knowledge and before I do that let me show show you what that knowledge is it is this Excel spreadsheet this Excel spreadsheet basically has all this information about all the assets that I go ahead and sell in my company and that's what the user
is inquiring against makes sense it's got machine name it's got all of these different categories the color description so on and so forth so I'm going to exer out this one CU that's what we're adding in as our knowledge so now I'll click on this add knowledge now you see this option is not grade out so I'll go and click on quick browse get my coffee machine spreadsheet click on open here we got to make sure we update these fields so the name one I'm going to go and change that to coffee machines for sale
and for the description I'm going to tweak that just a little bit I'm actually going to go and say something like this this knowledge Source provides a list of all the coffee machines that are available for sale all right keeping it very simple but at the same time providing some valuable information so I've got the file uploaded and I've gone ahead and update the name and the description so now I'll go and click on ADD now what it is saying is upload your fly file please do not close the browser window so we have to
be very patient over here make sure that it gets finished now it has been uploaded but has the file being processed the way we confirm that is by clicking on the see all and over here in the status it shows in progress it is very very important that you wait till this becomes available and it's done because this is what's going to determine hey can the knowledge specifically the generative ai go ahead and get information from this knowledge so patiently wait till the status is completed so right now it's in progress so we just have
to wait and that can vary sometimes it's pretty fast or depending on your file size it can take a minute so I'll just go and click on this refresh over here just to keep an eye on that all right so now the status is set to a green check which is ready now I fast forward a little bit but you can see that this entire processing took 6 minutes and that Excel spreadsheet is not too big only had about 97 some rows over there but it's processing each and every cell so you just have to
let it finish and wait till it's ready now we can go ahead and test this agent right now but I just want to make one little change I go back to my overview and right over here in the knowledge area over here the section which says allow the AI to use this own Genera knowledge I'm actually going to go ah and disable that and I'm going to click on continue let it finish loading because I only want to use my existing knowledge all right so now that we made this change and we've also confirmed that
the knowledge piece is active I'll just go and test this agent right now I'm actually going to go and put this question it says are there any coffee machines that are less than $300 I'll click on enter it is now taking us directly to this activity place over there it is processing on our knowledge sources and over here we even got an output and see the output comes in from the agent on the right side it says here are two coffee machines that are priced under $300 gives us the name of the coffee machine and
the price and it's putting in these sections over here cuz that one is coming in directly from our spreadsheet that way we know that this agent is not hallucinating it has 100% gotten this information from our knowledge very very important so the test went successfully over here this is great but now we got to move on we have to build on top of it so the first thing that we want to do is now actually start looking at the autonomous piece and before I do that I want to show you my Microsoft form so I'm
in my Microsoft form and this one right here coffee machine inquiry form that's the form that we're going to allow our end users to use and the beauty is in the Simplicity of this form because it has only three questions your name your email address and the question and that's what I mean by the beauty because people are going to ask any questions over here and a generative AI is going to process that using our knowledge and give a response back that's exciting stuff but but I just wanted to show you that all right so
here is our Microsoft form and I'll keep it open over here maybe close that tab off let's go back into our agent building let's go back into our overview all right and now in the triggers this is where we go ahead and now call that Microsoft form now it says triggers but in the back end it is actually a power automate Cloud flow with a little bit of magic to it and I'll show you what that magic is in just a second so here you go I'm going to go ahead and now click on ADD
trigger it comes directly over here and on the top right there is already the option we want it's just which is when a new response is submitted so I'll go and select that and it is actually going now adding that trigger and you're probably familiar with this part because this is already beginning to look like the power automate cloudflow process what I'm going to do is this trigger name though I'm going to actually change it by default it says when a new response is submitted but I'm going to change it to when a form about
coffee machines is submitted because you want to be very precise so that our agent will actually understand that from our instructions um all my connections are good the green checks we're good now I'll go and click on next after that we have to go ah and give it where the trigger is coming from so here you go I'm going to now click on that one over here and in my search I'm going to go and search for the uh coffee machine one there you go that's the form that I just showed you this one right
over here and right now the additional instruction to the agent when it's invoked this is what it does out of the box it says use content from body we are going to change this in just a few minutes but at this point leave it as is all you want to do now is go and click on this button called create trigger and what the create trigger really means is it's actually going ahead and creating now a flow a power automate Cloud flow in this environment so let it go and finish creating the flow we'll go
and take a look at that cloud flow in just a minute there it is done it is actually saying adding your trigger this might take a few seconds which means it's actually going and now keeping that flow ready and voila it says time to test your trigger your trigger will be successful successfully added now test to make sure it's properly working we'll do that in in a few minutes what I'm going to do is click on close and actually take a look at what this is so here's our new trigger it kept the name it's
even got the icon on Microsoft forms but on the right even past this experimental section over here if you click on the ellipses right there it says edit in power automate so triggers basically is a power automate Cloud flow that is running in the back end and if you did not know this well now you know that's what the autonomous is in the back and it's basically a power automate Cloud flow with a little bit of magic from gen AI but that's what it is triggers SL the autonomous piece is the power automate Cloud flow
in the back end so I'll click on this edit and power automate flow it opens up a tab directly takes us into the edit piece over here and on the top we just confirm that that is in our environment so this is basically what it does is right now it just has two different actions one is basically a trigger if I click on it that's the form that we just that's the form that I just showed you and then after that this is it this is the action that's where the magic of generative AI happens
over here now as I did some testing this wasn't sufficient so I had to do some tweaking however let me show you what this does right now as is right cuz we at least we can verify that hey is the connection from the form working well and is it triggering our trigger so at least let's test that piece we'll come back and tweak it in just a minute so I'm going to click on this back over here so we can at least keep an eye over here I'll come back to my Microsoft form I'll click
on preview in my preview I'll go and give it a name I'll just say uh Dan Christian for now I'll give it an email address an external even address so that I'm not even using my own tened one and in the question let me put that exact same question that I asked when we were testing the initial agent which is are there any coffee machines that are less than $300 I'll go and click on submit all right submit is done the form is completed let's switch over directly to our new flow that was also created
click on refresh over here the trigger should go through successfully and the flow is also completed successfully now let me go and take a look at it over here all right so once we are in we obviously know that the flow has triggered properly but what I'm interested to see is what is the data that you actually send to the agent so we've got two green checks which is great but I want to see over here all right so right now it is basically saying this is the host all of that little information blah blah
blah blah but when I go and see the parameters and I go and see all of this body that's it this is conversation ID and it gives me a conversation ID so maybe in the back end using some technology in the back end the information from the cloud flow is actually going into the co-pilot Studio a agent well the best way we can confirm that is first of all go back into our co-pilot studio right over here in the trigger section right in this thing where we have the test triggers let's click on that I'm
going to go and do a start testing all right so I'll click on the start testing cuz now it's going to test our new trigger once the trigger it takes us directly into this activity p over here see on the bottom right it assumes that a trigger is sent which is correct but it did not find anything all right so it says I'm sorry I'm not sure how to help with that can you try rephrasing and if I expand this over here you see this is the information that it gets something called as a web
hook ID and all that it's actually not getting the information that we filled from the form and this is why I at to update that power automate Cloud flow to make sure that the information is sent across so right over here right below the initial trigger I'm going to go and now create a variable so I'll go and click a search and I'm going to say variable and the first thing we're going to do is is initialize one so I'm going to go ahead and click on this initialize so that goes and gets added over
here but our initialized variable is going to be the VAR body and I'm going to call that as a VAR b o d and this is going to be simply of a typ string so I got that one all right next is we're going to go and get a response for the form all right so I'm going to go and do that first because when I have built power automate flows for the Microsoft forms U the form and a new response is submitted right over here when the new response is submitted that's what triggers it
but the next following step I've always had to add is get the response so I'm going to go and do that over here as well I'm going to go and say add an action and I'm going to I'm going to just in the search say uh get response so now I go and grab that one over here and that shows up well you know what to do over here in our form we actually need to go ahead and get the form which is right here coffee machine inquiry form that's the one I'll go and click
on this now some Chang is going to happen so Watch What Happens right I'm going to click on the FX piece over here in that Dynamics form in our Dynamics content I come down and I'm going to go and select the first one which is list of response notification response ID and I'll select that and moment it happens puts that into a for for each Loop all right there's no change I can make because I can't just drag this outside it won't work you've got to keep it inside the four each but now we can
work with it so inside the four each so inside the four each now we set value to our variable so I'm going to go and C an action inside the four each I'm going to go and get the variable right there and in my variable section I'm going to say set variable adds it over here and I'm going to go and say which is the variable we only have one so it's easy but I'm going to also make sure I go and say set the war set the war body are variable that way we've got
that one and this variable is going to be what well that variable is going to be all the three fields that we got from the Microsoft form and this is how you do it on the content think on the dynamic content let me scroll down just a little bit what do we need well we went ah and put in our name so I'm going to select name click on ADD add after that I'll put in a comma space let's go back again go and click on the power effects go to Dynamic content then the next
one was your email click on that click on ADD add a comma space and let's add the last one all right so I'm going to go on T content scroll down and then finally the question so I go and add that and click on add all of this is now coming inside our variable all right and this is also a good time for you to go and click save so we don't miss anything saving is done now right over here send a prompt to the specified co- pilot for processing when I go and click on
that this is what we already have it says use content from body this is done automatically what we're going to do is change it I'm going to replace this body and I'm going to go ahead and add our variable right there v body go and click on ADD and that is it but let's go and do a test so I'll come back to my Microsoft form over here um just make sure that everything is good on the side yep click on the preview I'll go and put in my name again here Daniel Christian put in
an external email address just to try to replicate as close as possible to the real scenario put the same question in for Simplicity click on submit and let's go back into our power automate flow uh 4 seconds pretty sure this is the one we just submitted and then now right over here see initialize okay that's variable is good get the the response detail now we actually getting in some information right over here uh but here's here's the one right now in the parameters that's what we are sending so we actually putting in the email address
question and the from but let's go to the agent side and take a look at the activity to see if it's making sense now so I come back over here to the activity and there you go this is the one that just ran but in the summary section if I hover over it right here if I just hover over it go back on the side and go and go back go back over here and if I hover over it you see that it says the customer is inquiring about coffee machines that are priced under $300
so you see it's making sense now now the co-pilot in the autonomous site which is basically our trigger is getting the correct information from the Microsoft form and once you get that information the agent using generative AI can process that so what I want to do is also now make sure that once the information is processed how do we return that back to the person who's requesting basically the person who's filling the form so for that we go ahead and now create an action the action is basically that send email so we come back over
here now to our actions piece click on add an action and over here on the top I'm going to search for The Office 365 Outlook because we should see all our outlooks and therefore I'm seeing it but the one that I want is specifically this one send an email version two click on it and it is going to go ahead and make sure that all our connections are good I'm pretty sure my connector is set up Bel over here yep got a green check so we are good and now I'm going to go and click
on next so this is a place where usually we don't have to make any change but because we are here we'll take a look at it so in the inputs now there are three sections the two the subject and the body and if you ever want to tweak anything you can always select the edit inputs and just make sure everything is good so by default here's what we have two well the two is going to be dynamically filled with the best option in our case the two is going to come from the Microsoft forms and
we just confirmed that the two is coming in the person's name Dan Christian member and then even the email address and everything so I think we good in this side I'm not going to make any change whatsoever but if you have to this is where you come and make that change all right so I'm just going to say yep don't leave actually I'm going to click on don't leave on I'm going to go back click on back um same thing for subject body outputs piece this is going to be our response but we'll have the
generative AI click create this so I'm not going to make any changes I'm just going to go and click on finish and the Finish side we'll leave things as is right over here make sure that this box is also checked by default it is but for some reason just double check allow agent to use this action it says this action can be used by the agent to respond to a user if generative orchestration is enabled which you and I just did so we're good I'll click on finish and make sure that this is all completely
done now it's important that I left everything as is and I'll tell you that why in a minute see right over here that Office 365 Outlook send an email version to I am leaving that name Asis why because right in our overview in the knowledge section I have put this in the respond with email I've put that under as say send an email send an email using the Office 365 Outlook D send an email version too so you can understand how and why I have done it the way I've done it is because you've gone
ahead and build that flow and all the names and the actions the way it is in fact if I scroll down now you will see it right there so it's it's kind of important that you follow along and if you make changes that's fine just follow along the same process so if for example you change that action name to something well in your instructions reference that action name and how you've gone ahead and named it very very important that you go and do all of this all right important but but now we are done with
building the agent what we have to do is verify does this all work so let's do this entire test all right so the first thing for the trigger for the autonomous piece to actually trigger is let's come ahead and actually fill out the form over here right so I'm going to go and say and right here right and just to mess things around I'm going to actually go and say something like my name Henry Jackson email address well I can't change that a whole lot I have to put in the correct one so I'll leave
that over here for now for the sake of the test I'm going to go and put in that same question all right so at least we know that there are some answers here so I'm going to go and click on submit this is done let's come over here to our power automate flow make sure that it is triggered 5 Seconds all right it is triggered now I come into my activity place over here I should see all right I see something which is in progress so what I'm going to do is I'm just going to
come over here to my email please right here this is the external email please I should be getting an email any second oh I think I got something over here right there if I go and click on that let's see what happens right there you see a question actually came and it says hi Daniel Christian now the Daniel Christian was because it was sent from my email account but if I open this I was say hey dear Henry Jackson That's the name that we put in the Microsoft forms so the generative AI is doing such
a great job leveraging all the information that we are sending in from Power automate 4 but wait there's more in addition in the subject it says thank you for reaching out with your inquiry about coffee machines under $300 that's what we just asked this is we found a couple of options that might interest you goes ahead and gives the coffee name the amount another coffee name the amount this is both of these machines offer great value for their price and are well suited for different needs if you have any further questions or needs blah okay
you get all of that now what happened is this makes sure that it also matched the polite tone that we asked so you can have a little bit of fun over here you can go and even do a pirate one or something snarky whatever but it does match what you ask for so let's do one more test all right I just want to kind of see how stuff things are moving around so I'll come back over here um let's go back into that original form please that we have right on this side um I'm going
to submit another form another form and this time I'm going to say Justin Landslide all right just some name got to give it that same email address cuz I can't change that one here but I will change the question now I'm going to say are there any Barista light machines like Barista light is actually a type of the machine all right so click on submit come back to our power automate flow all right I'll go Ahad and do a refresh over here this one 5 seconds so that's got to be the one that we just
had come back over here go ahead and do another refresh right there okay refresh there's a new one which is currently in progress right there so if everything works out well I come back in and voila it's already there it says Daniel Christian but hey dear Justin Landslide go and click on that and says Dear Justin Landslide thank you for reaching out with your inquiry about the Barista light coffee machines we are pleased to inform you that the Barista light at home expression machine is available with silver and black colors blah blah blah blah blah
I mean do you see the awesomeness over here and if you don't let's go and take a look at that power Auto automate flow right this is where it should blow your mind see this power automate flow is the most simplest one ever took the response from the form and we got the details from the form yeah sure we went and put in the variable just to make sure that all the data is going through which is basically the name email address and the question but right over here this is where all the magic happens
this one action takes the information sends it to your co-pilot agent the generative AI which is basically doing the orchestration work the generative AI is actually going ahead and processing all of that and then finally leverages this action which is basically your Office 365 Outlook send an email action to send not just the correct answer but in a polite tone none of that was done by us automatically the generative AI using the orchestration piece does that this is what really fascinates me but you know what just for Grins and Giggles right again for Grins and
Giggles let's do one last test to see if this will even break it all right so I'm going to come back over here to my Microsoft form I'm going to click on submit another response over here I'll put in mik I'll put in Michael Rasberry all right just to make sure that is picking up the name email address again I got to keep the right one away I can't change that but for the question I'm going to say enlighten me exclamation mark right let's see how the generative AI will will orchestrate all of this so
I'm going to go and click on submit right again it is a power automate flow that is what's triggering the whole Anonymous thing oh you go 3 seconds ago so that's good come back over here go to our activity in our activity section I'm already seeing a whole bunch of them running so I'm pretty sure one of these is ours right in fact yeah that's that's the one over here right there that's the one which is ours but the ultimate thing is going back and taking a look um so I go back into our main
inbox right here waiting right there it came in it says Daniel Christian and there you go Michael raspberry so we know that's the updated one right here it says thank you for reaching out with your inquiry about coffee Machin unfortunately we currently do not have any information available about coffee machines that matches your requirements so good it went ahead and at least gave us a response back based on what the inquiry we had and you know why because here's it is when we go back into our actual agent go into the overview see in the
last instruction which is respond with email one of the last points item number three was provide response to no information if no information is available then send an email using the Office 365 Outlook send an email version to action stating no device can be found that matches their requirement however they can contact us for additional information you see this knowledge that we provided in a step bystep descriptive way really came in handy because this is what is the whole concept of the orchestration using the generative AI I don't know about you but this gets me
very excited because now it opens up so many more possibilities so the big takeaway for you after watching this video is where all can you leverage this autonomous agent for example take a look at your incoming emails take the subject of the email the body of the email and send it to your orchestration it will go ahead and use the generative AI to go ahead and scan against any of the existing knowledge that you may have and automatically send an email back you literally have to do nothing else no complex workflows nothing it automatically takes
care of that so hopefully this video got you excited hopefully your wheels are turning start playing start testing with this this is not quite production ready yet but any plans that you might already have to build where you are thinking of building complex Cloud flows well think about this first use the generative AI use your co-pilot Studio from this side and plan on using the autonomous agents hopefully this video gets you excited and as always keep using co-pilot Studio hello hello hello so if you like this video go ahead and click on that subscribe button
and smash that like button also if you have a few extra seconds can you go and put in a comment either say something nice or give me ideas for my next video and until then see you