Build Your Own Copilot Agent
Two focused sessions that take you from a blank SharePoint site to a published, working Copilot agent โ at your own pace, with an AI coach to help along the way.
What's actually happening under the hood
When you connect a Copilot agent to SharePoint, it doesn't read every document every time someone sends a message. Instead, Microsoft Graph indexes your SharePoint content and makes it searchable through semantic search โ meaning the agent finds content based on meaning, not just keyword matches.
Understanding this indexing process is the single most important concept in this training. If your content isn't indexed correctly โ or isn't indexed at all โ your agent will either return nothing, or worse, make things up.
The retrieval pipeline
User sends a message
The agent receives the query and converts it into a semantic vector using Microsoft's embedding model.
Graph searches the index
Microsoft Graph searches indexed SharePoint content for semantically similar chunks, respecting the user's permissions.
Chunks are retrieved
The top matching content chunks (usually 3โ5 passages) are passed to the language model as context.
Agent generates a response
The model synthesizes an answer grounded in the retrieved chunks. It cites the source document.
What gets indexed โ and what doesn't
- Word documents (.docx), PDFs, PowerPoint (.pptx), Excel (.xlsx) โ all indexed
- SharePoint Pages and News posts โ indexed
- Plain text in list items โ indexed if columns are configured correctly
- Images, scanned PDFs without OCR, password-protected files โ NOT indexed
- Files in Personal/OneDrive folders not shared to the site โ NOT indexed
New or updated files can take 1โ4 hours to appear in the index. If you upload content right before testing your agent, give it time. This catches a lot of people off guard.
Semantic search vs. keyword search
Traditional SharePoint search matches exact keywords. Copilot agents use semantic search โ they understand intent. This means a user asking "how do I update a gift officer assignment?" can retrieve a document titled "Solicitation Code Management Guide" even though those words don't match.
The implication: your documents don't need to anticipate every question. But they do need to be well-written, clearly organized, and free of jargon that lacks context.
Library structure directly affects agent quality
The way you organize your SharePoint library is one of the biggest levers you have on agent accuracy. A messy library with vague file names and no metadata produces a confused agent. A clean library with clear naming conventions and structured columns produces a precise one.
File naming conventions
The document title and file name are both used in retrieval. A file named FINAL_v3_use-this-one.docx tells the index nothing. A file named Solicitation-Code-Management-Guide-2025.docx gives the model useful signal.
- Use descriptive, human-readable names โ avoid abbreviations your team will forget
- Include the year or version when documents are updated periodically
- Avoid spaces in file names (use hyphens or underscores)
- Match the document title (H1) to the file name wherever possible
Metadata columns โ your agent's filters
SharePoint columns are searchable metadata that help the agent narrow results. Think of them as tags that let the system know what a document is about before it even reads it.
Document Type
Policy, Guide, FAQ, Template, SOP โ lets users (and agents) filter by category.
Department / Unit
Which school or DAR unit owns this document. Scopes retrieval to relevant content.
Last Reviewed
Date field. Helps you build maintenance workflows and flag outdated content.
Status
Draft / Active / Archived. Keep archived docs out of the agent's scope.
Document internals matter too
The retrieval model chunks documents into passages. The structure of those passages matters. Documents with clear headings, short paragraphs, and one idea per section chunk better than dense walls of text.
- Use Heading 1 / Heading 2 styles โ they signal section breaks to the chunker
- Keep paragraphs under 150 words when possible
- Put the most important information first in each section (inverted pyramid)
- Avoid footnotes and endnotes โ they often get separated from context during chunking
Your SFMC documentation and solicitation code guides are already well-structured for retrieval. They make excellent templates for how other teams should format their own agent knowledge bases.
The agent only surfaces what the user can already see
This is one of the most important things to understand about Copilot agents: they respect SharePoint permissions automatically. This behavior is called security trimming. If a user doesn't have read access to a document, the agent will not retrieve or cite it โ even if that document would perfectly answer their question.
This is good news for compliance. It's also something to plan around when designing your knowledge base.
SharePoint permission levels
- Site Owners โ full control, can manage permissions
- Site Members โ can read, add, edit content. This is typically your agent's target audience.
- Site Visitors โ read-only access. Safe for broad sharing of reference content.
- No access โ the agent will not surface this content to that user, period.
Designing for your agent's intended audience
Before you build your library, ask: Who should this agent serve? That group needs at minimum Visitor access to every document you want the agent to retrieve for them.
Create a dedicated SharePoint site (not a subsite of something sensitive) for agent knowledge bases. Grant broad Visitor access to the team using the agent. Keep confidential content in a separate, access-controlled library โ don't mix it in.
Common permission mistakes
- Storing documents in a library where only the owner has access, then wondering why the agent returns nothing
- Breaking inheritance on individual files โ this creates inconsistent, unpredictable retrieval behavior
- Adding sensitive content (HR, legal, individual donor records) to a shared agent library
- Forgetting that external users (vendors, consultants) get security trimming too โ they can't see internal documents
Individual donor records, prospect research files, or any content with personal identifiable information should never be in a Copilot agent knowledge source. The agent is a retrieval system, not a secure vault.
This is where Sessions 1 and 2 connect
You've built and structured your SharePoint library. Now we'll prepare it to be a knowledge source inside Copilot Studio. This module is the bridge between the two sessions โ understand it well and Session 2 will feel natural.
What Copilot Studio needs from SharePoint
- The SharePoint site URL (not a specific document URL โ the site root)
- The agent's service account or the user's identity must have at least Visitor access to that site
- The content must already be indexed (see Module 1 โ allow time after uploading)
Step-by-step: Adding the knowledge source in Copilot Studio
Open your agent in Copilot Studio
Navigate to copilotstudio.microsoft.com and open the agent you're building (or start a new one โ we'll do this in Session 2).
Go to Knowledge
In the left nav, click "Knowledge." This is where you define what sources the agent can draw from.
Add a SharePoint source
Click "Add knowledge" โ "SharePoint." Paste your SharePoint site URL. Copilot Studio validates access automatically.
Scope the source (optional)
You can point to a specific document library within the site, rather than the whole site. This is useful if only one library contains agent-ready content.
You can add multiple SharePoint sources, plus URLs, files, and Dataverse tables as additional knowledge. The agent searches all of them per query. Useful if knowledge is split across departments.
Testing the connection before Session 2
Before moving to Session 2, take 5 minutes to verify your SharePoint library is ready:
- Open your SharePoint site and confirm documents are visible to a colleague (test with their account)
- Check that files were uploaded at least 2 hours ago (indexing time)
- Confirm your site URL is in the format
https://[tenant].sharepoint.com/sites/[sitename]
Diagnosing retrieval failures systematically
When an agent doesn't answer correctly, the failure can happen at any point in the retrieval pipeline. A systematic approach โ working backwards from the symptom โ saves hours of guessing.
The retrieval failure checklist
- Agent says it doesn't know โ Check indexing status and permissions first. Then check if the content exists at all.
- Agent cites the wrong document โ Multiple documents probably have similar content. Deduplicate or add more specific metadata.
- Agent gives a partial answer โ The relevant content may be buried in a dense paragraph. Restructure the document.
- Agent confabulates (makes things up) โ The knowledge base has a gap. The agent generated an answer without retrieval grounding. Add the missing content.
- Agent works for one user but not another โ Permissions issue. Check the second user's site access.
Using SharePoint search to verify indexing
Before blaming the agent, verify the document is actually searchable in SharePoint itself. Go to your SharePoint site โ search bar โ type a phrase from inside the document. If SharePoint can find it, the index is working. If not, the content isn't indexed yet.
You now understand how Copilot retrieves content, how to structure a library for accuracy, how permissions work, and how to troubleshoot failures. Your SharePoint library is ready. Session 2 is where you build the actual agent.
What is Copilot Studio?
Microsoft Copilot Studio is a low-code platform for building, customizing, and deploying AI agents. It sits on top of Azure OpenAI and Microsoft's Power Platform. You don't write LLM code directly โ you configure behavior through a visual interface and write natural language instructions.
Think of it as the cockpit for your agent. Copilot does the flying; you set the flight plan.
The four building blocks of any agent
Instructions
The system prompt. This is what tells the agent who it is, what it does, what it won't do, and how it should behave.
Knowledge
The sources the agent retrieves from โ your SharePoint library, URLs, uploaded files, or Dataverse.
Topics
Specific conversation flows you define. Used when you want deterministic behavior for predictable questions.
Actions
Connections to Power Automate flows that let the agent do things โ create records, send emails, update data.
Generative mode vs. topics
Copilot Studio has two operating modes. Understanding which one you're using is critical.
- Generative answers (AI-powered) โ The agent uses your knowledge sources to answer any question. Flexible, low-maintenance. Best for FAQs and reference content. This is what you'll primarily use.
- Topics (structured flows) โ You define the exact conversation path. Rigid but predictable. Best for forms, structured data collection, or compliance-critical interactions.
For most DAR use cases, start with generative answers and a well-crafted system prompt. Add topics only when you identify specific interactions that need structure. Less to build, easier to maintain.
The system prompt is everything
Your agent's instructions (the system prompt) determine its personality, its scope, its behavior when it doesn't know something, and how it structures its responses. A vague system prompt produces a vague agent. A precise one produces a precise one.
This is the highest-leverage thing you'll write in this entire process. Invest time here.
The five components of a strong system prompt
Persona
Who is this agent? Give it a name, a role, and a voice. E.g., "You are a DAR knowledge assistant who helps gift officers navigate university policies."
Scope
What is this agent for? What is it explicitly NOT for? Clear scope prevents scope creep and off-topic answers.
Behavior rules
How should it respond? Tone, format, response length. Should it always cite sources? Should it ask clarifying questions?
Fallback language
What should it say when it can't find an answer? Direct users to a human, a form, or a specific resource โ don't let it guess.
Format preferences
Should it use bullet points? Short answers or detailed ones? Always cite the source document? Formatting instructions here become habits.
Example: a DAR reference agent prompt
It has a persona, a clear scope, explicit do-nots, a scripted fallback, and formatting guidance. The agent has no room to improvise in ways that would cause problems.
This is where Session 1 pays off
Everything you built in Session 1 โ the structured library, the metadata columns, the permissions setup โ connects here. Adding a knowledge source in Copilot Studio takes about 2 minutes. What makes it work well is everything you did before this step.
Adding your SharePoint source โ step by step
- In Copilot Studio, open your agent and click Knowledge in the left nav
- Click Add knowledge โ select SharePoint
- Paste your SharePoint site URL (the site root, not a document URL)
- Copilot Studio will validate access. If it fails, check that your account has at least Visitor access to the site
- Optionally, narrow the scope to a specific document library by appending the library path to the URL
- Click Add โ the source appears in your Knowledge panel
Configuring generative answers
After adding your knowledge source, make sure Generative Answers is enabled:
- Go to Settings โ Generative AI
- Set "How should your copilot interact with people?" to Generative (preview)
- This enables the agent to use your knowledge source for open-ended questions โ not just predefined topics
Copilot Studio defaults to "Classic" mode, which relies on topics only. If generative answers aren't working, this setting is the first thing to check.
Multi-source knowledge bases
You can add multiple sources. Each query searches all of them. Useful configurations for DAR:
- SharePoint library (primary documents) + a URL (public UM policies page)
- Multiple SharePoint libraries from different schools/units in one agent
- SharePoint + uploaded PDF for a document that can't live on SharePoint
When to use topics
Topics are structured conversation flows you define manually. They're useful when you need the agent to behave consistently for specific, predictable interactions โ not for general Q&A.
- A "submit a request" flow that collects specific fields and sends a Power Automate trigger
- A greeting/welcome message every user sees on first interaction
- A compliance disclaimer the agent must always display for certain query types
- An escalation path that routes complex questions to a specific email
For everything else โ general questions answered from your knowledge base โ generative mode handles it without you building topics.
The fallback topic โ non-negotiable
Every agent needs a configured fallback topic. This is what fires when the agent can't find an answer and would otherwise confabulate or say nothing useful.
Find the Fallback topic
In Topics, look for the system topic called "Fallback." It's pre-created โ you just need to edit its message.
Write a useful response
Don't just say "I don't know." Tell users exactly where to go next: a specific person, team, email, or form.
Add an escalation option
Consider adding a button that opens an email or Teams message to a support contact. Reduces dead ends.
Test it deliberately
Ask the agent something completely outside its knowledge. Confirm the fallback fires and the message is useful.
"I don't have information about that in my knowledge base. For help, contact the DAR Operations team at dar-ops@miami.edu or visit [SharePoint link]. I'm best at answering questions about [your scope here]."
The greeting topic
The "Greeting" system topic fires when a user opens the agent or says hello. Use it to set expectations โ tell users what the agent is for and give them 2โ3 example questions to get started. This dramatically improves first-use experience.
Before you publish โ test thoroughly
Copilot Studio has a built-in test pane (right side of the interface). Use it aggressively before publishing. Test with the same mindset as your most skeptical user โ ask tricky questions, edge cases, out-of-scope queries, and deliberate attempts to make it confabulate.
The 10-question test protocol
- 3 questions that should be answered perfectly from your knowledge base
- 2 questions where the answer is partially in the knowledge base (tests handling of incomplete info)
- 2 out-of-scope questions (tests the fallback)
- 1 question with a typo or awkward phrasing (tests semantic robustness)
- 1 question in a different language if your audience is multilingual
- 1 "trick" question designed to make the agent confabulate โ verify it doesn't
Keep a simple spreadsheet: question, expected answer, actual answer, pass/fail. This becomes your regression test โ run it every time you update your knowledge base or system prompt.
Publishing channels
Microsoft Teams
Best for internal teams. Easy to deploy, users already have access. Recommended starting channel.
Copilot (Microsoft 365)
Surfaces the agent inside Microsoft 365 Copilot. Requires specific licenses. Good for enterprise rollout.
Web (Demo site)
Generates an embeddable web widget or standalone URL. Useful for sharing with external stakeholders.
SharePoint
Embed the agent directly on a SharePoint page. Context-specific โ great for departmental knowledge hubs.
The iteration loop
Agents are not launch-and-forget. Plan for a regular review cadence:
- Week 1โ2 post-launch: Daily review of conversation logs. Identify gaps and failures. Update knowledge base and system prompt.
- Monthly: Review for outdated content in your SharePoint library. Archive or update stale documents.
- Quarterly: Re-run your 10-question test protocol. Add new questions based on what real users have asked.
You now have a working agent published to at least one channel, a structured SharePoint knowledge base, and a system prompt you can iterate on. The next step is real-world testing with your team.
Training Complete
You've finished both sessions and passed all knowledge checks. Your certificate is ready below.
Use your browser's Print dialog โ Save as PDF to download your certificate. Set orientation to Landscape for best results.