← Learning

Adaptive RAG: Routing Between the Series' Five Strategies

A linear, one-concept-per-lesson path through Adaptive RAG, classifying each question and routing it to whichever of naive, hybrid, graph, corrective, or agentic retrieval actually fits, from a single-tier router to a complete FastAPI service wiring in the real implementations from courses 1-5. 26 lessons · 3 tiers.

Prerequisites: You should complete naive_rag, hybrid_rag, graph_rag, corrective_rag, and agentic_rag before starting this course - Lesson 2 recaps what each is good and bad at, but assumes you've already built and watched each one fail firsthand.

Lessons use Google's Gemini free tier (gemini-3.5-flash-lite) via direct google-genai calls, no LangChain, no LlamaIndex. No Docker, no database, no extra account - GOOGLE_API_KEY in a .env file is the only setup, and no new dependency beyond what courses 1-5 already installed.

Built directly on google-genai, Gemini's native SDK, routing to real implementations from five prior courses rather than a new retrieval mechanic of its own.

Course source

Every lesson's README and lesson.py for this course live in the ai-agent-engineering repo.

View on GitHub →
Adaptive RAG: Routing Between the Series' Five Strategies

Beginner

Classifying a question, dispatching by label, and a three-route router that beats always-naive.

  1. 01What Is Adaptive RAGGitHub
  2. 02Recap of the Series StrategiesGitHub
  3. 03Classifying Query ComplexityGitHub
  4. 04Routing by LabelGitHub
  5. 05A Single-Tier RouterGitHub
  6. 06Adding a Corrective RouteGitHub
  7. 07Measuring Whether Routing HelpsGitHub
  8. 08End to End Adaptive QAGitHub
  9. 09Checkpoint: CLI Q&A That Routes AutomaticallyGitHub

Intermediate

Confidence, fallback, tool-based routing, persisted decisions, cost, disclosure, misrouting, and a cost-aware evaluation.

  1. 10Confidence-Aware RoutingGitHub
  2. 11Falling Back on Low ConfidenceGitHub
  3. 12Agentic Tool-Based RoutingGitHub
  4. 13Persisting Routing DecisionsGitHub
  5. 14Cost and Latency TradeoffsGitHub
  6. 15Prompting for Disclosed Strategy ChoiceGitHub
  7. 16Failure Modes of MisroutingGitHub
  8. 17Minimal Evaluation, Routed vs. FixedGitHub
  9. 18Checkpoint: Notes Assistant That Reports Its Own RoutingGitHub

Advanced

Zero-cost pre-filtering, wiring in the series' five real strategies, a registry pattern, a FastAPI service, and the capstone.

  1. 19Multi-Signal RoutingGitHub
  2. 20A Rule-Based Pre-FilterGitHub
  3. 21Wiring in the Real Series StrategiesGitHub
  4. 22A Route and Strategy Registry PatternGitHub
  5. 23Wrapping It as a ServiceGitHub
  6. 24Instrumenting Strategy ChoiceGitHub
  7. 25Capstone: A Complete Adaptive RAG ServiceGitHub
  8. 26Series RetrospectiveGitHub
Start at Lesson 1

Contact

I read every message myself and usually reply within one business day.