Why RAG exists
A model knows only what was in its training data, up to its cutoff. It cannot know your policies, your contracts, or what changed last week - and it will confidently make something up rather than say so.
Know this: The fix in one line
Retrieve the relevant passages from your own content at query time, put them in the prompt as grounding data, and have the model answer from them - with citations back to the source.
The pipeline
User asks How many days of holiday do I get after five years?
Source documents are connected. In Foundry IQ these are knowledge sources: Blob Storage, SharePoint, OneLake, public web.
handbook.pdf, benefits-2026.docx, policy-leave.md and 11,997 more
The first three stages happen ahead of time. Only the last three run when a user asks something - which is why a question about "what happens when the user asks" always starts at retrieval.
Everything up to indexing happens ahead of time. Retrieval and generation happen per query. If a question asks what happens "when the user asks a question", the answer starts at retrieval.
| Stage | What it does | Why it matters |
|---|---|---|
| Ingest | Pull in source documents | Determines what the assistant can ever know |
| Chunk | Split into focused passages | A whole handbook as one vector represents nothing precisely |
| Embed & index | Vectorise passages and store them | Enables semantic matching, not just keywords |
| Retrieve | Find the passages closest to the query | The quality ceiling for the whole system |
| Augment | Insert those passages into the prompt | This is the "grounding data" |
| Generate | Model answers from the context, with citations | Traceable, checkable output |
Check your understanding
Why is chunking necessary when building a knowledge base for RAG?
Check your understanding
What is a vector index used for in a RAG solution?
Agentic retrieval
Changed: Classic RAG is no longer the only pattern
Classic RAG issues one query per question. Agentic retrieval uses a model to plan: it reads conversation history for context, decomposes a complex question into several focused subqueries, runs them in parallel, applies semantic ranking, and returns structured grounding data with citations and execution metadata.
| Choose… | When |
|---|---|
| Agentic retrieval | The client is an agent or chatbot; queries are complex or conversational; you want maximum relevance and structured, cited responses; you are building a new RAG solution |
| Classic RAG | You need generally available features only, want simplicity and speed, or already have orchestration code and want fine-grained control |
Check your understanding
How does agentic retrieval differ from classic RAG?
Foundry IQ
Foundry IQ is the managed knowledge layer that gives an agent a single endpoint to your organisation's data. It is built on Azure AI Search, but you configure it in Foundry rather than managing indexes directly.
Know this: The vocabulary
A knowledge base = one or more knowledge sources (Azure Blob Storage, SharePoint, OneLake, public web) plus retrieval parameters. Multiple agents can share one knowledge base.
| Knowledge source kind | How it works | Examples |
|---|---|---|
| Indexed | Content is ingested into a search index; chunking, vectorising and permission sync are automatic | Azure Blob Storage, OneLake, SharePoint, an existing search index |
| Remote | Nothing is copied; the source is queried live at retrieval time | SharePoint through the Copilot Retrieval API, the web through Grounding with Bing |
- Automates chunking, embedding generation and metadata extraction; indexers can run on a schedule for incremental refresh.
- Issues keyword, vector or hybrid queries across indexed and remote sources.
- Uses agentic retrieval to plan queries, select sources, run parallel searches and aggregate results.
- Returns extractive data with citations so answers trace back to source documents.
- Synchronises access control lists, honours Microsoft Purview sensitivity labels, and enforces permissions at query time.
- Can run queries under the caller's Microsoft Entra identity for end-to-end permission enforcement.
- Sets a retrieval reasoning effort: minimal merges results with no language model, while low and medium use a model to plan subqueries - medium adds iterative search.
Release status is mixed, so read questions carefully: extractive retrieval at minimal effort is generally available, while model-based query planning and answer synthesis are still in preview. For agents, Microsoft recommends returning extractive data and letting the agent write the answer.
Exam trap: The permission-aware angle
Foundry IQ is the standard answer to "the agent must never show restricted content to an unauthorised user". That is a privacy and security requirement - content filters, which block harmful categories, have no concept of who may see which document.
Check your understanding
What is Foundry IQ?
Check your understanding
Which statement about a Foundry IQ knowledge base is correct?
When grounding fails
A grounded assistant that answers something unsupported has failed in one of two places. Diagnose before you change anything.
| Symptom | Likely cause | Fix |
|---|---|---|
| Answer ignores the retrieved passages | The prompt did not constrain the model | System message: answer only from context, say "I don't know" otherwise |
| Retrieved passages were irrelevant | Chunking, embedding or search configuration | Revisit chunk size, embedding model, and keyword vs. semantic vs. hybrid search |
| Answers are slow | Large index, too many passages | Filtering, reranking, tighter retrieval |
| Token budget exceeded | Too much retrieved content in the prompt | Filter, rank or summarise passages before augmenting |
| Sensitive content leaked | No permission enforcement on retrieval | Permission-aware retrieval (Foundry IQ) - not a content filter |
Check your understanding
A grounded assistant returns an answer that is not supported by any of the retrieved passages.
Which two responses address the problem most directly?
Choose 2. Each correct answer is part of the solution. Each correct selection is worth one point.