AI Personal Learning
and practical guidance
讯飞绘镜

Microsoft AI Agent Introductory Course: Agentic RAG

This course provides a comprehensive overview of Agentic Retrieval-Augmented Generation (Agentic RAG), an emerging AI paradigm in which Large Language Models (LLMs) autonomously plan their next actions while acquiring information from external sources. Unlike the static "search-then-read" model, Agentic RAG involves iterative calls to LLMs, interspersed with tool or function calls and structured output. The system evaluates the results, optimizes the query, calls other tools when needed, and continues the cycle until a satisfactory solution is achieved.

summary

This course will cover the following topics:

  • Understanding Agentic RAG. Learn about emerging paradigms in AI where Large Language Models (LLMs) autonomously plan their next moves while extracting information from external data sources.
  • Mastering the iterative "maker-checker" model. Understanding the loop of iterative calls to the LLM, interspersed with tool or function calls and structured output, is intended to improve correctness and deal with misformatted queries.
  • Explore practical applications. Identify scenarios where Agentic RAG shines, such as "correctness-first" environments, complex database interactions, and extended workflows.

 

Learning Objectives

Upon completion of this course, you will know how to/understand:

  • Understanding Agentic RAG. Learn about emerging paradigms in AI where Large Language Models (LLMs) autonomously plan their next moves while extracting information from external data sources.
  • The iterative "maker-checker" model. Grasp the concept of iterative calls to LLM's loops, interspersed with tool or function calls and structured output, designed to improve correctness and deal with misformatted queries.
  • Possesses the reasoning process of. Understanding that the system owns the ability of its reasoning process to decide how to approach a problem without relying on predefined paths.
  • Workflow. Learn how Agentic models can make independent decisions to retrieve market trend reports, identify competitor data, correlate internal sales metrics, synthesize results and evaluate strategies.
  • Iterative Loops, Tool Integration, and Memorization. Understand how systems rely on cyclic interaction patterns to maintain state and memory across steps to avoid repetitive cycles and make informed decisions.
  • Dealing with failure modes and self-correction. Explore the system's robust self-correcting mechanisms, including iteration and re-querying, use of diagnostic tools, and reliance on human oversight.
  • Boundaries of the Agent. Understand the limitations of Agentic RAG, focusing on domain-specific autonomy, infrastructure dependency, and respect for guardrails.
  • Practical use cases and value. Identify scenarios where Agentic RAG shines, such as "correctness-first" environments, complex database interactions, and extended workflows.
  • Governance, transparency and trust. Understand the importance of governance and transparency, including explainable reasoning, bias control and human oversight.

 

What is Agentic RAG?

Agentic Retrieval-Augmented Generation (Agentic RAG) is an emerging AI paradigm in which Large Language Models (LLMs) autonomously plan their next actions while extracting information from external sources. Unlike the static "retrieve-then-read" model, Agentic RAG involves iterative calls to LLMs, interspersed with tool or function calls and structured output. The system evaluates the results, optimizes the query, calls other tools when needed, and continues this cycle until a satisfactory solution is achieved. This iterative "maker-checker" model improves correctness, handles misformatted queries, and ensures high-quality results.

The system actively owns its reasoning process, rewriting failed queries, choosing different retrieval methods, and integrating multiple tools (e.g., vector searches in Azure AI Search, SQL databases, or custom APIs) before ultimately determining its answer.The distinguishing feature of an Agentic system is that it is able to own its reasoning process. Traditional RAG implementations rely on predefined paths, but Agentic systems autonomously determine the order of steps based on the quality of the information they find.


 

Definition Agentic Retrieval-Augmented Generation (Agentic RAG)

Agentic Retrieval-Augmented Generation (Agentic RAG) is an emerging paradigm in AI development, where LLMs not only extract information from external data sources, but also autonomously plan their next actions. Unlike static "retrieve-then-read" patterns or elaborate cueing sequences, Agentic RAG involves iterative call loops to LLMs, interspersed with tool or function calls and structured output. At each step, the system evaluates the results it obtains, decides whether or not to optimize its query, calls other tools if needed, and continues this cycle until a satisfactory solution is obtained.

This iterative "maker-checker" approach is designed to improve correctness, handle badly formatted queries to structured databases (e.g., NL2SQL), and ensure balanced, high-quality results. Rather than relying solely on elaborate hint chains, the system actively owns its reasoning process. It can rewrite failed queries, select different retrieval methods, and integrate multiple tools (e.g., vector search in Azure AI Search, SQL databases, or custom APIs) before finalizing its answer. This eliminates the need for overly complex orchestration frameworks. Instead, a relatively simple "LLM call → tool use → LLM call → ..." loop can produce complex and well-reasoned output.

微软 AI Agent 入门课程:Agentic RAG-1

 

Having a reasoning process

The distinguishing feature that makes a system "Agentic" is its ability to have its own reasoning process. Traditional RAG implementations often rely on humans to predefine the path of the model: a chain of thought outlining what to retrieve and when. But when a system is truly Agentic, it decides internally how to approach a problem. It doesn't just execute scripts; it autonomously determines the order of steps based on the quality of the information it finds. For example, if it's asked to create a product launch strategy, it won't just rely on a prompt that details the entire research and decision-making workflow. Instead, the Agentic model decides independently:

  1. Use Bing Web Grounding to retrieve current market trend reports.
  2. Use Azure AI Search to identify relevant competitor data.
  3. Use Azure SQL Database to associate historical inside sales metrics.
  4. Synthesize analytics into cohesive strategies with Azure OpenAI Service.
  5. The strategies are evaluated for gaps or inconsistencies and another round of search is prompted if necessary. All of these steps (optimizing the query, selecting sources, and iterating until "satisfied" with the answer) are determined by the model, not pre-written by a human.

 

Iterative Loops, Tool Integration, and Memory

微软 AI Agent 入门课程:Agentic RAG-2

The Agentic system relies on a cyclic interaction model:

  • Initial call. The user's goals (i.e., user prompts) are presented to the LLM.
  • Tool call. If the model recognizes missing information or ambiguous instructions, it selects a tool or retrieval method (e.g., a vector database query (e.g., Azure AI Search's hybrid search of private data) or a structured SQL call) to gather more context.
  • Evaluation and Optimization. After reviewing the returned data, the model decides if the information is sufficient. If it is not enough, it will optimize the query, try different tools, or adjust its approach.
  • Repeat until satisfied. This cycle continues until the model determines that it has sufficient clarity and evidence to provide a final, well-reasoned response.
  • Memory and Status. As the system maintains state and memory through the steps, it can recall previous attempts and their results, avoiding repetitive cycles and making more informed decisions as it proceeds.

Over time, this creates an evolving sense of understanding that allows the model to handle complex multi-step tasks without the need for continuous human intervention or redesign of cues.

 

Dealing with failure modes and self-correction

The autonomy of Agentic RAG also includes a powerful self-correction mechanism. When the system hits a dead end (e.g., retrieves an irrelevant document or encounters an incorrectly formatted query), it can:

  • Iteration and Re-queries. Instead of returning low-value responses, the model tries new search strategies, rewrites database queries, or looks at alternative datasets.
  • Use of diagnostic tools. The system can call additional functions designed to help it debug its inference steps or confirm the correctness of retrieved data. tools such as Azure AI Tracing will help enable robust observability and monitoring.
  • Relying on manual supervision. For high-risk or repeated failures, the model may flag uncertainty and request manual guidance. Once the human provides corrective feedback, the model can adopt the experience in the future.

This iterative and dynamic approach allows for continuous improvement of the model, ensuring that it is not just a one-off system, but one that can learn from mistakes made in a given session.

微软 AI Agent 入门课程:Agentic RAG-3

 

Boundaries of the Agent

Although Agentic RAG is autonomous in its tasks, it is not equivalent to General Artificial Intelligence. Its "Agentic" capabilities are limited to the tools, data sources and strategies provided by human developers. It cannot invent its own tools or go beyond the boundaries of a set domain. Instead, it specializes in dynamically orchestrating the resources at hand. Key differences from more advanced forms of AI include:

  1. Domain-specific autonomy. Agentic RAG systems focus on achieving user-defined goals within known domains, using strategies such as query rewriting or tool selection to improve results.
  2. Infrastructure dependencies. The capability of the system depends on the tools and data that developers integrate. It cannot transcend these boundaries without human intervention.
  3. Respect for the guardrail. Code of ethics, compliance rules and business strategies are still very important.Agent's freedom is always subject to security measures and oversight mechanisms (hopefully?).

 

Practical use cases and value

Agentic RAG shines in scenarios that require iterative optimization and precision:

  1. "Correctness-first" environment. In compliance checks, regulatory analysis, or legal research, Agentic models can iteratively verify facts, consult multiple sources, and rewrite queries until a thoroughly vetted answer is generated.
  2. Complex database interactions. When working with structured data, where queries may often fail or need to be tuned, systems can use Azure SQL or Microsoft Fabric OneLake to autonomously optimize their queries to ensure that the final retrieval matches the user's intent.
  3. Extended Workflow. Longer-running sessions may change as new information becomes available, and Agentic RAG can continuously integrate new data, changing strategies as more is learned about the problem space.

 

Governance, transparency and trust

As these systems become more autonomous in their reasoning, governance and transparency are critical:

  • Interpretable Reasoning. Models can provide an audit trail of the queries they make, the sources they consult, and the reasoning steps they take to reach their conclusions.Tools such as Azure AI Content Safety and Azure AI Tracing / GenAIOps can help maintain transparency and mitigate risk.
  • Deviation control and balance retrieval. Developers can adjust retrieval strategies to ensure that balanced, representative data sources are considered, and use Azure Machine Learning to customize models for advanced data science organizations, periodically auditing output to detect bias or skewed patterns.
  • Manual Supervision and Compliance. For sensitive tasks, manual review remains critical.Agentic RAG does not replace manual judgment in high-stakes decision making, but augments it by providing the option of more thorough review.

It is vital to have tools that provide a clear record of operations. Without them, debugging a multi-step process can be very difficult. See Literal AI (the company behind Chainlit) for an example of an Agent run:

微软 AI Agent 入门课程:Agentic RAG-4

微软 AI Agent 入门课程:Agentic RAG-5

 

reach a verdict

Agentic RAG represents a natural evolution in the way AI systems approach complex, data-intensive tasks. By adopting cyclic interaction patterns, autonomously selecting tools and optimizing queries until high-quality results are obtained, systems shift from static prompt-following to more adaptive, context-aware decision makers. While still bound by human-defined infrastructures and ethics, these Agentic capabilities provide richer, more dynamic, and ultimately more useful AI interactions for businesses and end users.

May not be reproduced without permission:Chief AI Sharing Circle " Microsoft AI Agent Introductory Course: Agentic RAG
en_USEnglish