Skip to content
Valery

Module 2 · Lesson 3 of 6

Context engineering

What to give the model and what to leave out, including personal information, plus ordering, summaries and a context budget.

8 min

A good prompt tells the model how to work. Context is what it knows while it works: the facts, documents, records and tool results sitting in its context window when it answers. Anthropic describes context engineering as curating the smallest set of high-signal tokens that gets the job done. In a brokerage, that means deciding, for each workflow, exactly which facts go in, which stay out, in what order, and how long histories get boiled down.

This matters for three reasons you met in Module 1: models answer from what's on the desk, long and cluttered contexts get worse answers, and every token costs money. It matters for a fourth reason too: much of what sits in a brokerage's systems is personal information that has no business being sent to a model.

Key term
Context engineering

Choosing, trimming, ordering and refreshing the information a model sees for each request, so it has what it needs and nothing it doesn't.

What to give the model

Think in five kinds of context:

KindWhat it isBrokerage example
Structured factsShort, labelled fieldsA listing fact sheet: beds, baths, size, features, consent status
DocumentsThe relevant parts of longer textsThe leasing and pet rules from a condo's rules, not the whole package
RecordsSelected fields from a systemFrom the CRM: lead source, property asked about, last contact date
Tool resultsAnswers fetched during the taskA calendar lookup showing two open showing slots
SituationFacts the model can't knowToday's date, the agent's name and title, the province

The last row trips people up. A model doesn't know today's date, your time zone, or which province you're in unless you say so. A follow-up that says "see you this weekend" on a Friday afternoon reads very differently on a Monday.

Structured facts beat prose. "Bedrooms: 3. Parking: one space, rear lane" is harder to misread than a paragraph of agent notes with the same information buried in it.

What to leave out

Leaving things out is half the skill.

  • Personal information the task doesn't need. A reply to a web lead about 123 Example Street needs the lead's first name and question. It doesn't need their phone number, their pre-approval amount, notes about their divorce, or their ID details from the FINTRAC record.
  • Old versions. Last year's policy manual next to this year's invites the model to blend them.
  • Contradictions. Two fact sheets for the same listing with different square footage will produce one of the two numbers, unpredictably.
  • Noise. Email signatures, legal disclaimers, forwarded chains and tracking links all cost tokens and distract.
  • Everything "just in case". Context that isn't needed isn't neutral. Anthropic calls the decline in recall as contexts grow "context rot", and every extra page makes the important line harder to find.

Personal information: send only what the task needs

Canada's federal privacy law (PIPEDA) sets out fair information principles, including limiting the collection of personal information to what is needed for the purposes the organization identified, and using it only for those purposes. Canada's privacy commissioners, in their joint principles for generative AI, stress appropriate purposes, necessity and proportionality, and openness about how information is used. Trimming context is one of the simplest ways to follow that. Quebec, Alberta and British Columbia have their own private-sector laws; Module 11 covers them. This is general information, not legal advice; check with your broker of record or a lawyer.

Ordering and labelling

Where things sit in the context changes how well the model uses them.

  1. Stable material first. System prompt and house rules at the top. They rarely change, and keeping them first also lets vendors' prompt caching (Module 1, Lesson 6) reuse them across requests.
  2. Reference material next. Fact sheets, document extracts and records.
  3. The question or task last. Anthropic's prompting guide says that placing long documents above the question can improve response quality by up to 30% in its tests, especially with several documents.
  4. Label every block. Wrap each source in a named tag, such as <listing> or <crm_record>, and add a source line and date where it helps: "Source: status certificate, received October 14, 2026."

Labels also let you write precise instructions: "Answer only from <rules>. If <rules> doesn't cover the question, say so."

Summaries and compaction

Long-running work, such as a transaction that spans six weeks of emails, can't fit in every request, and shouldn't. Instead, keep a short, structured summary and refresh it.

A deal summary that replaces 40 emails of history
<deal_summary updated="2026-10-20">
Property: 88 Example Boulevard, Unit 1207, Mississauga (fictional)
Stage: conditional; financing condition expires Oct 28, 6 p.m.
Status certificate: received Oct 14; lawyer reviewing; special
assessment of $4,500 due Jan 15, 2027 flagged to buyer.
Open items: home inspection report (buyer's agent to send);
deposit receipt (brokerage trust account, confirmed Oct 16).
Next step: agent call with buyers Oct 23.
</deal_summary>

A person or the model can update the summary after each milestone; a person should check it. This is the same idea vendors call compaction: when a conversation gets long, summarize it and carry the summary forward instead of the whole transcript. The risk is that a summary drops a detail that matters later, so keep the originals in the deal file and pull them back in when a question needs them.

A context budget

For a workflow that runs hundreds of times, write down what goes in and roughly how many tokens each part uses. Here is an illustrative budget for a lead-reply draft:

PartApproximate tokens
System prompt and house rules800
Today's date, agent name and title, province30
Listing facts for the property asked about300
The lead's message150
CRM summary: source, prior contact, stated timeline120
Room for the reply250
Totalabout 1,650

The budget does two jobs. It keeps cost predictable (Module 1, Lesson 6), and it forces the question "why is this here?" for every part.

In practice

Maple & Main Realty's first lead-reply workflow pasted the whole CRM contact record into every request. Replies were slow, sometimes mentioned things the lead never said to the agent (a note from another agent's call), and once referred to the lead's "upcoming move after the separation", which came from a private note. The operations lead redesigned the context:

Lead reply with curated context
  1. 1. TriggerWeb lead arrives
  2. 2. ToolCRM lookup returns selected fields
  3. 3. DataListing facts for the property asked about
  4. 4. CheckStrip notes, phone, email, finances
  5. 5. AIDraft reply from labelled blocks
  6. 6. HumanAgent reviews and sends

Now each request carries the lead's first name, their message, the listing fact sheet, three CRM fields and today's date, in labelled blocks with the lead's message last. Replies got faster, cheaper and more relevant, and private notes never leave the CRM.

Common mistakes

  • Pasting entire CRM records, email threads or document packages "for context".
  • Forgetting the model doesn't know today's date or your province.
  • Mixing old and new versions of a policy or fact sheet.
  • Putting the question at the top of a long prompt.
  • Trusting a running summary without keeping the originals.

Key takeaways

  • Context is what the model knows while it answers; curate it per workflow.
  • Prefer short structured facts, relevant extracts and selected record fields over whole documents.
  • Leave out personal information the task doesn't need, old versions, contradictions and noise.
  • Stable material first, reference next, question last; label every block.
  • Keep long histories as checked summaries, and keep a context budget for repeated workflows.

Finished reading? Move on when you're ready.