DeepLearning.AI · Gen AI Solution Architect

Building and Evaluating Advanced RAG

A two-hour course: a baseline pipeline, the RAG triad, sentence-window retrieval, and auto-merging retrieval. Completing the notebooks is literacy. Hireability is being able to diagnose a bad answer and choose a retrieval design because the metrics moved.

DeepLearning.AI — Building and Evaluating Advanced RAGLlamaIndex is the labTruLens is the lab

What you are hired for Principal scope

A Gen AI solution architect owns the failure and the design choice. The library calls are how you run the lab.

Literacy

You can stand up a naive RAG pipeline, score it with the triad, and swap in sentence-window or auto-merging retrieval.

Hireability

You can point at one failing stage, name the fix, and refuse a more complex retriever when the baseline already fits the budget.

Architect's lens

LlamaIndex builds the index and the retriever. TruLens asks the three questions. Neither one decides whether a wider window was worth the tokens. That decision is the role.

The two ideas What the course is for

Everything else in the notebooks is a way to practice these.

IdeaThe skillWhere to go deep
The evaluation loopFreeze a set, change one design, keep the change only when the failing metric moves inside the budget.Also the RAG triad, which tells you which metric moved and why.
The chunk-size tradeoffOne chunk size cannot both match and explain. Split the unit you embed from the unit you hand the model.Sentence-window for a specific fact. Auto-merging when the answer lives in a section.

The lines worth practicing out loud are collected onInterview lines.

The two-hour course Lab map

Four lessons. Each one leaves a design judgment, not an API.

Baselinefixed-size chunksRAG triadthree separate failuresSentence windowmatch small, read wideAuto-mergingchildren hit, use parentsame questions every time — a design stays only if the failing score moves
The baseline is the number you regress against. The two retrieval patterns are candidates, scored on that same set.
LessonWhat the lab buildsWhat you leave able to say
Baseline pipelineNaive RAG: fixed-size chunks, embed, top-k, generate.The score everything else has to beat, including its token cost.
RAG triadContext relevance, groundedness, and answer relevance on each answer.Which stage failed, and the class of fix that stage allows.
Sentence-windowEmbed a sentence. Hand the model the surrounding window.Use it when the fact is a specific sentence and the neighbors carry the meaning.
Auto-mergingIndex a parent–child hierarchy. Replace children with the parent when enough of them hit.Use it when the source has real sections and the answer lives at section level.

Cheat sheet Recap

The track, in the order you would defend a design.

Key takeaways

  • The evaluation loop and the chunk-size tradeoff are the course. The APIs are how you measure them.
  • Walk a bad answer to one stage. Context relevance, groundedness, and answer relevance fail for different reasons and take different fixes.
  • Precision, context, and cost move together. A wider window or an aggressive merge is a budget decision, not a default upgrade.