RAG & Agents Engineering

M10 lab, the RAG lifecycle

Top-k sets how much the model reads.

Twelve Larkspur Cloud handbook chunks, indexed with real TF-IDF as in lesson 10.2. Pick a question and move k: the chunks above the magenta rule are what the LLM receives. A chunk that scores zero stays out at any k.

Golden question

Recall@k
Precision@k
Context sent, about this many tokens
All evidence retrieved

Ranking for this question

Cosine similarity, TF-IDF

RankChunkScoreGolden setText

Rows at 0.000 share no term with the query. A real index returns them in arbitrary order, so the lab never counts them as found. Tokens use the four-characters-per-token rule of thumb.

The baseline row at this k

Golden questionRecall@kPrecision@k
Mean

This is the row the M10 lab asks you to record. Every later module (better chunks, embeddings, hybrid search, reranking) reports its change against a row like this one, on the same questions.