A retry loop needs a bound.
The lesson 28.3 graph on five Larkspur Cloud golden questions: a topic check, top-2 retrieval, a grade for each chunk, and a rewrite when every chunk fails. Set how many rewrites the router allows, and read what each question costs.
- Path taken
- LLM calls
- Retrievals
- Rewrites used
What the graph did
TF-IDF cosine, top 2
| Step | Query or chunk | Score | Grade |
|---|
The golden set at this setting
| Golden question | Path | Retrievals | LLM calls |
|---|---|---|---|
This is the log the M28 lab brief asks for: how often each path fires on the golden set, and what it costs.
What is real here
Retrieval is real: TF-IDF with scikit-learn’s defaults over the twelve M10 handbook chunks, top 2 as in notebook 03a. The routing and the call counts follow 03a: one call for the topic check, one grader call per chunk, one per rewrite, one to generate; the handlers are fixed text. Three parts are stand-ins. The grader passes a chunk only if the golden set lists it as the answer, the topic check reads the golden label, and the rewrites are hand-written in the style the 03a optimiser prompt asks for. A real LLM grader and rewriter make mistakes these do not.