RAG & Agents Engineering

M19 lab, end-to-end RAG systems

Retrieval reads a sample. Some questions need every row.

Ten Larkspur Cloud server sizes, one Document per row, ranked by real all-MiniLM-L6-v2 cosine similarity. Move k and compare the best answer a reader could give from the rows above the magenta rule with the answer a routed query gives from all ten.

Question
Text embedded for each row
Rows the model reads
Best answer from those rows
Routed answer, all ten rows
Retrieval answer right

Rows ranked for this question

Cosine similarity, all-MiniLM-L6-v2

RankServer and the text embeddedScorePriceNeeded

Scores computed offline with sentence-transformers and checked against a LangChain FAISS index (same order for all eight question and text pairs). The context the model reads carries each row’s name and price from metadata, as in the lesson’s format_docs. “Best answer” is what a careful reader could compute from those rows; it is arithmetic, not a model output.

All four questions at this k

QuestionRouteFrom top-kRouted

The routed column assumes the router labels each question correctly, as the lesson’s router does for these four kinds.