OPERATION AGENT FORGEâąď¸ Operation Time Window:
~75 minutes
đĽ Watch the Walkthrough
Welcome back, Agent Maker. This mission puts you in the command seat of the most powerful capability in Copilot Studio - creating a custom agent from scratch using only natural language⌠and supercharging it with your own data.
This isnât just another chatbot. Youâre building a knowledge empowered digital coworker - one that can reason, respond, and reference real enterprise info.
Your weapon of choice? Natural language. Your mission? Design, train, and test a fully customized helpdesk agent that answers IT questions using SharePoint, uploaded files, or company URLs.
Letâs build your agent from the ground up.
In this mission, youâll learn:
A custom agent is a chatbot or virtual assistant that you create and design in Copilot Studio to help users with specific tasks or questions. Itâs called custom because:
!!! note Think of it this way: you are building your own digital helper that can talk to users and complete tasks for them such as answering questions, collecting information required by a process, or connecting to your enterprise data.
A custom agent can fulfill the following:
You build a custom agent that helps employees request vacation leave.
It asks for their name, vacation dates, and their managerâs name, then saves the information into the designated system that managed vacation requests, such as a SharePoint list.
Now, instead of navigating to the SharePoint list and creating a new item, employees simply chat with the agent instead.
Previously you learnt how to quickly build agents in Copilot Studio using prebuilt agent templates in Lesson 05 - Get started quickly with pre-built agents. In this lesson, weâll dive into the conversational creation experience with Copilot. Copilot Studio makes it easy to build agents by chatting with Copilot, just like having a conversation.
In Copilot Studio, you donât need to write code to create an agent. Instead, you describe what you want your agent to do in plain language, and Copilot helps you build it step by step through a chat-like experience.
Describing in natural language to create a custom agent might be a new concept for you. Whenever you use Copilot across Microsoft products and services, you are using natural language in the form of a prompt.
A prompt is the message or instruction you give to an AI agent to tell it what you want it to do. Think of it as giving directions to an assistant. The clearer your instructions are, the easier it is for your assistant to understand and act on them.
Letâs say the HR team needs an agent to help with vacation requests.
The prompt could be,
âI want to build an agent that helps users submit a vacation request. When a user says they want to request time off, the agent should ask for their name, the start date of their vacation, the end date of their vacation, and their managerâs name. Once the user provides this information, the agent should save it to a SharePoint list called âVacation Requestsâ and post a notification in a dedicated Microsoft Teams channel.â
Why this prompt works:
In Copilot Studio, knowledge sources are places where your agent can find information to give better answers. When you add these sources, your agent can pull in your enterprise data from places like Power Platform, Dynamics 365, websites, and other systems or services your company uses.
These sources work together with AI to help your agent respond more accurately to user questions, this is achieved through what is known as generative orchestration.
Generative orchestration means the agent uses AI to dynamically decide how to answer a question by combining its built-in language skills with information from your added knowledge sources.
When a user asks a question, the agent:
Smarter answers - when you add knowledge sources, your agent can give better, more accurate answers using real data from your organization.
Less manual work - you donât have to write every possible response. The agent can search through your added sources and respond automatically.
Use trusted information - your agent can pull answers from systems you already use such as Dataverse, SharePoint, or company websites so that users have reliable information from a source of truth.
Works with generative AI - knowledge sources and AI help your agent understand questions and respond naturally, even if the question wasnât pre-programmed or added as a starter prompt.
Flexible and expandable - you can add knowledge sources anytime during set up or at later point in time, your agent grows smarter as your needs change.
Imagine you build an agent to help employees with HR questions. You add your companyâs HR policy document and SharePoint site as knowledge sources.
When an employee asks, âHow many vacation days am I entitled to?â, the agent uses generative orchestration to search those sources and reply with the correct policy without you having to write that answer manually. This saves you time in having to account for every possible question an employee may ask regarding their entitlements.
Some sources such as SharePoint and Dataverse require user authentication. This means the agent will only reference data in its response that the user is allowed to see. Whereas other sources may have additional configuration required for the agent to connect to it such as Azure AI Search which requires an Azure account and specifying an authentication type.
After your agent is provisioned from the conversational creation experience, youâll want to test your agent against the instructions Copilot generated from your prompt. Improving your agentâs responses in Copilot Studio is all about making sure it understands your goals clearly and has the right information to work with.
Refine the agent instructions - this is where you tell your agent how it should behave. Use clear, specific language.
For example:
â âAct like a friendly customer support agent who explains things simply.â
â âBe helpful.â (Too vague)
Check the tone and language - make sure the agentâs tone matches your audience.
You can set it to be:
Add or update knowledge sources - if your agent needs to answer questions about a topic, make sure it has access to the right information.
Use Topics and Triggers - If your agent needs to handle specific tasks or conversations, you can create topics with trigger phrases. This helps guide the conversation more precisely. Weâll learn more about this in the following lesson.
Test with real questions - try asking your agent the kinds of questions users might ask.
If the answers arenât great:
Review and iterate - improving an agent is an ongoing process!
After publishing:
Weâre now going to learn how to create a custom agent that can chat over your data
Weâll use the same use case from Lesson 03 - Create a declarative agent for Microsoft 365 Copilot
As an employee
I want to get quick and accurate help from the IT helpdesk agent for issues like device problems, network troubleshooting, printer setup
So that I can stay productive and resolve technical issues without delays
Letâs begin!
Weâll be using the Contoso IT SharePoint site from Lesson 00 - Course Setup - Step 3: Create new SharePoint site.
If you have not set up the Contoso IT SharePoint site, please head back to Lesson 00 - Course Setup - Step 3: Create new SharePoint site.
Weâll be using the Contoso Helpdesk Agent solution from Lesson 04 - Creating a Solution for your agent.
If you have not set up the Contoso Agent solution, please head back to Lesson 04 - Creating a Solution for your agent.
!!! warning âCopilot questions may differ across sessionsâ
The Copilot conversational creation experience can vary each time where the provided questions for guidance may be slightly different than previously.
Navigate to the Home page of Copilot Studio and in the field, enter the following prompt which describes the IT help desk agent. The prompt includes the goal of the agent, the context, the expected tasks and format of the agentâs response.
You are an IT help desk agent. Your goal is to assist users with their IT issues. You can access information from our company's knowledge base at https://support.microsoft.com/en-us. Your responses should be polite and helpful. If a user reports a slow computer, ask about the age of the device, current software versions, and if they've recently installed any new programs. If a user is experiencing trouble logging into their email, guide them through password reset procedures. You should be concise and informative, using step-by-step instructions with bullet points when appropriate.

The conversational creation experience with Copilot will next load. Youâll see Copilot is in progress of responding to you.

Copilot confirms the agent has been set up with the instructions provided, and is asking for confirmation on the name of the agent. Weâll ask Copilot to name our agent as,
```text
Contoso Helpdesk Agent
```

Copilot performs the request and weâll see that the name of the agent has been updated in the agent pane. Copilot next asks us to refine the instructions. Itâs asking how we should respond to particular issues and weâll request that it acknowledges the issue, provide examples of topics to answer, and format the response as bullet points.
Copy and paste the following, and submit the request to Copilot.
```text
Prioritize urgent requests. Examples of IT issues or scenarios to help with: device problems, network connectivity, log in issues. When troubleshooting, first acknowledge their issue and respond with empathy, then provide step by step guidance using bullet points and ask if they require further assistance.
```

The instructions of the agent will be updated after Copilot has received the request. Notice how on the right hand side pane, that starter prompts have now appeared. These were formed based on our instructions.
Next, Copilot is asking for public websites to ground the agentâs knowledge.
Copy and paste the following, and submit the request to Copilot.
https://support.microsoft.com

The public website will be added as a knowledge source. Copilot is asking if additional knowledge sources are to be added. We donât need to add additional public websites.
Copy and paste the following, and submit the request to Copilot.
Proceed with setup

Copilot confirms the setup of our Contoso Helpdesk Agent is complete but weâll add one more modification, weâre going to request that our agent does not answer HR related questions. This lets our agent know that it should not answer HR related questions asked by users.
Copy and paste the following, and submit the request to Copilot.
```text
Do not provide assistance to questions related to HR, examples are: What is my vacation leave balance? How many sick days do I have? What's the URL to our payroll portal?
```

The instructions will be updated to not provide assistance with questions related to HR. We donât need to make further updates, our agent is ready to be created.

Before we create our agent, letâs do a couple of things.
First, select the Configure tab to view the agent details defined from our conversation with Copilot. This is where youâll see the Name, Description, Instructions, Knowledge and Suggested/Starter prompts.

Secondly, letâs test our agent. Copy and paste the following, and submit the question to our agent.
```text
How can I check the warranty status of my Surface?
```

The response to the question will then display where the answers are in the format of a step-by-step guide using bullet points. Great, our agent works! đđť

Lastly, weâll double check the solution that our agent will be created in, is the solution we created and selected as the preferred solution in Lesson 04 - Create a new solution.
Select the ellipsis icon (âŚ) and select Update Advanced Settings.

The Advanced Settings modal will appear and we can see our solution created from earlier is selected by default. This is due to selecting our solution as the preferred solution in Lesson 04 - Create a new solution.
Select Cancel.

Letâs now create our custom agent! Select Create.

Copilot Studio will begin provisioning our agent.

Once our agent has been provisioned, we can see the details of the agent reflect what we requested during our Copilot conversational creation experience. Scroll down to review the agent where youâll see the name, description, instructions, the knowledge sources and the suggested prompts. The orchestration mode is enabled by default and the default model is used for the response model of the agent.



Letâs now test our newly created agent. In the Test pane on the right hand side, select the Activity Map icon.

Enter the following question in the Test pane.
```text
How do I find my Windows 11 product key?
```

The Activity map will then load which shows us in real-time what path the agent is processing. In this scenario, our agent has understood the question and searches the knowledge sources. Currently we have one source which is the public website we added earlier using Copilot, which is what the agent is reviewing.

Our agent then responds with answers that are outlined as bullet points, as defined in the instructions. The response has references to the web pages that the agent formed its response from. This enables users to verify the source of the answer.

You can also review the response and its sources by scrolling down the Knowledge modal in the Activity map.

Congratulations! Youâve built your first custom agent with Copilot in Copilot Studio đđť
Previously with Copilot, we added a public website as an external knowledge source for our agent during the conversational creation experience. Weâre now going to add an internal knowledge source using a SharePoint site. This will be the SharePoint site you created during Lesson 00 - Course Setup.
Select + Add knowledge.

Select SharePoint.

Paste in the address of the SharePoint site created in Lesson 00 - Course Setup in the SharePoint URL field and select Add.

Update the name of the SharePoint site to Contoso IT and select Add.

The SharePoint site has now been added as a knowledge source with a status of Ready. The Status column will show whether the knowledge source has been loaded/connected to successfully, or if there is an issue.

Weâll now add another internal knowledge source by uploading a document directly to our agent.
Select Add knowledge.

Select Upload file or Select to browse.

Download this sample file and select it in your File Explorer. Select Open.

The file has been selected for upload. Select Add to agent next.

The document will be in the process of being added to the agent. Wait until the upload has completed, do not close the browser window. The status of the document will initially show as In progress, wait until the status has been updated to Ready before testing your agent.

Letâs now test our agent!
Weâll test our three knowledge sources by asking questions to our Contoso Helpdesk Agent.
Select the refresh icon in the test pane, followed by selecting the activity map icon.

Enter the following question to test our public website (external) knowledge source.
How can I find the serial number on my Surface device?

Youâll next see the agent reviewing the knowledge sources and providing a response using the website knowledge source.

A response will be returned an notice how there are references to the web page it formed its answer from. If you scroll down the knowledge modal in the activity map, youâll see the other knowledge sources the agent searched, which is the SharePoint site and the uploaded file.
However these were not used as in the Referenced sources section, the website knowledge source was only referenced. The answer was grounded using the website knowledge source. If you select the references, youâll be directed to the web page.

Letâs now test both our SharePoint site knowledge source and document knowledge source in a single message. Enter the following question.
How can I access our company Contoso VPN? How do guests connect to the Contoso Guest wifi?

Once again youâll see the agent reviewing the three knowledge sources to generate a response to the questions our single message. The agent responds to both questions in a single message, and separately references the SharePoint page and document of where it generated its response from.
In the knowledge modal in the activity map, youâll see the SharePoint site and document used as the reference sources. You have full visibility of what knowledge sources were used to answer both questions.

Itâs always good to verify the generated response is correct. Select the SharePoint site reference and the FAQs SharePoint page will load where you can scroll down to review the VPN instructions.

Next, select the document reference and a modal will appear with the text from the document that reflects the answer.

The agent can answer multiple questions in a single message, and search the knowledge sources + reference the knowledge sources in its response. Make sure to always verify the response is correct by reviewing the references.
Congratulations! đđť Youâve learnt how to use natural language to create your own custom agent that can chat over your data from three different knowledge sources đđť
This is the end of Lab 06 - Create an agent with Copilot, select the link below to move to the next lesson. Your custom agent created in this lab will be used in the next lessonâs lab.
âď¸ Move to Add a new Topic with trigger lesson
Welcome to the elite. You now know how to forge digital agents that speak your language, reference your data, and support your team. Keep goingâyour missionâs just getting started.
đ Quickstart: Create and deploy an agent
đ Key concepts - Authoring agents
đş Create a custom agent using natural language
đş Add knowledge to your agents