Back to AI/ML Overview
🪟 Knowledge Site · Context for Agentic Software · Selection, Retrieval, Budget

Context EngineeringA model knows only what it can see now. Context engineering chooses what that is.

Every answer a model gives is computed from one finite block of text: the instructions, the documents, the tool results and the history that the application chose to put in front of it. This site starts from that block and climbs, one idea at a time, to retrieval, budgets, compaction, coding agents, isolation between agents, security and measurement, asking one question at each step: what did the model see, what was left out, and can we prove why?

🎯The problem

An underwriting decision could draw on 63 intake fields, twenty policy documents and thousands of past decisions. None of that fits, and most of it should not. The context that reaches the model has to be relevant, current and authorized, and someone has to be able to show afterwards what was left out and why.

🔑The question every page asks
What did the model see, what was left out, and can we prove why? Every chapter assembles, trims or isolates the context for the same synthetic insurance quote and keeps a manifest of each choice.

🗺️What is inside

The window and its signals

Tokens, messages and ordering; instructions against data against tool output; provenance and trust; the assembly pipeline from selection to packing.

Retrieval and

, , and ; , metadata, grounding, citations and freshness.

Budgets, compaction and coding agents

Token budgets and caching, compaction with information-loss tests, and repository instructions, diffs and tool output for coding agents.

Isolation, security and measurement

Scoped hand-offs between agents, context poisoning and tenant boundaries, and recall, utilization, grounding and ablation as measures.

🖱️How to read it

  • New to context engineering: read in order. Each chapter starts in plain English with one tiny example.
  • Experienced: jump to assembly, budgeting, compaction or the insurance lab. The rigorous part sits in folded blocks.
  • Eleven interactive labs, among them a token-budget allocator and a compaction loss detector, each with a plain table next to it.
  • The example is synthetic and its agent is a scripted stand-in. Results show how the mechanism works, not how good any model is.