Wednesday, July 16, 2025

๐Ÿค– ๐Ÿ“„ How to Create a Document-insight Agent in Microsoft 365 Copilot

๐Ÿ“šMicrosoft 365 Copilot enables you to build custom agents that interact with users, retrieve knowledge from organizational data, and answer context-based questions. This guide covers how to create an agent that reads specified documents and provides accurate answers.


1. Overview

The agent will:

  • Read and process uploaded or linked documents.

  • Answer user queries strictly based on document content.

  • Support knowledge integration from SharePoint, OneDrive, and Teams.


2. Steps to Create an Agent in Microsoft 365 Copilot

Step 1: Open Microsoft 365 Copilot

  • Launch the Microsoft 365 Copilot app.


Step 2: Access Agents

  • Navigate to:
    Chat → Agents

  • Click Create Agent or go to All Agents to explore templates.


Step 3: Choose Creation Method

  • From Scratch:
    Use Agent Builder with natural language instructions.

  • Template:
    Select a pre-built option from Agent Store.


Step 4: Configure the Agent

  • Description:
    Define the purpose of the agent.
    Example:
    “This agent reads and indexes documents from connected knowledge sources and provides context-based answers.”

  • Add Instructions:
    Use this prompt for agent behaviour:

Agent Instruction Prompt

You are an intelligent Copilot agent designed to assist users by reading and understanding the content of specified documents and answering questions based on those documents.
Your objectives: 1. Read and process the provided documents thoroughly. 2. Break down documents into manageable sections for better retrieval. 3. When a user asks a question, search the documents to find the most relevant information. 4. Provide accurate, concise, and context-aware answers strictly based on the documents. 5. If the answer is not in the documents, respond with: "I could not find this information in the provided documents." 6. Never fabricate or use external knowledge. 7. Maintain a clear and professional tone. 8. Summarize for complex queries unless full details are requested. Capabilities: - Extract and parse text from PDFs, Word, and text documents. - Index and retrieve answers efficiently from multiple sources.

  • Connect Knowledge Sources:
    Examples:

    • SharePoint libraries (Contracts, Policies)

    • OneDrive folders

    • Teams document repositories


Step 5: Test and Deploy ๐Ÿ› ️

  • Test the agent in Preview Mode.

  • Verify:

    • It uses only allowed sources.

    • It returns correct and concise answers.

  • Publish and share with your organization.


3. Visual Flow Diagram

Below is a representation of the Copilot Agent creation process:


4. Example Copilot Configuration

Description:
"Document Search Agent – Reads and indexes organizational documents to provide accurate answers based on their content."

Instructions:

You are a Copilot agent that answers questions only using provided documents.
If the answer is not present, say: "The information is not available in the provided documents." Always provide concise responses and mention the source document name where possible. Do not use external information.

Knowledge Sources:

  • SharePoint Site: Company Contracts

  • OneDrive Folder: HR Policies

  • Teams Channel Files: Project Documentation


Best Practices

  • Write explicit guardrails to prevent hallucination.

  • Ensure data access is restricted to approved sources.

  • Monitor agent responses and refine as needed.


Reference: Copilot Developer Camp


No comments:

๐Ÿค– ๐Ÿ“„ How to Create a Document-insight Agent in Microsoft 365 Copilot

๐Ÿ“šMicrosoft 365 Copilot enables you to build custom agents that interact with users, retrieve knowledge from organizational data, and answer...