Skip to content
Service status

Type to search

Advanced Course: Advanced Prompting · 2 min read

From prompt to context engineering

Six building blocks, context rot, and why more text doesn't always mean better answers.

Section 1: From prompt to context engineering

Section titled “Section 1: From prompt to context engineering”

Learning objectives

  • Explain what context engineering is and why it matters
  • Recognize six recurring building blocks in a well-structured prompt
  • Understand context rot and how to avoid unnecessary context

In the basics course you built clarity with WHAT–WHY–HOW–WHO–TONE. Now we zoom out: every time you choose background, examples, document excerpts, and rules you’re doing context engineering – consciously or not.

What is context engineering?

It’s about actively shaping the information the model sees: role, task, attachments, examples, format requirements, and clear delimiters – and how they interact.

The goal: the right information, at the right time, for every response generated.

Component Purpose Example
Behavior instruction Role, tone, overall behavior “You are an experienced HR specialist …”
Instruction The actual task “Summarize the deviations in three bullet points”
Context Background, documents, prior events “Attached meeting notes …”
Examples Shows desired format Input → Output pairs
Output constraints Format, length, structure “Max 100 words, bullet list”
Delimiters Separates sections Headings, XML-style tags, ---

You don’t need all six every time – but when the result disappoints: which piece is missing or unclear?

Context window and context rot

The context window tells you how much text the model can take in. It says nothing about how well the model uses that text — and the two do not track each other.

Context rot is the name for what happens as context grows: the more text sits in the window, the worse the model gets at finding and weighing the one detail the question was about. It is not a defect in the model but an effect of how it works. The model spreads its attention across everything it was given, so every irrelevant passage competes with the relevant ones. A model with a 200,000-token context window does not perform as well at token 190,000 as it does at token 2,000.

How to recognise it:

  • The answer conflates two similar documents, or two similar rules.
  • The model misses an instruction you did in fact give — usually one that appeared early, well before all the pasted material.
  • Answers get vaguer and more generic the longer the chat runs.
  • The same question against the same material gives a better answer in a fresh chat.

How to avoid it:

  • Paste the relevant paragraph, not the whole document “just to be safe”.
  • Start a new conversation when the topic changes, rather than extending a long thread.
  • Put the most important instructions last, closest to the question, when context is long.
  • Let RAG do the selecting for you when the material is large (more on that in section 5).

Without awareness: paste 30 pages of policy and ask about one detail.
With awareness: paste the relevant paragraph plus a clear task.

Pick a work task from yesterday. Write a prompt using at least three of the components in the table above. Afterwards, note: what did you leave out – and did you notice a difference from how you normally write?

  • Context engineering = curated context + structure.
  • Think in six building blocks when troubleshooting.
  • Quality beats quantity – avoid filling the window with irrelevant text.

Test your knowledge

Question 1 of 3

Question 1 of 3

What does context engineering mean?

What does context engineering mean?