SSheLeads AI

Week 10 · Phase 2 Engineering & Tools

The Evaluation Lab

“It looks right” is not a metric. Week 10 turns your RAG pipeline into something you can score, compare, and defend — faithfulness, relevancy, precision, recall.

RAGAS metricsPrecision@k & RecallFaithfulnessFailure modes
W10 · 1

The four questions every RAG eval asks

Each RAGAS metric interrogates a different link in the chain — two judge the retriever, two judge the generator.

Context Precision

“Was what we fetched actually relevant?”

Of the retrieved chunks, how many were useful? Low = your prompt is full of noise. Judges the retriever.

Context Recall

“Did we fetch everything we needed?”

Of all relevant chunks in the corpus, how many did we find? Low = answers miss facts. Judges the retriever.

Faithfulness

“Is every claim grounded in the context?”

Claims in the answer supported by retrieved text ÷ total claims. Low = hallucination. Judges the generator.

Answer Relevancy

“Did we answer the question that was asked?”

A faithful, precise answer to the wrong question still fails the user. Judges the generator.

W10 · 2

Precision@k vs recall — the eternal trade-off

Our corpus has 10 documents; 4 are truly relevant (leaf icon) to the query. The retriever returns documents in its own ranked order. Drag k and watch the two metrics fight.

Precision@k
Recall@k

Your Week 8 acceptance bar was precision ≥ 0.7 — now you can see what hitting it costs in recall. Dashed red tiles are relevant documents your retriever missed at this k.

W10 · 3

The faithfulness check, by hand

This is literally what RAGAS automates: split the answer into claims, then hunt for each one in the retrieved context. Run it.

Retrieved context
Remote employees may work from home up to 3 days per week with manager approval. Wednesdays are anchor days when all teams work in-office. A home-office stipend of ₹15,000 is available once every 24 months.
Generated answer → 4 claims
You can WFH up to 3 days a week with approval.✓ SUPPORTED
Wednesdays are mandatory office days.✓ SUPPORTED
A ₹15,000 stipend exists for home-office setup.✓ SUPPORTED
The stipend renews every 12 months.✗ HALLUCINATED
W10 · 4

Reading the scores: failure modes → fixes

Low context precision → chunks too big, or top-k too high → shrink chunks, add a score threshold (Week 8's dials) Low context recall → embeddings miss synonyms, k too low → better embedding model, hybrid search (Week 14) Low faithfulness → model free-styling beyond context → tighten the grounding guardrail (Week 4's prompt) Low answer relevancy → question lost in a noisy prompt → restate the question after the context

Week 10 deliverable: an evaluation report with an improvement plan — score your pipeline, name the weakest metric, and prescribe the fix from this table.