Retrieval track  ·  Lessons 01 & 02

RAG, built in
front of you.

How to give a language model access to a hundred thousand documents without ever putting a hundred thousand documents in the prompt. Every number on screen is real output — nothing here is an illustration.

54
slides
5
interactive playgrounds
8
runnable demos
<$0.01
to build it yourself

Behind this: an embedding space. Every few seconds one point becomes a query and reaches for its nearest neighbours — which is all retrieval is.

Two edits

However much time you have

The same lesson, cut two ways. Same rigour, the same eight terminal demos, the same code — the short edit just carries fewer slides around them. Neither is a summary of the other; either works on its own.

Two ways in

Learn it, or teach it

The shape of the thing

A RAG system is two pipelines

Not one. People collapse them in their heads, and that is exactly where the mental model breaks. Ingestion runs once, ahead of time. Retrieval runs on every question.

Pipeline 01  ·  INGESTION  ·  runs once
Sourcedocuments
Chunkingcut to size
Embeddingmodel
Vectorslists of numbers
Vectordatabase
Pipeline 02  ·  RETRIEVAL  ·  runs per question
Userquestion
Embeddingmodel
Retrieverranks by closeness
Top chunksplain text
LLM writesthe answer

The same embedding model appears in both rows. That is not a drawing shortcut — and the last playground breaks it on purpose to show you why.

Move the sliders

Five things you can take apart

They run in your browser. No API key, no sign-up, no install. Two of them are driven by real precomputed OpenAI vectors.

Outcomes

What you will be able to do

  • Explain why a bigger context window does not remove the need for RAG.
  • Define token, chunk, embedding, dimension, vector database and retriever.
  • Draw both halves of a RAG system from memory.
  • Predict which chunks a retriever will return, and say why.
  • Build a working ingestion pipeline in about sixty lines of Python.
  • Avoid the mistake that silently breaks most first RAG builds.
Honesty

Where the numbers come from

Every terminal block in the lesson is pasted from a real run. Where reality disagreed with the source material, the lesson says so:

  • The tokenizer gives 7 tokens for a sentence the source calls 9.
  • This corpus yields 547 chunks, not 797 — article lengths differ.
  • Real embeddings put dog closest to cat, not kitten. The demo explains why.

The retrieval playground scores with character-trigram vectors so it runs with no key — the mechanism is identical, and the page says so rather than implying otherwise.

Work along

Build it on your own machine

The whole thing is a repo. One entry point, eight demos, and the finished sixty-line pipeline. Costs well under a cent in embeddings.

Get the source →

# clone it, then:
./run.sh setup     # venv, packages, documents
./run.sh check     # preflight, tests your API key
./run.sh slides    # this deck, locally

./run.sh demo 5    # chunking, in the terminal
./run.sh demo all  # all eight, in order