Module 2 of 13
Prompting and context engineering
Write prompts and system prompts that hold up, give models the right context, answer from your own documents, get structured data out, and test it all before agents rely on it.
6 lessons · 52 min readingLab · about 120 minQuiz · 10 questions
What's in this module
- Lesson 1 · 10 minThe anatomy of a strong promptRole, task, context, examples, format, constraints and checks, with a weak and a strong version of the same brokerage task.
- Lesson 2 · 9 minSystem prompts and house styleWhere system prompts live, how to write brokerage voice and RECO advertising rules into one, and how to refuse helpfully.
- Lesson 3 · 8 minContext engineeringWhat to give the model and what to leave out, including personal information, plus ordering, summaries and a context budget.
- Lesson 4 · 9 minRetrieval: answering from your own documentsChunks, embeddings, search and citations in plain words, a brokerage policy-manual assistant, and when RAG beats fine-tuning.
- Lesson 5 · 8 minStructured outputsJSON and schemas in plain words, extracting fields from a fictional agreement summary, validation, and handling missing fields.
- Lesson 6 · 8 minEvals: testing prompts before you trust themTest sets, rubrics and pass/fail checks, human and model grading, and re-testing when prompts or models change.
- Lab · 120 minListing-description prompt and evalWrite a RECO-aware listing-description system prompt for a fictional brokerage, test it on ten fictional listings, improve it, and compare version 1 with version 2.
- QuizModule 2 quizTen scenario questions. Pass with 8 or more; retake as often as you like.
Template · Markdown
Prompt specification and eval sheet
A one-file specification, test set, rubric, results log and change log for any prompt a brokerage relies on, pre-filled with ten listing-description test cases.
Sources and further reading
- Prompting best practices · Anthropic
- Effective context engineering for AI agents · Anthropic
- Define success criteria and build evaluations · Anthropic
- Structured outputs · Anthropic
- Structured model outputs · OpenAI
- Evaluation best practices · OpenAI
- RECO Bulletin 5.1: Advertising requirements · Real Estate Council of Ontario
- RECO Bulletin 5.2: Permitted terms · Real Estate Council of Ontario
- RECO Bulletin 5.4: Advertising sold property · Real Estate Council of Ontario
- Trademark Protection & Competition · Canadian Real Estate Association
- Writing a fair rental housing ad (fact sheet) · Ontario Human Rights Commission
- Principles for responsible, trustworthy and privacy-protective generative AI technologies · Office of the Privacy Commissioner of Canada