AI MOOC
✦ Grow togetherInvite 3 friends, earn 1 month of membership · Up to 12 monthsInvite friends →

Library / My reading notes

Define the task before choosing a stack

Map the data flow and distinguish answerable, uncertain and out-of-scope questions.

Back to the RAG course plan: Build a searchable, cited RAG knowledge base

Chapter 1 / 8 · Read and take notes

Map the data flow and distinguish answerable, uncertain and out-of-scope questions.

Understand the method

Imagine maintaining a team document assistant. People repeatedly ask about lodging limits or broken computers. The goal is to locate current rules with evidence people can inspect. A useful answer needs relevant sources, the right audience, necessary conditions and traceable citations.

Do not start with a vector database. Separate ingestion—reading, cleaning, chunking and storing sources—from answering—filtering, retrieval, context assembly, generation and review. A different model cannot supply a missing policy. Locate failures in individual steps.

The lab has six current rules, one archived rule and 12 questions. These are original fictional materials for reproducible experiments. First inspect evidence manually, then run retrieval without a model, and finally connect a real local model if available. Each stage has its own observable output.

Download and extract the lab, then read README.txt. documents.json contains evidence, questions.json contains review cases, and rag_lab.py is the complete standard-library program. Keep these files together: data is resolved relative to the script.

Write boundaries for scope, missing conditions and archived sources. Require another person to reproduce retrieval from the same files. Model wording can vary, so also record the model name, original response and human judgment instead of a success screenshot alone.

Course lab files

Complete Python code, seven records, 12 cases and instructions. Extract and read README first. Retrieval requires no model account. The corpus is Chinese in both editions for reproducibility.

Download lab ZIP
  1. 1Scope
  2. 2Prepare
  3. 3Retrieve
  4. 4Generate

Included material

Lab folder: README.txt, documents.json, questions.json, rag_lab.py.
Check: python3 --version
Requires Python 3.10+. Install Python from its official documentation if the command is unavailable.

Work through the steps

  1. Extract the lab and check that all four files are together.
  2. Choose one answerable case and one insufficient-evidence case and predict behavior.
  3. Draw question → filter → retrieval → evidence → model → review; name each input and output.

Worked example

Question: What is the intern lodging cap?
Audience: intern. Needed rule: allowance.
P2 requires prior approval but specifies no cap.
Acceptable: explain the gap and cite P2.
Failure: reuse the permanent-staff cap from P1.

Your exercise

Write a one-page brief: users, corpus, three boundaries, and separate retrieval/generation deliverables. Revisit it at delivery.

Check before delivery

  • Identify the fictional corpus and the exact model-call stage.
  • Continue the retrieval track without a local model.
Finish the exercise, then view the reference

Retrieval delivers candidates, scores and a report. Generation adds real responses and human review. Without the latter, deliver a retrieval prototype rather than a deployed answering system.

An original course with teaching exercises. Reading records, practice outcomes and independent certification are distinct.

References and further reading

The lessons are original. The following sources are provided under their respective permissions.

Article / guide

Prompt Engineering Guide

DAIR.AI · en/zh

MIT

License checked. This entry links to the original; the book text is not mirrored.

License checked: 2026-10-16 · Pinned 57673726
Article / guide

RAG and Vector Databases

Microsoft · en/zh

MIT

License checked. This entry links to the original; the book text is not mirrored.

License checked: 2026-10-16 · Pinned d45da912
Whitepaper / report

NIST AI 600-1: Generative AI Profile

NIST / Autio et al. · en

NIST Technical Series reprint policy

Original PDF provided under the institution’s reprint policy.

License checked: 2026-10-16
Article / guide

Ollama Chat API

Ollama · en

Official documentation link; no full-text reproduction

Original link only; full text is not mirrored.

License checked: 2026-10-20