An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
Hello @Meenakshi Kathiresan ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
Knowledge files in Azure AI Foundry are not directly accessible to an agent unless a retrieval mechanism is configured. The File Search tool (vector store) serves as this mechanism by ingesting documents, splitting them into chunks, generating embeddings, and retrieving relevant content dynamically at runtime. Without this setup, the model operates only on the prompt and its pre-trained knowledge, which means uploaded documents are not reliably used. For this reason, File Search should be considered essential for consistent and scalable knowledge grounding.
The observed difference between GPT-4 and GPT-5 behavior is primarily due to how each model handles context and retrieval. In some GPT-4-based setups, document content may appear to be used without explicitly enabling File Search. This can happen when small files are implicitly included in the prompt or when preconfigured templates already include a retrieval layer. However, this behavior is not consistent or transparent. GPT-5, by design, follows a stricter and more structured approach, where access to external data depends entirely on explicitly defined tools such as File Search.
GPT-5 separates prompt-based context from tool-based retrieval. Prompt injection involves passing document content directly into the model input, which is limited in size and not suitable for large-scale use. In contrast, File Search enables dynamic retrieval of only the most relevant document chunks at runtime. This improves reliability, ensures better traceability, and avoids hidden or implicit data usage.
To validate and troubleshoot document retrieval behavior, built-in observability features can be used.
- Connecting Application Insights
- Open the Foundry project
- Navigate to Agents > Traces
- Select Connect and link an existing or new Application Insights resource
- If not visible: Project Details > Connected Resources > Add Connection > Application Insights
- Ensure appropriate access e.g - Log Analytics Reader role
- Generating an agent run
- Execute a request using
- Agent Playground
- SDK or API
- Deployed endpoint
- Traces are generated automatically during execution
- Inspecting execution traces
- Go to Agents > Traces
- Open a specific thread/run
- Then review the
- Input prompts
- Model responses
- Execution flow
- Tool invocation events
- Token usage
- Validating File Search usage
- Check trace details for
- Tool invocation entries (File Search)
- Related inputs and outputs
- This confirms:
- Whether retrieval was triggered
- Whether the agent used external knowledge
- If an alternate path (no retrieval) was taken
The following references might be helpful , please check them out
- How to use Azure OpenAI Assistants file search (classic) - Microsoft Foundry (classic) portal | Microsoft Learn
- How to use Azure AI Agents file search (classic) - Microsoft Foundry (classic) portal | Microsoft Learn
- Set Up Tracing for AI Agents in Microsoft Foundry - Microsoft Foundry | Microsoft Learn
- Application Insights OpenTelemetry observability overview - Azure Monitor | Microsoft Learn
- Vector stores for file search in Microsoft Foundry Agent Service - Microsoft Foundry | Microsoft Learn
Thank you