Chapter 1. Introduction to Context Engineering
Building agentic AI systems requires a delicate balance. Without enough information, the Large Language Model (LLM) won’t know what to do. But with too much information, costs go up while performance goes down.
Writing instructions in the prompt has become relatively less important over time, as the models have become more powerful. However, as AI agents work autonomously for longer periods of time, early errors compound and costs grow exponentially. The context provided to the LLM must be carefully curated by the surrounding system, so they get the right information, at the right time, in the right format.
Context Engineering has replaced Prompt Engineering as the central challenge in developing reliable AI agents. This chapter introduces Context Engineering, a practical discipline for shaping everything the model consumes—data, tools, instructions, memory, and structure—so it can do the job reliably and efficiently. You’ll learn the main failure modes of long ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access