17. RAG Foundations

Understand retrieval augmented generation and why grounding documents matter.

By Jacques Botte, founder of Toptronic®. Last updated 17 October 2026.

The lesson

RAG means the system retrieves relevant documents and supplies them to the model as context. This reduces guessing because the answer can be grounded in known material.

The quality of RAG depends on chunking, metadata, retrieval ranking, prompt design, and the model's ability to cite or use the retrieved text.

TPEE does not run a RAG server; it teaches you how to ask for grounded answers and how to prepare source material for another tool.

A junior support agent uses TPEE to answer product questions only from the supplied help-centre excerpts, and reports plainly when the excerpts do not cover the question.

A hospital policy officer builds a grounded prompt that answers staff questions only from the supplied infection-control documents, citing the section used.

A warehouse compliance lead grounds AI answers in the supplied storage and handling rules rather than letting the model rely on memory.

An insurance claims officer prepares policy wording excerpts as retrieval context so AI answers stay tied to the actual conditions.

A university librarian builds a grounded prompt that draws only from catalogue records and borrowing policy excerpts.

A municipal officer grounds AI answers about permit steps in the supplied procedure documents and flags anything the documents do not cover.

A manufacturing quality lead supplies the plant own work instructions as retrieval context so AI answers about batch release stay grounded.

A legal knowledge manager prepares clause excerpts so AI answers about contract terms quote the supplied text only.

A veterinary practice nurse grounds AI answers about aftercare in the supplied clinic protocols and says when the documents are silent.

An aged care educator builds a grounded prompt from the organisation own training material so answers cite the supplied pages.

Check yourself

Question 1: What is RAG?
  1. Random answer generation
  2. A GPU connector
  3. A file menu
  4. Retrieval augmented generation using documents as context — correct

Answer: Retrieval augmented generation using documents as context

RAG retrieves relevant material and gives it to the model.

Question 2: What affects RAG quality?
  1. Only monitor type
  2. Only keyboard layout
  3. Chunking, metadata, retrieval ranking, prompt design, and citation behavior — correct
  4. Only font size

Answer: Chunking, metadata, retrieval ranking, prompt design, and citation behavior

RAG systems depend on retrieval and how the model uses retrieved text.

Question 3: What does TPEE do about RAG?
  1. Starts MCP servers
  2. Teaches grounded prompting and preparation, but does not run a RAG server — correct
  3. Runs a vector database
  4. Uploads documents automatically

Answer: Teaches grounded prompting and preparation, but does not run a RAG server

TPEE remains local and educational.

← Previous lesson · All 134 lessons · Next lesson →

The full course — 134 lessons and 405 quiz questions — ships inside the app. Get TPEE to study it offline.

This lesson is the written summary of a course that ships inside the TPEE prompt editor for Windows - fifteen sections, a 0-100 score before you send anything, and it works with no network connection. The three one-time prices, and a 14-day free trial.

If you would rather not read another lesson: the prompt builder shows the fifteen sections being filled, the tool page says what the program does and does not do, and the free score marks a prompt you paste in - nothing installed.

Do this lesson in TPEE. The editor scores the prompt you write for it, 0 to 100, before you send it to a model, and it keeps the prompt on your own disk - no account and no network connection. This lesson is Professional level with 3 questions to check yourself against. The same lesson, and the whole course, ships inside the app.

Start the 14-day free trial Score a prompt here first, nothing to install