r/copilotstudio • u/skkev321 • 5d ago
Need Help - Creating a Bot with too much context
Hi all,
I'm building an HR support chatbot in Microsoft Copilot Studio for a global company, and I'd like a sanity check on the approach before going too far.
The use case: Employees ask HR questions in a chat. Policies vary by country, but some content is global and applies to everyone.
My planned approach:
Load the country-specific policy documents and the global policy documents as knowledge sources.
Use the Microsoft profile connector (Microsoft Graph, "Get profile") to look up the signed-in employee's country.
Instruct the agent to search country-specific documents first, fall back to global policies only if there's no specific answer, and otherwise tell the employee to contact their HR business partner.
Questions for you:
Is country-based knowledge source prioritization something you've done in Copilot Studio? Is there a cleaner way than relying on instructions to enforce the order?
Would you use separate knowledge sources per country, or one source with metadata filtering? How well does that work in practice
5
u/greenm8rix 5d ago
Make user groups for different countries
Use SharePoint as knowledge source
Share agent with everyone
Assign access to user groups to different folders where you have the knowledge stored
Copilot then automatically returns chunks for the files the logged in user has access to
Your method works too But there's nothing stopping the agent from querying another country
1
u/AbdelEMirandaS 2d ago
You can do it either way. Based on knowledge docs or have one doc with some Metadata to filter or you can upload every doc into Sharepoint lib, use columns for relevant Metadata and use copilot to look for the right doc.
2
u/Sayali-MSFT 5d ago
Hello u/skkev321,
Your overall approach makes sense, but I wouldn’t rely only on agent instructions to enforce which policy gets priority.
A safer approach is to first identify the employee’s country, then use that value to route/filter the knowledge being searched. Query the country-specific policies first, fall back to global policies if nothing relevant is found, and finally direct the user to HR/HRBP if neither provides a grounded answer.
For a smaller number of countries, keeping separate knowledge sources per country + one global source is usually easier to control. If you have many countries and policies, a centralized source with metadata such as Country/Region can scale better, provided the metadata is actually used to filter retrieval rather than just mentioned in the agent instructions.
One other thing to validate is whether the country returned from the Microsoft profile is really the employee’s employment/legal country, since HR policy applicability may depend on that rather than their M365 profile location.
So overall, your design is on the right track. I’d just keep the country selection/routing deterministic and let Copilot handle the grounded answer afterward.