Building Real Systems.
Prompting that survives contact with reality, retrieval as memory, tool-calling agents, and the cost/latency/eval/safety bill that comes due in production.
Prompting, retrieval, agents — and the bill that comes due
The player screen is a live animation stage with real diagrams — prompts gain structure piece by piece, retrieval walks a real document into a real answer, an agent loops through think, act and observe, and the cost of every choice is drawn where you can see it. Karaoke subtitles in English, fullscreen.
That was the first 10 minutes.
The rest of this chapter — and chapters 2 to 5 — come with lifetime access.
Every idea in the chapter
Each concept the video builds — what it is, what it does, and where it lands in the story. Click any row to open its full breakdown. Filter to find any of them.
| Idea | Category | What it does | In one line | Lesson |
|---|
Building real systems, on one page
Everything Chapter 5 builds, as a reference you can scan: the prompt patterns that actually work, the RAG pipeline end to end, how agents act in the world, and the production triangle you will live inside.
| Pattern | Instead of… | Do this |
|---|---|---|
| 1 · Set a role | “summarize this report” | “You are a senior financial analyst. Summarize this for a busy executive, in three bullets.” |
| 2 · Provide context | “give me five marketing ideas” | “I am launching a budget meal kit for busy university students. Give me five marketing ideas.” |
| 3 · Use examples | describing the format | show 2–3 input/output pairs — few-shot. Showing beats telling. |
| 4 · Constrain | hoping for the right shape | “reply only with valid JSON, these exact fields” · “no more than 50 words” |
| 5 · Ask for reasoning | demanding the answer | “Let us think step by step.” — chain of thought |
| Phase | Step | What happens |
|---|---|---|
| Preparation once | 1 · collect | help articles, manuals, policies, records — everything it should know |
| 2 · chunk | chop into pieces of a few hundred words — you want the paragraph, not the 200-page manual | |
| 3 · embed | every chunk becomes a vector — a point in the space of meaning | |
| 4 · store | into a vector database, whose superpower is finding nearest points instantly | |
| Live every question | 1 · embed the question | now the question is a point in the same space |
| 2 · similarity search | find the chunks whose vectors sit closest — works with zero shared keywords | |
| 3 · augment | paste those chunks into the prompt: “answer using only the information below” | |
| 4 · generate | it reads from real source material instead of guessing from foggy memory |
Closed book → open book. A plain model must recall everything, and bluffs when memory fails. With RAG the relevant pages are open on the desk. Retrieval quality is everything — a disappointing answer is very often a retrieval failure wearing a disguise.
| Corner | The problem | The levers |
|---|---|---|
| Cost | tokens add up astonishingly fast — × 10,000 users a day and the bill is terrifying | cache aggressively · trim every wasted word · small models for simple tasks |
| Latency | 2 seconds feels snappy; 10 seconds feels broken and users walk away | streaming (same total time, feels alive) · pre-compute · move slow work off the critical path |
| Quality | language is fuzzy — there is no single correct answer to test against | a golden set of real questions + excellent answers · a strong model as judge, at scale |
| Safety | jailbreaks bypass your rules; prompt injection hides instructions in your own documents | filter inputs and outputs · firm system-prompt boundaries · never act dangerously without a check |
| Reliability | services go down, requests time out, rate limits hit | retries · graceful fallbacks · handle every error so the product bends instead of shattering |
You can usually optimize for two, rarely all three. And then there is the last ten percent — the long tail of strange edge cases no demo reveals. Handling that gracefully is not the easy part of the work. It is the work.
Filter by idea, category or lesson.
Chapter 5 · the one sentence: a better prompt gets a better answer, RAG turns a closed-book exam into an open-book one, agents let the model act through your tools, and production is a deliberate trade-off between cost, latency and quality — plus the long tail that is the real work.Building-real-systems check
Questions and answers reshuffle every load. 70%+ and the course is yours.