RAG for Everyone

← Back to interview questions

Chapter 2 Project90-120 min build

Build a Traceable RAG Execution Pipeline

This project implements the lifecycle as a small, inspectable Python system. It includes document metadata, access checks, retrieval scoring, reranking, context assembly, answer/refusal/escalation behavior, traces, and golden evals.

Project strengthThis is no longer a tiny demo. The reference solution includes role-based access control, approved/draft source filtering, lexical scoring, reranking, context limits, answered/refused/escalated outcomes, citation checks, trace diagnostics, and three golden evals.

1 Implement lifecycle stages

Classify intent, build retrieval query, apply filters, score candidates, rerank, assemble context, answer or refuse, and emit a trace.

2 Add production controls

Include role-aware access checks, source status, context limits, citation rules, and escalation behavior.

3 Add golden evals

Test one answered case, one refusal case, and one escalation case. Report pass/fail results.

4 Extend one retrieval strategy

Add keyword weighting, hybrid-style scoring, multi-query expansion, or reranking logic.

← Interview QuestionsAll Chapters →