Context Engineering
Also called Context management
Deciding what information goes into an AI model's context window, and in what form, so it has what it needs and little else.
What is context engineering?
Context engineering is the work of choosing everything an AI model sees when it answers: the instructions, the conversation so far, retrieved documents, tool results, memory and examples. It grew out of prompt engineering as AI systems started running longer tasks, where the prompt a person writes is only a small part of what fills the context window.
How does it work?
Common techniques include:
- Retrieval: fetching only the passages a task needs with RAG, rather than pasting in whole documents.
- Summarising: replacing a long conversation or tool output with a short summary once its detail is no longer needed.
- Note-taking: having an agent write progress notes to a file it can read later, a simple form of agent memory.
- Loading on demand: giving the model a short list of what's available, and letting it pull in the full detail only when it needs it.
- Clear structure: keeping the system prompt, documents and the question in clearly separated sections.
What is it commonly confused with?
- Prompt engineering. That's about how you word instructions. Context engineering covers everything else in the window too, and much of it is done by software rather than typed by hand.
- A bigger context window. More room helps, but models often get worse at finding details as the window fills up, so more context isn't automatically better.
Why does it matter?
When an AI system gives a poor answer, the cause is often missing, outdated or buried information rather than the model itself. Good context engineering makes answers more accurate and keeps costs down, because every token in the window is paid for. It's a large part of what an agent harness does.


