Benchmarking, Exam, and Interview Readiness
Evaluate a context-engineered on-call assistant against a naive prompt using fair benchmarks for token usage, cache hits, retrieval quality, and citation accuracy. Learn to validate results with a real model, choose meaningful metrics, answer the final exam, and defend design decisions in system design interviews.
We'll cover the following...
The on-call assistant is now built. It has a fixed prefix with tool masking, filtered hybrid retrieval with edge ordering and quote checks, a sandboxed runner, five workers over a shared state with verification, and a memory guarded by provenance, namespaces, versions, and expiry. That’s a lot more code than one prompt.
So any reviewer will ask the obvious question: is it actually better than putting everything into one big prompt? And if it is, by how much, and how do you know? In this lesson, we’ll write the project’s last file, evals.py, and run a fair side-by-side benchmark on the four numbers we named in Lesson 8.1. Then we’ll finish the course with a final exam and practice for system design interviews.
Build the naive baseline
A benchmark needs a control: the thing the project replaced. The naive version is what a team builds first. It puts every document and the team memory into one system prompt, sends all six tools, and asks the question. It has no retrieval filters, no stubs, and no rule about what goes before or after the cache breakpoint.
The engineered version is the project: the fixed 1,063-token prefix, with memory and filtered, edge-ordered retrieval after the breakpoint. It applies the Select move from Chapter 1 on every call.
To compare answers without a model, both arms use the fixed-rule drafter from Lesson 7.3, which quotes the two documents it trusts most. In the naive arm, those are the two best search matches, since a model reading the whole prompt would lean on them. In the engineered arm, they’re the two notes loaded in full at the edges.
Here’s how the two arms compare.
Here’s the evals file.
In the code above:
Lines 14–15: We find the retired notes, the ones the freshness and authority filters would drop: superseded runbooks and unapproved drafts. ...