Problem Summary
I'm trying to build a Copilot Studio agent that allows users to provide any SharePoint/Teams folder path and then interact exclusively with the documents in that folder. The agent should answer questions, create summaries, and extract information using semantic search - but strictly limited to the documents in the user-specified folder.
Key Requirements:
-
User provides a dynamic folder path (can be from any Team or SharePoint site)
-
Strict isolation: Only documents from the specified folder may be used (no information mixing)
-
Semantic search capability is mandatory
-
Up to 25 documents per folder (PDF, Word, PowerPoint - no Excel needed)
-
Integration into a multi-topic agent structure with potential sub-agents
My Environment
-
Valid Copilot license
-
Generative Orchestration enabled
-
Model: GPT-5
-
System prompt is not unusually long
Approaches I've Already Tried
I've explored both different methodological approaches (how to architect the solution) and different technical implementations (which tools/features to use).
Methodological Approaches
Approach A: Flow-Based Extraction with Caching Strategy
The idea was to process documents at runtime and persist results for subsequent queries:
-
User provides folder path
-
Agent Flow iterates through all files, analyzes each document via AI Builder prompts
-
First call: Return extracted content as variable to the Copilot Studio topic
-
For follow-up queries: Store combined results in a text file to avoid re-processing all documents with multiple prompts each time
Result: Context window overflow with error message:
"The request results in too much data needing to be processed. Review the amount of data being returned by your actions."
Even with summarization attempts, 25 documents exceed the available context.
Approach B: Staging Folder with Native Indexing + Dynamic Filtering
The idea was to leverage Copilot Studio's built-in indexing while maintaining document isolation:
-
Configure a fixed SharePoint folder as Knowledge Source in the agent
-
Copy user's files to this staging folder
-
Append unique GUID to each filename for identification
-
Use GUID as dynamic filter in Knowledge Source to scope retrieval to the current session's documents
Result: Indexing latency defeats the use case. New files take too long to become searchable, making real-time dynamic folder selection impractical.
Technical Implementations Tried
Implementation 1: SharePoint Knowledge Sources (Both Configuration Methods)
Tested both available methods for adding SharePoint as a knowledge source in Copilot Studio:
-
Method A: Direct file upload to agent knowledge
-
Method B: SharePoint site/library integration via the knowledge configuration panel
Result: Either files are not found at runtime, or the same indexing delay issues occur as in Approach B.
Implementation 2: Runtime File Retrieval via Tools and MCP
Attempted to bypass indexing entirely by retrieving file contents programmatically:
-
Built-in "Get File Content" connector actions
-
Microsoft SharePoint and OneDrive MCP (Model Context Protocol) connector
Result: Connector output size limits with error message:
"The output returned by the connector was too large to be processed by the agent. Reduce the size by using the available connector filters or reducing the number of configured action outputs."
No viable way to retrieve multiple document contents without exceeding limits.
Additional Context
-
Document sizes: Typical business documents, 100 KB to 5 MB per file
-
Document count: Up to 25 documents per folder
-
Document types: PDF, Word (.docx), PowerPoint (.pptx)
The Core Dilemma
I seem to be stuck between two fundamental constraints:
-
Pre-indexed Knowledge Sources provide semantic search but require indexing time that makes dynamic folder selection impractical
-
Runtime document retrieval (via flows/tools) allows dynamic folder paths but hits context window limits and lacks true semantic search across all documents simultaneously
What I'm Looking For
Has anyone successfully implemented a pattern for dynamic, user-specified document interaction in Copilot Studio that:
-
Works with arbitrary SharePoint/Teams folder paths provided at runtime
-
Maintains strict document isolation (no cross-contamination from other sources)
-
Provides semantic search capability across the folder contents
-
Handles up to 25 documents without context overflow
-
Responds within acceptable timeframes (not waiting for indexing)
After spending many hours exploring these approaches, I'm running out of ideas. I'm open to architectural alternatives, workarounds, or even confirmation that this use case isn't currently feasible with Copilot Studio's capabilities.
Any insights, experiences, or even a "this isn't possible yet" would be greatly appreciated.
Best regards

Report
All responses (
Answers (