Single logo
  • Courses
  • Blog
  • About
Join free on SkoolJoin free on Skool
  1. Blog
  2. /
  3. Learning paths
  4. /
  5. Build and Measure a RAG System

Learning path · 9 posts

Build and Measure a RAG System

Who it is for
Developers who can call an LLM API and want answers grounded in their own documents.
What you will achieve
See why RAG exists, pick embedding models, chunk documents, store vectors in Chroma or pgvector, assemble cited prompts, add hybrid search and reranking, and measure retrieval with Recall@K, MRR and nDCG.
Prerequisites
Basic Python · Calling an LLM API
Start with step 1: Why RAG Exists

Curriculum

  1. 1
    Step 1: Why RAG Exists: The Problem It Solves, Compared With Pasting Everything and Fine-Tuning

    A smart model has never read your company's files, and they change every month. Three ways to give it the facts: paste everything, fine-tune, or retrieve only the right pieces. Follow a refund-policy question through all three and see why RAG wins when documents change.

  2. 2
    Step 2: Real Embedding Models: an Open Model or a Provider API, Then Search, Duplicates and Recommendations

    Swap a toy embedder for a model that learned. Two roads (all-MiniLM-L6-v2 on your machine, or OpenAI's API with your key), three sizes (384, 1,536 and 3,072 numbers), one rule, and three use cases built on the same rank function, with real scores.

  3. 3
    Step 3: Chunking Strategies for RAG: Fixed Size, Sentences or Headings, Measured on One Handbook

    Where you cut decides what search can find. Cut a 13-section employee handbook three ways in plain Python and count the damage: fixed size gives 12 chunks with 12 cut and 11 mixed, sentences give 0 cut but 9 mixed, and headings give 13 clean chunks that know their source.

  4. 4
    Step 4: Vector Databases Hands-On: The Same Search in Chroma and pgvector

    Store 12 help articles as vectors in two databases and ask both the same questions. Chroma is a folder on disk with where filters; pgvector is a table in the Postgres you already run. Same model, same answers, to the fourth decimal: 0.4259, 0.4494 and 0.8257.

  5. 5
    Step 5: The RAG Pipeline Explained: 7 Stages From Documents to a Cited Answer

    Ingest, chunk, embed, store, retrieve, rerank and generate, in one Python file. Follow one question through a 26-chunk employee handbook to an answer that cites its source.

  6. 6
    Step 6: RAG Prompt Assembly and Citations: Number the Blocks, Fit a Token Budget, Check Every Claim

    Hand the retrieved pieces to the model so every answer can be checked. Number each block, fit 471 tokens into a 330-token budget by dropping the weakest blocks, and run a checker that passes a good reply and finds three problems in a bad one: a wrong number, a block that doesn't exist and a sentence with no citation.

  7. 7
    Step 7: Hybrid Search: BM25 Plus Dense Embeddings, Merged With Reciprocal Rank Fusion

    One customer types an error code, another describes the problem. BM25 nails the code and misses the meaning; dense search does the opposite. Run both over 12 help articles, see why adding scores fails, and merge the ranks with Reciprocal Rank Fusion so all three test searches come out right.

  8. 8
    Step 8: Reranking With a Cross-Encoder: When the Second Pass Helps, and When It Doesn't

    A cross-encoder reads the question and each candidate together and re-orders them. On one question it lifts the right article from fourth to first. On 12 golden questions, first places go from 10 to 9. Here's why, what changes with a weaker first pass, and how many candidates are worth the milliseconds.

  9. 9
    Step 9: Retrieval Evals: Score the Retriever With Recall@K, MRR and nDCG Before Blaming the Model

    When a RAG answer is wrong, check the retriever first. Score two retrievers on 24 graded queries with Recall@5, MRR and nDCG@5: overall there's no clear winner (0.757 vs 0.819, 0.854 vs 0.826, 0.769 vs 0.782), but the paraphrase slice drops to about 0.5 for both, and one query scores zero everywhere.

Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.