How to build a minimal evaluation pipeline
Five parts — sample set, batch run, graders, records and comparison — enough for one afternoon, extend only when it pays off.
What this guide covers
A minimal evaluation pipeline is one repeatable channel for comparison. Its output is not a score; it is the basis for saying whether this change beat the last one. This guide builds five parts only: sample set, batch run, graders, records and comparison. Get it running first; talk about a platform later.
Who this is for
- You have a working agent or prompt, edited several times, and cannot say whether it improved.
- Your team argues "I think this version is better" and needs one record everyone reads.
- Production is already producing failure samples you can harvest.
- There is no budget for an annotation platform and no appetite for a full observability stack.
Not applicable: the task has no judgeable output (open-ended brainstorming). Redefine the task before building a pipeline for it.
Prerequisites
- A repeatable entry point: the same input twice must not take a randomly different path.
- At least 20 real samples (an example threshold — raise it for harder tasks).
- Each sample states what counts as passing; if you cannot write that, drop the sample.
- Somewhere to record every run: files, a spreadsheet, or experiment records in a platform.
- A written statement of what is not tested, so results are not over-read.
Five parts
| Part | Minimal form | When to replace it |
|---|---|---|
| Sample set | One file with input, expected condition, source tag | When you need slices by audience or scenario |
| Batch run | A loop with fixed parameters and seed | When one run exceeds ten minutes or you need concurrency |
| Graders | Rules before models | When subjective quality must be judged |
| Records | One result line per output | When two versions must be compared |
| Comparison | Two tables side by side | When the delta starts driving release decisions |
The ordering of graders deserves its own note. Anything equality, containment, regex or a JSON field can decide should not be asked of a model. The promptfoo documentation groups assertions into those types and adds similarity and model-graded checks. For model graders, pin the prompt and the output format, or the same samples drift between runs.
The LangSmith documentation splits evaluation by when it runs: curated datasets during development, live scoring of real production interactions. Official text: "Run evaluations on curated datasets during development."
Six steps
- Collect samples: half from recent failures, half from typical successes.
- Write graders: one rule grader per sample first; mark what truly resists rules as "needs a human".
- Fix the run: pin model, version, parameters and tool permissions, and store them with the run metadata.
- Measure a baseline: run the current version once so later numbers have a reference.
- Change one variable at a time, otherwise the delta has no attribution.
- Review disagreements: read the mismatching samples by hand and decide whether the grader or the application is wrong.
Step 4 is the one people skip. Without a baseline the later numbers have nothing to compare against. Keep traces: a correct final answer that took extra steps or called the wrong tool costs differently. The OpenAI Agents SDK tracing documentation states that traces capture LLM generations, tool calls and agent runs.
Worked example: fixing a grader
The figures and the scenario are illustrative — invented assumptions, not measured results for any product.
- Input: 18 samples of "answer the customer from the contract clause", each requiring one clause number to appear.
- Processing: one run uses the same model and the same retrieval configuration; two graders — a rule checking whether the required clause number appears, and a model judging whether the explanation matches the clause.
- Judging the result (example): the rule passes 15 of 18, the model passes 11 of 18. The gap is not the application but the grader: the rule only sees the number, so a right number with a wrong explanation passes.
- What to do after a failure: Add a forbidden-phrasing condition to the rule, and have a human review the 3 disagreeing samples; two of them trace back to a vague model-grader prompt — rewrite the criterion and rerun the same set.
- Records: baseline 15 of 18, after the change 17 of 18, both annotated with sample-set version and grader version.
A pass-rate delta is comparable only when the sample set and the graders stay fixed. The MLflow documentation also warns that its classic and generative evaluation interfaces are separate systems. Official text: "These two systems are not interoperable."
Acceptance
- [ ] Rerunning on another machine or at another time gives differences you can explain
- [ ] Every sample has both a pass condition and a fail condition written down
- [ ] Run records include model version, parameters, tool permissions and sample-set version
- [ ] The graders themselves have human-reviewed samples, so you know how they fail
- [ ] You can rerun only the failing subset with one command
Troubleshooting branches
- Scores swing up and down: check unpinned versions or parameters first, then whether a grader prompt was quietly edited.
- Everything passes or everything fails: the grader is probably wrong — read one sample's output by hand.
- The run errors halfway (401 / 403): credentials or permissions differ between environments; do not file this as a quality problem.
- Batch requests hit rate limits (429): lower concurrency, add backoff, and record retry counts in the run metadata.
- Retrieval scores look broken: inspect whether the recalled passages match before tuning generation — that order saves time.
- Cited answers are hard to judge: match each claim to its evidence, and have the grader check the mapping rather than the presence of a link.
- JSON parses but fields are missing: parsing is not schema validation; grade against the schema.
- Too few samples: do not pad with near-duplicate phrasings; harvest real production failures into the set instead.
Next steps
- Wire this pipeline into the release check so a failing run blocks the release (see the matching guide).
- Keep a human spot-check log for the graders and align it with human conclusions periodically.
- Once live traffic runs, add continuous scoring on real interactions instead of relying only on the offline set.
- When explaining capability to outsiders, publish the sample-set version together with the graders.
What was verified and what is not
On 2026-11-06 five official sources were fetched directly: the LangSmith evaluation page, the promptfoo intro and assertion pages, the MLflow evaluation page, and the OpenAI Agents SDK tracing page. This guide only reports the parts, categories and limits those pages state; no evaluation product was executed.
Unknowns:
- Batch runtime and concurrency ceilings at your data volume — the official pages give no comparable measurement basis.
- Agreement rate between model graders and human judgement for a specific task — this needs your own review samples.
- Migration cost between MLflow's two evaluation interfaces in the version you run — that release note was not checked.
Sources
| Source | URL |
|---|---|
| LangSmith official documentation · Evaluation (direct fetch 200 on 2026-11-06) | https://docs.langchain.com/langsmith/evaluation |
| promptfoo official documentation · Intro (direct fetch 200 on 2026-11-06) | https://www.promptfoo.dev/docs/intro/ |
| promptfoo official documentation · assertion and expected-output types (direct fetch 200 on 2026-11-06) | https://www.promptfoo.dev/docs/configuration/expected-outputs/ |
| MLflow official documentation · evaluation, covering the classic and generative interfaces (direct fetch 200 on 2026-11-06) | https://mlflow.org/docs/latest/ml/evaluation/ |
| OpenAI Agents SDK official documentation · Tracing (direct fetch 200 on 2026-11-06) | https://openai.github.io/openai-agents-python/tracing/ |
Source snapshot: 2026-11-06; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.
This page appears in: Research with AI