
Context
In this blog post, we are going to explore how to leverage Azure AI search and Microsoft Foundry to create an end-to-end retrieval pipeline. Agentic retrieval is a design pattern intended for Retrieval Augumented Generation (RAG) scenarios as well as agent-to-agent workflows.
With Azure AI search you can now leverage the new multi-query pipeline designed for complex questions posed by users or agents in chat and copilot apps.
Using a sample end-to-end solution, complete with screenshots, I will walk you through creating this Foundry IQ solution.
What is Foundry IQ
Foundry IQ creates a separation of concerns between domain knowledge and agent logic, enabling retrieval-augmented generation (RAG) and grounding at scale. Instead of bundling retrieval complexity into each agent, you create a knowledge base that represents a complete domain of knowledge, such as human resources or sales. Your agents then call the knowledge base to ground their responses in relevant, up-to-date information.
This separation has two key benefits:
- Multiple agents can share the same knowledge base, avoiding duplicate configurations.
- You can independently update a knowledge base without modifying agents.
Powered by Azure AI Search, Foundry IQ consists of knowledge sources (what to retrieve) and knowledge bases (how to retrieve). The knowledge base plans and executes subqueries and outputs formatted results with citations.
High level architecture

The diagram shown above shows a high-level architecture of a Foundry IQ solution. The elements of the architecture are explained below.
1. Your App
This your agentic application, a conversational application that require complex reasoning over large knowledge domains
2. Foundry Agent Service
Microsoft Foundry is your one-stop shop for hosting your Azure OpenAI model deployments, project creations and agents
3. Azure AI Search
Azure AI Search is a fully managed, cloud-hosted service that connects your data to AI. It hosts the knowledge base, which handles query planning, query execution and results synthesis
Microsoft Foundry project setup
Follow the following steps to setup a Microsoft Foundry project
- Navigate and login to your Azure portal subscription.
- Search and select Microsoft Foundry
- On the Microsoft Foundry overview page, select Create a resource
- Specify the Subscription details, Resource group to use, the Foundry Resource name, Region as well as Foundry Project name. Ensure you use the recommended naming conventions and best practices for your resources. Also ensure the Region selected supports Azure AI Search.
- Below is Basics dialog page
- Below is the Storage dialog page. You will notice I have created new CosmosDB, AI Search and Storage account for my Foundry project.
- On the Identity dialog page, ensure you Enable a system-assigned managed identity for both your search service and your project.
- Review and Create the Foundry Resources and Project. This may take a short while to complete
- When completed, you will see confirmation page below. You can then view the resources using Got to resource button
- Below is Basics dialog page
- Go to resource will redirect to the Microsoft Foundry portal as shown below.

- This is where to retrieve key settings that we will be using in this solution. Such as the following
AZURE_SEARCH_ENDPOINTis on the Overview page of your search service.PROJECT_ENDPOINTis on the Endpoints page of your project.PROJECT_RESOURCE_IDis on the Properties page of your project.AZURE_OPENAI_ENDPOINTis on the Endpoints page of your project’s parent resource.
- On your search service, enable role-based access and assign the following roles. First, navigate to the Keys section and enable role-based access control

- Then assign these roles shown below
| Role | Assignee | Purpose |
| Search Service Contributor | Your user account | Create objects |
| Search Index Data Contributor | Your user account | Load data |
| Search Index Data Reader | Your user account and project managed identity | Read indexed content |
On your project’s parent resource, assign the following roles.
| Role | Assignee | Purpose |
| Azure AI User | Your user account | Access model deployments and create agents |
| Azure AI Project Manager | Your user account | Create project connection and use MCP tool in agents |
| Cognitive Services User | Search service managed identity | Access knowledge base |
Local Dev environment setup
We will be using Python in this sample solution. I presume you already have Python installed in your development environment.
To verify Python is setup and working correctly, open your command line tool and type the following commands:
Bash# Check the Python version.python3 --version# Check the pip version.pip3 --version
If you are on Ubuntu, you should see similar output as my screenshot below:

Follow the steps provided in the README file in my accompanying source code repository for steps on how to set up your local a virtual environment. When successful, your ai-agentic-retrieval.ipynb Jupyter Notebook should look like the one shown below:

Source code repository
You can access the source code used in this solution from my GitHub repository.
Next steps
In this blog post, we looked at a Foundry IQ – Agentic retrieval solution. We started with a high-level architecture and the various elements within the Foundry IQ solution. I also walked you through the process of creating a project within Microsoft Foundry and configured access needed. I also shared steps of preparing your local development environment, ready for the Foundry IQ solution. In the follow-up blog post, we will deep dive into the end-to-end solution, including a walk through of the source code.
Stay tuned for future posts, feel free to leave us comments and feedback as well.

































