Create an agent
When you create an agent, you can describe what you want your agent to be and do, or add those details as separate pieces of information.
The examples in this quickstart create an agent called the Friendly Agent Tutor to help users learn about Copilot Studio. However, you can create your own unique agent using a publicly available website.
After logging in or signing up for Copilot Studio, you land on the Home page. Select Create in the left navigation.
On the Create page, select New agent.
Use the chat to describe your agent, using the provided questions for guidance.
Keep your description simple for now, but make sure you include information about what your agent helps users do and what conversation style and tone it uses. Copilot Studio uses your responses to fill in the details in name, description, instructions, and knowledge that define your agent.
For example: _Your name is Friendly Agent Tutor. You will help users learn how to create agents. You should talk to users like a kind, patient teacher.
Tip
Instructions determine the goals, tone, and limitations of your agent. When writing instructions, make sure you:
- Use conversational language with a full description of how you want your agent to behave. Avoid single-word responses, because they do not give the agent enough information or context.
- Provide details about the specific goal you want your agent to help users achieve. For example, Create an agent for topics related to Human Resources and employee benefits.
- Describe the tone as how you would want a person to respond in a conversion. You can use words and phrases like casual, formal, and understandable for children in grade three.
Add an image to represent your agent.
Select the agent icon in the top bar.
Select Change icon.
Choose an image from your device. The image file must be in PNG format and less than 30 KB in size.
Select Save.
After you have a name, icon, description, and instructions, your agent is ready. Select Create. The Overview tab for your agent appears.
You now have an agent you can start testing! You can chat with your agent in the Test your agent chat.
Improve your agent
Now that you have an agent, you can start testing and improving it.
To open your agent, in the left navigation select Agents, then select your agent.
You need the Overview tab for most of the actions in this section.
Test changes to your agent
The best way to improve your agent? Test it. Make some changes. Test it again. Repeat.
In this section, you'll test how changing your agent's knowledge sources affects how your agent responds to users.
Start by testing how your agent currently responds in the Test your agent chat. Ask your agent a question. For example, ask how to create an agent.
In this example, the agent's instructions are to talk to users like a kind, patient teacher. What if you give your agent different instructions?
In the Details card, select Edit. Change your agent's instructions to use a different tone, like talk to users like Jane Austen.
Test your agent's new instructions with another question. How has the response changed?
Change your agent's introduction
Help your agent make a great first impression with a new introductory message. This first message lets users know what your agent does and encourages them to interact with your agent.
In the Test your agent chat, select on your agent's introductory message. This opens the message in the Topics tab.
If you can't see the introductory message, select Refresh at the top of the test chat panel to restart the conversation.
In the Message box, select the text of the message.
Delete the default message and add your own. In the introduction message, your agent should greet users, tell them what your agent does, and tell them how to start interacting with your agent. You can also give users an example question or prompt.
For the Friendly Agent Tutor, the introduction message says Hello, I'm here to help you learn how to use Microsoft Copilot Studio. You can ask me all about agents: "What is an agent?" "How do I make an agent?" "How do agents work?"
Select Save.
To test this change, select Refresh in the Test your agent chat panel.
Edit your agent's basics
You can change your agent's name, description, instructions, and knowledge sources after creating it. Remember to test your changes as you go!
To update your agent's name, description, or instructions:
In the Overview tab's Details section, select Edit.
Make your changes.
Select Save. Remember, editing the instructions changes how your agent engages with users. Make sure to test your changes.
To add a knowledge source:
In the Overview tab's Knowledge section, select Add knowledge.
Select the type of knowledge. This quickstart uses Public websites sources.
Enter the URL for the website, then select Add beside the textbox.
Name and describe the knowledge source so you can keep track of all your agent's sources.
Select Add.
To change existing knowledge sources:
In the Overview tab's Knowledge section, select the overflow menu.
Select Edit to change the knowledge source, or Delete to remove it from your agent's sources.
You now have an agent you can start testing! You can chat with your agent in the Test your agent chat.
Publish your agent
Once you're happy with the content authored in your agent, you can publish your agent to a website.
Note
You may need to change the authentication for your demo website, depending on who you want to access your agent. Go to Key concepts - Publish and deploy your agent for information on authentication levels and how to change them.
At the top of the page, select Publish, and then select Publish again in the Publish this agent confirmation message. If the publish is successful, you see a green banner on the top of the page.
At the top of the page, select Go to demo website in the overflow menu.
Send the URL to others to demonstrate it.
Copilot Studio empowers anyone in the organization to build agents in Microsoft Teams. The agent has built-in natural language processing (NLP) and a no-code graphical interface. With our latest Teams integration, you can create, author, test, and publish your agent into Teams within the Microsoft Teams interface.
When you create an agent, consider:
- The types of questions someone might ask
- The different ways a question is asked
- The expected answers
- Whether or not a user has follow-up questions or concerns
To help you get started making human resource (HR) agents, this quickstart guides you through:
- How to map your scenario and needs to align with what an agent can do
- How to create an agent in the Copilot Studio app in Teams
- How to build and enhance topics that answer common HR-style questions
- How to test, publish, and share the agent with your organization
HR Support Agent is a friendly question and answer agent that brings a support professional expert from the HR team, when HR personnel are unable to help. An employee can ask the agent a question and the agent responds with an answer if the agent has content for it.
If the agent doesn't have an answer, the employee can submit a query. The query is sent to a preconfigured team of experts who respond to a query notification.
Scenario
You work in human resources (HR) at Contoso and need to build an HR support agent in Microsoft Teams. The agent answers common HR questions, such as employee time-off, with relevant information from the company's internal knowledge base. The agent contacts human HR experts and notifies them that an employee needs assistance for uncommon scenarios.
Once the agent is published, Contoso employees can access HR information in Teams without needing to search the company's intranet.
Install the Copilot Studio app in Microsoft Teams
Start by launching the Copilot Studio app in Teams:
Go to the Teams app store and search for MicrosoftCopilot Studio.
Select Add or Open, if you already added it, for the Microsoft Copilot Studio app.
The app opens to the Copilot Studio home page. Teams users can build agents here without leaving the Teams app.
Tip
Select "..." in the side bar of Teams to show your added apps. Select and hold (or right-click) the Power Virtual Agents icon and select Pin. The Power Virtual Agents app appears in your side bar. You can now return to the app more easily.
Create a new agent in a team
Select Start now on the Home page.
Pick which team manages the agent. You can create a new team if necessary, before you add an agent to it.
Fill in the agent name and language in the agent creation window. For more information about choosing a language, see Language support.
Select Create.
Build an employee time-off topic for common time-off queries
Go to the topic list by selecting Topics in the navigation menu.
An agent comes with a collection of topics that defines the agent's interaction with end users. Let's build a topic to answer employee questions about taking time-off.
Select + New topic > From blank on the menu bar to create a new topic.
Select Details on the Overview menu and name the topic Employee time off. Give it an appropriate description.
Select Save at the top. Close your Details pane.
Select the Trigger Phrases box to add phrases.
Create several trigger phrases in the Add phrases fields:
- Need information on time off
- I need help with time off
- How many days of paid vacation do I have
- What are the national holidays
- I need extended leave
Trigger phrases for each topic define the ways users ask questions about that topic. These phrases are how we expect employees to ask about time off.
Copilot Studio comes with built-in natural language capabilities. You only need to define a few trigger phrases about time-off and the agent can accurately trigger the topic based on the employee's input.
Select Save to add the phrases to your topic list.
Define the agent's interaction with a user topic
Give the employee a message that the agent is here to help with time-off questions using a message node.
Enter the text in the existing message node I can help with questions related to time-off.
As an HR employee, you know the most common time-off questions are about paid vacation time and national holidays. When a question node with user response options is added, the topic automatically gets a forked branch for each response.
Select the (+) icon below the message node, then select Ask a question to add a question node to the topic.
Enter What information are you looking for? in the Ask a question text box. The employee might ask this question.
Under Options for user, add Paid vacation and National Holidays as two options.
User choices are stored in a variable and the topic branches off, based on the option the user chooses. You can rename the variable to track it better in the topic.
On the variable, under Save response as, select the pencil icon to edit the variable properties.
The Variable properties pane opens. Rename the variable to TimeoffType. Close the Variable properties pane and you see the changes reflected in the authoring canvas.
You can add different responses for each option. For paid vacation, the agent can point employees to an internal HR website to look up paid time-off policies.
Add a message node for the Paid vacation branch with this message to the user: For paid vacation time-off, go to www.contoso.com/HR/PaidTimeOff to submit time-off requests.
Add a node by selecting the (+) icon to end the conversation with a survey. Select End the conversation, then End with survey. This survey is the customer satisfaction survey prebuilt in the agent for use in topics.
In the National Holidays path, add a message node with the following text:
National holidays for 2020:
- New Year's Day: January 1st
- Memorial Day: May 25th
- Independence day: July 4th
- Labor Day: September 7th
- Thanksgiving: November 26th - 27th
- Christmas Eve and Christmas Day: December 24th - 25th
End this path in the topic with a survey as well. Add a node by selecting the (+) icon then End the conversation and End with survey.
Test agent for expected behavior
Copilot Studio comes with a built-in test agent that lets you test the agent in real time. You can test the agent by launching the test agent canvas and providing the employee's input. When you save the topic, the test agent is refreshed with the latest content.
To launch the test agent canvas, select the agent icon at the bottom of the screen.
Type I need time off information into the agent chat.
Even though I need time off information doesn't match the trigger phrases exactly, Copilot Studio processes the user's input and triggers the employee time off topic.
As you chat with the agent in the test agent canvas, you see where the agent is in the conversation in real-time by following the green highlights.
Select Paid vacation.
The topic branches off based on the user's response. You can open the TimeoffType variable to see the value of Paid time-off by the user. However, what happens if the user is looking for national holidays in their inquiry? The user might feel annoyed if the agent asks them to repeat themselves. Let's give it a try.
Above the test agent pane, select Reset.
Enter Need information on national holidays.
The agent bypasses its response question on vacation type and directly provides information on national holidays. This choice is because Copilot Studio supports entity extraction and can determine that the user asks about national holidays.
Enhance topic to handle complex queries by escalating to HR experts
Now that you performed the basics, you can add a more complex option to the topic of extended leave.
Return to the topic you created, and then go to the authoring canvas.
In the Question node, add an option named Extended leave.
Since each employee's personal situation is different, questions about extended leave require a discussion with an HR expert You can build the agent to connect HR experts with your employees.
Add a message node that says Extended leave needs HR expert approval. Let me connect you with them.
Copilot Studio agents can take actions by adding actions into a topic. In this example, you add a previous basic action that notifies an HR expert. This basic action sends an adaptive card to the HR expert channel in Teams to let experts know a user needs them to reach out.
You can create the basic action to send a message to a Teams channel and then call it with the appropriate input.
Add a question node asking for a description for the issue and add the text How would you describe the issue?
Save the description in a variable named Description.
Add a node under the question and select Call an action.
Select Basic action and then create new flow, which launches Power Automate.
Choose the template Send a message to a Teams channel, then select Continue.
The flow template takes in two inputs from the agent, the Subject (title for the message) and Message text (actual message) to post to the channel.
Under the Post a message (v3) flow definition, select the Team ID and the Team channel ID where the message should be posted.
(Optional) Add text to the message, in addition to the description entered by the user, and complete the Message field.
Give the flow a name and save it.
Close the flow authoring canvas.
You return to the authoring canvas. You can now add an action and call this newly created flow.
Pass in the variable you created earlier called TimeOffType for the Subject and the Description gathered in the chat. When the flow posts a message on the Expert channel, it shows Extended leave as the title and the message defined in the flow.
Tip
Copilot Studio is directly integrated with Teams, so the agent knows which user from Teams it's chatting with. This feature allows agent authors to build personal and customized agent responses.
To use the name of the person chatting with the agent, there's a predefined variable named bot.UserDisplayName that be used like any other variable.
You can let the employee know their request notified the experts, who will reach out to them soon.
Add a message node with the message We notified the expert. They'll reach out shortly.
End the conversation with a survey.
Save the topic.
You can add more topics so that HR Agent can answer more questions from Contoso employees.
Tip
Always test your agent to ensure it's working as expected for the best employee experience.
You see a message posted to the Teams channel when the flow executes in the test canvas.
Publish your agent
Publishing the agent makes the latest updates available to end users.
In the navigation menu, select Publish. Select Publish again.
You need to do a few more actions to make the agent available to employees.
Tip
If you're already in a conversation with the agent, you can type start over after publishing your latest agent content. This restarts the conversation with the latest content published.
Make your agent available to other employees
On the Publish page, find the option to Open the agent. You can test your agent before sharing it.
Select Share the bot, which opens a pane of customization options.
Employees can now find your published agent in the Teams app store.
Edit agent details
In the customization pane, you can edit the agent icon that displays in Teams and change the short and long descriptions for your agent. These settings are prepopulated with starter content, but can be customized.
Share your agent with your team
You can add your agent to the Agent extensions section of the Teams app store.
Select Add to Teams. You see a checkmark indicating the agent was added to Teams.
Viewing the agent in the app store is a workaround to test it, since admin approval isn't required and avoids any spam to the admin. Once you're fully satisfied, share the agent with your organization, which requires admin approval.
Share your agent with your organization
Sharing your agent with the entire organization makes it appear in the Built for your org section of the Teams app store. Access requires admin approval.
Select Submit for admin approval.
Confirm the agent icon, short description, and long description are correct.
Confirm you want to share the agent with everyone in the organization.
Submit for admin approval. This part of the process can't be completed right away and requires follow up with the admin for approval.
Find your agent in the Teams app store
An employee named Melissa can find the agent you built in the Teams app store.
Depending on how you shared your agent, Melissa can find it either in the Agent extensions section or the Built for your org section of the Teams app store. For an agent to appear in the Built for your org section, it must be approved by an admin first.
Melissa selects the agent app and selects Add for me. The agent appears in the Teams side bar.
The Greeting topic automatically welcomes Melissa.
Employee chats with the agent to ask about time-off
Melissa needs time-off in July and August for personal reasons and enters Need time-off information. Melissa selects Paid vacation and a website appears where she can learn more about paid time-off.
The agent then gathers customer satisfaction data and ends the conversation.
Melissa reviews the HR site for paid time-off and understands she needs an extended leave. Melissa returns to the agent and types I need extended leave.
The agent lets Melissa know that an HR expert is needed for the extended leave request and asks Melissa for a description of the issue.
The agent notifies an expert, who will reach out to Melissa shortly.
Return to the author's view and go to the HR team's experts channel
You see the agent ran the flow you added earlier and posted Melissa's request to the channel.