Agent Builder file limits

Williams, Paula 0 Reputation points
2026-12-01T17:25:06.6466667+00:00

"Optimize content retrieval" (Microsoft Learn) says Copilot searches the full content of up to 20 specified SharePoint files, and only the 20 most relevant above that. Does this apply to agents created in Agent Builder (Microsoft 365 Copilot app), or only to pro-code declarative agents? If an Agent Builder agent has 90 SharePoint files as knowledge, can it fully read one specific file by exact name?

Microsoft Copilot | Microsoft 365 Copilot | Development
0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-12-01T17:25:49.64+00:00

    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:

    1. 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.
    2. In Microsoft 365 Copilot → agent → Configure → Knowledge, use Browse → Attach cloud files and select the specific SharePoint file.
    3. Confirm that the file appears in Knowledge and is no longer marked Preparing.
    4. 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

    1. Add knowledge sources to an agent in Agent Builder
    2. Optimize content retrieval
    3. Best practices for building declarative agents
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.