Module 3 of 7

Retrieval (RAG)

Ground models in your own data with embeddings, chunking and search.

~40 min5 lessons2 interactive labs7 Python exercises5 questions5 quizzes1 code walkthroughs1 click challenges
Start module

What you'll learn

  1. 1

    Embeddings & Similarity

    Turn meaning into numbers so you can search by meaning, not just keywords.

    • Meaning as coordinates
    • Explore an embedding space
    • Implement cosine similarity
    • Reading scores

    Take-home template: Semantic Search in 40 Lines

  2. 2

    Chunking Documents

    Split documents into retrievable pieces, without cutting the meaning apart.

    • Why split documents?
    • Tune chunk size and overlap
    • Implement chunking with overlap
    • Chunk size trade-offs

    Take-home template: Recursive Text Chunker

  3. 3

    Building a RAG Pipeline

    Connect indexing, retrieval and generation into one working system.

    • Two phases
    • Watch: a whole RAG system in 30 lines
    • The query-time flow
    • Retrieve the top-k chunks
    • Build the grounded prompt
    • Find the hallucination guard

    Take-home template: Production RAG on Supabase pgvector

  4. 4

    Hybrid Search & Reranking

    Combine keyword and vector search, then rerank for precision.

    • Vectors aren't enough on their own
    • Implement Reciprocal Rank Fusion
    • Which search wins?
    • Measuring retrieval

    Take-home template: Hybrid Search: BM25 + Vectors + RRF

  5. 5

    Evaluating RAG: Recall, MRR & Faithfulness

    Measure retrieval and generation separately, so you know exactly what to fix.

    • Two halves, two scorecards
    • Recall@k
    • Mean Reciprocal Rank
    • Retrieval or generation?
    • Diagnose it

    Take-home template: RAG Retrieval Eval Script