編輯

共用方式為


Optimize SharePoint content retrieval

Declarative agents extend Microsoft 365 Copilot to customize the experience for users. When you build declarative agents, you can add SharePoint content as a knowledge source. This article describes the best practices to apply to optimize how your agent returns data from SharePoint knowledge sources.

Note

Agents grounded in SharePoint data are only available to users in tenants that have Copilot Studio metering enabled or users who have Microsoft 365 Copilot licenses. For details, see Agent capabilities for Microsoft 365 users.

Reference only relevant SharePoint files

You can reference specific SharePoint files in your agent manifest via the OneDriveAndSharePoint object in the agent manifest, either by URL or by ID.

When you specify up to five files, Copilot searches the full contents of all files. Copilot will have full access to all the file content and returns the appropriate content to the user based on their query. If you specify more than five SharePoint files, Copilot chooses content from the most relevant five files, rather than searching all the files specified, and only returns content from those files.

To optimize the content that Copilot returns, choose the most relevant SharePoint files to specify in your manifest. For example, if a folder contains eight files and only five are relevant to the users' task, specify the five files individually instead of referencing the folder.

Coming soon: The number of files that you can specify for Copilot to search all contents will increase to 20.

Limit SharePoint file size

When you reference SharePoint sites or folders by URL in your agent manifest, Copilot might have trouble identifying the right content to return to the user when the files included in the site or folder are large. To reduce the risk that Copilot won't find the right content in the sites or folders you reference, strive to keep your SharePoint files to a maximum of 36,000 characters (approximately 15-20 pages). If your files are larger than 36,000 characters, consider breaking them up into separate shorter files to help Copilot scan the full contents.

Alternatively, you can reference specific SharePoint files by ID. Copilot will search the full contents if you specify five or fewer files, or it will search the five most relevant files if you specify more than five files.

Remove special formatting

Copilot is currently unable to parse tables and other special formatting in SharePoint content. To ensure that Copilot can consume your SharePoint content, remove tables or other special formatting from the content before you reference it in your agent manifest.