context engineering
Choosing and arranging everything a model reads on each call, from instructions and tools to history, memory and retrieved data, within a token budget.
In more detail
Anthropic describes context as a finite attention budget: every token added competes with the rest. Context engineering pays the fixed costs first, ranks the flexible material, loads bulky data just in time and compacts or isolates long work.
Related terms
- context (LLM) — Everything a model reads on one call: system prompt, tool definitions, conversation history, retrieved passages and the current request.
- context window — The maximum number of tokens a model can take into account at once, covering the prompt and the reply together.
- context compaction — Replacing older turns of a long conversation with a model-written summary so the history fits the context again.
- context rot — The fall in a model's accuracy as its input grows longer, even on simple tasks and well within the context window.
Taught in
- From Prompts To Context — AI Engineering: LLM Apps, RAG & Agents
- How RAG Works And When To Use It — AI Engineering: LLM Apps, RAG & Agents
- Retrieval That Finds The Right Thing — AI Engineering: LLM Apps, RAG & Agents
- Planning, Memory And Many Agents — AI Engineering: LLM Apps, RAG & Agents
References
- Anthropic: Effective context engineering for AI agents (2025-09-29)
- Drew Breunig: How to Fix Your Context (2025-06-26)