Creating Copilot Agent for Document Library Search

Terrel Brown 20 Reputation points
2025-12-11T03:41:58.09+00:00

I have created a document library within SharePoint site for company policies and procedures, and would like to build an agent that will be used basically as a search feature for all of the documents in that library.

"AskQA" would be the name of the agent. End users can ask a question to AskQA, and that agent will be able to find policies and procedures that pertain to the question asked. The end user would not have to leave that page to get the answer, but within the answer, a link will be provided to that document(s).

Once the agent is created, documents will continuously be added to the library. So, the agent must remain up to date with the document additions.

What would be the necessary steps I would need to take to create this type of feature in my company's SharePoint site?

Microsoft Copilot | Microsoft 365 Copilot | Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-12-11T03:42:09.81+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To create a Copilot agent named "AskQA" for searching documents in your SharePoint document library, you can follow these steps:

    1. Ensure Prerequisites: Make sure you have the necessary permissions and licenses. You need a SharePoint Online license and at least read permission to access the documents in the library.
    2. Create the Agent: Use Microsoft SharePoint to create the agent. You can build agents that query content from specific sites, folders, or files within SharePoint.
      • If your organization has the Microsoft 365 Copilot license, you can create agents using the Microsoft 365 Copilot app.
    3. Configure the Agent: In the agent configuration, specify the document library URL where your policies and procedures are stored. You can add the URL to the capabilities array in the declarativeAgent.json file. For example:
         {
           "name": "OneDriveAndSharePoint",
           "items_by_url": [
             {
               "url": "https://yourcompany.sharepoint.com/sites/YourSite/YourDocumentLibrary"
             }
           ]
         }
      
    4. Provision the Agent: After configuring the agent, select Provision in the Lifecycle pane of the Microsoft 365 Agents Toolkit. This will allow the agent to access the content in your document library.
    5. Continuous Updates: To ensure that the agent remains up to date with new document additions, you may need to implement a mechanism that refreshes the agent’s knowledge base periodically. This could involve re-provisioning the agent or setting up automated updates based on document changes in the library.
    6. Testing: Once the agent is created and configured, test it by asking questions related to the documents in your library to ensure it retrieves the correct information and links to the relevant documents.

    By following these steps, you can successfully create a search feature using the "AskQA" agent in your SharePoint site that allows end users to find relevant policies and procedures without leaving the page.


    References:


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.