Session 5 of 12
Session 05

Retrieval-Augmented Generation (RAG)

Grounding AI with real knowledge — embeddings, vector search, and citation-backed answers

⏱ 60 minutes Intermediate 📊 Presentation + Study Notes + Lab
What This Session Covers

Session Topics

Why RAG?

LLMs hallucinate when they don't know something. RAG replaces hallucination with retrieval — grounding answers in real, citable documents.

Embeddings

What embedding vectors are, how semantic similarity works, and why 'king - man + woman = queen' is more than a curiosity.

Semantic Search

Moving beyond keyword matching to meaning-based retrieval. Cosine similarity, nearest-neighbour search, and re-ranking.

Vector Databases

Pinecone, Weaviate, Chroma — how they store and search millions of embedding vectors at speed.

RAG Architecture

The complete retrieve-augment-generate pipeline: chunking, indexing, query embedding, retrieval, context assembly, and generation.

🧪 Lab Exercise

Build Your Resume RAG System

Build a functioning Retrieval-Augmented Generation system using your resume as the knowledge base. Answer questions about the resume with citations. Compare RAG vs non-RAG responses to see the power of grounding. This is what LinkedIn, Bing, and legal tech use.

Deliverable

Compare a resume against 3 job descriptions using embeddings, and present which job is the closest fit with evidence.

Key Takeaways

  • RAG is the single most impactful technique for reducing LLM hallucination
  • Embeddings convert meaning into geometry — similar meanings cluster together
  • Chunking strategy dramatically affects retrieval quality
  • RAG + structured output + prompt engineering = most enterprise AI stacks
← PreviousSession 4: Structured Outputs Next →Session 6: Fine-Tuning & Specialization