Command Palette

Search for a command to run...

Hectal
Phase 0Beginner1 of 14 in RAG and Vector Search

Start Here: What RAG Is and What You Will Build

What retrieval-augmented generation is, why models need it, when not to use it, your first real embeddings, and the product this course builds step by step.

This phase assumes you can write a few lines in one programming language and have a rough idea of what a large language model is (Hectal's LLM Engineering course, Phase 0, is enough). It explains retrieval-augmented generation (RAG) from the ground up: a model answers better when your program first finds the right pages and puts them in front of it, like an open-book exam.

You will build the smallest possible RAG by hand, watch it answer correctly, and then watch one reworded question break it. That failure is the reason for the rest of the course. You will also run a real embedding model in your own browser and see it find the passage that word matching missed.

This course is a build-along. One product, AskDocs, grows phase by phase: a service that answers questions from the handbook of a made-up bike-rental company, Lumen Bikes, with sources, and refuses when the handbook has no answer. Every phase teaches its ideas from first principles in Python, Java and JavaScript, then adds one step to the product, and ends with a playbook of recipes to reuse.

0/8 · 0%
8 topics ~3 h 12 code blocks & diagrams
Start with the first topic
1
0.1

What RAG Is

Retrieval-augmented generation (RAG) means your program first finds the passages that answer a question and then asks a language model to answer using those passages. It turns a closed-book exam into an open-book one.

21 min 1 code practice

2
0.2

Why Models Need Retrieval

A model's knowledge stops on its training date, never included your private data, cannot be updated quickly and comes without sources. Retrieval closes each of these gaps at question time.

20 min 1 code practice

3
0.3

RAG, a Long Prompt or Fine-Tuning

There are three ways to give a model knowledge it lacks: paste all of it into the prompt, retrieve only the relevant parts (RAG), or fine-tune the model. Each fits a different situation, and the choice is mostly arithmetic.

19 min 1 code practice

4
0.4

The Smallest RAG, Built by Hand

A complete RAG pipeline fits in forty lines: score passages by shared words, put the best one in a prompt, let the model answer and cite. It works, until a question uses different words from the document.

21 min 1 code practice

5
0.5

Your First Real Embeddings

An embedding model turns a text into a list of numbers so that texts with similar meaning get similar numbers. This topic runs a real one in your browser on the question that word matching got wrong, and explains how every example and lab in the course works.

27 min 3 code practice

6
0.6

The Product You Will Build

This course builds one product from start to finish: AskDocs, a service that answers questions from a company handbook, shows its sources and refuses when the handbook has no answer. Each phase adds one production-grade part.

20 min 1 code practice

7
0.7

Build: The Corpus and a First Answer

AskDocs version 0: the twelve-passage handbook as typed documents, a retrieve function behind a fixed interface, a prompt builder, a stand-in model and a refusal. It answers, cites, refuses, and still gets the login question wrong.

23 min 1 code practice

8
0.8

Playbook: Is RAG the Right Tool?

Two recipes to start any RAG project with: a decision function that says whether to paste, retrieve or fine-tune, and a baseline harness that measures how often your retriever finds the right passage. Plus where a real embedding call plugs in.

23 min 3 code practice

Practise this phase

Hands-on exercises: write the code, run it, and press Check to have it tested automatically.