Context engineering is the work of deciding what goes into the context window, the input a large language model or AI agent receives at once, when it produces an answer. It covers not only instructions but also retrieved documents, database results, tool outputs, conversation history and long-term memory, including what to include, in what order and how much.
It is broader than prompt engineering, which focuses on the wording of a prompt, and aims to give the model only information that is accurate, current and authorized. It is considered especially important in agent systems that work through many steps.