Lesson 2 of 3 Multi-Agent RAG and Knowledge Integration

Improving Retrieval Precision in Multi-Agent RAG

This lesson covers the retrieval techniques and architectural patterns that keep grounding precise for each agent in a multi-agent system, where agents need different knowledge with different permissions and irrelevant passages waste tokens and mislead the model.

Learning outcomes

After completing this lesson, you will be able to:

  • Apply hybrid search, semantic ranking and filters to improve precision.
  • Choose between per-agent knowledge, a retrieval agent and a shared knowledge base.
  • Enforce document-level security in retrieval.

Techniques that improve precision

Hybrid search in Azure AI Search runs a keyword (BM25) query and a vector query together and merges the results with Reciprocal Rank Fusion (RRF), so exact terms such as product codes and semantic matches both count. The semantic ranker re-scores the top results with a cross-encoder model and can return captions. Filters on metadata (product, region, date, document type, access groups) remove irrelevant or unauthorized chunks before ranking.

Agentic retrieval uses a model to plan subqueries from a complex or conversational question, runs them in parallel and merges the results, which improves recall for multi-part questions. Query rewriting turns follow-up questions such as "what about the second one?" into standalone queries using the conversation.

The following diagram shows the stages of hybrid retrieval.

Hybrid retrieval in Azure AI Search. A keyword (BM25) query and a vector query run together, and Reciprocal Rank Fusion merges their results, so exact terms such as product codes and semantic matches both count. Metadata filters remove irrelevant or unauthorized chunks first. The semantic ranker then re-scores the top results with a cross-encoder model. Agentic retrieval can split a complex question into parallel subqueries.
Keyword and vector results are merged, then re-ranked.
Match the pairs

Retrieval techniques

Exam skills 2.2.3

Match each retrieval technique with what it does.

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

Multi-agent RAG patterns

Three patterns are common. In per-agent knowledge, each specialist agent queries its own index or knowledge source (the HR agent queries HR policies, the IT agent queries IT documentation), which keeps retrieval focused and permissions simple. In a retrieval agent pattern, one agent owns search and serves the others, which centralizes query logic and evaluation. In a shared knowledge base, all agents use one Foundry IQ knowledge base or index with filters per agent or per user.

The following table compares the patterns.

PatternStrengthsWatch for
Per-agent knowledgeFocused results, simple permissions per agentDuplicated ingestion, inconsistent quality
Retrieval agentCentral expertise and evaluationAn extra hop of latency and tokens
Shared knowledge base with filtersOne ingestion pipeline, consistent behaviourFilters must be enforced for every query
Sort into groups

Which multi-agent RAG pattern?

Exam skills 2.2.3

Identify the multi-agent RAG pattern from each description.

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

Security in retrieval

Whatever the pattern, retrieval must return only content the end user may see. Document-level security stores allowed groups or users in a filterable field and applies a filter built from the user's token on every query; Azure AI Search also supports permission filtering that honours Microsoft Entra ID access lists for supported sources. Agents never decide permissions themselves, and instructions such as "only show documents the user may see" are not access control.

Scenario questions

Security trimming

Exam skills 2.2.3 · 4.1.1

Choose how retrieval should enforce what each user may see.

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

Part numbers not found

A procurement agent uses vector-only search over supplier catalogues. Queries containing part numbers such as "HX-4471-B" return similar but wrong parts, while descriptive queries work well.

Embeddings capture meaning, not exact strings, so similar part numbers end up close together. Hybrid search adds BM25 keyword matching for the exact code, and the semantic ranker orders the merged results; a filter on supplier can narrow further. Switching to a larger embedding model would not reliably distinguish near-identical codes.

Check yourself

Where must the security filters on a retrieval query come from?

Show answer

From the user's token, applied on every query in every pattern, so agents cannot retrieve content the user may not see.

Exam Tips

Remember for the exam

  • Default for RAG: hybrid search with semantic ranking and metadata filters.
  • Multi-part or conversational questions: agentic retrieval or query rewriting.
  • Security filters come from the user's token on every query, in every pattern.