Lesson 5 of 5 Retrieval and Grounding Pipelines with Azure AI Search

Connecting Retrieval to Agents with Agentic Retrieval and Foundry IQ

This lesson explains classic single-query retrieval through tools and agentic retrieval through knowledge bases, which power Foundry IQ, and how to connect each to agents and workflows.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain how agentic retrieval plans and merges subqueries.
  • Describe what Foundry IQ provides.
  • Choose how to connect retrieval to an agent or workflow.

Agentic retrieval

Classic retrieval sends one query and returns one ranked list. That works for a focused question, but it struggles with the questions agents receive in conversation: "What changed in the returns policy this year, and does it apply to the Nordic stores?" contains two questions, refers to "this year" and may need content from more than one source. A single query either matches one part well and the other poorly, or matches neither.

Agentic retrieval is a multi-query pipeline in Azure AI Search. A knowledge base receives the query and conversation history, uses an LLM to plan focused subqueries (for example one per part of a multi-part question, or with corrected spelling and resolved references), runs them in parallel against its knowledge sources with keyword, vector or hybrid search, reranks each with the semantic ranker and returns merged content with references and an activity log. Answer synthesis can optionally generate a cited answer.

Knowledge sources can be indexed (backed by a search index) or remote (queried at request time, such as SharePoint or the web). The retrieval reasoning effort (minimal, low or medium) controls query planning: minimal skips the LLM planning step, while higher levels plan and iterate more, at higher latency and token cost. The REST API offers generally available capabilities with minimal, extractive retrieval and preview capabilities such as LLM query planning and answer synthesis.

The following diagram follows one multi-part question through a knowledge base.

Agentic retrieval. A knowledge base receives the question and the conversation history, uses an LLM to plan focused subqueries, runs them in parallel against its indexed and remote knowledge sources, reranks each with the semantic ranker and returns merged content with references and an activity log. Answer synthesis can optionally generate a cited answer. Minimal reasoning effort skips the LLM planning step.
Query planning splits the question into focused subqueries, one per source or part, and the knowledge base returns one merged result with references that an agent can cite.

Foundry IQ

Foundry IQ is the managed knowledge layer for agents in the Foundry portal. It creates knowledge bases on Azure AI Search from enterprise content, with permission awareness for supported sources, and connects them to agents, which call the knowledge base through its MCP endpoint. Several agents can reuse the same knowledge base, so the content is prepared once.

Choosing how to connect

An agent or workflow can reach retrieval in several ways, and the right one depends on how complex the questions are and how much control the team needs. The Azure AI Search tool is the simplest: the agent sends one query to one existing index with a configured query type. A Foundry IQ knowledge base suits complex or conversational questions and several sources, because it plans subqueries and merges the results. A function tool that wraps a search query gives full control in code, which is the choice when the query must apply filters that the agent cannot be trusted to set, such as the signed-in user's permissions.

A workflow retrieval step always retrieves at a fixed point, which suits pipelines in which retrieval must not depend on the model's judgement. File search suits a small set of files attached to an agent or conversation and needs no search service of the team's own. The following table compares the options.

OptionBest forNotes
Azure AI Search toolOne existing index with a known query typeSimple; single query per call
Foundry IQ knowledge base (MCP)Several sources, complex or conversational questionsQuery planning, merged references
Function tool wrapping a search queryCustom filters, such as the user's permissionsFull control in code
Workflow retrieval stepFixed pipelines that always retrieveDeterministic orchestration
File searchFiles attached to an agent or conversationManaged vector store, small scale
Sort into groups

Connect retrieval to the agent

Exam skills 5.1.5

Choose how to connect retrieval to each agent or workflow.

Log in to try this activity Interactive activities are free with an account.
Worked example

A research assistant

Analysts ask an agent questions such as "Compare our Q2 returns policy changes with what competitors announced, and list which regions are affected." Internal policies are in a search index and SharePoint; competitor announcements require web content. Latency of several seconds is acceptable.

A Foundry IQ knowledge base with three knowledge sources (the index, SharePoint and web) at low or medium retrieval reasoning effort plans subqueries for each part and source and returns merged references; the agent connects to it through the MCP endpoint. A single Azure AI Search tool query would cover neither SharePoint nor the web, nor the multi-part structure.

Check yourself

How does agentic retrieval answer a multi-part question?

Show answer

An LLM plans subqueries, runs them in parallel, reranks the results semantically and merges the references.

Exam Tips

Remember for the exam

  • Agentic retrieval: LLM-planned subqueries in parallel, semantic reranking, merged references.
  • Foundry IQ knowledge bases connect to agents through an MCP endpoint and can be reused.
  • Minimal reasoning effort skips query planning for lower latency and cost.