Lab 17: Building a RAG System in Practice
Objective
What is RAG and Why Does It Exist?
WITHOUT RAG:
User: "What were InnoZverse's Q3 2025 results?"
LLM: "InnoZverse's Q3 2025 results showed..." [HALLUCINATION]
WITH RAG:
User: "What were InnoZverse's Q3 2025 results?"
Step 1: Search knowledge base for "InnoZverse Q3 2025"
Step 2: Retrieve: actual_q3_report.pdf, pages 3-7
Step 3: "Based on the Q3 2025 report: revenue was £4.2M..." [GROUNDED]The RAG Architecture
Step 1: Document Ingestion and Chunking
Chunking Strategies by Document Type
Step 2: Embedding
Step 3: Vector Store
Step 4: Generation — The Full RAG Chain
Advanced RAG Patterns
Hybrid Search: Keyword + Semantic
Self-Query: AI Generates the Filter
Evaluating RAG Quality
Common RAG Failure Modes
Problem
Symptom
Fix
Further Reading
PreviousLab 16: AI Developer Toolkit — APIs, LangChain, Vector DatabasesNextLab 18: AI in Cybersecurity — Threat Detection and AI Attacks
Last updated
