Skip to content

Plain-language explainer

Context engineering, explained

What is context engineering, and how is it different from prompt engineering?

Context engineering is deciding everything the model gets to see for a task, not just the wording of one prompt. A modern system assembles its context from many sources: instructions, the user's request, retrieved documents, past turns, tool results, memory, and files. The model can only reason about what is in that window, and the window is a limited budget. Good context engineering puts the right information in, leaves noise out, and orders it well. It is the discipline that replaced 'prompt tips' once systems got complex.

Last reviewed

Reading is the slow way. Start with a free lesson you can operate right now.

Start free: The harness: the loop, made real

Free, no code, no signup.

Then go deeper: Context engineering: cut the noise Locked

What people get wrong

  • It is just writing a better prompt. The prompt is one input; context engineering manages all of them.
  • More context is always better. A full, noisy window degrades answers and raises cost and latency.
  • The model remembers your conversation. It only sees what is placed back into the context each turn.

Where you see it in real products

  • Assistants assemble instructions, history, and retrieved docs into each request.
  • Agents compress and prune context so a long task still fits the budget.
  • RAG is one part of context engineering: choosing which documents make the cut.

Common questions

How is context engineering different from prompt engineering?
Prompt engineering is wording one message. Context engineering is deciding what goes into the window at all: which documents, which past turns, which tool results, in what order, and what gets dropped. On a long-running agent that budget matters more than phrasing.
What actually takes up the context window?
The system instructions, the tool definitions, whatever history survived trimming, retrieved documents, and the result of every tool call so far. Tool output is usually the part that silently eats the budget.
Why does quality drop as the context fills up?
Attention has to spread across more tokens, and material in the middle of a long input gets used less reliably than material at the start or the end. Adding more text can lower accuracy, which is why pruning is a real technique and not just cost control.

Related explainers

More in Agents and tools

One idea at a time, in your inbox

New lessons and explainers, written the way these pages are. Now and then, not daily, and never a sales sequence.

We email you a confirmation link first. Unsubscribe in one click, any time. Privacy.

Part of See How AI Works, a free interactive course, where you learn how modern AI works by operating it, not watching videos.