Manage knowledge in Copilot Studio agents with the standard harness
Scenario
In this exercise, you will:
- Create a Dataverse table
- Create an agent
- Upload a file to use as a knowledge source
- Add a public website as a knowledge source
- Add the Dataverse table as a knowledge source
- Configure generative orchestration settings
- Configure the Create generative answers node
- Publish the agent to Microsoft Teams
This exercise will take approximately 60 minutes to complete.
What you will learn
- How to add knowledge sources to an agent
- How to configure generative orchestration and generative answers behavior
High-level lab steps
- Create a Dataverse table using Copilot
- Create an agent using Copilot
- Add knowledge sources
- Configure generative AI
- Publish the agent
Prerequisites
- Have a Microsoft Entra ID account
- Have a Copilot Studio license or have signed up for a free trial.
- Have access to a Power Platform environment and a solution where you can create agents and related assets.
- You can use:
- the environment and Lab Exercises solution created in the ILT Setup lab, or
- your own existing environment and solution.
- If you do not already have an environment and solution prepared, complete the steps in the ILT Setup lab before continuing.
[!IMPORTANT] You may notice a new Copilot Studio experience that is currently in preview. These labs use the current Copilot Studio interface, so some steps and screenshots may not match the preview experience. To follow the lab instructions successfully, use the Classic Copilot Studio UI experience throughout these exercises.
Key concept: Agent components and behavior
When generative orchestration is enabled, the agent can use instructions, knowledge, topics, and tools to generate responses dynamically. Multiple types of knowledge sources can be used to ground an agent, and several settings influence how generative responses are generated.
Exercise 1 - Create a table in Dataverse
In this exercise, you will create a Dataverse table that will be used as a knowledge source by an agent.
Task 1.1 – Create a table for expense claims
-
In a web browser, navigate to Power Apps Maker portal at
https://make.powerapps.com/and sign in if prompted. Skip any welcome messages. -
At the top of the page, verify that you are working in the environment you want to use for this exercise.

-
In the left-hand navigation in the Maker portal, select Tables.

-
Select the Get started with Copilot tile.
-
In the Get started with Copilot dialog, select the Table options icon, and select One table.

-
In the Describe the tables you want Copilot to build text box, enter the following prompt:
A table to store and process expense claims with an Expense Title, Expense Type (Accommodation, Meals, Entertainment or Travel), Expense Date, Submission Date, Approved Date, Amount Requested, Amount Approved, and Expense Status (Submitted, Evaluating, Approved, Rejected). -
Select Generate.
[!NOTE] The generated table schema may vary slightly from the screenshot shown in this lab. Minor differences in column naming or formatting are expected.
-
A table will be created. Make a note of the name of the table.

-
Select Save and exit and select Save and exit again.
Exercise 2 - Create an agent
In this exercise, you will create a new agent using natural language to answer questions about expense policies in a fictional corporation.
Task 2.1 – Create an agent for expense claims
-
Navigate to the Copilot Studio home page
https://copilotstudio.microsoft.com/. -
Make sure you are in the Copilot Studio classic experience. If you are using the new Copilot Studio experience, select the ellipsis (…) next to your account in the lower-left corner, and then select Open classic experience before proceeding.
-
If the Share feedback before opening the previous experience? dialog appears, select Skip feedback to open the classic experience in a new tab.
-
At the top of the page, verify that you are working in the environment you want to use for this exercise.
-
Select Agents in the left-hand navigation.
-
Select + Create blank agent.

-
Enter
Expense Claims Assistantas the agent name. -
Expand Agent settings (Optional), if it is not already expanded.
-
Leave English (United States) set as the primary language for the agent.
-
In the Solution drop-down, select Lab Exercises or another solution you want to use for this exercise.
-
Enter
expenseagentfor the Schema name. -
Select Create.
Once your agent has been provisioned, you may proceed with configuring your agent.
Task 2.2 – Configure agent instructions
-
In the Overview tab, locate the Instructions section and select Edit.
-
Add the following instructions to the agent:
# Role and Purpose You are the Expense Claims Assistant. Help employees understand expense policies, prepare expense claims, and interpret available expense claim data. # General Guidelines - Be professional, helpful, and respectful. - Use plain English (United States) and explain unfamiliar terms. - Ask one clarifying question at a time when necessary. - Do not provide legal or tax advice. - Do not guarantee claim approval, reimbursement amounts, or payment dates. # Skills - Explain allowable expenses, reimbursement limits, documentation requirements, and submission procedures using the configured expense policy. - Help users understand Accommodation, Meals, Entertainment, and Travel expense categories. - Use the Expense Claims data knowledge source for questions about recorded claims, amounts, dates, and statuses. - Recognize "expense label" and "expense category" as synonyms for Expense Type. - Explain incidental expenses as minor, necessary business costs that arise in addition to a primary expense, such as tips or fees. - Summarize expense amounts by category when sufficient data is available. # Knowledge and Accuracy - Use the configured IRS Publication 463 knowledge source for questions about IRS expense rules, incidental-expense methods, and related limits. - If a question about incidental-expense limits does not specify company policy or IRS rules, consult both relevant configured sources and clearly distinguish company reimbursement rules from IRS tax guidance - If one source lacks an answer, consult other relevant enabled knowledge sources before concluding that information is unavailable. - Do not treat tax deductibility as confirmation that an expense is reimbursable by the company. - Respect the knowledge sources and web search settings enabled for the current agent or topic. - Use public web information only when permitted by those settings; do not use it to invent or override company policy. - Cite supporting sources when available. - Do not invent policy limits, deadlines, receipt requirements, claim records, or exchange rates. - If information is unavailable, sources conflict, or a source is not ready, explain the limitation rather than guessing. # Working with Expense Data - Distinguish Amount Requested from Amount Approved. - Clarify which amount the user wants when a request for totals is ambiguous. - State the amount field, currency, date range, and status filters used when available. - Do not combine different currencies without a supported conversion rate and date. - Do not present totals from partially retrieved records as complete totals. - Distinguish Submitted, Evaluating, Approved, and Rejected statuses without inferring an unrecorded decision or payment. - For current exchange rates, use a permitted current source and state the rate date; if none is available, say that the rate cannot be verified. # Actions and Limitations - Treat knowledge sources as information sources, not as tools for changing records. - Do not claim to submit, approve, reject, update, or pay a claim unless an authorized, configured tool supports that action. - Obtain confirmation before submitting information or changing records. - If a request cannot be completed, explain the limitation and the appropriate next step. - Refer unresolved policy or approval questions to the organization's expense administrator or finance team without inventing contact details. # Privacy and Integrity - Request only the information needed to answer the question. - Do not request passwords, full payment card numbers, or bank account details in chat. - Share claim information only within the authenticated user's authorized access. - Do not help fabricate receipts, conceal duplicate claims, inflate expenses, or bypass approval requirements. # Response Format - Give a direct answer followed by essential supporting details. - Use numbered steps for procedures, bullet points for policy requirements, and tables for comparisons or category totals. - Clearly separate policy guidance, recorded claim facts, and calculations. - Include relevant qualifications and sources without overwhelming the user. -
Select Save.
Exercise 3 - Ground the agent with knowledge
In this exercise, you will add knowledge sources to the agent to ground the agent.
Task 3.1 – Add a document as a knowledge source
-
Open a new browser tab, navigate to
https://github.com/MicrosoftLearning/mslearn-copilotstudio/raw/main/expenses/Expenses_Policy.docxand download the expenses policy document locally. This document contains details of the expenses policy for the fictional corporation. -
Return to the Copilot Studio browser tab with the agent you created in Exercise 2.
-
Select the Knowledge tab to verify the knowledge sources defined in your agent (currently there should be none).

-
Select + Add knowledge, and note the multiple types of knowledge source that you can add to your agent.

-
In the Upload file section, use select to browse to upload the expense policy document you downloaded previously and select Add to agent.

[!NOTE] After uploading the file, Copilot Studio begins indexing. This may take 10 minutes or longer, so you will check back after the next exercise.
Task 3.2 – Add a public website as a knowledge source
-
In the Copilot Studio agent, select the Knowledge tab.
-
Select + Add knowledge.
-
Select Public websites.
-
In the Public website link text box, enter
https://www.irs.gov/publications/p463. This official government public website has details on reimbursement of travel expenses that could be useful for your agent. -
Select Add.
-
For Name, enter
Travel, Gift, and Car Expenses | Internal Revenue Service. -
For Description, enter
This knowledge source contains information on reimbursement of travel expenses.. -
Select Add to agent.
[!NOTE] Public website indexing may take several minutes. If responses are incomplete, wait a few minutes and test the agent again.
Task 3.3 – Add a Dataverse table as a knowledge source
-
In the Copilot Studio agent, select the Knowledge tab.
-
Select + Add knowledge.
-
Select Dataverse.
-
Search for and select the Expenses table you created in Exercise 1.

-
Select Add to agent.

Task 3.4 – Configure the Dataverse knowledge source
-
In the Copilot Studio agent, select the Knowledge tab.
-
Select the ellipsis (⋮) for the Dataverse table and select Edit.

-
In the Details tab, for Name, enter
Expense Claims data. -
Select the Synonyms tab.
-
In the Expense Type row, select + Add synonyms.
-
Enter
Expense labeland select Add. -
Enter
Expense categoryand select Add.
-
Select Done.
-
Select the Glossary tab.
-
For Enter term, enter
Incidental expenses. -
For Enter description, enter
Minor, necessary business costs that arise in addition to a primary expense such as tips or fees.. -
Select Add.
-
Select Save.
Task 3.5 – Check in on your file indexing
Check whether the uploaded file has completed indexing. If indexing is still in progress, wait a few minutes and refresh the page before continuing.
-
Select the Knowledge tab.
-
Check on the Status of your file upload. If it is still In progress, refresh every few minutes until it is Ready.
Task 3.6 – Test grounding
-
Select the Test icon in the upper-right of the page to open the testing pane.
-
In the Test pane, select the ellipsis (…) next to the variables {x} icon, and toggle Show activity map when testing to On and Track between topics to Off.

-
At the top of the Test pane, select the Start new test session icon +.
-
Enter and submit the following prompt:
What can I claim for expenses? -
The response should be grounded using the uploaded expense policy document and may also reference other configured knowledge sources.

-
At the top of the Test pane, select the Start new test session icon +.
-
Enter the following prompt:
What is the total amount of all expense claims for each category? -
The agent should search all the knowledge sources and generate a response using the Dataverse table.

-
At the top of the Test pane, select the Start new test session icon +.
-
Enter the following prompt:
What are the limits for incidental expenses? -
The agent should search all the knowledge sources and generate a response that uses information from the public website.

Exercise 4 - Generative AI settings
In this exercise you will configure generative AI for the agent and for the generative answers node.
Task 4.1 – Configure agent knowledge settings
-
In the upper-right of the agent page, select the Settings button.
-
Note that Orchestration is set to Yes - Responses will be dynamic, using available tools and knowledge as appropriate.
-
In the Knowledge section, set Allow ungrounded responses to Off.
-
In the Knowledge section, set Use information from the Web to Off.

-
Select Save.
-
In the upper-right of the Settings page, select X to close settings.
-
Test the agent using the prompts from the previous exercise. The file and Dataverse knowledge sources will be used but the public website will not be used when generating a response.
Task 4.2 – Configure generative answers node
-
Select the Topics tab.
-
Filter by System topics.
-
Open the Conversational boosting topic.
-
If a Boost your conversations with copilots dialog appears, select Done.
-
Select the Create generative answers node.

-
Select Edit under Data sources.
-
Select and enable Search only selected sources.
-
Select the Public website knowledge source.
-
Enable Web search.
When enabled, Web search allows generative answers to supplement configured knowledge sources with public web information.

-
Select Save.
-
Select the Overview tab.
-
Select the Test icon in the upper-right of the page to open the testing pane.
-
In the Test pane, select the ellipsis (…) next to the variables {x} icon, and toggle Show activity map when testing to Off and Track between topics to On.
-
At the top of the Test pane, select the Start new test session icon +.
-
Enter the following prompt:
What is the current exchange rate between the U.S. dollar and the euro? -
The knowledge sources will not provide an answer but the agent will use generative answers to search the web to generate a response.

Task 4.3 – Fallback topic
-
Select the Topics tab.
-
Filter by System topics.
-
Open the Conversational boosting topic.
-
Select the Create generative answers node.
-
Select Edit under Data sources.
-
Disable Web search.
-
Select Save.
-
Select the Overview tab.
-
Select the Test icon in the upper-right of the page to open the testing pane.
-
In the Test pane, select the ellipsis (…) next to the variables {x} icon and verify that Show activity map when testing is set to Off and Track between topics is set to On.
-
At the top of the Test pane, select the Start new test session icon +.
-
Enter the following prompt:
What is the current exchange rate between the U.S. dollar and the euro? -
The knowledge sources and generative answers will not provide an answer. If no suitable grounded or generative response is available, the conversation may route to the Fallback topic.

Exercise 5 - Publish the agent to Microsoft Teams
In this exercise, you will publish the agent to Microsoft Teams, first ensuring that Microsoft Entra ID authentication is enabled.
Task 5.1 – Microsoft Entra ID authentication
-
In the upper-right of the agent page, select the Settings button.
-
In the left-hand side of the Settings page, select Security.
-
Select Authentication.
-
If not already selected, select Authenticate with Microsoft.
-
Select Save and select Save again.
-
In the upper-right of the Settings page, select X to close settings.
Task 5.2 – Publish the agent
- On the agent page, select Publish and select Publish again to confirm.
Task 5.3 – Microsoft Teams channel
[!NOTE] Publishing to Teams in this lab is intended for testing and learning purposes. Production deployments may require additional governance, security, and app approval processes.
-
Select the Channels tab.

-
Select the Microsoft 365 and Microsoft Teams tile.
-
Deselect Make agent available in Microsoft 365 Copilot.
-
Select Add channel.

-
Select See agent in Teams.
-
Select Cancel in the dialog box for This site is trying to open Microsoft Teams (work or school).
-
Select Use the web app instead.
-
Sign in to Microsoft Teams if prompted.
-
Select Add to add the agent to Teams.

-
Select Open and wait for the agent to load in Teams.
-
Test the published agent in Microsoft Teams.

Summary
In this lab, you added knowledge sources to an agent and explored how generative AI settings affect when and how the knowledge sources are used to generate responses to prompts.