What is context engineering (vs prompt engineering)?
Context engineering is the practice of designing everything a model sees in its context window β instructions, retrieved documents, memory, tool outputs, and the user's request β not just the single prompt you type. Prompt engineering was about wording one good instruction; context engineering is about assembling the whole set of information the model needs, in the right shape, at the right moment. It has become the main framing for building serious LLM applications.
What's the difference from prompt engineering?
Prompt engineering focuses on one message: how you phrase a question, what examples you include, how you ask the model to respond. It's still useful, but it treats the prompt as the whole job.
Context engineering zooms out. In a real application the prompt is only a small slice of what reaches the model β there's also retrieved data, past conversation, tool results, and system rules. Context engineering is the job of deciding what goes into that window, what stays out, and how it's ordered, so the model has exactly what it needs and nothing that distracts it.
What goes into the context window?
A production request is usually assembled from several sources stitched together:
- Instructions β the system prompt, role, rules, and tone.
- Retrieved data β documents or facts pulled in for this specific query, often via RAG.
- Memory β relevant history from earlier in the conversation or past sessions.
- Tool outputs β results from searches, database queries, or API calls.
- The user's request β the actual task at hand.
The engineering part is choosing which of these to include and how much, since the window is finite and noise crowds out signal.
Why did it replace prompt engineering as the framing?
As people moved from clever one-off prompts to agents and RAG systems, they found the wording of the prompt mattered far less than what information surrounded it. Most failures came from the model missing context, getting stale data, or drowning in irrelevant text β problems no amount of prompt polishing fixes.
- Too little context and the model guesses or makes things up.
- Too much and the important details get buried and ignored.
- Wrong or outdated context and it confidently gives a wrong answer.
Getting that mix right is the real work of building with LLMs today, which is why context engineering has largely absorbed prompt engineering as the broader, more accurate name for the craft.
Related Questions
Related News
More in How-To & Practical