Frontend Labs
⋯

Chapter 4 — Our running example: the Help Desk problem

To keep everything concrete, we'll solve the same problem with each era's technology. You'll feel exactly why each generation replaced the last.

The problem

You work at a company with a 400-page internal handbook. Employees keep emailing HR the same questions: "How many holiday days do I get?", "What's the parental leave policy?", "Can I expense a monitor?"

Build something that answers these automatically.

How each era would attempt it

Era Approach What happens
Rules (Part 2) Write IF-THEN rules: IF question contains "holiday" AND "how many" THEN answer "25 days" Works for the exact phrasings you thought of. Fails on "how much annual leave do I have", "vacation allowance?", "PTO days". You end up writing hundreds of rules and still missing cases.
Classical ML (Part 3) Collect 500 past questions, label them by topic, train a classifier on word counts. Return a canned answer per topic. Handles rephrasing much better. But it can only pick from your pre-written answers, needs labelled data, and can't answer anything specific ("how many days do I have left?").
Word vectors (Part 5) Represent questions as vectors of meaning; match a question to the most similar handbook paragraph. Now "vacation" and "holiday" are close in vector space, so it matches without exact words. Big jump. But it doesn't understand sentences, just averages of words.
Transformers / BERT (Part 6) Encode whole questions and paragraphs in context; retrieve the right paragraph accurately. Retrieval gets very good. Still returns a paragraph, not an answer.
LLM (Part 8+) Retrieve the right paragraphs, then have the model read them and write an answer in natural language, with citations. This is a modern RAG system — and it's Project 3 in Part 11, which you will build.

Why this matters for your learning

Every chapter from here answers a piece of that table. When you reach Part 11, you will build the last row yourself. Keep the Help Desk problem in mind — when a concept feels abstract, ask: "how would this help answer 'how many holiday days do I get?'"

Practice (5 min, no code)

In notes.md, write down:

  1. Five different ways an employee might phrase the holiday-days question.
  2. For each, would a simple keyword rule (contains "holiday") catch it?
  3. One question that no pre-written answer could handle.

Keep this list. You'll test your systems against it in Parts 3, 5, and 11.

Further reading

  • Article: "What is RAG?" — the AWS or Pinecone explainer. Read it now for motivation; you'll understand every word by Part 11.
  • Video: IBM Technology, "What is Retrieval-Augmented Generation (RAG)?" (~7 min) — a good preview of where this guide is heading.

Generated from real-life-ai-example-v1.md · 8 Oct 2026 16:36