liveBook · Manning

Context engineering

As explained in Introduction to Generative AI, Second Edition

Context engineering is the systematic assembly and structuring of prompts, instructions, history, memory, retrieved information, tools, and output constraints needed for a model to complete a task.

Context engineering is the systematic design of everything a language model receives to complete a task effectively. It extends prompt engineering beyond manually written, single-shot instructions. section 7.6

A designed context can combine:

  • System instructions, user queries, interaction history, and long-term memory. section 7.6
  • Retrieved documents, tool definitions, and output-formatting requirements. section 7.6
  • Decisions about what to include, exclude, structure, and deliver at each point. section 7.6

Many failures arise from irrelevant retrievals, vague instructions, or overloaded memory rather than from the model alone. Clear prompting principles still matter, but they now operate across a dynamic system. section 7.6

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines the expanded scope and design decisions, but stops short of implementation procedures or technical internals.
Examples
Uses system instructions, queries, histories, memories, retrieved documents, tool definitions, and formatting constraints as examples.
What it assumes
Builds on prompt engineering while treating clarity, structure, and relevance as system-wide design principles.
What you can do after
Apply it by selecting, excluding, structuring, and timing the information supplied to a language model.
How it connects
Connects prompt engineering with system instructions, memory, retrieval, tools, interaction history, and output formatting.

Also explained in

Compare how 2 books explain context engineering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.