← All weeks LLM Engineering / Week 06
Context Engineering Build a conversation context manager. Apply one context manager to long conversations, with budget, compaction, and constraint-retention fixtures.
// Put it into practice
A conversation context manager Download week06.py from a lesson's practice section. Follow its setup instructions before running it. Lesson 1: Build a token ledger and compare dropping old messages with preserving current constraints. Lesson 2: Answer a policy question from a small dated document set under a fixed token budget. Lesson 3: Compact a conversation containing a decision, a tentative option, and a revoked constraint. Run the supplied assertions and record actual results; a simulated contract check does not certify real model quality. Download week 6 Python lab ↓ Read the script’s setup instructions and run it on your own computer. The website does not execute code or verify your results.
// Independent work
W06-LAB
Week 6: A conversation context manager Apply one context manager to long conversations, with budget, compaction, and constraint-retention fixtures.
Extend the guided artifact rather than start a second project. Fresh-session tests preserve explicit decisions, uncertainty, revoked instructions, and source links.
What to produce A conversation context manager Setup commands, data or generation procedure, versions, and recorded outputs Acceptance results and a precise limitation Check your work Fresh-session tests preserve explicit decisions, uncertainty, revoked instructions, and source links. Each claimed execution is supported by actual saved output. Fixture results and real model results are identified separately. Setup and reproduction use the taught tools without private credentials. Self-assessment rubric
Technical correctness · 35 points Implementation or analysis follows the relevant technical mechanism and handles the stated case.
Evaluation and evidence · 30 points Reproducible tests, appropriate baseline, and accurate interpretation.
Engineering quality · 20 points Clear structure, safe boundaries, and usable reproduction instructions.
Explanation and reflection · 15 points Explains tradeoffs, limitations, and next experiment with evidence. // Retrieve before you reread
Week 6 knowledge check Try all 6 questions. Check your answers, review the explanations, and retry whenever you like. Answers are checked on this device.
Next: week 7 → What you’ll work toward
Allocate a context window while preserving instructions, evidence, and output space. Choose between complete documents, selected passages, and summaries for a task. Preserve facts, uncertainty, decisions, and revoked instructions through summarization. A week is a planning unit, not a deadline. Keep the pace that lets you explain and apply what you learn.
Back up your progress →