Keep your agents organized: Create File Groups for better responses

When you’re building agents in Copilot Studio, adding knowledge sources is a key step in building your agent. One of the quick ways to add knowledge to the agent is by providing documents! This can be done in 2 separate ways today, and the option you’ll go for will depend on how your agent will be used, and by whom! Today you can use SharePoint or OneDrive as a knowledge source, where you can point your agent to SharePoint sites, folders or files and/or OneDrive folders or files. The trick here is to understand the limitations when you’re using SharePoint or OneDrive as knowledge: anyone who interacts with your agent that is using this type of knowledge is required to authenticate.

This can be a problem if you are building an external/customer facing agent for a website, that doesn’t require authentication, as this limitation will prevent you to use SharePoint or OneDrive in these no-authentication scenarios. This is where the second option I mentioned earlier will work: uploading files directly into the knowledge section of an agent from Copilot Studio. This option does support agents that have the user authentication set to ‘No Authentication’. Previously we were only able to upload documents without being able to group them together or provide instructions related to the documents, but with this new preview feature this has changed!

How does it work?

In case you aren’t familiar, let me first explain that any time when you use documents (I.E. SharePoint, OneDrive, Files) as knowledge in Copilot Studio, these documents are stored in Dataverse where the content is processed to create indexes and vector embedding, which helps your agent provide those accurate, context-aware responses. If your agent isn’t responding the way you expected or if you’re not able to add documents to your agent, I would suggest that you check to see if Dataverse search is enabled as this is what your agent uses to search through this knowledge sources. So how does this new feature work? I mentioned before that for a while now we have been able to upload individual files into the agents knowledge section. It is important to understand that each individual file we upload becomes its own knowledge source. That means your agent treats every file separately when it’s looking for answers, searching through all available sources at once and pulling together responses from whatever chunks of information it finds.
This changes when you’re using file groups. Instead of treating each file separately, it will group multiple files together, turning the file group into a single knowledge source. Think of it like this: if your organization’s knowledge vary by region, department, or role, file groups help your agent know which files to look at first! By adding instructions to the file group you can make the agent understand what the documents in the file group are used for, and what they shouldn’t be used for!
So what happens under the covers? When someone initiates a conversation the agent uses your instructions to pick the right file group, then it digs into that file group to find the most relevant information, resulting in better agent responses.

Create a file group

You will only see the option to create a file group when you manually upload two or more documents in the knowledge section. You can do this by navigating the knowledge tab inside the agent, and clicking on the ‘+ Add Knowledge’ button on the top. From here you can drag two (or more) documents into the ‘Upload file’ section in the ‘Upload files’ window that opened, or you can click on the ‘Select to browse’ and select the documents that way.

Once this is done you’ll notice a list of the documents you’re trying to upload and a toggle ‘Group these files’ which you need to set to ‘On’. It’s important to describe what the documents are and when it should be used by the agent. The instructions section is where you can give the agent more details on when the file group should be use and it allows makers to add global variables the agent can use. For example if you have a file group that contains documentation related to a specific state, you could us the users location to direct the agent to the file group for that specific state.

What I found

When I tested this I created two different file groups. One for two documents that I have that are related to menu items for Halloween, and one with menu items for St. Patrick’s Day. I wanted the agent to make clear to the user that these items are only available during the day of the specific holiday, and not any other time. When I created the Halloween themed documents, I added on the top of the document the sentence: ‘The below items are only available during Halloween, which falls on October 31 of every year. These items are not available to order on any other dates.’ I didn’t do this for the St. Patricks Day documents, instead I added instructions for the St. Patrick’s Day file group stating that the menu items in the file group are only available on St. Patrick’s Day and not during any other time. When I tested this, I noticed that when I asked if the Halloween items were available to order on a day that was not Halloween, the agent correctly informed me the items are only available during the Halloween holiday. When I asked the same question regarding the St. Patrick’s Day menu items, unfortunately the agent got it wrong and said the items are available for me to order next week when I am there for a party. Keep in mind that this feature is still in preview, and therefor we’ll see some of these incorrect responses. Hopefully as these agents get better, this type of mistakes will become less and less. I hope you enjoyed this article! Be sure to check in again next week or subscribe here to never miss another post!

Share this!

Comments are Closed