Context Engineering

Context Engineering

Context engineering is the practice of curating and maintaining the right set of information an AI model sees at each step of a task, rather than only phrasing a single prompt. It covers the whole information environment around the model, including instructions, retrieved documents, memory, and tools.

Context engineering emerged as AI applications moved from one-shot chatbots to multi-step agents. The term was popularized in 2025 by Andrej Karpathy and others, who framed it as the art and science of filling a model's context window with just the right information for the next step. It reflects a simple truth: what a model can see determines what it can do.

How Is It Different From Prompt Engineering?

Prompt engineering asks how to phrase a single request. Context engineering asks what information the model needs access to right now, across an entire task. Prompt engineering is one part of it, focused on the instruction layer, while context engineering manages the whole system that feeds the model: system prompts, conversation history, retrieved data, memory, and tool results.

Why Does It Matter?

Bigger context windows do not fully solve the problem, because model accuracy tends to degrade as the input grows, an effect discussed in Anthropic's guidance on context engineering. The goal is not to give a model everything, but the smallest set of high-signal information that leads to a good result. Too much context can distract or confuse a model as easily as too little can starve it.

What Are the Core Strategies?

  • Write: save information outside the context window, such as notes or memory, so it can be reused.
  • Select: pull only the relevant information back in, often through retrieval such as RAG.
  • Compress: keep only the tokens the task needs, for example by summarizing long history.
  • Isolate: split work across focused steps or sub-agents so each has a clean, relevant context.

These ideas apply to content as well. The same structure that makes a passage easy for a model to use, a clear answer stated up front in a self-contained section, is what GEO and AEO reward.

Frequently asked questions

What is context engineering?+

Context engineering is the practice of giving an AI model the right set of information at each step of a task, not just a single prompt. It manages the whole information environment around the model, including instructions, retrieved data, memory, and tools.

How is context engineering different from prompt engineering?+

Prompt engineering focuses on how you phrase one request. Context engineering manages all the information a model sees across a multi-step task. Prompt engineering is one part of context engineering, which is the broader discipline.

Why does context engineering matter?+

Model accuracy can degrade as the input grows, so giving a model everything is not the answer. Context engineering aims for the smallest set of high-signal information that produces a good result, which makes AI systems more reliable.