Index

RAG Over Your Own Notes

RAG
RAG · Open board

The RAG board draws a question going out to a library before it reaches the model. This lesson builds it over your own notes and measures whether it works.

Before you start. A language model, the AI that writes the answer, only knows what is in the text you hand it. So you cut your notes into chunks of a few paragraphs each. You find the chunks that match the question. You paste them in with “answer only from these”. That recipe is retrieval-augmented generation, RAG, from RAG (Retrieval-Augmented Generation). That lesson found matches by embeddings, lists of numbers where texts about the same thing sit close together; this one uses a simpler word-matching score instead. The first search engines matched words too, as Context Engineering (what goes in the window, and who decides) told. An eval set is a list of questions with the right answer written beside each. A second model call can grade each reply against a written rule, as Evals for Apps (the test suite for a program that is a string) showed.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

The returns desk cuts its policy into pieces and hands the model the best few. How big should a piece be, and how many should go in?

Drag How many words in each piece from 5 to 200 and watch Answers that arrived whole climb while the tokens grow.

Open The chunk size →

Related paper

Review AI →

Saved in this browser, and to your account when you sign in.