Module 13 · Context Engineering · Lesson 27 of 34

The context window is your budget

Everything competes for one window. Choose what the model needs for this step, and leave out the rest.

In this lesson · about 20 minutes

  • List the components that compete for the context window
  • Explain why more context can make answers worse
  • Use summarising, tool selection, re-ranking and trimming to make room

Prompt engineering is about wording instructions well. Context engineering is the bigger job: deciding everything the model sees on each call, because the model knows nothing else. A request can hold:

  • the system prompt and rules;
  • tool definitions;
  • memories about the user;
  • retrieved documents;
  • conversation history;
  • tool results from earlier steps;
  • and space for the reply.

More is not better. Every extra token costs money and time, and a model's attention is limited: relevant details buried among irrelevant ones are easier to miss, and conflicting old information can mislead. The goal is the smallest set of high-signal tokens that lets the model do this step well.

Try it · simulator

Context budget planner

Everything an assistant sends competes for one window. Set the pieces, watch the bar fill, then use the four strategies to make room.

System prompt 1,500Tool definitions 6,250Memory notes 400Retrieved documents 5,000Conversation history 5,400Tool results 6,000Reserved for the reply 2,000

Window used

83%

Input tokens

24,550

Input cost per call

$0.074

Per 10,000 calls

$736

It fits, but the window is crowded. Details in the middle of a long context are easier for a model to miss, and every call pays for all of it. Most of this is noise for any single question.

Check your understanding0 of 3 correct

Question 1

1.What is the main difference between prompt engineering and context engineering?

Question 2

2.An agent has 60 tools connected, and their definitions take 15,000 tokens. What helps most?

Question 3

3.Why can adding 20 more retrieved documents make an answer worse?

Quiz score: 0 of 3

Tip: answer every quiz question correctly first.

Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.