1 Introduction to context engineering
This chapter covers
- Context engineering and its layered stack
- The evolution from LLM calls to workflows, agents, and agentic systems
- The limitations of LLMs and benefits of context engineering
- The six context sources that LLM-based systems supply to the model
Artificial intelligence (AI) is driving one of the fastest technology adoption cycles in recent history. The most visible part of this wave is generative AI (GenAI), a class of AI systems designed to produce novel content from natural-language input, including text, code, images, music, and video. At the core of text-based GenAI are large language models (LLMs), deep learning models that can interpret and generate human-like language. In practice, the effectiveness of an LLM-based system depends on its context, meaning the information available to the model at inference time. Context engineering is the discipline of assembling, maintaining, and routing that information, so that every model call carries the smallest set of tokens that makes the task solvable within the limits of the model’s context window.
This book is for builders who work with LLMs. By the end of this book, you will be able to treat the context window as a resource you design, measure, and budget. We start with a closer look at context engineering and the LLM limitations that make it necessary.