liveBook · Manning

Context

As explained in Prompt Engineering in Practice

Context is supplementary information supplied to a model because it cannot be assumed to know it.

Context is task-specific background supplied to a model so it can interpret an instruction accurately. It may describe the audience, system, situation, or relevant facts. It is not the model’s context window, which refers to token capacity. section 2.4

Give context a defined place in the prompt:

  • Put stable background in an Additional Context section. Keep it distinct from the instruction, which states what to do, and the output format, which states what to return. section 2.4 section 2.1
  • Use named input parameters for details that change between runs. In chat applications, keep stable configuration in system messages and changing context in user messages when practical. section 2.9 section 6.5
  • Delimit embedded notes or other supplied data so their contents are treated as data rather than additional instructions. section 6.4.5

Incident status update

# Additional Context You are assisting the incident commander for the checkout service in production. # Incident Notes ```text Checkout failures rose from 0.9% to 12.8% at 14:07 UTC. A database connection pool misconfiguration after deployment is suspected. The team rolled back at 14:22 UTC. Failures were down to 1.4% at 14:31 UTC; p95 latency and pool health still need verification. ``` # Instructions Write a stakeholder-facing update based only on the notes. # Constraints Use a neutral tone. Do not present the suspected cause as confirmed. # Output Format Use Current Impact, Root Cause (Known/Unknown), Mitigation in Progress, and Next Update ETA. If no next-update time is supplied, say so rather than inventing one. Here, the service and audience frame the task; delimited notes supply incident facts; the constraint and headings make the response easier to check. section 2.8.1 section 6.4.5

Include context when it changes how the task should be interpreted; do not add it by default. Check the result against the supplied facts and explicit constraints. If details vary across runs, move them into parameters rather than repeatedly editing stable instructions. Basic prompt context is separate from in-context learning and few-shot prompting. section 2.8 section 2.4 section 2.9

How Prompt Engineering in Practice covers it

How deep it goes
Defines static prompt context and works through engineering examples; defers in-context learning and few-shot prompting.
Examples
Demonstrates architecture decision summaries and incident status updates grounded in supplied operational details.
What it assumes
Defines the prompt components needed to place context and distinguishes task background from token capacity.
What you can do after
Build it from scratch: compose prompts with relevant background, separated variable inputs, and explicit output requirements.
How it connects
Links context to instructions, constraints, input parameters, output formats, and delimiters.

Also explained in

Compare how 18 books explain context →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.