Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 1 of 5 · Concept · 15 min · revision 2

Scoping a Capstone You Can Evaluate

Scope a RAG capstone so that someone else can check it: a dated and licensed corpus, named users, out-of-scope behaviour, numeric success criteria on a versioned question set, and an inventory of every input that decides a reported number, sorted into exact, close and recorded.

Contentsand lesson path

What you will learn

  • Explain what makes an integrated RAG application reproducible by someone else.

Prerequisites: AI Evaluation, AI Security, App Deployment, Observability

01. Why it matters

Your capstone ends with a claim: this assistant answers questions about a set of documents, cites what it used, says so when the documents do not cover a question, and here are the numbers that show it. The claim is worth exactly as much as someone else can check. That is why the last milestone of Build a Grounded RAG Assistant is judged on two things: another person can reproduce the demo from the README alone, and two design trade-offs are explained with the evidence behind them.

Both are settled long before the README is written. Scope decides whether there is anything to measure: a chatbot for our docs has no pass mark, while finds the answer to these kinds of questions in this snapshot of these documents does. Inputs decide whether anyone else can measure it again: an embedding model that changed under its name, a question set edited after the report, or an index built by hand last month each turn your numbers into numbers nobody can get again, including you.

This lesson covers both. You write a scope with numeric success criteria, then list every input that decides a reported number and where each one is pinned. Lesson 2 reads a small reference repository that does this, lesson 3 turns the same evidence into design decisions, and lesson 4 tests it all with a dry run from a clean checkout.

02. A scope someone else can check

A scope that can be evaluated has five parts. Write them in docs/scope.md before you build anything else; they extend the requirements you write in milestone M1.

  1. A corpus snapshot. A named set of documents, copied on a known date, with the origin and licence of each source and a checksum for each file. A live wiki or a shared folder that keeps changing is not a corpus: your numbers would drift with it. The project asks for 20 to 100 documents, small enough to commit, or to fetch with a script that verifies the checksums.
  2. Users and their questions. Who asks, what kinds of questions they ask, and what a good answer contains: a direct answer, the sources it used, and an honest I could not find this when the documents do not say.
  3. Out of scope, with the intended behaviour. The kinds of questions the assistant must not answer from these documents, such as pricing, personal data or anything the corpus does not cover, and what it does instead. Each one becomes a test case whose right answer is an abstention.
  4. Success criteria as numbers on a named set. Each criterion names a metric, a threshold, a question set with its version, and a split. Good retrieval is not a criterion; recall@5 of at least 0.80 on the held-out split of eval set v1 is. Set the floors before you see any results, or every result will look like success.
  5. Known limitations, declared up front. What you deliberately left out: scanned PDFs, tables, follow-up questions, other languages. A limitation you write down is a decision; one a reviewer discovers is a defect.

Risk frameworks ask for the same things. The NIST AI Risk Management Framework opens its Map function with documenting the intended purpose and context of use (MAP 1.1), and its Measure function asks for test sets, metrics and tools to be documented (MEASURE 2.1). A scope file with numeric criteria is a small, concrete version of both.

Markdown · docs/scope.md (example)
# Scope

## Users
New engineers on a small team that runs Larkspur, looking up how it is installed,
configured and operated.

## Corpus
The Larkspur docs folder: 48 Markdown pages, snapshot of 2026-10-12, CC BY 4.0.
Origin and checksums: data/SOURCES.md, data/checksums.sha256.

## Out of scope (the assistant says it could not find the answer)
- pricing and licensing
- anything about a named customer or person
- versions before 3.0

## Success criteria (eval set v1, held-out split, fixed before building)
- retrieval: recall@5 of at least 0.80 on 15 answerable questions
- abstention: no answer to any of the 5 out-of-scope questions
- citations: every answer cites at least one retrieved passage
- latency and cost: p95 under 4 s, under 0.01 USD per question

## Known limitations
- English only; tables and code samples are indexed as plain text
- one question at a time, no follow-up questions

The example names its question counts, so a reader knows that one question moves held-out recall by almost 7 points, and a script could check every criterion. Scoping is mostly cutting: a narrow use case done in depth is easier to evaluate, and to get right, than a wide one.

03. What decides a number in your report

A number such as held-out recall@5 = 0.80 is the output of a long function. Reproducible means that a second person can supply the same inputs and get the same output without asking you anything. So list the inputs. In a RAG application they fall into seven groups:

  • Code: the Git commit the report was made from, with no uncommitted changes.
  • Environment: the Python version and the exact version of every package. pip freeze into requirements.txt, as milestone M2 does, pins everything installed. A lock file goes further: uv.lock, or a file from pip-compile --generate-hashes, also records a hash of every package file, so a changed upload fails the install instead of slipping in. pip can write the standard pylock.toml format with pip lock, which is still marked experimental.
  • Data: the snapshot, its sources and licences, and checksums that the build verifies.
  • Processing settings: parser, chunk size and overlap, embedding model and its revision, k, abstain threshold, reranker, prompt version, generation model ID and output token limit. Keep them in one configuration file that the code reads, not as constants scattered through modules.
  • Evaluation set: a version. Once you have reported on v1, any change goes into v2; Building a versioned evaluation set shows the routine.
  • Randomness: a recorded seed for anything sampled on purpose, such as a bootstrap or a split, and no accidental randomness. Lesson 2 demonstrates a source of it that catches many people.
  • External services: a hosted model or API whose behaviour you do not control. The next section deals with those.

Make every evaluation run write this list next to its numbers. Here is what that record could look like for a full-size version of the capstone:

JSON · eval/runs/v1-held-out.json (example)
{
  "code": {"commit": "<output of git rev-parse HEAD>", "uncommitted_changes": false},
  "environment": {"python": "3.12", "lock_file": "requirements.txt"},
  "data": {"snapshot": "data/raw", "files": 48, "checksums": "data/checksums.sha256"},
  "chunking": {"splitter": "markdown-headings", "max_tokens": 400, "overlap": 0},
  "embedding": {
    "model": "sentence-transformers/all-MiniLM-L6-v2",
    "revision": "1110a243fdf4706b3f48f1d95db1a4f5529b4d41"
  },
  "retrieval": {"k": 5, "min_score": 0.35, "reranker": null},
  "generation": {
    "model_from_env": "ANTHROPIC_MODEL",
    "model_reported_by_api": "claude-sonnet-5-5",
    "prompt_version": "answer-v3",
    "max_tokens": 400
  },
  "eval": {"set": "eval/queries-v1.csv", "split": "held_out", "questions": 20},
  "seeds": {"bootstrap": 7}
}

The embedding revision is there for a reason. A model name on the Hugging Face Hub names a Git repository whose main branch can move: the repository behind all-MiniLM-L6-v2 received a new commit in June 2026, years after the model was released. Whether or not a commit like that touches the weights, a name without a revision cannot tell a second person which files you used. Pass the commit hash as revision when you load the model, as the batch embedding lab does, and store it with the index.

04. Exact, close or recorded

Not every part of a RAG application can be repeated to the last byte, and a report that pretends otherwise loses trust the first time someone checks. Sort each part into one of three levels.

Exact. Loading, chunking, IDs, embedding with a pinned local model, retrieval and the metrics computed from it are deterministic code over pinned inputs. Aim for a byte-identical report: then running git diff on the regenerated report is the whole check, and any difference means an input changed. That takes care with small things: sorting file lists, breaking score ties by ID, and keeping timestamps and timings out of the compared file.

Close. A hosted model is outside your control. Anthropic, for example, fixes the weights behind each Claude model ID, but its documentation notes that changes to the serving infrastructure can still cause small differences in behaviour, and every model ID has a retirement date. Regenerated answers will differ in wording, and a metric computed from them lands near the reported value rather than on it. Say so in the report, and give the spread of at least two runs instead of a single number.

Recorded. Save the raw outputs of the evaluation run: for each question, the retrieved IDs, the prompt version, the model ID the API reports in its response, and the answer text. Commit them, or attach them to a release if they are large. The grading can then be repeated exactly from those records, even after the model is retired, and a reviewer can read the answer behind every score.

The project prepares for this: milestone M3 hides the model behind a generate(prompt) interface with a deterministic mock, so the pipeline and its tests run without an API key (one client for hosted, local and mock models shows the pattern). Read the real model ID from an environment variable, for example ANTHROPIC_MODEL=claude-sonnet-5-5, write the ID the API reports into the run record, and let the README say which numbers need a key.

05. Check your understanding

Practice check · 3 questions

Scope and inputs

Apply the ideas of this lesson to three new situations. Each question has one best answer.

Q1. Which of these success criteria could a reviewer check without asking you anything?
Q2. A teammate checks out your commit, verifies the data checksums, uses the same eval set version and installs the pinned packages, yet gets held-out recall@5 of 0.74 where your report says 0.80. Your config names the embedding model but no revision. What is the most likely cause?
Q3. Your answers come from a hosted model. Six months later a reviewer reruns your evaluation and the answer texts differ slightly. Which preparation still lets them regenerate your reported grounding score exactly?
Practice only: not graded, not saved, not evidence.

06. Apply it

Open your copy of the project (milestone M1 of Build a Grounded RAG Assistant) and write docs/scope.md with the five parts above. Then:

  1. Under Success criteria, write at least three numeric criteria, each naming its metric, threshold, eval set version and split. Write them now, before your M4 report exists.
  2. Add a section Inputs that lists, for each of the seven groups, what decides your numbers and which file pins it. Mark each entry exact, close or recorded.
  3. Mark the inputs that are not pinned yet. Typical first finds are an embedding model loaded without a revision, a model name hard-coded in a module, and an evaluation file edited in place. Fix one now and keep the list: lesson 4 turns it into a checklist.

07. Review prompt

Without looking back, answer in your own words:

  1. What are the five parts of a scope that someone else can evaluate, and why is a live wiki not a corpus?
  2. Name the seven groups of inputs that decide a reported number, with one example of each from your own project.
  3. Why does an embedding model name need a revision, and where do you record the model ID of a hosted model?
  4. Which parts of a RAG pipeline are exact, close or recorded, and what does each level let a reviewer check?

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

4 questions · about 5 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check