CHAPTER 01 · What Context Engineering Is, and Why It Replaced Prompt Engineering · 1 / 5
What "context" actually means
The word "context" is doing a lot of work here, so it helps to expand it. Context is not just your prompt. It is everything the model sees before it generates its next response. The first article breaks this into pieces:
- The system prompt or instructions: the rules and behavior you set up front, often including examples.
- The user prompt: the immediate question or task.
- The short-term memory or history: the conversation so far, including earlier model responses and tool outputs.
- Long-term memory: persistent knowledge gathered across many past sessions, such as learned preferences or facts the agent was told to remember.
- Retrieved information: external, up-to-date knowledge pulled in from documents, databases, or APIs. This is RAG.
- Available tools: the definitions of every function the agent can call, such as
check_inventoryorsend_email. - Structured output rules: the required shape of the response, for example a specific JSON format.
All of that has to fit inside the model's context window, which is the fixed-size working memory measured in tokens. So context engineering is partly about choosing what to include, and partly about what to leave out.