Context Engineering: Giving AI the Right Information
Learn to choose what goes into the model’s context window, because the right information beats more information.
A model can only use what’s in front of it. It doesn’t know your shop’s return policy, today’s date, or what the customer bought last month, unless the app puts that information into the request. Deciding what to include, and what to leave out, is called context engineering, and for many real apps it matters more than clever wording.
The context window (Track 2) is the space available. Into it can go:
- Instructions: the system prompt.
- Knowledge: policies, documents, facts retrieved for this question (Track 6 shows how).
- Memory: the conversation so far, or a summary of it, and facts about the user.
- Tool results: what a search or database lookup returned.
- Examples of good answers.
Think of it as packing a small suitcase for a specific trip. Leave out something essential, such as the shop’s actual return policy, and the model fills the gap with general knowledge: “returns are usually 30 days”, stated with total confidence, and wrong for this shop. That’s a hallucination the app could have prevented.
Over-packing hurts too. Dumping in the whole product catalogue and every old message costs money on every request (input tokens are billed), slows down the first token, and buries the one relevant line in noise, where Track 2’s “lost in the middle” effect says it may be overlooked.
So good context is relevant, current and compact: the facts this question needs, summaries instead of transcripts, and nothing just because it might come in handy.
Key takeaways
- The model only knows what’s in its context; the app decides what goes in.
- Context includes instructions, knowledge, memory, tool results and examples.
- Missing facts get filled with confident general guesses, a preventable kind of hallucination.
- More isn’t better: irrelevant context costs money, adds delay and buries what matters.
Check your understanding
Go deeper (more technical)
The term “context engineering” became popular in 2025 as apps, and especially agents (Track 7), grew more complex: an agent working for an hour can generate far more history and tool output than any window holds, so deciding what to keep, summarise or drop becomes the central design problem.
Common techniques: retrieving only the relevant document chunks (RAG, Track 6), summarising old conversation turns, storing long-term facts about a user outside the window and adding them only when relevant, and placing key facts and the question near the end of the prompt.
The simulation’s token counts and price are illustrative.