Hi everyone,
I’ve implemented an SPFx web part that captures the clicked element (folder name) on a SharePoint page and passes it to a Copilot agent via query string. The Copilot agent reads this value and stores it as a global variable.
The agent uses a SharePoint document library as its knowledge source, which contains multiple folders and subfolders. My requirement is:
When the SPFx web part sends a folder name, I want the Copilot agent to restrict its knowledge scope to only that folder—so all responses should be based solely on documents within that folder.
I’m looking for a way to implement this with minimal customization. Ideally, I’d like to avoid re-indexing the entire library or creating separate agents per folder.
Has anyone tackled a similar scenario? What’s the best way to dynamically filter the knowledge base in Copilot based on a folder name passed from SPFx?
Thanks in advance!