본문으로 건너뛰기

Level 9 project

Evidence-Backed RAG

Start from the canonical project files, validate the result, and keep the evidence you need to explain what you built.

There is no upload or grading service. Run the documented validator or checks where applicable, keep the results, and score your own evidence against the rubric below. A passing check by itself does not mean the project is complete. Suggested strong-evidence target: 16/20. Critical-criterion rule: A 16/20 total is not sufficient if any criterion the rubric marks as critical scores zero.

Launch lesson: RAG System Integration Workshop

Prerequisite project: Adapt a Small LLM

Prerequisites

Python help for this project:

Complete Level 9 through RAG System Integration Workshop. The cumulative project dependency is Adapt a Small LLM.

Goal

Build a retrieval-augmented workflow whose evidence path is inspectable:

source snapshot
→ chunk/source identity
→ eligibility filter
→ retrieval ranking
→ supplied evidence
→ grounded output
→ citation/provenance validation
→ retrieval + answer evaluation
→ release decision

Task

  1. token_overlap
  2. eligible_source_ids
  3. retrieve
  4. validate_grounded_output
  5. validate_run

Stuck on a TODO?

Choose one function at a time. Hint 1 offers direction, hint 2 offers pseudocode, and hint 3 reveals only that function's reference implementation after confirmation.

rag.py: token_overlap()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

rag.py: eligible_source_ids()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

rag.py: retrieve()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

rag.py: validate_grounded_output()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

rag.py: validate_run()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

Validation

Run these commands from the downloaded Project folder or the public materials repository root.

python projects/tests/l09/validate_submission.py \
projects/starters/l09/rag.py \
path/to/your/rag-run.json

Compare with a reference

First complete your own TODOs and run the submission validator above. Then open the published reference solution. Reference acceptance tests check the completed reference, not your submission:

python projects/tests/l09/test_reference.py

Rubric

Score each criterion from 0–4. A submission should score at least 16/20 overall and must not score 0 on access/provenance or evaluation.

Criterion4 — Strong evidence3 — Meets2 — Partial1 — Weak0 — Missing
Corpus/chunk/index lineageSource snapshot, chunker, embedding/retrieval identity, updates, and IDs are traceable and reproducibleClear lineage with minor gapsCore IDs exist but version/update evidence is incompleteMostly an unversioned document dumpNo trustworthy corpus/index identity
Retrieval and rerankingCandidate retrieval, exact/semantic trade-offs, cutoff, reranking, and failure slices are measured under fixed casesReproducible retrieval with minor gapsRetrieval works but diagnostics or slices are shallowOnly a few anecdotal queriesNo coherent retrieval system
Access and provenanceEligibility is enforced before ranking; supplied sources are authorized; supported answers cite supplied evidenceCorrect boundaries with minor gapsSome provenance checks but one important boundary is missingPrompt wording is the main security controlUnauthorized/unsupplied evidence can be accepted
RAG evaluation and failure analysisRetrieval metrics + grounded-answer metrics + abstention + earliest-boundary debug trace are all presentComplete evaluation with minor gapsFinal-answer evaluation present but retrieval diagnosis weakCherry-picked answer samples onlyNo fixed evaluation
Reproducibility and communicationCorpus/retriever/reranker/prompt/generator/evaluator identities, commands, limitations, and optional live-path differences are explicitReproducible package with small omissionsSeveral artifact versions or limitations missingMostly screenshots/output dumpsNo reproducible package

Objective checks

The reduced validator checks:

  • tenant/active eligibility filtering before ranking;
  • deterministic retrieval over eligible sources;
  • grounded-output provenance;
  • supplied-source subset relationships;
  • recall@2 and grounded-answer accuracy recomputation;
  • unauthorized-exposure count;
  • release-rule recomputation;
  • intentional cross-tenant failure rejection.

Judgment questions

Ask yourself, and locate a trace or measurement for each answer:

  • Do chunks preserve the evidence the task requires? If not, show the lost span and revise the chunking choice.
  • Do lexical, vector, or hybrid choices match the actual query types? If not, compare a failure slice.
  • Does reranking improve the intended slices, not just aggregate scores? If not, inspect per-slice metrics.
  • Does each citation substantiate its claim? If not, correct or abstain from the claim.
  • Are freshness and deletion behavior recorded? If not, document the update boundary.
  • Did you locate the earliest failed boundary? If not, trace authorization → retrieval → ranking → generation.

Assessment guardrail

A live vector database or model API is optional for repository acceptance. If provided, it extends the evidence but does not replace deterministic provenance, authorization, and evaluation checks.

Self-check before you call it done

  • Can you trace corpus versions, chunk/index IDs, retrieval/reranking settings, and freshness/deletion behavior?
  • Can you prove tenant/active filtering happened before ranking and that each cited claim uses an authorized, supplied source?
  • Can you reproduce recall@2, grounded-answer accuracy, abstention, unauthorized-exposure count, and the release decision?
  • Can you reproduce the cross-tenant failure and diagnose the earliest failed boundary with a focused remedy?

← Back to all projects