liveBook · Manning

Context engineering

As explained in Retrieval Augmented Generation, The Foundational Ideas

The deliberate selection, organization, and presentation of information in a model's input context.

Context engineering deliberately selects, structures, and optimizes the information placed in an LLM’s input. Its goal is to increase relevant signals while reducing noise, rather than treating a larger context window as a complete solution. section 1.3.4

Retrieval-augmented generation (RAG) is a practical form of context engineering. It programmatically retrieves relevant chunks, ranks or filters them, and injects them into the prompt, allowing in-context learning without changing model weights. section 1.3.4

A context-engineering design balances several concerns:

  • Precision: retrieve the small portion of a large knowledge base that matters to the task. section 1.3.4
  • Efficiency: avoid forcing entire document collections into extended prompts, which can obscure important facts through “lost in the middle” effects. section 1.3.4
  • Control: encode human judgment through search filters, ranking logic, and task decomposition. section 1.3.4
  • Checkability: return supporting passages with answers so reviewers can verify claims instead of reconstructing the reasoning. section 1.3.5

Large knowledge base

When relevant information represents only a small fraction of a large document collection, semantic search can filter irrelevant data and place high-value passages in the prompt. The resulting answer is both more focused and easier to verify when those passages are returned as evidence. section 1.3.4 section 1.3.5

Context engineering complements rather than replaces model adaptation. Fine-tuning changes parameters, while retrieval supplies changing or rare knowledge at query time; retrieval can also expose provenance that absorbed model knowledge cannot cite directly. section 1.3.5

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Explains prompt construction, information density, retrieval, ranking, and grounding, but does not provide implementation code.
Examples
Uses large knowledge bases, semantic retrieval, extended prompts, lost-in-the-middle effects, and supporting passages as examples.
What you can do after
Build RAG pipelines that retrieve focused context, structure prompts, and expose passages for answer verification.
How it connects
Connects retrieval-augmented generation with in-context learning, semantic search, vector embeddings, fine-tuning, provenance, and attribution.

Also explained in

Compare how 7 books explain context engineering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.