CourseAI System Design: The Complete Course · Module 6: Retrieval Architecture · part 44 of 107
Part 44 · Module 6: Retrieval Architecture

Lab: Permissioned retrieval, from Intake's store to cited answers

149 min read·
Module 6 · Lab · About 60 minutes · Needs: lessons 1 to 3 of this module, and the Module 5 lab (or nothing: Step 1 rebuilds Modules 1 to 5)

What you are building

CODE TOUR One question, a cited Answer Intake's store 456 checked retrieve.py Retriever.search answer.py floor, port model via port retrieval_eval.py every change test_retrieve.py pins the behaviour ADR-003 and Module 6's part of design step 5
The lab's piece: Intake's checked documents (grey) feed the retriever and the answer path (blue); the model (amber) sits behind the port; the evaluation and tests (green) check every change.

Leila wants one retriever that does what the three lessons taught, reading the documents Intake already checked. This lab puts the lessons' 14 files into the repository unchanged and adds the four guide 03 names for this module: northdesk/retrieve.py, the retriever; northdesk/answer.py, Ask's answer path with its refusal; evals/retrieval_eval.py, recall and leaks on every golden question; and tests/test_retrieve.py. docs/adr/ADR-003-retrieval-pipeline.md records the decision.

One cell calls your provider through Module 4's port; every number quoted comes from a scripted stand-in or no model.

Open a new Colab notebook, call it module-06-lab.ipynb, and run each cell in order.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan