Back to Courses

Agentic RAG: Tool Use, Function Calling & ReAct

A fixed retrieve-then-generate pipeline answers one question with one search. Some questions need several searches, a choice between indexes, or a calculation first. Agentic RAG hands that control to the LLM: using function calling and the ReAct loop, the model decides when to retrieve, what to retrieve, and when it finally has enough to answer.

Day 2 Progress0%

From Static Pipelines to Agentic RAG

The pipeline you've built so far is static: embed the question, retrieve once, rerank, generate. One question in, one search, one answer out. For a huge fraction of questions that's exactly right — and you should not reach for anything fancier when it works.

But some questions break the single-shot assumption.

Where One Retrieval Isn't Enough

  • Multi-part questions. "Compare our refund policy for digital goods versus physical goods." One query blends two topics and retrieves a muddy mix of both. Two targeted searches would each be clean.
  • Conditional questions. "If the customer is on the enterprise plan, what's the SLA?" The right search depends on a fact you have to look up first.
  • Multi-hop questions. "Who signed off on the policy that governs EU data retention?" You first find the policy, then find who approved it — the second search needs the first's result.
  • Questions that aren't retrieval at all. "What's 18% of our $4,200 invoice?" There's nothing to retrieve; the model should compute, not search.

A static pipeline answers all of these by doing the one thing it knows how to do — retrieve once — and then hoping. That's where quality quietly falls apart.

The Agentic Idea

Agentic RAG stops treating the LLM as the final step and starts treating it as the controller. Instead of you hard-coding "always retrieve, then generate," you give the model a set of tools (search this index, search that index, do math, look up a record) and let it decide:

  1. Do I need a tool at all, or can I answer directly?
  2. If so, which tool, with what arguments?
  3. Given the result, am I done — or do I need another step?
STATIC:     question ─► retrieve ─► generate ─► answer

AGENTIC:    question ─► [ LLM decides ] ─► tool? ─► observe ─┐
                            ▲                                │
                            └──────── loop until done ◄───────┘
                                          │
                                          ▼
                                        answer

The Trade

Agentic RAG is strictly more powerful and strictly more expensive. Each decision is another LLM call, each search adds latency, and a loop that doesn't terminate cleanly can run up cost or spin forever. The skill this lesson teaches is not "always go agentic" — it's knowing the mechanism well enough to apply it only where the question shape demands it, and to bound it when you do.

Key Takeaways
  • A static retrieve-then-generate pipeline is correct for most questions — don't add agency you don't need
  • Multi-part, conditional, multi-hop, and compute questions break the single-retrieval assumption
  • Agentic RAG promotes the LLM from final step to controller: it decides whether, which, and when to use tools — more powerful and more expensive

AI Learning Assistant

Powered by advanced LLM

Get personalized help with concepts, code examples, and explanations tailored to your learning pace.

Course Stats

Estimated Time
55 min
Lessons
5 sections