Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Mastering Advanced RAG: From Basics to Production
New
2 students

Mastering Advanced RAG: From Basics to Production

Master Retrieval Augmented Generation (RAG), Python, hybrid search, reranking, and systematic RAG evaluation.
Created byHamza Ijaz
Last updated 11/2026
English

What you'll learn

  • Build a RAG pipeline in Python using chunking, embeddings, vector search, retrieval, and answer generation.
  • Create a benchmark with evidence-grounded questions and evaluate retrieval using Recall@K and MRR.
  • Diagnose retrieval failures and improve results using chunking, query rewriting, hybrid search, and reranking.
  • Compare retrieval techniques using consistent experiments and measure quality–latency trade-offs.
  • Explore vector search, metadata filtering, and diversity selection using interactive playgrounds.
  • Study research papers and apply their ideas through coding exercises and advanced assignments.
  • Identify production-oriented failure scenarios and reason about validation, monitoring, and safe rollout.

Course content

4 sections • 63 lectures • 22h 0m total length
  • Welcome, Roadmap, How This Course Works15:46
  • RAG Architecture: When to Use It (and When Not To)5:13
  • Environment Setup — Prerequisites & Workflow4:51
  • Dataset Walkthrough & Environment Verification11:29
  • Document Chunking: From Documents to Chunks10:01
  • Embeddings and Vector Search28:53
  • Run the Naive RAG Pipeline on Real Data9:02
  • Designing the RAG Benchmark4:42
  • Implementing the Benchmark Labels31:28
  • Measuring RAG Performance — Retrieval Metrics & Confidence Intervals7:29
  • Implementing RAG Retrieval Metrics in Python — Hit Rate, Precision, Recall & MRR13:54
  • Understanding Confidence Intervals & Bootstrap for RAG Evaluation33:19
  • Paired Bootstrap — Testing Whether a RAG Improvement Is Real11:57
  • Evaluating a Real-World RAG Pipeline with Bootstrap & Confidence Intervals30:39
  • Why RAG Fails — The Nine Failure Modes4:21
  • Diagnosing RAG Failures — A Hands-On Benchmark Walkthrough10:39
  • Assignment 1 -> Module 1 Baseline Benchmark — standard required suite
  • Assignment 2 -> Module 1 Research Reproduction — Advanced Challenge

Requirements

  • Basic Python knowledge, including functions, lists, dictionaries, and installing packages.
  • A computer suitable for running Python; local models require downloads and sufficient hardware.
  • No prior RAG experience or paid API key is required. Cloud APIs are optional.

Description

Stop guessing which RAG technique works. Learn how to test it.

Learn hands-on with Ollama and local models—no paid API key or per-call API fees required for the core local experiments.

A RAG system can retrieve the wrong passage, miss evidence that's already in your documents, or produce a confident answer based on incomplete context.

Adding another technique may help—but it may also introduce latency, cost, or new failures. How do you know which change is worth making?

Learning a RAG technique is only part of the job. In real-world systems, techniques encounter limitations that aren't always visible in a simple notebook demonstration.

Throughout this course, we go beyond implementation to examine how each technique can be improved, where it breaks down, why those failures occur, and how to address them. We discuss practical engineering considerations such as retrieval noise, context loss, truncation, ranking errors, latency bottlenecks, scalability, and quality-versus-cost trade-offs.

The goal is to help you understand not only how to implement a technique, but how to troubleshoot, improve, evaluate, and make informed engineering decisions when using it in real-world RAG systems.

In this course, you'll learn to reason about RAG from the fundamentals to advanced retrieval. You'll explore the mathematics, work through Python implementations, inspect experimental results, and compare techniques using evidence—not just diagrams or demos.

Available now: 4 modules · 63 lectures · 23 hours

Module 1: RAG fundamentals and benchmarking

Build a baseline pipeline, understand embeddings and retrieval, create an evaluation harness, and learn to diagnose failures. A research-inspired advanced assignment challenges you to investigate the Lost in the Middle hypothesis.

Module 2: Chunking and context engineering

Go beyond chunk size and overlap. Explore semantic and proposition chunking, contextual headers, parent-child retrieval, neighbour expansion, and compression. Investigate when smaller chunks improve precision—and when they lose essential context.

Module 3: Query enhancement

Work through query rewriting, multi-query retrieval, decomposition, step-back prompting, HyDE, HyPE, and conversational follow-ups. Investigate when a transformed query helps and when it drifts away from the original question.

Module 4: Advanced retrieval—from techniques to engineering decisions

Go beyond hybrid search and reranking to investigate what evidence a RAG system keeps, loses, and sends to the model.

  • Compare top-k, MMR, and Dartboard to see when diverse selection helps—and when it can discard useful evidence.

  • Explore SPLADE, ColBERT, Matryoshka representations, binary retrieval, and compression, with worked examples and comparisons.

  • Follow a small embedding-model fine-tuning experiment, from training pairs and ranking loss to before-and-after retrieval.

  • Diagnose where evidence disappears in a pipeline, and compare reranking on versus off using paired quality and latency results.

You'll inspect wins, losses, and limitations—not just celebrate techniques when they work. The experiments are development-set investigations, not production guarantees.

An example of the engineering trade-offs you'll investigate

One course experiment compares the same hybrid retrieval pipeline with and without a reranker. On 87 labelled development questions, Recall@5 increased from 0.391 to 0.528, while warm median retrieval latency rose from 28 ms to approximately 2.59 seconds.

This is a retrieval-only result from one environment—not a claim about answer quality or production performance. It illustrates why measuring improvements alongside their costs matters.

What's planned next: Modules 5–11

The course is designed to grow from its initial four modules into an 11-module learning journey, targeting approximately 60 hours of content.

Here's what the next stages are intended to cover:

Module 5: Multimodal and Structured Data RAG

  • PDF and document understanding beyond plain text

  • Tables, charts, images, and multimodal retrieval

  • XBRL, SQLite, and constrained text-to-SQL

  • Building and benchmarking a multimodal financial-document RAG application

Module 6: Adaptive and Corrective RAG

  • Retrieval quality grading and query routing

  • Feedback loops and bounded retry strategies

  • Corrective RAG and conditional web fallback

  • Self-RAG and retrieval-augmented fine-tuning (RAFT)

Module 7: Graph and Hierarchical RAG

  • Knowledge graph construction and retrieval

  • Microsoft GraphRAG: local versus global search

  • RAPTOR and LightRAG

  • Comparing graph, hierarchical, vector, and hybrid architectures

Module 8: Agentic RAG

  • Agentic control loops and tool-based retrieval

  • MCP-ready retrieval interfaces

  • Retrieval planning and multi-step reasoning

  • Building and evaluating an agentic retrieval workflow

Module 9: RAG Evaluation

  • Retrieval and generation evaluation metrics

  • LLM-as-a-judge limitations and reliability

  • DeepEval, RAGAS, and other evaluation approaches

  • Statistical comparisons, regression testing, and end-to-end evaluation

Module 10: Production RAG

  • Production architecture, latency, and cost optimization

  • Vector indexes and approximate nearest-neighbour search

  • Observability, tracing, and monitoring

  • Security, privacy, access control, and index freshness

  • Failure handling, regression gates, and deployment

Module 11: Capstone — RAG Architecture Decision

  • Work through a realistic RAG engineering brief

  • Compare architectures using held-out evaluation

  • Develop an evidence-based architecture recommendation

  • Present a final decision report covering quality, cost, latency, and trade-offs

Roadmap transparency: Modules 5–11 are planned, not currently available. Their lecture titles, scope, examples, and release order may change based on student feedback and development. The approximately 60-hour course length and three-month development schedule are targets, not guarantees. Future experimental results are not predetermined.

How you'll learn

This is not a course that stops at an architecture diagram.

  • Understand the idea: Start with the problem, intuition, and relevant mathematics.

  • Follow the implementation: Work through notebooks, Python functions, inputs, and outputs in detail.

  • Explore interactively: Use playgrounds to inspect vectors, rankings, fusion, reranking, filters, and diversity.

  • Run experiments: Compare techniques, examine failures, and investigate quality–latency trade-offs.

  • Apply your knowledge: Complete detailed assignments, including research-inspired challenges.

You'll work with real financial filings and questions grounded in source evidence—not just a toy document that happens to produce a convincing answer.

No paid API key required for local options

You can follow the local execution path without paying per-call API fees. Where appropriate, supplied experiment results let you inspect the methodology and findings without having to run every computationally expensive experiment yourself.

Some model-backed exercises require downloads, setup, disk space, and suitable hardware. Optional cloud services may charge.

Join early. Help shape the course.

The course launches with four substantial modules and approximately 23 hours of learning material. You can start learning immediately, work through the implementations and experiments, and share feedback that can help shape future modules.

The course is designed to grow toward 11 modules and approximately 60 hours of content. By joining now, you can begin with the available material and follow the course as it develops.

The course price is expected to increase as modules are added, although future pricing and discounts may vary. Joining at the current price gives you an opportunity to enrol before those planned increases.

Who this course is for

  • Python developers who want to build and understand RAG systems

  • AI and ML practitioners who need to evaluate retrieval techniques

  • Engineers who want to diagnose failures rather than blindly add complexity

  • Learners who want to move beyond framework tutorials into implementation depth

You should be comfortable with basic Python, including functions, classes, and working with libraries. No prior RAG experience is required—we establish the fundamentals before progressing into advanced techniques.

The goal is not to memorise a collection of RAG methods. It's to understand them, implement them, test them, and make better engineering decisions.

Who this course is for:

  • This course is for Python developers, AI engineers, Python developers building applications that answer questions over documents.achine learning engineers, data scientists, and software engineers who want to build more accurate, reliable, and production-ready RAG systems. If you've built a basic document chatbot and want to go beyond simple vector search, you'll learn how to improve retrieval with chunking, query transformation, hybrid search, reranking, GraphRAG, adaptive retrieval, and agentic workflows. You'll also learn how to evaluate RAG systematically instead of relying on intuition. Using a consistent benchmark, you'll compare techniques, measure quality and latency, examine statistical confidence intervals, and determine whether an improvement justifies its additional cost and complexity. Tech leads, solution architects, and technical decision-makers will benefit from learning how to choose between retrieval strategies and design architectures suited to different questions and datasets. Through hands-on work with real SEC company filings, you'll develop a practical understanding of RAG engineering and produce an evidence-based architecture decision report. **Prerequisites:** Basic Python programming is required. Previous experience with RAG is helpful but not necessary. This course is not intended for learners seeking a no-code tutorial or an introduction to Python programming.
  • AI and machine learning engineers who want to evaluate and improve RAG systems.
  • Data scientists and software engineers interested in retrieval, research, and hands-on experimentation.
  • Technical leads and architects making evidence-based decisions about RAG design.