Lightning Lesson · 30 min

Context Engineering

The skill that beat prompts

Same request the whole session. We only change what the model can see.

Aki Wijesundara

Aki Wijesundara, PhD

Instructor · The AI Internship

One decision. Three levers. One dial.

We will approve or deny a refund without rewriting the request. Everything happens in Context Lab.

01

Name the window

Instructions, knowledge, and state

02

Fix without prompting

Add the right documents — then break it with clash

03

State is context too

Memory helps. Noise distracts.

04

Turn the dial

One toggle that proves context is measurable

Prompt engineering is column one

Context engineering is all three — plus a budget.

Instructions

How you word the task. Role, tone, rules, few-shots. Everyone's 2023 obsession.

Knowledge

What the model can look up. Docs, policies, records, retrieved facts.

State

What it remembers. History, memory, prior turns, scratch notes.

The job stopped being writing and became assembling.

Context LabRequest stays locked. Toggle what the model can see.
Request · locked

Should we approve a refund for order #48291? The customer says the item arrived defective.

Context budget0 / 3,200 tokens

Instructions

How you word it

Knowledge

What it can look up

State

What it remembers
Model answer

Press Run. Watch what changes when the request does not.

Context Lab · Shift + ← / → for slides

Zero characters changed in the request

You changed what the model could see.

Right context

Current policy + order + prior tickets → approve, cite the defective-item exception, note 44 days and two tickets.

Context clash

Add the 2024 archive and two documents disagree. Nothing says which wins. Dumping everything fails in production.

The fix

A conflict-resolution rule in Instructions. Clean answer again — and it names which policy it applied. Retrieval quality and conflict handling beat prompt polish.

The window is not memory. It is an attention budget.

State can help — or steal every token that mattered.

Company memory

A retention note shifts tone and explains why. No prompt change. No new document.

Context distraction

2,400 tokens of unrelated history. Answers get vague — or mimic the transcript instead of deciding.

Compact

Summarise old turns. Keep the last few verbatim.

Isolate

Give the decision its own clean sub-agent.

Offload

Write scratch state to a file. Read back only what's needed.

Once you have a dial, you can put a number on it

Context is not a text box. It is a system with inputs you can tune and measure.

Good configuration

Policy + order + tickets + conflict rule → strong, citable decision.

Weaker answer

The defect is no longer corroborated. Same prompt. Lower confidence.

Strong again — that number is an eval

Measure context quality the same way you measure any other system input.

Three rules for every AI decision

01

When the answer is wrong, ask what it could not see — before you ask how to reword it.

02

More context is not better context. Clash, staleness, and noise cost you accuracy.

03

Assemble on purpose: instructions, knowledge, state — each with a budget.

Next step

Tonight was one decision

The Agentic AI Builder's Bootcamp is building the systems that make these decisions all day — with evals to prove they work.

maven.com/tailabs/ai-builder

Aki Wijesundara

Aki Wijesundara, PhD · The AI Internship

Questions we hear every time

“Isn't this just RAG?”

RAG is one column — knowledge. Context engineering is the whole window: instructions, knowledge, and state, under a budget.

“Won't bigger context windows fix it?”

No. Distraction and clash get worse with more room, not better. Attention is still finite.

“How do I know my context is good?”

You measure it. That number is an eval — and that is the next skill to learn.