Skip to content
Last Dictionary

context engineering

nounAlso: context engineer, context management

In plain wordsManaging an AI model's reading material: choosing, trimming and arranging the instructions, documents, tool results and memories it is given on every turn, so that it has what the task needs and little else.

  1. The practice of designing the machinery that decides, before each call to a language modellarge language model, n.: A computer program trained on enormous amounts of text to predict the words that come next. At vast scale, that simple skill lets it chat, answer questions, translate, summarize and write code., what goes into its context windowcontext window, n.: How much an AI model can read and keep in view at once: the instructions, the conversation so far and any attached documents. Text that does not fit has to be cut, summarized or left out., in what order and in what form, on the view that the window is a limited budget in which every token should earn its place. It covers selecting and ordering instructions and system promptssystem prompt, n.: Background instructions given to a chatbot before the conversation starts, setting its role, rules, tone and tools. Users usually never see it, but it shapes every reply., tooltool, n.: Any outside capability an AI model is allowed to use — a web search, a calculator, a code runner, a database or an app — described to the model so it can ask for it by name. definitions, retrieved documents, conversation history, memoriesagent memory, n.: The ways an AI assistant or agent keeps information — your preferences, past conversations, lessons from earlier tasks — and brings it back later, beyond what fits in a single conversation. and tool outputs; deciding what to load up front and what to fetch on demand (just-in-time retrievaljust-in-time retrieval, n.: Letting an AI agent fetch information only at the moment it needs it — opening a file, running a search — instead of stuffing everything into its prompt in advance., progressive disclosureprogressive disclosure, n.: Showing only a short summary first and revealing details when they are actually needed. AI agents use it to avoid filling their limited memory with instructions they may never use.); and shrinking or isolating context through compactioncompaction, n.: Like replacing a stack of rough notes with a one-page digest: when an AI's conversation grows too long for its memory, the history is condensed into a summary and the work continues from there., clearing stale tool results, external notes and subagentssubagent, n.: A helper AI agent that a main agent starts to handle one piece of a job; it works in its own separate workspace and reports back a short summary when it is done. with fresh windows. The motivation is empirical: models degrade as inputs grow (context rotcontext rot, n.: The way an AI model becomes less reliable as you give it more and more text to read, even when the answer is in there somewhere.) and are misled by errors or irrelevant material (context poisoningcontext poisoning, n.: When a mistake or a planted falsehood gets into an AI's working notes or memory and the AI keeps relying on it, so the error grows over later steps.), so for long-running agentsAI agent, n.: An AI system that does not just answer but acts: given a goal, it decides on steps, uses tools such as a browser or code editor, checks the results and keeps going until the job is done. the aim is to include as little as will still let the model act correctly.

    Most of our agent's failures were context engineering problems: stale tool output and forty unused tool definitions.

Origin

Scattered earlier uses exist; Dex Horthy's '12-Factor Agents' guide (HumanLayer, spring 2025) urged builders to take control of their context windows and is sometimes credited with the coinage. The term took off in June 2025 when Shopify CEO Tobi Lütke (19 June) and Andrej Karpathy (25 June) endorsed it over 'prompt engineering', Karpathy describing the job as 'filling the context window with just the right information for the next step'. Anthropic's guide of 29 September 2025 helped standardize it.

Usage note

Often presented as the successor to prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it.; skeptics call it a rebranding. A workable distinction: prompt engineering concerns wording a single input well, context engineering the system that assembles inputs turn after turn. Closely tied to harnessharness, n.: The software around an AI model that gives it instructions and tools, carries out its actions and decides when it stops. The model is the engine; the harness is the rest of the car. design.

Related

See also
  • context windowcontext window, n.: How much an AI model can read and keep in view at once: the instructions, the conversation so far and any attached documents. Text that does not fit has to be cut, summarized or left out.
  • prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it.
  • context rotcontext rot, n.: The way an AI model becomes less reliable as you give it more and more text to read, even when the answer is in there somewhere.
  • compactioncompaction, n.: Like replacing a stack of rough notes with a one-page digest: when an AI's conversation grows too long for its memory, the history is condensed into a summary and the work continues from there.
  • agent memoryagent memory, n.: The ways an AI assistant or agent keeps information — your preferences, past conversations, lessons from earlier tasks — and brings it back later, beyond what fits in a single conversation.
  • retrieval-augmented generationretrieval-augmented generation, n.: Giving an AI an open-book exam: before answering, it looks up relevant passages in a set of documents and bases its reply on them, often citing where each point came from.
  • just-in-time retrievaljust-in-time retrieval, n.: Letting an AI agent fetch information only at the moment it needs it — opening a file, running a search — instead of stuffing everything into its prompt in advance.
  • harnessharness, n.: The software around an AI model that gives it instructions and tools, carries out its actions and decides when it stops. The model is the engine; the harness is the rest of the car.
Contrast with
  • prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it.

Sources

  1. Rajasekaran, P., Dixon, E., Ryan, C. & Hadfield, J. (2025). Effective context engineering for AI agents. Anthropic Engineering blog, 29 September 2025. anthropic.com/engineering/effective-context-engineering-for-ai-agents
  2. Willison, S. (2025). Context engineering. Simon Willison's Weblog, 27 June 2025. simonwillison.net/2025/Jun/27/context-engineering

Mentioned in

agent memoryagent memory, n.: The ways an AI assistant or agent keeps information — your preferences, past conversations, lessons from earlier tasks — and brings it back later, beyond what fits in a single conversation., context windowcontext window, n.: How much an AI model can read and keep in view at once: the instructions, the conversation so far and any attached documents. Text that does not fit has to be cut, summarized or left out., promptprompt, n.: The message or instructions you give an AI system — a question, a request, some examples or a document — that it responds to. Clearer prompts generally get better results., prompt engineeringprompt engineering, n.: The skill of writing requests to an AI — picking the words, examples, format and background information it receives — so that it reliably gives the result you want, without retraining it., retrieval-augmented generationretrieval-augmented generation, n.: Giving an AI an open-book exam: before answering, it looks up relevant passages in a set of documents and bases its reply on them, often citing where each point came from., agent instruction fileagent instruction file, n.: A plain-text file kept in a software project that tells AI coding agents how the project works — how to build and test it, which conventions to follow, what to avoid — read at the start of every session., agent loopagent loop, n.: The repeating cycle at the heart of an AI agent: the model decides what to do next, software carries it out, the result is shown to the model, and the cycle repeats until the task is finished., agent skillagent skill, n.: A packaged how-to guide for an AI agent — written steps, sometimes with small programs and examples attached — that sits unread until a job of that kind comes up, when the agent opens it., AI engineeringAI engineering, n.: The craft of building useful, reliable products on top of AI models — choosing models, writing prompts, connecting data and tools, testing quality and running it all safely at scale., compactioncompaction, n.: Like replacing a stack of rough notes with a one-page digest: when an AI's conversation grows too long for its memory, the history is condensed into a summary and the work continues from there., context poisoningcontext poisoning, n.: When a mistake or a planted falsehood gets into an AI's working notes or memory and the AI keeps relying on it, so the error grows over later steps., context rotcontext rot, n.: The way an AI model becomes less reliable as you give it more and more text to read, even when the answer is in there somewhere., harnessharness, n.: The software around an AI model that gives it instructions and tools, carries out its actions and decides when it stops. The model is the engine; the harness is the rest of the car., lost in the middlelost in the middle, phr.: AI models reading a long input behave a little like a skimmer: they reliably catch facts placed near its start or end but are much likelier to miss the same fact buried halfway through., prompt cachingprompt caching, n.: Saving the work a model did reading the start of a prompt, so later requests that begin the same way can skip that reading and come back faster and cheaper., prompt engineerprompt engineer, n.: A person whose job is writing and testing the instructions given to AI models so they behave reliably; hyped in 2023 as a six-figure job anyone could learn, the role has since largely merged into ordinary engineering., Software 3.0Software 3.0, n.: Andrej Karpathy's name for programming computers by writing plain-language instructions for AI models, following traditional code (Software 1.0) and trained neural networks (Software 2.0)., subagentsubagent, n.: A helper AI agent that a main agent starts to handle one piece of a job; it works in its own separate workspace and reports back a short summary when it is done., working memoryworking memory, n.: The small amount of information held in mind right now while doing a task. For an AI model, that is roughly whatever currently sits in its context window., code modecode mode, n.: A way for AI agents to use tools by writing a short program that calls them, instead of asking for each tool one step at a time., externalizationexternalization, n.: Moving an AI agent's know-how and memory out of the model itself and into files, tools and rules around it, so the whole system can do more than the model alone., just-in-time retrievaljust-in-time retrieval, n.: Letting an AI agent fetch information only at the moment it needs it — opening a file, running a search — instead of stuffing everything into its prompt in advance., llms.txtllms.txt, n.: A short guide file that a website puts at a standard address to help AI assistants find and understand its most useful pages., MemGPTMemGPT, prop. n.: A 2023 research system that gave a chatbot a computer-style memory hierarchy, letting it move information in and out of its limited working space so it could handle long documents and remember users.