Learn how to enable Customer Intent for Custom Agents in Copilot Studio!
Previously I have written articles on the Customer Intent agent in Dynamics 365 Customer Service and Contact Center where I explained how the Customer Intent agent works, and how to enable it. If you haven’t had a chance to read those articles yet, you can do so here and here. How great would it be if we could allow our custom built agents (yes the ones you build using Copilot Studio) to access the same intent library managed by the Customer Intent agent? This will allow for even better deflection rates and less of a need to talk to a live agent!
How does it work?
As I explained in the previous article, the Customer Intent agent is an autonomous agent designed to identify and understand the intent of customers. When I say ‘understand intent’ I am referring to why the customer is reaching out to customer support. For example, a customer could be looking for a refund, they could be reporting a product issue, etc. Understanding why a customer reaches out is very important as it speeds up the process of solving the problem. Once it understands a customer’s intent, it can generate the appropriate questions for a Customer Service Rep to ask, which helps speed up the process of solving the issue. In this article I will show you how we can configure a custom Agent in Copilot to access the same questions.
Prerequisites
Before you can enable the customer intent agent for the customer facing copilot, you will need to have enabled the Customer Intent agent in the Copilot Service Admin center first. You will also need to have gone through the intent discovery steps where the system generates Intent and Intent groups in the application based on historical cases and/or conversations from the system. If you want to learn how to do that, please review this article where I dive into the details on how to enable and configure the customer intent agent in Dynamics 365 Customer Service/Contact Center. Once the Customer Intent Agent has been configured, you can start working on the configuration to add the customer intent agent to the custom agent (Copilot) that is connected to your Dynamics 365 Customer Service or Contact Center environment.
Enable the Customer Intent Agent for Copilot Agent
To enable the customer intent agent for your custom agent you’ll need to open the Copilot Service Admin center in Dynamics 365 Customer Service / Contact Center and navigate to ‘Intent’ on the sitemap. Under the ‘Intent-based suggestions’ section on the Customer Intent Agent (preview) page you’ll see the ‘Enable for chatbots’ option. Click ‘Manage’ in order to access the settings. NOTE You can also navigate to ‘AI Agents’ on the sitemap. From here you should see the agents that are connected to your Dynamics 365 Customer Service or Contact Center environment. Select the AI agent you want to enable the feature for and click on the ‘Add intent-based features’ button on the top of the screen.

This will take you to the AI agent in Copilot Studio. The screen will automatically open on the “Manage Component Collections (preview)’ screen. Click on the ‘Available’ tab to see the ‘Intent-based suggestions (preview)’ component collection. Click on the three dots that show up when you hover your mouse on the right side of the name, then click on the option that reads ‘Add to agent’. A pop-up will show with the message ‘This will add the collection and all of its components to the agent.’. Click OK. When you navigate to the ‘Installed’ tab, you’ll see the collection show up after it’s been installed.
Add Connections
In order for the component collection that you just installed, to work correctly we have to point the connection references to valid connections. We can do this by navigating to make.powerapps.com and selecting the environment you’re setting this up in. We will then click on ‘solutions’ on the sitemap and open the default solution. Once the solution loads, click on ‘Objects’, then use the filter to search for ‘connection references’ (not connection reference!) on the top left of the screen. This will pull up all the connection reference in the environment. On the right side of the screen we need to search for the connection reference named ‘IA.Cr.IAPluginDVConnector‘. Click on the ellipse and select ‘Edit’ to replace the connection.

From here you can either create a new Dataverse connection or use an active one that already is in your environment. Once this is done click ‘Save’. A pop-up will show asking if you’re sure, click the ‘Save changes’ button. NOTE: The user who owns the connection needs to have admin rights, otherwise this will not work the way it’s intended.
Authentication
As you may or may not know, the intent library lives in Dataverse, and by default whenever Dataverse is accessed the user needs to be authenticated. Since I’m using my custom AI agent, which answers customers’ questions, this will not be the case. My customers will not need to be authenticated, so instead we’ll use the agent authentication. We need to make that change in Copilot Studio. Login to Copilot Studio by accessing copilotstudio.microsoft.com and make sure you select the correct environment on the top right of the screen. From there we can open the custom AI agent that is connected to Dynamics 365 Customer Service/Contact Center. Open the agent and then click on the ‘Topics’ tab, we see all the intent based topics that were added to the agent when we installed the component collection. Open the ‘Intent-based suggestions-Plugin’ topic. Click the ellipse on the right side of the ‘Perform an unbound action in selected environment’ node and click on ‘Properties’. Set the authentication to ‘Agent Author Authentication’ and save the topic.
Add Intent-based suggestions to topics
The next step is to add the topic to the conversation flow in Copilot Studio. We can do this by adding it to a custom topic, or we can add it to a topic where the agent doesn’t understand the intent. In this scenario I am going to add the ‘Intent-based suggestions – Main’ topic to the ‘Conversational boosting’ topic (which triggers on unknown intent). We can do this by opening the ‘Conversational Boosting’ topic (navigate to Topics > System) and adding a node directly below the trigger. We will need to select the ‘Redirect’ node, which you can find by clicking on the + button below the trigger, selecting ‘Topic Management’ > ‘Go to another topic’ and selecting the ‘Intent-based suggestions – Main’ topic. In the ‘Create generative answers’ node I change the input to the ‘SolutionQuery’ variable.

An additional step you can configure is the ability for your custom agent to use the knowledge articles in Dynamics 365 Customer Service or Contact Center. This will allow the agent to show an article after all the questions generated by the intent have been answered. If you don’t do this, then the agent will be redirected to the ‘Fallback’ topic, where it will tell the customer it is not sure how to help them. Instead, by integrating knowledge articles, the agent can offer up (an) article(s) it found in Dynamics 365 and ask if that solved the problem, if the issue wasn’t solved, the customer can be connected to a live agent. This can be configured using an existing power automate flow in the environment. I’ve written an article on how to set this up previously, you can read the full article here. The configurations for the agent are slightly different when using the Intent with a custom agent.
Add knowledge search topic
Once you have enabled the ‘Search Dynamics 365 knowledge article flow’ (see this article) in your environment we can add it to a topic. You can add the steps to individual topics, or you can create a new topic and redirect other topics there. I am going to create a new topic which I call ‘Knowledge Base Topic’ and do exactly that. To create a new topic, navigate to ‘Topics’ in Copilot Studio, then click the ‘+ Add a topic’ button on the top. Make sure you name your topic. I am not entering any phrases here, as I will redirect other topics to this new one. I have the ability to filter the knowledge articles the flow surfaces, as the powerautomate flow contains a filter. Since I don’t want users to have to enter a filter, I will pre-set it in the topic. Click + to add a node and select ‘the ‘ ‘Variable Management’ . “Set a variable value’. Click on the arrow under ‘Set Variable’ and select ‘Create a new variable’. This will show as ‘Var1 unknown’ in ‘Set Variable’ node. Click on ‘Var1’ and change the variable name to ‘Filter’. In the ‘To value’ paste statecode eq 3 and isinternal eq false. This will filter the knowledge articles from Dynamics 365 to only return articles that are active and where the ‘lnternal’ field of knowledge articles is set to ‘No’, excluding any internal articles. You can change the filter to match your requirements if needed. We will now add the ‘Search Dynamics 365 knowledge article flow’ node as a plugin action. Click on the + button below the last node, then select ‘Add a tool’ > ‘Tool’. You should see the flow in the list. Click on the flow to add it. Click on ‘Set value’ in the action and select the ‘text’ variable (Topic.text). Click on the ellipse to select the ‘SolutionQuery’ (Global.SolutionQuery) variable. Click ‘+Set value’ again and select the ‘text_1’ variable (Topic.text_1). Click on the ellipse to select the ‘Filter’ (Topic_Filter) variable. Since we’re using this flow as a redirect from another topic, we want to be able to send the results of the query (the knowledge article(s) it found, back to the original topic. On the plugin action, below ‘Outputs’, click on the gray colored ‘textresults’ variable to view or change the properties. Make sure the ‘Return values to original topics’ under ‘Usage’ is checked as shown in the image below and save your topic.

Redirect Knowledge Base topic from Fallback topic
The last step here is to redirect the Knowledge Base topic we created in the previous step, from the Fallback topic. As I mentioned above, the fallback topic is triggered if the AI agent doesn’t understand the intent of the person who is interacting with the agent. In this case the questions generated from the Intent in Dynamics 365 have been asked, so we want to offer knowledge article(s) from Dynamics 365 Customer Service/Contact center as a last resort. To configure this, you will need to open the ‘Fallback’ topic in Copilot Studio. Below the ‘FallbackCount’ condition, click the + button and select ‘Topic Management’ > ‘Go to another topic’ and select the ‘Knowledge Base’ topic we created earlier. I want to add a condition in case there are no knowledge articles found, so below the redirect node I add a condition. Click on the arrow next to ‘Select a variable’ and select the ‘Textresult’ variable. I click on the condition “currently set to ‘is equal to’ and I select ‘is not Blank’. Below that I add a new message node where I enter: ‘Here is a knowledge article(s) I found: ‘. To add the actual knowledge articles, click on the {x} icon and select the ‘textresults’ variable. This will enter the article(s) that were found from the knowledge base topic. Below the message node I add a redirect node to the ‘End of conversation’ topic, then I add the ‘End current topic’ node. I click on the existing message that reads: ‘I’m sorry, I’m not sure how to help with that. Can you try rephrasing?’ and click ‘cut’ (the scissors icon) on the left top of the screen. Below the ‘Other conditions’ I click the + button and select ‘Paste’, which will add the message we just copied. Make sure to save the topic and publish the agent! I hope you enjoyed this article! Be sure to check in again next week for a new article or subscribe here to never miss another post!



Comments are Closed