Copilot Studio Agent Gives Answers From Old SharePoint Files: Fix
🔍 WiseChecker

Copilot Studio Agent Gives Answers From Old SharePoint Files: Fix

When you ask a Copilot Studio agent a question about your company’s SharePoint content, you expect the most current information. Instead, the agent returns answers from outdated files, archived documents, or old versions. This happens because the agent’s default settings include all SharePoint sites and document libraries without filtering by date or relevance. This article explains why the agent pulls from old files and provides a step-by-step fix to restrict its knowledge sources to current content only.

Key Takeaways: Restrict Copilot Studio Agent to Current SharePoint Files

  • Copilot Studio > Settings > Generative AI > Data sources > SharePoint: Controls which SharePoint sites and libraries the agent can query for answers.
  • Copilot Studio > Topics > Knowledge > Add knowledge > SharePoint: Adds specific document libraries or folders as explicit knowledge sources, overriding the general site crawl.
  • Microsoft 365 admin center > SharePoint > Site collection > Versioning settings: Allows you to limit the number of major versions retained, reducing the chance the agent finds old ones.

ADVERTISEMENT

Why Copilot Studio Agent Returns Answers From Old SharePoint Files

The Copilot Studio agent uses Microsoft Graph to search all SharePoint sites that the authenticated user can access. By default, the agent indexes every file and every major version within those sites. If your SharePoint environment contains years of accumulated documents, the agent may retrieve a match from an old file that matches the user’s query better than a newer file.

The root cause is the agent’s lack of date-based filtering in its default configuration. The agent does not automatically prioritize files by modified date or version number. It returns the best semantic match from all available content, regardless of age. Additionally, if you have not defined explicit knowledge sources in the agent’s topics, the agent falls back to a broad crawl of all SharePoint sites the user can see.

How SharePoint Versioning Contributes to the Problem

SharePoint versioning creates a new copy of a file each time a user saves changes. The agent can index every major version as a separate document. If versioning limits are not configured, the agent may find and return content from version 1 of a file while ignoring the current version. The agent does not automatically select the latest version unless you configure the knowledge source to restrict by version.

How User Permissions Affect Search Scope

The agent’s search scope is tied to the user’s SharePoint permissions. If a user has read access to an entire site collection containing historical archives, the agent will include those archives in its search. The agent cannot distinguish between a user’s current working documents and legacy content stored in the same site. You must restrict the agent’s data sources to exclude archived sites or folders.

Steps to Restrict the Agent to Current SharePoint Files

Follow these steps to configure your Copilot Studio agent to use only current SharePoint files. You need Copilot Studio contributor or administrator permissions and SharePoint site owner permissions for the sites you want to include.

  1. Open your agent in Copilot Studio
    Sign in to Copilot Studio. Select the agent that is returning old SharePoint answers. Click the Settings tab in the top navigation bar.
  2. Navigate to Generative AI settings
    In the Settings panel, select Generative AI. This section controls how the agent retrieves and generates responses from connected data sources.
  3. Configure SharePoint data sources
    Under the Data sources section, locate SharePoint. Click Manage. You will see a list of all SharePoint sites currently connected to the agent. Remove any sites that contain archived or outdated content. To remove a site, click the three dots next to the site name and select Remove.
  4. Add only current SharePoint sites
    Click Add data source and select SharePoint. Enter the URL of a specific site or site collection that contains only current working files. Do not add the root tenant URL. Repeat this step for each relevant site. The agent will now search only these sites.
  5. Restrict knowledge sources at the topic level
    Go to the Topics tab. Select the topic where the agent returns old answers. In the topic editor, click the Knowledge node. Click Add knowledge and choose SharePoint. Enter the exact URL of a document library or folder that contains current files. This overrides the broader site-level search for that specific topic.
  6. Limit SharePoint version retention
    Open the Microsoft 365 admin center. Go to SharePoint > Site collections. Select the site collection containing the agent’s knowledge sources. Click Settings > Versioning settings. Set Keep the following number of major versions to a low number, such as 3. Uncheck Keep drafts for the following number of major versions to prevent draft versions from being indexed. Click OK.
  7. Test the agent with a sample query
    Return to Copilot Studio and click Test in the top menu. Ask a question that previously returned an old answer. Verify the agent now returns a response from a current file. If it still returns old content, repeat steps 2 through 6 to ensure no outdated sites or libraries remain connected.

ADVERTISEMENT

If Copilot Studio Agent Still Returns Old SharePoint Answers

Agent Returns Content From a Site You Removed

If the agent continues to return answers from a site you removed, the agent may be using cached search results. Clear the agent’s cache by going to Settings > Generative AI > Data sources > SharePoint > Manage and clicking Refresh. Wait 15 minutes for the cache to rebuild, then test again.

Agent Returns Answers From Old Versions of a Current File

If the agent returns content from an old version of a file that is still in a current library, the versioning limits you set may not have taken effect yet. Versioning settings apply to new saves only. To remove old versions, go to the SharePoint document library, open the file, click the Version history command, and delete all versions except the latest one. The agent will then index only the current version.

Agent Ignores Topic-Level Knowledge Sources

If the agent ignores the specific SharePoint library you added in a topic, check that the library URL is correct. The URL must point to the root of the library, not a subfolder. Also ensure the agent’s Generative AI data sources do not include a broader site that contains the same library. When both a general site and a specific library are connected, the agent may use the broader site’s results. Remove the broader site and keep only the specific library.

Copilot Studio Agent Default Search vs Restricted Search: Key Differences

Item Default Search Restricted Search
Data sources All SharePoint sites the user can access Only sites and libraries explicitly added in Settings and Topics
Version handling Indexes all major versions Indexes only the latest version after versioning limits are applied
Date filtering None — returns best semantic match regardless of age Implicit date filtering by restricting to current libraries with recent files
Cache refresh Automatic every 24 hours Manual refresh available in Settings > Generative AI > Data sources
User permission scope Full read access across tenant Limited to sites and libraries added as knowledge sources

You can now configure your Copilot Studio agent to return answers only from current SharePoint files by removing outdated sites, setting versioning limits, and adding specific libraries as topic-level knowledge sources. Test the agent with a query that previously failed. If the problem persists, clear the agent’s cache and verify that no broader site collection remains connected. For advanced control, consider creating separate agents for different departments, each with its own restricted SharePoint data source.

ADVERTISEMENT