Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can control the knowledge available to your agent for generating responses with knowledge sources from the web and your Microsoft 365 organizational data. For a full list of the knowledge sources available, see Add knowledge sources to your declarative agent.
Important
This guide assumes you have completed the Create declarative agents using Microsoft 365 Agents Toolkit tutorial.
Add web search to the agent
Adding web search to your agent allows it to search the web to generate answers. You can optionally scope the knowledge to specific websites.
Open the
appPackage/declarativeAgent.json
file and add thecapabilities
array with the following content."capabilities": [ { "name": "WebSearch" } ]
For more information, see Web search object.
Select Provision in the Lifecycle pane of the Teams Toolkit.
The declarative agent will have access to web content to generate its answers after you reload the page.
Add a SharePoint site to the agent
You can add files in OneDrive or the contents of SharePoint sites as a knowledge source.
Open the
appPackage/declarativeAgent.json
file and add the following value to thecapabilities
array, replacinghttps://contoso.sharepoint.com/sites/ProductSupport
with a SharePoint site URL in your Microsoft 365 organization.{ "name": "OneDriveAndSharePoint", "items_by_url": [ { "url": "https://contoso.sharepoint.com/sites/ProductSupport" } ] }
For more information, see OneDrive and SharePoint object.
Note
- URLs should be full path to SharePoint items (site, document library, folder, or file). You can use the "Copy direct link" option in SharePoint to get the full path or files and folders. Right-click on the file or folder and select Details. Navigate to Path and select the copy icon.
- Not specifying the
items_by_url
array (or the alternativeitems_by_sharepoint_ids
array) causes all OneDrive and SharePoint content in your Microsoft 365 organization that is available to the logged in user to be available to the agent.
Select Provision in the Lifecycle pane of the Teams Toolkit.
The declarative agent will have access to OneDrive and SharePoint content to generate its answers after you reload the page.
Add Teams messages to the agent
Open the
appPackage/declarativeAgent.json
file and add the following value to thecapabilities
array, replacinghttps://teams.microsoft.com/l/team/...
with a Teams channel or team url from your organization.{ "name": "TeamsMessages", "urls": [ { "url": "https://teams.microsoft.com/l/team/..." } ] }
For more information, see Teams messages object.
Note
- The url in the url object must be well formed links to a Teams chat, team, or meeting chat.
- Not specifying the
urls
array causes all Teams channels, teams, meetings, 1:1 chat, and group chats in your Microsoft 365 organization that is available to the logged in user to be available to the agent.
Select Provision in the Lifecycle pane of the Teams Toolkit.
The declarative agent will have access to Teams data to generate its answers after you reload the page.
Add people knowledge to the agent
The people knowledge source allows you to scope your agent to answer questions about individuals in an organization.
Open the
appPackage/declarativeAgent.json
file and add thePeople
entry to thecapabilities
array.{ "name": "People" }
For more information, see People object.
Select Provision in the Lifecycle pane of the Teams Toolkit.
The declarative agent will have access to people knowledge after you reload the page.
Add email messages to the agent
The email knowledge source allows you to scope your agent to use email from the user's mailbox or a shared mailbox to answer queries.
Open the
appPackage/declarativeAgent.json
file and add theEmail
entry to thecapabilities
array.{ "name": "Email", "folders": [ { "folder_id": "inbox" } ] }
For more information, see Email object.
Note
- This example accesses the user of the agent's mailbox. To access a shared mailbox instead, add the optional
shared_mailbox
property set to the email address of the shared mailbox. - The
folders
array limits the mailbox access to specific folders. To access the entire mailbox, omit thefolders
array.
- This example accesses the user of the agent's mailbox. To access a shared mailbox instead, add the optional
Select Provision in the Lifecycle pane of the Teams Toolkit.
The declarative agent will have access to email knowledge after you reload the page.
Add a Microsoft 365 Copilot connector to the agent
Adding a Copilot connector makes the items ingested by that connector available to the agent as a knowledge source.
Open the
appPackage/declarativeAgent.json
file and add the following value to thecapabilities
array, replacingpolicieslocal
with a valid Copilot connector ID in your Microsoft 365 organization. For more information about how to find Copilot connector IDs, see Retrieving capabilities IDs for declarative agent manifest.{ "name": "GraphConnectors", "connections": [ { "connection_id": "policieslocal" } ] }
For more information, see Copilot connectors object.
Note
- Not specifying the
connections
array causes all Copilot connectors content in your Microsoft 365 organization that is available to the logged in user to be available to the agent.
- Not specifying the
Select Provision in the Lifecycle pane of the Agents Toolkit.
The declarative agent will have access to Copilot connectors content to generate its answers after you reload the page.