Use generative answers in a topic

By using a generative answers node, your agent can respond to users based on knowledge sources at the topic level. Knowledge sources provide authoritative responses based on information you provide to your agent.

When you first create your agent, you can enter a URL your agent uses to generate responses. The agent uses this URL in all features. However, you can enhance your agent's conversations by using multiple internal and external knowledge sources within individual topics.

Generative answers as a fallback

When your agent can't find a matching intent (defined in a topic) for the user's query, it uses generative answers to try to answer the question. This behavior is known as generative answers as a fallback. If the user's intent isn't matched to topics or generative answers, the Fallback system topic is used. System topics can escalate a query for the agent.

Generative answers knowledge sources

Within an agent's topic, you can add a generative answers node. This node allows you to specify more sources that the node searches based on your inputs. Sources defined in the generative answers node override knowledge sources you specified at the agent level, which functions as a fallback. For the best results, configure your generative answers nodes with specific knowledge sources.

These sources include:

  • External resources:

  • Internal resources:

    • Azure OpenAI on your data
    • Documents uploaded to Dataverse
    • SharePoint (only specific file formats are supported)
    • Custom data (internal or external): supply your own source, such as a Power Automate Flow or from Skill.

Supported knowledge sources

Different knowledge sources offer different capabilities. These capabilities include the number of inputs, the type or format of the data, and how (or if) the source needs authentication to access it.

Name Source Description Number of inputs supported in generative answers Authentication
Public website External Searches the query input on Bing, only returns results from provided websites Generative mode: 25 websites
Classic mode: Four public URLs (for example, microsoft.com)
None
Documents Internal Searches documents uploaded to Dataverse, returns results from the document contents Generative mode: All documents
Classic mode: Limited by the Dataverse file storage allocation
None
SharePoint Internal Connects to a SharePoint URL, uses GraphSearch to return results Generative mode: 25 URLs
Classic mode: Four URLs per generative answers topic node
Agent user's Microsoft Entra ID authentication
Dataverse Internal Connects to the configured Dataverse environment and uses a retrieval-augmented generative technique in Dataverse to return results Generative mode: Unlimited
Classic mode: Two Dataverse knowledge sources (and up to 15 tables per knowledge source)
Agent user's Microsoft Entra ID authentication
Enterprise data using connectors Internal Connects to connectors where your organization data is indexed by Microsoft Search Generative mode: Unlimited
Classic mode: Two per custom agent
Agent user's Microsoft Entra ID authentication

Note

  • Agent user authentication for knowledge sources means that when a specific user asks a question of the agent, the agent only surfaces content that the specific user can access.

  • Knowledge sources in generative answers nodes currently don't support Bing Custom Search, Azure OpenAI, or Custom Data. Instead, from the generative answers node properties, use the Classic data option for Bing Custom Search, Azure OpenAI, or Custom Data sources.

  • For websites, you need to confirm which website(s) your organization owns that Bing will search through Copilot Studio.

  • You can perform language-agnostic querying across all supported file types and languages.

  • If you're using unstructured data, such as individual SharePoint files and folders, OneDrive files and folders, or connectors, there are different limits and limations. For more information, go to Limits and limitations.

  • Currently, citations returned from a knowledge source can't be used as inputs to other tools or actions.

Choose which knowledge sources the node searches

The generative answers node's Knowledge sources section includes the Search only selected sources setting that controls which knowledge sources the node searches. This setting applies only to that node.

Screenshot of the generative answers node properties, with Search only selected sources turned off (the default).

Tip

If the agent should answer using only certain knowledge sources, turn on Search only selected sources and select just those sources. This action keeps results from the agent's other knowledge sources from affecting the quality of the answer.

Search only selected sources turned off

When Search only selected sources is off, the default setting, the node searches all the knowledge sources that are configured for the agent.

  • The node uses the agent's current set of knowledge sources, so sources you add or remove at the agent level are reflected automatically.
  • If you turn off a knowledge source, the node doesn't search it.

Choose this option when you want the node to draw on the agent's full set of knowledge.

Search only selected sources turned on

When Search only selected sources is on, the node searches only the sources you select in the list. The agent-level knowledge sources aren't searched by this node.

Screenshot of the generative answers node properties, with Search only selected sources turned on and specific sources selected.

  • The sources you select replace, rather than add to, the agent-level set for this node.
  • The node always searches the sources you select, even if a source has trigger conditions that would otherwise limit when it's used. The node shows the note "Trigger conditions will be ignored for explicitly selected sources."

Choose this option when a topic needs a focused, predictable set of sources. For example, a sensitive topic that should use only one approved SharePoint site.

Note

Search only selected sources doesn't fall back to the agent-level knowledge sources. If the sources you select don't return an answer, the node doesn't automatically search the agent's other knowledge sources. Generative answers as a fallback, described earlier on this page, is separate agent-level behavior.

Answer using only custom data from a variable

If you want a generative answers node to respond using only custom context that you supply from a variable, and not from any knowledge source, use the Custom data option together with Search only selected sources:

  1. Turn on Search only selected sources and leave all knowledge sources unselected. With nothing selected, the node doesn't search any knowledge sources.
  2. Under Classic data, set Custom data to the variable that holds your content.
  3. Keep Web search and Allow the AI to use its own general knowledge turned off so the answer relies only on your custom data.

With this configuration, the node generates its answer only from the data in your variable. For how to provide custom data, see Use a custom data source for generative answers.

Add a generative answers node

  1. Go to the Topics page and open the topic you want.

  2. Select the Add node icon under the node after which you want to use generative answers, point to Advanced, and select Generative answers. A new node called Create generative answers appears.

  3. Select the three dots () of the node, and then select Properties. The Create generative answers properties pane appears.

    You can specify and configure your new data sources:

Customize the agent's response

This section shows how to store the agent response in a variable instead of immediately returning it, so that you can include it on an Adaptive Card.

  1. On the Create generative answers node, for Input, select the Activity.Text system variable.

  2. In the Create generative answers properties panel:

    1. Expand the Advanced section.

    2. Create a global variable. Enter a meaningful name for the variable. This variable stores the answer generated in response to a query from the user.

    3. Clear the Send a message box.

      Note

      Clearing this option prevents your agent from immediately returning the generated answer, which allows you to customize the answer. Limitation: If you publish this agent to Teams, you must explicitly include rendering of citations for the customized answer. In Teams, Copilot Studio agents automatically return citation links only for answers without customizations. Learn more in Citations aren't rendered for customized answers.

  3. Add either a Question node or a Message node, and add an Adaptive Card to this node.

  4. In the Adaptive Card properties panel, switch to Formula, and replace the default content with a Power Fx formula that uses your global variable and the customizations you want.

Authentication

Some sources require authentication because the agent makes calls on behalf of the user in the chat window. The calls use the account credentials from copilotstudio.microsoft.com.

The authentication settings you configure in the agent require manual authentication with the Service Provider type of Microsoft Entra ID.

To configure authentication and create a Microsoft Entra ID, see:

Include delegated permissions for Microsoft Graph:

  1. Files.Read.All
  2. Sites.Read.All

Supported content

Generative answers get content stored in these formats:

  • SharePoint pages (modern pages)
  • Word documents (docx)
  • PowerPoint documents (pptx)
  • PDF documents (pdf)

Note

For a list of limits and supported SharePoint functionality, see SharePoint web app limits.

Content moderation

Set the content moderation settings for a generative answers node from the Properties pane. The content moderation settings allow your agent to provide more answers. However, the increase in answers might affect the allowance of harmful content from the agent.

  1. Select the three dots () of the node, and select Properties.

  2. Select the desired moderation level.

    The moderation levels range from Lowest to Highest. The lowest level generates the most answers, but they might contain harmful content. The highest level of content moderation generates fewer answers, and applies a stricter filter to restrict harmful content. The default moderation level is High.

  3. Select Save at the top of the page.

Note

If you set your generative answers node to moderate content, it might not return answers. For more information on how to diagnose answers not being returned, see Content blocked by content moderation.