Lab: Retrieval, a budgeted context and memory
Module 7 · Lab · About 75 minutes · Needs: lessons 1 to 4 of this module, and the Module 1, 2 and 6 labs (or the cells in Step 1)
What you are building
It is Friday 17 July 2026, the end of week 7. This week's retrieval, token budgets and memory live in notebook cells; this lab moves them into three files that Module 8's agent will import. supportdesk/kb_search.py holds KBSearch and a search_help_centre tool with Module 6's fixed name and contract, now backed by real retrieval. supportdesk/context.py holds the builder, its report, the history policy and one function that assembles a draft request. supportdesk/memory.py holds the store with slots, provenance, scope and the customer's controls. You finish by drafting Ana Duarte's T-1041 from all three. Two cells call the hosted model.