Mirage Academy · Course · Advanced · Retrieval

Production-Ready RAG Engineering course: cited, measured answers

Production-Ready RAG Engineering is an advanced course for software engineers and technical product people who ship AI features. You build a searchable knowledge application that grounds its answers, cites its sources and is measured. The course is taught in English.

Open the courseNew to RAG? Read the RAG course guide

The course loop

One loop runs through the course: documents in, search, answer, measure

Watch the intro video first, then follow the loop that the chapters hang on. The video loads when you click it.

Intro video
Still from the intro video for the course Production-Ready RAG Engineering
Intro video, 1 min 7 s. Transcript below.
Read the transcript

This course is for engineers who must answer questions from their own documents. You build a searchable knowledge application that grounds every answer, cites its sources, and is measured. The course follows one loop. You bring documents in, clean them and chunk them. You search with vectors, keywords and hybrid queries, then rerank. You generate answers that cite their sources. Then you measure quality, and what you measure tells you what to fix next. A demo stops at one good answer. Production needs more. You keep the index fresh as documents change, you enforce who may see what, and you control cost and latency at scale. The course ends with a capstone: a cited knowledge assistant you build, measure and can defend. If you need answers from documents that people can check, start with chapter one.

  1. Documents in
  2. Search
  3. Answer with sources
  4. Measure

Around the loop in productionFreshnessAccess controlCost and latency

  1. 01

    Documents in

    You load documents, clean the text and cut it into chunks that keep a pointer back to where they came from.

  2. 02

    Search

    You search with vectors, with keywords and with a mix of both, then rerank what comes back.

  3. 03

    Answer with sources

    The assistant answers from the retrieved passages and names the passage behind each claim.

  4. 04

    Measure

    You score retrieval and answers against a test set, and the numbers show what to fix next.

The course loop as a dotted ring: documents in, search, answer with sources, measure, with freshness, access control and cost around it.
  • Chapter one lays the base: retrieval, grounding and citations, the stages of a RAG pipeline, the ways it fails and a first measurable baseline.
  • In production an assistant also has to stay fresh, respect who may see what and stay affordable. Chapters eight and nine cover that.

Chapters 2 and 3

A document becomes chunks, and each chunk becomes a vector you can index

Search quality starts before any query runs. How you split the text decides what can be found at all.

One documentExample drawing

Chunk 1anchorChunk 2anchorChunk 3anchor

Overlap: text shared by neighboring chunks

One vector per chunk

IndexHNSWIVFFlat

  1. 01

    Load and clean

    Document records, loaders and text cleaning come first, because each later step sees only what this one lets through.

  2. 02

    Chunk with anchors

    You compare chunking strategies, weigh size against overlap and keep metadata so a citation can point back to its place.

  3. 03

    Embed and index

    You learn what an embedding is, store vectors with pgvector and build HNSW and IVFFlat indexes, then measure approximate recall and storage.

A document cut into three overlapping chunks, each with an anchor, turned into one vector per chunk and indexed with HNSW or IVFFlat.

Chapter 6

Answers cite the passages they came from, and each citation is checked

The chapter covers how the prompt is built, how sources are labeled and how a citation is verified.

Draft answerExampleQuestionCan an opened item be returned?
  • An opened item can be returned if its seal is intact. [1]Citation matches its passage
  • The refund goes back to the original payment method. [2]Citation matches its passage
  • Delivery is free for large orders. No passage found, held back
Retrieved passages
  1. [1] Returns policyOpened items may be returned when the seal is intact.
  2. [2] Refund policyRefunds are issued to the original payment method.

In this example a sentence without a source does not reach the reader.

  1. 01

    Prompt assembly and budgets

    Prompt assembly, and the budgets that retrieved passages and instructions share.

  2. 02

    Citation formats

    Citation formats for labeling sources.

  3. 03

    Verifying citations

    Checking a citation after the model has written it.

  4. 04

    Abstention and conflicts

    Abstention when no passage supports an answer, and conflicts between passages.

  5. 05

    Context order

    The order of the passages in the prompt.

An example answer: two sentences carry a citation that matches a retrieved passage, one sentence has no source and is held back.

Chapter 7

Quality is measured before it is claimed: retrieval, answers and a regression gate

You change one thing, run the test set and see what moved.

Test setRun the systemRetrievalRetrieval metricsnDCGAnswersAnswer metricsJudgeHuman reviewRegression gatePass: ship the changeBlock: it got worse
  1. 01

    Retrieval metrics

    Scoring what the search returns, including nDCG.

  2. 02

    Answer metrics

    Metrics for the generated answers, not only for the search behind them.

  3. 03

    Judges and humans

    When a model judge scores an answer and when a person does.

  4. 04

    Noise and regression gates

    Telling a real change from noise, and regression gates.

From a test set to a regression gate: run the system, score retrieval and answers, then pass or block the change.

Chapters 8 and 9

Three constraints decide whether it holds up in production: fresh data, access control and cost

Chapter 8 covers freshness, updates and access control. Chapter 9 covers cost, latency and scale.

Fresh dataOld version, replacedCurrent versionAccess controlReader AReader B

Visible to this readerHidden from this reader

Cost and latencyTokensLatencyIndex size

Example drawing, no real figures

  1. 01

    Fresh data

    Change detection, transactional updates, and versions with effective dates.

  2. 02

    Access control

    Access control in retrieval, with leak tests and row-level security.

  3. 03

    Cost, latency and scale

    Where tokens and money go, latency budgets, storage and index sizing, caching and batching, and scale decisions.

Three constraints as three small drawings: a replaced version next to the current one, two readers who see different passages, and the budgets that cost and latency set.

Chapter 10

The capstone is a cited knowledge assistant, built in five parts and ending in a release report

The last chapter puts the whole loop together.

  1. Specification and frozen test set

    frozen

    You specify the assistant and freeze the test set it will be judged on.

  2. Ingest and index

    You load, clean, chunk and index your documents.

  3. Retrieval

    You build the search and the reranking step.

  4. Answers and verification

    You generate answers with citations and verify those citations.

  5. Triage and release report

    release report

    You work through what the measurements show and write up the release.

The full chapter list is on the course page:Open the course: Production-Ready RAG Engineering

The capstone as a dotted path of five parts, from the frozen test set at the start to the release report at the end.

How you learn here

An AI coach asks about your decisions, and the course comes with a certificate

AI coach
You explain your choices to the coach by voice. It is an AI, and it asks follow-up questions where your explanation is thin.
Certificate
The course comes with a certificate once you meet the rules. It carries a check code, and anyone who has the code can open the public check page, which says whether the code is genuine and names no one.
Limits
According to the Get certified page, the certificate is not a state-recognized qualification, and the coach does not decide whether you receive it.
Three rows on learning here: the AI coach, the certificate and what the certificate is not.

All rules for the certificate →

Where to go next

Read the RAG guide first, then pair this course with its neighbors

These four pages sit closest to this course.

  • RAG course guide

    • Topic page

    A guide to what RAG is and where this course fits.

  • Data Engineering for AI Applications

    • Course

    Build an ingestion, transformation and retrieval pipeline that keeps AI applications fed with good data.

  • Hallucination Detection & Factuality Engineering

    • Course

    Find, measure and reduce unsupported claims in AI output with controls at all levels.

  • Context Engineering

    • Course

    Give AI the right information at the right time, including retrieval on PostgreSQL.

The RAG course guide, the sibling course on data pipelines and two neighboring courses in the LLM engineering family.

RAG course guide →Data Engineering for AI Applications course →Hallucination Detection course →Context Engineering course →

Questions about the Production-Ready RAG Engineering course

  • What is the Production-Ready RAG Engineering course?

    An advanced course in which you build a searchable knowledge application that grounds its answers, cites its sources and is measured. It has ten chapters and ends with a capstone.

  • What does the RAG capstone leave me with?

    A cited knowledge assistant. You write the specification and a frozen test set, ingest and index documents, build retrieval, generate and verify answers, and finish with a triage and a release report.

  • How is this different from the RAG course guide?

    The RAG course guide explains what RAG is and when you do not need it. This page is about the full course, Production-Ready RAG Engineering, with its ten chapters and its capstone.

  • Which search methods does the course cover?

    Vector search with pgvector, keyword and full-text search in Postgres, hybrid search with reciprocal rank fusion and reranking, plus query rewriting, multi-query, HyDE and decomposition.

  • How do answers get their sources?

    You learn citation formats and how to verify a citation after the model has written it. You also learn how an assistant abstains when no passage supports an answer.

  • How is quality measured?

    With retrieval metrics including nDCG, answer metrics, judges and human review, and with regression gates that separate real changes from noise.

  • Is a certificate included with the RAG course?

    Yes. The certificate has a check code, and a public check page lets anyone look it up. Per the Get certified page, no state recognizes it as a qualification.

  • How does the coach work with my retrieval design?

    In a voice session you explain what you learned, and the coach, which is an AI, asks again where an explanation is unclear. Whether you receive the certificate is not up to the coach.