When (and When Not) to Retrieve
What language models actually know, where they hallucinate, and the engineering decision that defines every RAG system.
- Explain the difference between parametric knowledge and externally grounded knowledge
- Identify the query categories where retrieval adds value — and where it adds only cost
- Set up a professional local development environment: Ollama, uv, git
- Empirically map a model's knowledge boundaries
Open the full Week 1 study material → Complete lesson: concepts in depth, the full lab with all code, and troubleshooting.
Concepts
1. Parametric knowledge and its limits
Everything a model 'knows' is compressed into its weights during training. That compression is lossy: frequent facts survive; rare ones blur. The model has no flag for 'I never learned this' — which is why it confabulates fluently.
2. The context window as a budget
Whatever the model didn't memorize must arrive through the prompt. The context window is finite, and quality degrades as it fills. Context engineering is the discipline of spending that budget well.
3. The retrieval decision
Retrieval earns its cost on: private data, fresh data, long-tail facts, and auditable citations. It wastes cost on: stable general knowledge, reasoning tasks, and creative work. Production systems route between these cases.
4. Alternatives to RAG
Long-context stuffing, fine-tuning, and tool calls each solve part of the problem. You will be able to argue when each beats retrieval — a question every system design interview and every architecture review asks.
Lab — live session
- Install Ollama, pull
llama3.1:8bandnomic-embed-text - Create the course repo with
uv; first commit - Write
hello_llm.py— your first programmatic call to a local model - Probe the model's knowledge boundaries across query categories
- Choose your capstone corpus (20+ documents in a domain you can judge)
Working local environment, committed repo, and a one-page retrieval-decision memo for your capstone domain.
Reading
Watch
Reflection — bring answers to the next session
- Which model failure surprised you most, and why?
- If you could fix only one failure category with retrieval, which delivers most value to your capstone users?
- When the model didn't know, did it refuse or confabulate? Why does that difference matter in production?
Challenge 1: Catch Your Model Lying — Before trusting retrieval to fix hallucination, you need to see hallucination — systematically, in your own model, with your own eyes.