Generative answers pointing to SharePoint sources don't return results

Generative answers allow makers to create agents that respond to questions grounded in data sources, like public websites or SharePoint, by pointing the agent at those data sources. However, sometimes the agent doesn't provide a response and instead returns something like 'I’m not sure how to help with that. Can you try rephrasing?' (the actual message depends on the implementation).

Screenshot showing no response from Generative Answers.

Why doesn't the 'Create generative answers' node respond?

When a SharePoint data source is configured, there could be several different factors preventing generative answers from returning a response, such as the following potential factors:

  1. Search results are missing

  2. The user accessing the agent doesn't have sufficient permissions on the data source

  3. Files are larger than 3 MB

  4. The app registration or the agent are misconfigured

  5. Content blocked by content moderation

Note

Before continuing, please make sure you have followed the instructions on how to set up generative answers over SharePoint.

Search results are missing

Generative answers for a SharePoint data source rely on making calls to the Graph API search endpoint. Only the top three results coming back from Graph API are used to summarize and generate a response. If no results come back from Graph API, the generative answers node doesn't provide a response.

To diagnose whether Copilot Studio isn't returning results from the Graph API, you can make direct calls to the Graph API search endpoint. This call simulates the way Copilot Studio works behind the scenes. Calls to the Graph API search endpoint can be generated by using the following template with Graph Explorer. When accessing Graph Explorer, be sure to sign-in using the appropriate credentials for the SharePoint tenant.

The template can be used either by copying the following payload, or using this deep link, which opens Graph Explorer with a prepopulated query.

POST https://graph.microsoft.com/v1.0/search/query

{
    "requests": [{
            "entityTypes": ["driveItem", "listItem"],
            "query": {
                "queryString": "SEARCH TERMS filetype:docx OR filetype:aspx OR filetype:pptx OR filetype:pdf path:\"https://DOMAIN.sharepoint.com/sites/SITENAME\""
            },
            "from": 0,
            "size": 3,
            "QueryAlterationOptions": {
                "EnableModification": true,
                "EnableSuggestion": true
            }
        }
    ]
}

Missing results

Let’s assume that generative answers are configured to provide responses based on content stored in https://<user-domain>.sharepoint.com/sites/HR. However, users aren't getting responses when asking, "What is our policy regarding perks & benefits?"

Behind the scenes, users’ queries are being rewritten, so only the main keywords are being sent to Graph API, resulting in a query similar to the following example:

Screenshot of a search query in Graph Explorer.

If no results are returned to the search endpoint, as shown in the following response, generative answers doesn't provide a response, either.

Screenshot showing no results returned from a search in Graph Explorer.

How to fix

  1. Ensure that your Create generative answers node points to a SharePoint location with relevant content.

  2. Only documents in supported formats are used to generate responses.

    Note

    Only modern SharePoint pages are supported.

  3. It's possible that documents were only recently uploaded to SharePoint, but have yet to be indexed. It's also possible that there are settings that prevent some sites from appearing in search results. For more information, see Search results missing in SharePoint Online.

Missing user permissions

Generative answers over SharePoint rely on delegated permissions when making calls to Graph API. At a minimum, a user must have read permissions on the relevant sites and files, or the call to Graph API doesn't return any results.

If the user is missing permissions, no results are returned from Graph API, nor any errors or exceptions. For a user with no permissions, it appears as if no documents were found.

How to fix

Amend permissions so users can access the relevant sites and files. For more information, see Sharing and permissions in the SharePoint modern experience.

The app registration or agent are misconfigured

When admins configure generative answers over SharePoint, admins are expected to set up authentication with a Microsoft Entra ID, and configure extra scopes. If scopes are missing from the app registration or from the agent authentication settings, or if consent wasn't granted to the required scopes, no results are returned, nor any errors or exceptions. For an end user, it appears as if no documents were found.

How to fix

Add the necessary scopes to the App Registration and/or the agent’s authentication settings, and grant consent.

The following example is a reference to a well configured app registration:

Screenshot of app registration permissions.

The following example shows the required authentication settings in Copilot Studio:

Screenshot showing Copilot Studio authentication settings.

File size support

Currently, for SharePoint sources, generative answers can only process files up to 3 MB in size. Larger files can be stored in SharePoint and are returned by a Graph API search, but aren't processed by generative answers. As an alternative, files up to 512 MB in size can be uploaded.

How to fix

If files relevant for your conversational AI experience exceed the size limitation, you might want to explore alternative architectures, such as using Microsoft 365 Semantic Indexing or connect your data to Azure OpenAI for Generative answers.

Content blocked by content moderation

When generating responses, Copilot Studio moderates content that's harmful, malicious, noncompliant, or in breach of copyrights. When content gets moderated, generative answers don't provide a response or an indication that content was moderated. However, moderation events are logged when Copilot Studio is configured to send telemetry data to Azure Applications Insights.

After connecting your agent to Azure App Insights, you can use the following Kusto Query Language (KQL) query to find out if content was filtered:

customEvents
| extend cd = todynamic(customDimensions)
| extend conversationId = tostring(cd.conversationId)
| extend topic = tostring(cd.TopicName)
| extend message = tostring(cd.Message)
| extend result = tostring(cd.Result)
| extend SerializedData = tostring(cd.SerializedData)
| extend Summary = tostring(cd.Summary)
| extend feedback = tostring(todynamic(replace_string(SerializedData,"$","")).value)
| where name == "GenerativeAnswers" and result contains "Filtered"
| where cloud_RoleInstance == "myCopilot"
| project cloud_RoleInstance, name, timestamp, conversationId, topic, message, result, feedback, Summary
| order by timestamp desc

In the following example, the KQL query highlights an attempt to use generative answers filtered by content moderation:

Screenshot of Azure Application Insights.

How to fix

  1. Try to adjust content moderation, but keep in mind that lower content moderation settings might result in answers that are less accurate or relevant.

  2. If you think your content shouldn't be moderated, raise a case with customer support.