Home / Memory & context

WTF is Context Engineering?

mainstreamFirst seen Jun 2025

Deciding exactly what goes into a model's context window at each step: instructions, tools, data and history.

TL;DR

Prompt engineering is about wording one prompt well. Context engineering is the bigger job of curating everything the model sees on every turn of a long agent run: which documents, which tool results, what to summarise, what to drop. Most agent failures are context failures, not model failures.

How it works

Techniques include just-in-time retrieval (load data when needed instead of up front), compaction (summarising old turns when nearing the context limit), structured note-taking or external memory files, sub-agents that explore in their own context and return condensed results, and careful tool design so results are compact. The core constraint is that context is a finite attention budget: more tokens can make performance worse ("context rot").

Origin

Coined / introduced by
Popularised by practitioners
When
Jun 2025
Story
Gained wide use in mid-2025 after posts by Shopify's Tobi LĂĽtke and Andrej Karpathy; AI labs then published guides using the term.

Related jargons

Sources