Agent lesson 03 · Construct the working set
Shared teaching scenario · fictional product data
Research three laptops under €900, verify current evidence, and write laptop-comparison.md. Do not purchase anything or contact a vendor.
01 · Smallest useful mechanism
At every turn, the runtime assembles instructions, user intent, relevant history, tool descriptions, retrieved evidence, and current state. Selection and compression are engineering decisions. Omitting a decisive fact can make the model fail; including untrusted or stale material without provenance can make it fail confidently.
The harness decides what evidence enters each model call, in what order, under which authority, and within which budget.
02 · Experiment
Deterministic browser simulation
The construct the working set experiment uses inspectable, repeatable teaching data. It does not claim to be a live agent trajectory.
03 · Production-minded practice
Use your own stack or a contained mock environment. Do not point failure drills at real accounts, people, or irreversible services.
Build a context manifest that labels each segment by source, authority, freshness, token cost, and reason for inclusion.
Add an expired price and a retailer sentence that tells the agent to ignore the budget and buy immediately.
The packet refreshes or excludes stale evidence, keeps retailer text at data authority, and restores the user’s budget and no-purchase constraint on the next turn.
Your learning artifact
Stored only in this browser. No account required; course reset does not delete it.
04 · Check your understanding
Next: Context is temporary. The next lesson separates instructions, run state, durable memory, and external sources of truth.
166 used · 4 free
Included in the next call
System instructionsrequired
Role, behavior, stop conditions, and non-negotiable rules.
Current user goalrequired
The task the next model call must advance.
Tool definitions
Names, descriptions, and JSON schemas for available actions.
Recent conversation
The latest turns, including unresolved decisions.
Persistent project memory
Curated facts and handoff artifacts from earlier sessions.
Across turns
Choose an operation and inspect what the next inference can reuse, what must be serialized again, and what survives outside the model.
Input
260
teaching tokens
Cached prefix
190
teaching tokens
Summary
0
teaching tokens
Prompt cache
The stable prefix matches; only the appended turn needs fresh processing.
Model context
The earlier conversation is still supplied together with the new message.
External persistence
Nothing became long-term memory merely because another turn was sent.
Cache is reused computation, not remembered knowledge. A session can be restored after its inference cache is cold, and a warm cache does not make information durable.
Research basis: OpenAI’s Codex agent loop, Claude Code prompt caching, and long-running agent harnesses.