LESSON 07 · MODEL INPUT

Context Engineering

The model should not see everything the system knows. Build the smallest, freshest, most decision-relevant context for the current step.

TIME35–45 min
LEVELEngineering
LABContext assembly
ARTIFACTContext Assembly Policy

Context is a runtime product, not a prompt dump.

Good context engineering decides what to retrieve, what to summarize, what to exclude, how to represent uncertainty, and which authoritative facts must be refreshed before each decision.

D→V RULE

Every context item should earn its place. Include it because it changes the current decision, constrains action, or supplies evidence—not because it exists.

LAYER 01

Stable instructions

Role, goal, policy boundaries, tool contracts, response format, and non-negotiable stop conditions.

LAYER 02

Current state

Fresh case facts, unresolved questions, approval state, budgets, recent tool results, and loop position.

LAYER 03

Retrieved evidence

Only policies, prior cases, and source records relevant to the immediate decision.

01Determine decision
02Refresh authoritative state
03Retrieve relevant evidence
04Compress + label uncertainty
05Assemble bounded context
INTERACTIVE LAB · BUILD THE CONTEXT

What should the model see now?

The current decision is whether to recommend a recovery route. Select only information useful and authorized for that decision.

Current bounded goal
Defines the decision.
12
Fresh shipment state
Authoritative current evidence.
18
Relevant SLA rule
Constrains the decision.
15
Current recovery option
Directly relevant candidate action.
22
Authority rule
Prevents unauthorized execution.
20
Prior case narrative
Potentially useful, but may anchor incorrectly.
35
Entire policy manual
Mostly irrelevant.
40
Unrelated employee data
Outside need-to-know.
25
ASSEMBLED CONTEXT

87 / 120 budget units

Focused context.

LESSON ARTIFACT

Write the Context Assembly Policy.

Specify how the runtime builds model input at each step rather than relying on one static prompt template.

D→V · DESIGN RECORD

Context Assembly Policy

NEXT · LESSON 08

Planning and Decomposition

Coming next: decide when the agent should plan, when it should act directly, and how to prevent plans from becoming stale.

Back to track →