M07 · Retrieval-augmented generation (RAG)07-0936 min read

Lesson 49 of 106 · Module 8 of 14 · Week 4

Threads:The measurement threadThe weights threadThe infrastructure threadThe control thread

The complete RAG pipeline, stage by stage

A complete retrieval-augmented generation pipeline is nine stages — parse, chunk, embed, index, query, retrieve, rerank, assemble, generate-and-cite — split across an offline ingestion path and an online query path. NVIDIA states the query path as query, embedding model, vector match against an indexed knowledge base, retrieve and decode, then the LLM synthesises and cites sources. The property that governs every design decision is that the pipeline's end-to-end quality equals its single worst stage: a flawless reranker cannot repair a parser that silently dropped every table.

01

What the complete RAG pipeline is

Nine stages, two paths, one shared artefact — the index — that connects them:

text
════════════ OFFLINE: INGESTION (runs on corpus change) ════════════

  source documents
        │
   [1] PARSE ──────────► text + structure + metadata          (06-01)
        │                 PDFs, tables, scans; failures are SILENT
        │
   [2] CHUNK ──────────► retrievable units with overlap        (06-02)
        │                 + dedup and boilerplate strip        (06-04)
        │                 + metadata attached                  (06-03, 07-05)
        │
   [3] EMBED ──────────► one vector per chunk                  (07-02)
        │                 model + version + prefix convention PINNED
        │
   [4] INDEX ──────────► sparse inverted index  (07-01)
                       + dense ANN index        (07-04)
                       + metadata store, filterable
                              │
                              ▼
                    ┌──────────────────┐
                    │   THE INDEX      │  ← the only shared state
                    └──────────────────┘
                              │
════════════ ONLINE: QUERY (runs per request) ══════════════════════
                              │
   [5] QUERY PREP ◄─── user question + conversation history     (12-11)
        │                 rewrite to a self-contained query
        │                 resolve the caller's entitlements     (07-05)
        │
   [6] RETRIEVE ───────► sparse leg + dense leg, both filtered
        │                 fuse with RRF                         (07-06)
        │                 → N candidates
        │
   [7] RERANK ─────────► cross-encoder scores each candidate    (07-07)
        │                 → reordered, thresholded
        │
   [8] ASSEMBLE ───────► edge-loaded context with headers       (07-08)
        │                 token budget respected                (04-06)
        │
   [9] GENERATE ───────► answer grounded in context, WITH        (07-11)
                         CITATIONS — or an honest decline

Why nine and not five. Most published diagrams show four or five boxes: embed, store, retrieve, generate. That compression is exactly why RAG systems fail in ways their builders cannot explain. Parsing is not part of chunking. Reranking is not part of retrieval. Assembly is not part of generation. Each of the nine has its own failure mode, its own measurable output, and its own owner. A stage you have not named is a stage you cannot attribute a failure to, and attribution is the whole game (07-10).

Mapping to NVIDIA's stated pipeline. The [NVIDIA-DOC] description covers the query path at a coarser granularity, and the mapping is exact:

NVIDIA's stated stage [NVIDIA-DOC]Stages here
query[5] query prep
embedding modelpart of [6] — the dense leg encodes the query
vector match against indexed knowledge base[6] retrieve, over the [4] index
retrieve and decode[6] and [7] — candidates fetched and scored
LLM synthesises and cites sources[8] assemble and [9] generate-and-cite

Learn the NVIDIA ordering as an ordering; component-order questions are an explicit drill emphasis. Learn the nine-stage decomposition as your debugging vocabulary.

The NVIDIA products that sit on this pipeline [NVIDIA-DOC]:

ProductWhere it sits
NeMo Retrieverretrieval accuracy at scale — stages [3], [4], [6], [7]
NVIDIA AI Blueprint for RAGa reference workflow for the whole pipeline; the shape, not a stage
NeMo Curatordata curation — stages [1] and [2]
NeMo Guardrailskeeps applications accurate, appropriate, on-topic, and secure — wraps stage [9]
NIMpre-optimised inference microservices; how the embedding model, reranker, and LLM are served
Triton Inference Serverserving many models — the same layer as NIM, different framing

Note carefully: NIM and Triton are deployment for the models this pipeline calls, not pipeline stages. 12-13 covers them properly, and confusing "how a model is served" with "what stage it serves" is a real distractor family.

02

How the RAG pipeline works, stage by stage

L1 — The intuition you can carry into an exam

Two paths. Offline you turn documents into a searchable index. Online you turn a question into a search, narrow the results, arrange them, and answer with citations. The quality of the whole thing is the quality of its worst stage.

Three facts to carry:

  • Nine stages: parse, chunk, embed, index, query-prep, retrieve, rerank, assemble, generate-and-cite.
  • NVIDIA's query path: query → embedding model → vector match → retrieve and decode → synthesise and cite [NVIDIA-DOC].
  • Chain, not sum. Find the worst stage.

L2 — What each stage takes in, puts out, and how it fails

This table is the lesson's core asset. Every row is a stage you can measure independently, and the "silent?" column is the one that decides how much monitoring each deserves.

#StageInputOutputCharacteristic failureSilent?Lesson
1Parsesource filestext + structure + metadatatables flattened, columns interleaved, scans yielding nothing, headers lostYes — always06-01
2Chunkparsed textretrievable unitsanswer split across a boundary; chunks too long to be specific; boilerplate dominatingYes06-02, 06-04
3Embedchunk textone vector per chunkwrong model version, missing instruction prefix, wrong poolingYes — and dangerous07-02
4Indexvectors + metadatasearchable indexesANN recall too low; metadata unfilterable; stale after corpus changePartly07-04, 12-12
5Query prepquestion + history + identitya self-contained, entitlement-scoped queryambiguous follow-ups unresolved; identity not propagatedPartly12-11, 07-05
6Retrieveprepared queryN fused candidatesrecall miss — the answer is not in the poolNo, if you look at the pool07-01, 07-02, 07-06
7RerankN candidatesreordered, thresholded listnear-miss left at the top; the good chunk left mid-listNo, if you look07-07
8Assembleranked chunksthe literal promptnaive ordering; too many chunks; metadata not rendered; output budget not reservedPartly07-08
9Generate + citepromptanswer with citationsunsupported claims; citations that do not match; no decline pathNo — visible in the answer07-11, 09-12

Read the "silent?" column as a monitoring budget. Stages 1, 2, and 3 fail without any error, anywhere, ever. A parser that drops a table returns text. A chunker that splits an answer returns chunks. An embedder with the wrong prefix returns vectors. These three stages need assertions, because they will never volunteer a problem — and they are also the three that sit earliest, which means their failures propagate through everything downstream and get misattributed to whatever stage the team happens to be looking at.

The corresponding assertions, each cheap:

StageAssertion that catches its silent failure
1 ParseFor a sample of documents, assert extracted character count is within a plausible band of the source; assert known table cell values appear in the output
2 ChunkAssert no chunk exceeds the embedding model's or reranker's input limit; assert a known answer sentence is wholly inside exactly one chunk
3 EmbedSelf-retrieval: embed a known chunk's own text as a query; it must return that chunk at rank 1 with similarity near 1.0
4 IndexCompare ANN top-k against brute-force top-k on a sample; assert index recall above a threshold you chose
5 Query prepAssert a follow-up query resolves to a self-contained question; assert the entitlement predicate is non-empty
6 Retrieverecall@N on the frozen eval set
7 RerankMRR / nDCG@k on the frozen eval set
8 AssembleAssert the assembled token count is within budget and output space is reserved; log ordered chunk ids
9 GenerateFaithfulness and citation-accuracy checks (09-07)

The self-retrieval assertion at stage 3 is the highest-value single test in the entire pipeline. It is one embedding call and one search, it catches nearly every encoder-consistency failure, and it belongs in CI.

L3 — The two paths' different lifecycles, and where they couple

The ingestion path and the query path run on completely different schedules, and most operational RAG problems live in the seam between them.

Ingestion path (1–4)Query path (5–9)
Triggercorpus changeuser request
Frequencyhourly to weeklycontinuous
Latency budgetminutes to hoursmilliseconds
Cost profilebatch, parallel, throughput-boundper-request, latency-bound
Failure visibilitynone by defaultimmediate
Idempotentshould beyes
Who notices a failurenobody, for weeksusers, in minutes

Where they couple, and what breaks:

The embedding model is shared state. Stage 3 encoded the corpus; stage 6's dense leg encodes the query. They must use the same model, version, prefix convention, and pooling. This is the coupling that produces the module's signature failure: mismatched encoders yielding plausible nonsense with high scores and no error (07-02). The engineering answer is a single module owning the embedding convention, imported by both paths.

Changing the embedding model invalidates the whole index. Vectors from two models are not comparable even at equal dimensionality. A model upgrade is therefore a full re-embed and re-index — a migration project, not a config change (12-12).

Metadata schema is shared state. Stage 2 attaches it; stages 6 and 8 depend on it. Adding a filterable field means re-ingesting, which is precisely why permission metadata has to be designed in before the pipeline is built (07-05) and why this module put access control at 07-05 rather than later.

Index freshness is a correctness property, not a performance one. Between a document changing and the index reflecting it, the pipeline confidently serves stale content (07-03). Permissions changing is the acute version of the same problem, and it is why ACL sync must be decoupled from content re-embedding (07-05).

Two things must be versioned together. The corpus snapshot and the embedding-model version form one logical unit. If you cannot say "this index is corpus snapshot X embedded with model Y at settings Z", you cannot reproduce a result, roll back, or explain a regression.

03

The RAG pipeline compared: full pipeline vs minimal RAG vs long-context vs fine-tuning

Full 9-stage RAGMinimal RAG (embed, store, retrieve, generate)Long-context stuffingFine-tuning
Stages you can attribute a failure to9410 — the weights are opaque
Handles exact identifiersyes (sparse leg)usually notyesnot reliably
Handles paraphraseyesyesyesyes
Freshnessindex updateindex updateresend the documentretrain
Provenance / citationsyes, by designpossiblepossibleno
Per-query costmoderatelowhigh — scales with document sizelow
Scales to a large corpusyesyesnoyes, at training cost
Setup complexityhighlowlowesthigh
Changes model style/formatnononoyes
Adds new factsyesyesyesunreliably
Access control feasibleyes, at retrievalif designed inper-request onlyno — weights cannot forget (13-05)
Lost-in-the-middle exposurelow (small k)moderatehighn/a
Right whenproduction system, real corpus, real usersprototype, or genuinely simple corpussmall corpus that fits the windowbehaviour/format change, not fact injection

Four readings that exam items probe.

RAG and fine-tuning solve different problems. RAG injects facts with provenance and freshness; fine-tuning changes behaviour, style, and format. The confusable pair is on the study guide's explicit list and 11-08 owns the full decision rule. The one-line version: if the answer changes when the documents change, that is RAG; if the answer changes when you want a different kind of answer, that is fine-tuning.

Minimal RAG is a legitimate starting point and a bad ending point. Four stages is the right shape for a prototype. Its problem is not that it is wrong but that it is unattributable: when quality disappoints, there are four boxes and the real cause is usually in a stage the diagram does not name.

Long-context stuffing is a real alternative at small scale. If the corpus fits in the window, sending it whole eliminates every retrieval failure in this module. It does not scale, it is expensive per query, and it maximises lost-in-the-middle exposure (07-08). Considering it seriously is part of not over-applying RAG (07-12).

Only RAG gives you citations and access control. These are the two properties that most often make RAG the right architecture in an enterprise, and neither is available from a fine-tuned model — model weights cannot forget a fact, cannot cite a source, and cannot be filtered per user (13-05).

04

Worked example: tracing one query through all nine stages

This is a constructed end-to-end trace with invented numbers, built so every stage boundary is inspectable. It is not a measurement of any real system.

The system. An internal support assistant over 12,000 chunks drawn from product documentation, release notes, and an archived support forum. Because 12,000 chunks is small, the dense index is exact in-memory search rather than an ANN index — the 07-04 argument applied.

The question. A support engineer authenticated as u_4417 (groups: support-tier2, all-staff) asks:

"customer on 4.2 is hitting ERR_CERT_AUTHORITY_INVALID after we rotated their CA — is this expected?"

Stage 1 — Parse

Source: 340 PDFs, 1,100 HTML pages, one CSV of release notes.

text
Extracted:      1,441 documents
Empty output:   3 documents      ← scanned PDFs with no OCR layer
Table-bearing:  61 documents     ← extracted as pipe-delimited text, not flattened prose
Assertion:      character count within 0.8×–1.2× of source estimate → 3 failures, flagged

The three empty documents are the stage's silent failure caught by an assertion. Without that assertion they would simply be absent from every future answer, and nobody would ever know why the certificate-rotation runbook could not be found.

Stage 2 — Chunk

Recursive chunking at ~400 tokens with 50-token overlap (06-02), boilerplate stripped and near-duplicates removed (06-04), metadata attached (06-03, 07-05).

text
Chunks before dedup:      13,884
Near-duplicate removed:   1,412    ← mostly a repeated legal footer
Boilerplate-only removed:   472    ← nav blocks
Final chunks:            12,000
Max chunk length:           487 tokens   ← under both the embedder's and the reranker's limits ✓
Assertion: known answer sentence wholly inside exactly one chunk → pass

That 1,412-chunk dedup is doing more work than it looks. A footer repeated across thousands of pages becomes the nearest neighbour of every query, because its vector sits at the centroid of the corpus. Removing it is a retrieval-quality intervention disguised as a hygiene task.

Stage 3 — Embed

text
Model:      pinned by name AND version
Prefix:     "passage: " for chunks, "query: " for queries   ← ONE module owns this
Pooling:    mean, as the model requires
Normalise:  L2, so cosine == dot product
Output:     12,000 × 768 float32 = 30.7 MB      (M0.4)

SELF-RETRIEVAL ASSERTION:
  embed chunk_0041's own text as a query
  → returns chunk_0041 at rank 1, similarity 0.998  ✓

That assertion is the pipeline's single highest-value test. Had the prefix been omitted on the query side, this check would have returned rank 1 at similarity ~0.72 or a different chunk entirely — and every downstream stage would have continued reporting success.

Stage 4 — Index

text
Sparse:  inverted index, one analyser shared by index and query paths   (07-01)
Dense:   exact in-memory NumPy matrix — 12,000 rows, recall 1.0 by construction  (07-04)
Meta:    acl_groups, classification, product_version, doc_date, status, source_type, doc_id, chunk_pos
Index identity recorded: corpus snapshot 2026-07-28 + embedding model vX.Y + prefix convention A

No vector database. At 30.7 MB and 7.7 million multiply-adds per query, one is unnecessary — and exact search means index recall is not a variable that can confound anything downstream.

Stage 5 — Query prep

text
Raw:      "customer on 4.2 is hitting ERR_CERT_AUTHORITY_INVALID after we rotated their CA
           — is this expected?"
History:  none (first turn) → no rewrite needed                (12-11)
Identity: u_4417 → groups [support-tier2, all-staff]           (07-05)
Filter:   acl_groups ∈ {support-tier2, all-staff}
          AND status = 'current'                               ← recency, per 07-03
Eligible: 9,120 of 12,000 chunks

Two filters, two different jobs. The ACL filter is a security boundary and must be inside the retrieval query (07-05). The status = current filter is a quality control addressing recency blindness (07-03). Both are pre-filters; with exact search both are a boolean mask applied before the dot product.

Stage 6 — Retrieve and fuse

Both legs run over the eligible 9,120, in parallel, top-50 each.

Sparse leg (BM25). ERR_CERT_AUTHORITY_INVALID is maximally rare, so it dominates:

text
rank 1  c8801   11.42   "ERR_CERT_AUTHORITY_INVALID: the presented chain terminates in an untrusted root"
rank 2  c2170    9.88   release note 4.2: "ERR_CERT_AUTHORITY_INVALID now includes the chain in the log"
rank 3  c5512    3.10   "certificate rotation checklist"
...

Dense leg (cosine). Recovers the mechanistic and procedural chunks that share no rare terms:

text
rank 1  c5512   0.81   "certificate rotation checklist"
rank 2  c8801   0.78   the direct explanation
rank 3  c6033   0.76   "after replacing a CA, clients must be restarted to reload the trust store"
...

Fusion (RRF, k_rrf = 60). For the four documents that matter:

text
c8801:  sparse 1 → 1/61 = 0.016393  +  dense 2 → 1/62 = 0.016129  =  0.032522
c5512:  sparse 3 → 1/63 = 0.015873  +  dense 1 → 1/61 = 0.016393  =  0.032266
c2170:  sparse 2 → 1/62 = 0.016129  +  absent          = 0        =  0.016129
c6033:  absent            = 0       +  dense 3 → 1/63 = 0.015873  =  0.015873

Fused: c8801 > c5512 > c2170 > c6033. Note the defect already familiar from 07-06: c6033 — the chunk stating that clients must be restarted to reload the trust store, which is the actual answer to the user's real problem — sits fourth, because only one leg found it.

Stage 7 — Rerank

The fused pool of 74 unique candidates goes to the cross-encoder. Scores for our four:

text
c6033   0.93   "after replacing a CA, clients must be restarted to reload the trust store"  ← the answer
c8801   0.91   the error's meaning
c5512   0.62   rotation checklist
c2170   0.28   a release note about log formatting

Reranked: c6033 > c8801 > c5512 > c2170. The reranker promoted c6033 from rank 4 to rank 1, because joint encoding let it see that "after replacing a CA, clients must be restarted" answers "we rotated their CA and now they get this error" — a connection with almost no lexical overlap and only one leg's vote. It also collapsed c2170 from rank 3 to last: a release note that mentions the error string in the context of log formatting is not an answer, which is the mention-versus-explanation distinction from 07-07.

Relevance floor of 0.5 keeps three candidates and drops c2170 and the other 70.

Stage 8 — Assemble

Edge-loaded, best first and second-best last, with rendered headers (07-08):

text
[SYSTEM] Answer using only the numbered sources below. Cite the source id after
         each claim. If the sources do not contain the answer, say so.

[SOURCE 1 · doc:ops-118#c14 · 2026-05-02 · current · official]
after replacing a CA, clients must be restarted to reload the trust store …

[SOURCE 2 · doc:ref-441#c07 · 2026-03-11 · current · official]
certificate rotation checklist …

[SOURCE 3 · doc:err-009#c01 · 2026-01-20 · current · official]
ERR_CERT_AUTHORITY_INVALID: the presented chain terminates in an untrusted root …

[QUESTION] customer on 4.2 is hitting ERR_CERT_AUTHORITY_INVALID after we rotated their CA
           — is this expected?
text
Token accounting:
  instructions          120
  3 chunks + headers    430
  question               35
  ─────────────────────────
  input                 585
  reserved for output   500
  total                1,085  ≪ context window            ✓  (02-03, 04-06)

Three chunks, not fifty. 585 input tokens, not 8,000. The two strongest chunks at the two strong positions. Every chunk carries a date, a status, a source tier, and a citable id.

Stage 9 — Generate and cite

text
Yes, this is expected. Replacing a certificate authority does not take effect on a
client until the client is restarted so it reloads its trust store [SOURCE 1].
ERR_CERT_AUTHORITY_INVALID specifically indicates the presented chain terminates in
a root the client does not trust [SOURCE 3], which is what happens while the old
trust store is still loaded. The rotation checklist [SOURCE 2] lists the restart as
a required step.

Every claim cites a source. Every source is current, official, and one this user is entitled to read. The answer addresses the user's real question — is this expected — rather than merely defining the error code.

What the trace proves

StageIts specific contribution to this answer
1 ParseCaught 3 empty documents that would otherwise have been silently missing
2 ChunkRemoved 1,412 near-duplicate footers that would have crowded every result
3 EmbedSelf-retrieval at 0.998 proved the encoder convention was consistent
4 IndexExact search removed ANN recall as a confounder entirely
5 Query prepApplied the ACL boundary and the currency filter, narrowing 12,000 to 9,120
6 RetrieveSparse found the exact error string; dense found the procedural chunk; fusion ranked the agreed one first
7 RerankPromoted the actual answer from rank 4 to rank 1
8 Assemble3 chunks, 585 input tokens, both best chunks at strong positions, headers rendered
9 GenerateCited every claim; the answer addresses the question asked

Now remove one stage and watch the whole thing fail:

RemoveResult
Stage 1's assertion3 documents silently absent from every answer forever
Stage 2's dedupFooter chunks crowd the top-50; real candidates pushed out
Stage 3's prefix conventionEvery dense score becomes noise; nothing errors
Stage 5's ACL filterRestricted chunks eligible for retrieval — a breach (07-05)
Stage 5's currency filterA superseded 4.1 document may contradict the 4.2 answer (07-03)
Stage 6's sparse legThe exact error string is not found reliably
Stage 6's dense legc6033 and c5512 are never retrieved at all
Stage 7 rerankThe real answer sits at rank 4 and never enters a 3-chunk context
Stage 8's edge-loadingThe best chunk lands mid-context and is under-used
Stage 9's citation instructionThe answer is unverifiable and hallucination is undetectable

Nine stages, and removing any one of them degrades or breaks the answer. That is what "quality equals the worst stage" means concretely — and it is why a diagram with four boxes cannot support a debugging conversation.

05

Decision table: designing each pipeline stage under real constraints

StageCheap default that worksUpgrade whenDo not bother if
1 Parsetext extraction + an extracted-length assertiontables or scans matter → structured extraction, OCR (06-01)corpus is already clean markdown
2 Chunkrecursive, ~300–600 tokens, ~10% overlapanswers span boundaries → semantic chunking (06-02)documents are already short, self-contained units
2b Dedupexact-hash dedup + boilerplate stripnear-duplicates persist → near-dup detection (06-04)corpus is genuinely unique content
3 Embedone pinned model, one convention, self-retrieval assertioneval set shows the model is the bottleneck (03-03)never skip the assertion
4 Indexexact in-memory searchcorpus > ~10⁵ chunks or concurrency demands it → HNSW/IVF (07-04)corpus is small — a vector DB is over-engineering
5 Query preppass the query through; apply ACL + currency filtersmulti-turn chat → query rewriting (12-11)single-turn, public corpus → filters may be unnecessary
6 Retrievemeasure BM25 first, then dense, then fuse (07-01, 07-06)one leg's blind spot shows in the eval setone modality genuinely covers your queries
7 Rerankadd it early — it is the cheapest experiment (07-07)quality plateaus on orderinghard latency floor with no GPU budget
8 Assembleedge-load, relevance floor, rendered headers, reserved output spacemulti-part questions need per-part chunksnever skip the token accounting
9 Generategrounding instruction + citations + a decline path (07-11)faithfulness metrics show drift (09-07)never skip citations if provenance matters

The build order that avoids wasted work, which is not the same as the pipeline order:

  1. Eval set first (01-08). Twenty real questions with labelled answer chunks. Without this every later decision is a guess.
  2. Parse and chunk with assertions. Silent stages first, because their failures masquerade as everyone else's.
  3. BM25 baseline (07-01). Free, and the denominator for every later claim.
  4. Dense retrieval with the self-retrieval assertion (07-02).
  5. Exact index (07-04). Do not adopt infrastructure yet.
  6. Fuse (07-06), measure.
  7. Rerank (07-07), measure. Often the largest single gain.
  8. Assemble properly (07-08). Often the largest gain per line of code.
  9. Ground and cite (07-11).
  10. Only now consider a vector database, a bigger model, or fine-tuning.

Teams routinely invert steps 1 and 10, and that inversion is the most expensive mistake in applied RAG.

06

Why the complete RAG pipeline is on the NCA-GENL exam

This is the highest-yield lesson in the module by objective coverage. The blueprint mentions RAG three times across its objectives [OFFICIAL], and this lesson serves:

  • 1.3 / 4.2 — Build LLM use cases such as retrieval-augmented generation (RAG), chatbots, and summarizers. The pipeline is the build.
  • 1.4 — Curate and embed content datasets for RAGs. Stages 1–3.
  • 1.6 / 4.3 — Familiarity with the capabilities of Python natural language packages (spaCy, NumPy, vector databases, etc.). Stage 4.
  • 1.8 — Select and use models to create text embeddings. Stage 3.
  • 1.9 — Use prompt engineering principles to create prompts to achieve desired results. Stages 8 and 9.
  • 4.4 — Identify system data, hardware, or software components required to meet user needs. The component inventory is this lesson's §1.
  • 4.1 / 1.1 — Assist in deployment and evaluation of model scalability, performance, and reliability. Two paths with different latency and cost profiles.
  • 4.5 — Monitor functioning of data collection, experiments, and other software processes. The silent-stage assertions.
  • 5.1 / 5.2 / 5.3 — Trustworthy AI. Citations serve Transparency; retrieval filtering serves Privacy and Safety and Security; grounding is a hallucination control [NVIDIA-DOC], and 13-01 covers the four named pillars.

Memorise NVIDIA's stated pipeline order [NVIDIA-DOC]: query → embedding model → vector match against indexed knowledge base → retrieve and decode → LLM synthesises and cites sources. Component-order questions are an explicit drill emphasis, and this sequence is the most likely thing to be asked about RAG.

Also memorise the product-to-stage map: NeMo Retriever for retrieval, NeMo Curator for curation, NeMo Guardrails for safety rails, the AI Blueprint for RAG as the reference workflow, NIM and Triton for serving [NVIDIA-DOC]. The [FIELD] calibration that NVIDIA-branded options tend to be keyed when two answers are technically defensible makes this map worth knowing cold; 12-13 and 13-02 go deeper.

Question phrasings you should recognise:

PhrasingTestingAnswer shape
"Place the RAG pipeline stages in order."the canonical sequencequery → embedding model → vector match against the index → retrieve and decode → synthesise and cite
"Which stage of a RAG pipeline runs offline?"the two pathsparse, chunk, embed, index
"A RAG answer is wrong. What should be checked first?"attributionwhether the correct chunk was retrieved — retrieval vs generation (07-10)
"Which NVIDIA product provides retrieval accuracy at scale?"the stack mapNeMo Retriever
"What is the NVIDIA AI Blueprint for RAG?"the stack mapa reference workflow for building a RAG application
"Which pipeline stages fail without producing an error?"silent stagesparsing, chunking, embedding
"Why does improving the reranker not fix a parsing failure?"chain not sumend-to-end quality is bounded by the worst stage
"What must be redone when the embedding model changes?"shared statere-embed and re-index the whole corpus
"Which stage adds provenance to a RAG answer?"citationsgeneration, using ids rendered during assembly
"Where is per-user access control enforced?"the boundaryinside the retrieval query (07-05)

Distractor families:

  • Stages out of order — most commonly retrieval before embedding the query, or reranking before retrieval.
  • NIM or Triton offered as a pipeline stage. They are how models are served (12-13).
  • "Fine-tuning is required to add new documents." No — RAG's whole value is that adding facts does not require retraining (11-08).
  • "RAG eliminates hallucination." It reduces it by grounding and makes it detectable via citations. It does not eliminate it (09-12, 07-11).
  • The embedding model conflated with the generator. Different models, different stages.
  • The vector database credited with embedding. It stores and searches; the embedding model encodes.
  • A four-box pipeline offered as complete. Parsing, reranking, and assembly are the omissions that matter.
  • "Improve the LLM to fix retrieval." Wrong stage.

One calibration note to carry as uncertainty: candidate reports converge on a heuristic that in scenario questions, when one option proposes building a RAG solution, it is usually the keyed answer [FIELD]. This is field calibration, not official NVIDIA guidance. Use it only as a tie-breaker on genuinely ambiguous items, and check the counter-cases first — no corpus to retrieve from, a need to change style or format rather than facts, and a hard latency floor. 07-12 is entirely about those counter-cases.

07

Common mistakes with the complete RAG pipeline

#SymptomCauseFix
1Quality is poor and nobody can say which stage is responsibleThe pipeline is conceived as four boxes, so six failure modes have no homeName all nine stages; instrument each boundary (07-10)
2Weeks spent improving retrieval; the parser was dropping every tableEffort was spent on the interesting stage, not the worst oneAssert on parse output first; silent early stages dominate
3Everything reports success and answers are still wrongThe three silent stages have no assertionsSelf-retrieval for embedding, length checks for parsing, boundary checks for chunking
4The system was fine, then degraded with no deployEmbedding endpoint updated its model behind a stable name; or the index went stalePin the model version as part of index identity (12-12)
5Vector database deployed for 8,000 chunks; retrieval quality never measuredInfrastructure adopted before measurementExact in-memory search plus an eval set (07-04, 01-08)
6Users see documents they cannot accessPermission filter absent, applied post-retrieval, or applied to only one legPre-filter inside every retrieval leg (07-05)
7Answers cite superseded documentsNo currency filter; superseded content indexedStatus metadata plus a pre-filter; ideally do not index superseded content (07-03)
8Answer quality varies run to run for the same questionThe answer-bearing chunk sits mid-context; or ANN traversal is non-deterministicEdge-load (07-08); check index recall (07-04, 09-11)
9A model upgrade was treated as a config change and broke retrievalEmbedding-model change requires re-embedding the corpusTreat it as a migration with a re-index and an eval re-run (12-12)
10Cost per query is far above forecastk was never revisited after prototypingCount assembled tokens; set k from a measured curve (07-08, 12-09)
11Nobody can reproduce a past resultCorpus snapshot and model version not recorded togetherRecord index identity: snapshot + model + version + settings
12Latency regressed after adding a rerankerPool size N set by default, not measurementSweep N against quality and pick the knee (07-07)
13Answers are fluent, confident, and unsupportedNo grounding instruction, no citations, no decline pathStage 9 is a designed stage, not a default (07-11)
14Four changes shipped together; the gain cannot be attributedNo isolationOne change at a time against a frozen eval set (03-04)

Mistakes 1, 2, and 3 are the same mistake at three levels of severity, and they share one root: the earliest stages are the silent ones, and the interesting stages are the late ones. Human attention flows to the reranker and the LLM; the failures live in the parser and the embedder. Instrumenting the boundary of every stage is what breaks that pattern, and it is the practice that separates a RAG system you can operate from one you can only hope about.

08

Which RAG pipeline stage is most often the bottleneck?

In practice, the earliest ones — and that is exactly why they get the least attention.

I am offering this as a reasoned ordering rather than a measured ranking; I have no sourced distribution of RAG failure causes to quote. The reasoning is structural and I think it holds:

StageWhy it is so often the bottleneck
1 ParseFails silently and totally. A table extracted as word salad cannot be retrieved by any retriever, ranked by any reranker, or cited by any model. Nothing downstream can recover it
2 ChunkAn answer split across a boundary is unretrievable as a unit; a 3,000-token chunk's vector is an average of eight topics and matches nothing specifically
3 EmbedThe prefix/pooling/version failure produces confident nonsense with no error, and is invisible without the self-retrieval assertion
8 AssembleThe cheapest fix in the pipeline and the most commonly left at its tutorial default — naive order, fixed k, no headers
9 GenerateMissing grounding instructions and citations turn a retrieval failure into a hallucination
6 RetrieveGenuinely often a problem, but visible: look at the candidate pool
7 RerankRarely the bottleneck because it is usually absent; adding it is often the largest single gain
4 IndexRarely the bottleneck, and frequently the stage teams optimise first
5 Query prepMatters mainly in multi-turn systems (12-11)

The pattern: the stages that fail silently and early dominate, and the stages that are fun to tune are usually fine. The corrective is mechanical rather than intuitive — instrument every boundary, assert the silent stages, and measure the eval set at each boundary rather than only end to end.

The single most valuable diagnostic remains the one 07-07 and 07-10 both point at: for a failing question, retrieve the top-50 and find where the correct chunk actually is.

Where it isBottleneckFix
Not in the corpus1 or 2parsing, chunking, curation (06-01, 06-02, 08-01)
In the corpus, absent from top-503, 4, or 6encoder convention, index recall, hybrid coverage
In the top-50 but below the cutoff7reranking
In the context but the answer is wrong8 or 9assembly order, grounding, citations

Four questions, ten minutes, and a stage name. That is the whole method, and 07-10 formalises it.

09

How do I evaluate a complete RAG pipeline rather than just its answers?

By measuring at stage boundaries, not only at the end. An end-to-end score tells you whether the system is good; boundary metrics tell you which stage to fix.

BoundaryMetricWhat it isolates
After 1 Parseextracted-length ratio vs source; known-value presencedid the text survive
After 2 Chunkmax/median chunk length; answer-sentence containmentare the units retrievable
After 3 Embedself-retrieval rank and similarityis the encoder convention consistent
After 4 Indexindex recall@k vs brute forceis approximation costing you (07-04)
After 6 Retrieverecall@N on the frozen eval setis the answer in the pool
After 7 RerankMRR, nDCG@k, recall@3is the answer at the top
After 8 Assembletoken count, chunk order, header presenceis the prompt well formed
After 9 Generatefaithfulness, answer relevance, citation accuracy (09-07)did the model use what it was given

Two metrics matter most, and they must be reported separately. Retrieval recall answers "was the evidence available?" Faithfulness answers "did the model use the evidence?" A system with high recall and low faithfulness has a generation problem. A system with low recall and high faithfulness is faithfully answering from bad evidence. Collapsing them into one score makes both diagnoses impossible — this is the decomposition 07-10 and 09-07 are built on.

Re-run the eval set at every stage change. The evalRerun discipline (01-08, 03-04) exists because a change that improves one stage can degrade another: shorter chunks improve retrieval precision and may split answers; a deeper reranker pool improves ordering and raises latency; a stricter currency filter improves accuracy and may cause empty results.

Two things beyond quality metrics.

Cost and latency are pipeline metrics too. Track tokens sent per query, embedding calls, reranker calls, and p95 end-to-end latency (12-09, 12-10). A quality gain that triples cost is a decision someone must make explicitly.

Put it in CI. A retrieval-recall threshold and a self-retrieval assertion that fail the build are worth more than a dashboard nobody reads (10-04). The week-5 deliverable of this course is exactly that: an eval set, four RAG metrics, and a CI gate that fails the build.

10

Where do NeMo Retriever and the NVIDIA AI Blueprint for RAG fit?

They sit at two different levels: NeMo Retriever is a component family for the retrieval stages, and the AI Blueprint for RAG is a reference workflow for the whole pipeline [NVIDIA-DOC].

NeMo RetrieverNVIDIA AI Blueprint for RAG
What it isNVIDIA's retrieval offering, aimed at retrieval accuracy at scaleA reference workflow for building a RAG application
Levelcomponent — stages 3, 4, 6, 7architecture — all nine stages
Answers"how do I get good retrieval?""what does a complete RAG system look like?"
Part ofthe NeMo familythe AI Blueprints family

The rest of the NeMo family maps onto the pipeline cleanly, and this mapping is worth memorising as a table because it is exactly the kind of tool-to-problem matching the exam rewards:

NVIDIA component [NVIDIA-DOC]Pipeline role
NeMo Curatordata curation and deduplication — stages 1–2
NeMo Retrieverembedding, indexing, retrieval, reranking — stages 3, 4, 6, 7
NeMo (platform)building, customising, and monitoring models
NeMo Guardrailstopical, safety, and security rails around stage 9
NIMpre-optimised inference microservices — how the embedder, reranker, and LLM are served
Triton Inference Serverserving many models with dynamic batching — same layer as NIM
TensorRT / TensorRT-LLMcompiling models for fast inference — beneath NIM
AI Blueprintsreference workflows, including the one for RAG
AI Enterprisethe governed platform these ship within

Two distinctions the exam cares about, both flagged as reported confusables:

NIM is packaged deployment, not a training tool [NVIDIA-DOC]. It is how a model becomes a stable, secure, low-latency API. It is not a pipeline stage and it does not train anything (12-13).

TensorRT and TensorRT-LLM are different products. TensorRT is a general-purpose inference compiler; TensorRT-LLM adds LLM-specific machinery — KV cache, paged attention, in-flight batching, speculative decoding (12-08, 12-05, 12-07). Both sit beneath serving, not inside the RAG pipeline's logic.

The value of the Blueprint framing for a course like this one: it is an explicit acknowledgement that RAG is a workflow with named stages rather than a library call. That is the same claim this lesson makes, and it is the claim that makes debugging possible.

Glossary recap: the terms this lesson introduced

TermDefinition
RAG pipelineThe nine-stage system that turns documents into an index and a question into a cited answer
Ingestion path (offline)Stages 1–4: parse, chunk, embed, index — runs on corpus change
Query path (online)Stages 5–9: query prep, retrieve, rerank, assemble, generate-and-cite — runs per request
NVIDIA's stated RAG pipelinequery → embedding model → vector match against indexed knowledge base → retrieve and decode → LLM synthesises and cites sources [NVIDIA-DOC]
Worst-stage propertyEnd-to-end quality is bounded by the pipeline's weakest stage; it is a chain, not a sum
Silent stageA stage whose failures produce no error — parsing, chunking, embedding
Self-retrieval assertionEmbedding a known chunk's own text as a query and requiring it back at rank 1 near 1.0
Index identityThe recorded triple of corpus snapshot, embedding-model version, and settings that makes a result reproducible
Stage boundary metricA measurement taken between two stages, enabling attribution rather than just scoring
AttributionDetermining which stage caused an observed failure — the purpose of the nine-stage decomposition
NeMo RetrieverNVIDIA's retrieval component family, for retrieval accuracy at scale [NVIDIA-DOC]
NVIDIA AI Blueprint for RAGNVIDIA's reference workflow for a complete RAG application [NVIDIA-DOC]
NeMo CuratorNVIDIA's data-curation tooling, serving the parse and chunk stages [NVIDIA-DOC]
NeMo GuardrailsRails keeping an LLM application accurate, appropriate, on-topic, and secure [NVIDIA-DOC]

Key takeaways on the complete RAG pipeline

  • Nine stages, two paths. Offline: parse, chunk, embed, index. Online: query prep, retrieve, rerank, assemble, generate-and-cite.
  • NVIDIA's stated query path, in order [NVIDIA-DOC]: query → embedding model → vector match against the indexed knowledge base → retrieve and decode → the LLM synthesises and cites sources. Memorise the sequence.
  • Quality equals the worst stage. A flawless reranker cannot repair a parser that dropped every table. Find the worst stage, not the interesting one.
  • Parsing, chunking, and embedding fail silently. They are also the earliest, so their failures get misattributed downstream. Assert on all three.
  • The worked example's headline result: the reranker promoted the chunk that actually answered the question from fused rank 4 to rank 1, and the assembled context was 3 chunks and 585 input tokens — not 50 chunks and 8,000.
  • The self-retrieval assertion is the single highest-value test in the pipeline. One embed, one search, catches nearly every encoder-consistency failure.
  • The embedding model is shared state between the two paths. Changing it invalidates the entire index and requires a full re-embed (12-12).
  • Build in a different order than you run: eval set, assertions on silent stages, BM25 baseline, dense, exact index, fuse, rerank, assemble, ground — infrastructure last.
  • Measure at stage boundaries, not only end to end. Retrieval recall and faithfulness must be reported separately or neither diagnosis is possible.
  • The NVIDIA map: NeMo Curator curates, NeMo Retriever retrieves, NeMo Guardrails guards, the AI Blueprint for RAG is the reference workflow, and NIM and Triton serve the models rather than being stages [NVIDIA-DOC].

Next: debugging RAG by separating retrieval failure from generation failure

You now have a nine-stage object and a set of boundary metrics. What you do not yet have is the procedure — the specific sequence of questions that turns "the answer was wrong" into "stage 7 is the problem" in under ten minutes. There is one question that resolves roughly half of all RAG debugging time on its own, and it must be asked before any other. Next: 07-10 names it — was the correct passage retrieved, or was it retrieved and misused? — and builds the full decision tree from that single split, because asking anything else first means you may spend a week improving a stage that was never at fault.