Context engineering
Context engineering is designing everything that goes into a model's context window, instructions, tools, retrieved documents, memory and history, so an agent has the information it needs and little else.
Anthropic describes context as a finite resource with diminishing returns: as it grows, models recall less of it, so the aim is the smallest set of high-signal tokens. Techniques include just-in-time retrieval, summarising or compacting history, and structured notes outside the window.
It extends prompt engineering from a single prompt to the whole state a long-running agent sees.
Learn more on Kojen
Related terms
- MCPThe Model Context Protocol (MCP) is an open protocol for connecting AI applications to external tools, data and prompts through a standard client–server interface, built on JSON-RPC..
- KV cacheThe KV cache stores the attention keys and values of tokens a Transformer has already processed, so generating each new token doesn't recompute them.
- Indirect prompt injectionIndirect prompt injection is prompt injection delivered through content an AI system reads, such as a web page, email, document or tool result, rather than typed by the user..
Sources
- Anthropic. Effective context engineering for AI agents
Put the definitions to work.
Kojen evaluates, tunes and red-teams your agents with these methods built in: Wilson intervals, pass^k, LLM judges with visible components. Free to start.
Start training free