Building Production-Grade Semantic Search with GPT-5 and Microsoft Foundry, From Scratch A developer built a production-grade semantic search pipeline using GPT-5 and Microsoft Foundry's Foundry IQ, an agentic retrieval layer on Azure AI Search. The system treats retrieval as a reasoning task, planning sub-queries, executing them in parallel, and synthesizing cited answers. The knowledge base exposes an MCP endpoint for integration with Foundry Agent Service or other MCP-compatible clients. Most "RAG tutorials" stop at a single embedding query against a single index. That works for a demo and falls over the moment a real user asks something like "compare our Q3 and Q4 vendor contracts and flag anything that changed" — a question that needs multiple sub-queries, reasoning about what's still missing, and synthesis across documents. Microsoft Foundry's answer to this is Foundry IQ : an agentic retrieval layer built on Azure AI Search that treats retrieval as a reasoning task rather than a single keyword or vector lookup. This is a from-scratch build of a semantic search pipeline using GPT-5 for query planning/synthesis and Foundry IQ for retrieval. Instead of one query hitting one index once, Foundry IQ's knowledge base plans sub-queries, executes them in parallel against one or more knowledge sources, evaluates whether it has enough signal, and iterates before synthesizing a final, cited answer. The knowledge base sits between your agent and the underlying content. Your Foundry agent doesn't talk to Azure AI Search directly — it calls the knowledge base's MCP endpoint, which handles planning, retrieval, and synthesis behind a single tool call. A knowledge source is a reusable reference to your underlying content — in this example, a Blob Storage container of documents. Creating it also triggers Azure AI Search to generate the index, skillset, and indexer needed to chunk and vectorize the content automatically. python from azure.search.documents.indexes import SearchIndexClient from azure.search.documents.indexes.models import SearchIndexKnowledgeSource, SearchIndexKnowledgeSourceParameters, from azure.identity import DefaultAzureCredential index client = SearchIndexClient endpoint="https://