Look up first, then think.
Teaching order (important): Do NOT open with Embedding, Vector DB, or Similarity Search. Students will be lost.
Start with three problems every user feels. Then show why AI must plug in external memory. Technical details come last.
Matches course-present-rag.html slide deck.
Three questions — problem-driven, not definition-driven
LLMs predict plausible next tokens. They are not fact-checkers.
Internal PDFs, wikis, CRM exports, and policies were never in pretraining data.
Every model has a training cutoff. Weights freeze at train time.
RAG = give the LLM an external knowledge system.
In class, say: "Look up first, then think." — not the academic translation "retrieval-augmented generation."
You are not defining RAG — you are explaining why AI must have external memory
It is the core of an Agent Memory System
| Memory type | Role | Typical implementation |
|---|---|---|
| Short-term memory | Current conversation, recent turns | Context window (128K tokens) |
| Long-term memory | Retrievable knowledge at query time | Vector database (RAG index) |
| Episodic memory | What happened in past sessions / tasks | Session logs, task history store |
| Semantic memory | Stable facts about domain / user | Curated knowledge base, user profile |
LLM + Memory + RAG + Agent — connected in one picture
Pretraining teaches knowledge.
RAG teaches retrieval.
Agents teach action.
RAG essence: Look up first, then think.
Introduce mechanics only after students understand the problem
| Phase | When | Plain English |
|---|---|---|
| Offline | Before launch; on doc update | Build the library (index documents once) |
| Online | Every user question | Look up relevant passages, then LLM thinks |
FAISS / ChromaDB / Milvus / Pinecone / pgvector
System: Answer using ONLY the context below. Cite [doc_id]. Context: [chunk_42] EU refunds allowed within 14 days... User: What is our EU refund policy?
Embedding maps text to vectors. Similar meaning → nearby vectors → retrieval finds the right passage.
| Phase | Metrics |
|---|---|
| Offline | Recall@k, chunk quality, index build latency |
| Online | Faithfulness, citation hit rate, end-to-end latency |
Advanced retrieval (BM25, hybrid, rerank, eval): Retrieval Engineering course.
Full depth in Retrieval Engineering course
| Method | When to use |
|---|---|
| BM25 | Keywords, SKUs, exact terms |
| Dense semantic | Paraphrase, conceptual match |
| Hybrid + RRF | Production default |
| Cross-encoder rerank | Top-50 → Top-5 precision |
Metrics: Recall@k, MRR, NDCG, faithfulness, citation accuracy.