Agentic RAG: Retrieval-Aware Workflows
From pipeline to agent: the model decides when to search, judges its own context, and re-queries until it can answer.
- Reframe retrieval as a tool the model invokes deliberately
- Implement a ReAct-style reason-act-observe loop
- Build self-correction: draft, critique, re-retrieve
- Route across multiple indexes and sources
Open the full Week 7 study material → Complete lesson: concepts in depth, the full lab with all code, and troubleshooting.
Concepts
1. Retrieval as a tool
Static pipelines retrieve once, always, for everything. An agent decides: search or answer directly? Which index? What query? The Week 1 retrieval decision returns — made per-query, by the model itself.
2. The ReAct loop
Reason about what's missing, act (search), observe results, repeat. A dozen lines of control flow around your existing pipeline — but it changes what the system can answer.
3. Self-correction
Draft an answer, critique it against the retrieved evidence, re-retrieve for unsupported claims. Slower and costlier, measurably more faithful. Your eval harness decides if it's worth it.
4. Context engineering for agents
Loops accumulate context fast. What stays in the window, what gets summarized, what gets dropped — memory management is the difference between an agent that scales and one that drowns.
Lab — live session
- Convert your Week 6 pipeline into a ReAct agent with retrieval as a tool
- Add a context-sufficiency check: the agent judges whether it can answer yet
- Implement one self-correction cycle
- Run the full eval: agent vs. static pipeline — quality, latency, and cost
An agentic version of your system plus an honest comparison table against the Week 6 pipeline. Sometimes the pipeline wins — knowing when is the skill.
Reading
Watch
Reflection — bring answers to the next session
- On which query types did the agent beat the pipeline? Where did it just burn tokens?
- How did you decide what to evict from the agent's context — and what broke when you got it wrong?
- What would it take to trust this agent unsupervised in front of your users?
Challenge 7: Agent vs. Pipeline — A rigorous head-to-head: your agent against your static pipeline, three metrics, no favorites. The interesting result is wherever the agent LOSES.