Building and customizing solutions using Microsoft 365 Copilot APIs and tools
The 20-file full-content retrieval rule applies to Agent Builder agents because Agent Builder creates declarative agents; with 90 individually selected SharePoint files, an exact filename can help retrieval relevance but does not guarantee that the named file will enter the 20-file full-content set.
How the two limits interact
- Authoring limit: Agent Builder allows up to 100 SharePoint files per agent, so configuring 90 files is supported.^1^
- Runtime retrieval behavior: When no more than 20 specific SharePoint files are referenced, Copilot searches the full contents of all of them. Above 20, it searches the full contents of the 20 files judged most relevant to the request.^2^
- These describe different stages: 100 is how many SharePoint files Agent Builder permits as knowledge; 20 is how many receive guaranteed full-content searching for a request.
The optimization article describes declarative-agent behavior and explicitly covers both SharePoint knowledge and Agent Builder embedded-file knowledge. Its manifest examples are the pro-code configuration equivalent, but the retrieval guidance is not documented as exclusive to pro-code agents.^2^
Can an exact filename force full reading?
No documented guarantee says that mentioning the exact filename forces that file into the selected 20. It is reasonable to test an exact-name prompt because the name contributes to relevance, but it should not be treated as deterministic file selection.
For reliable access to that file:
- Create a narrower agent containing that file and no more than 19 other relevant SharePoint files; or reduce the existing agent’s selected files to that scope.
- In Microsoft 365 Copilot → agent → Configure → Knowledge, use Browse → Attach cloud files and select the specific SharePoint file.
- Confirm that the file appears in Knowledge and is no longer marked Preparing.
- On Preview, ask a question with a known answer inside the file and verify that the response cites or uses that file.^1^
If 90 files must remain available, split them into task- or subject-specific agents rather than relying on filename prompting. Microsoft recommends relevance over quantity and testing known-answer questions to verify both grounding and source attribution.^3^
Additional content constraints
Even when a file is selected as relevant, retrieval can still be affected by its content:
- For sites or folders referenced by URL, Microsoft recommends files no larger than 36,000 characters, approximately 15–20 pages.
- For up to 20 specifically referenced files, the recommended combined total is no more than 300 pages.
- Tables and other special formatting might not be parsed correctly.^2^
- SharePoint permissions and sensitivity labels continue to apply. If Restricted SharePoint Search is enabled, SharePoint cannot be used as an Agent Builder knowledge source.^1^
Therefore, 90 SharePoint files are valid as Agent Builder knowledge, but only a scope of 20 or fewer specifically selected files provides the documented assurance that every file’s full content is searched.
References