Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Prompting Techniques and Context Engineering  ›  Lesson

Context Engineering

Context vs Prompt Eng. 12 minContext engineering is choosing, shaping and ordering everything the model sees in a call — instructions, history, retrieved documents, tool results and user data — so it has what it needs and little else.

Context Engineering

The Pedal Point assistant has a polished system prompt, and still it tells a customer they can return a helmet delivered five weeks ago. The prompt was fine. The problem was what came with it: the returns policy was retrieved, but the customer's order date was never looked up. The model answered from half the picture.

The rule

Prompt engineering words the request; context engineering chooses what the model sees.

Prompt engineering is about phrasing: clear instructions, good examples, a precise output format. Context engineering is about the whole package that arrives in the context window for this call. Think of it as a layer of your app, a context layer, that assembles each request from several sources:

  • Instructions: the system prompt and any task-specific rules.
  • Conversation state: recent messages, plus a summary of older ones.
  • Retrieved knowledge: the RAG chunks for this question.
  • Tool results: live data, such as the customer's order.
  • Memory and profile: stable facts about the user, stored between sessions.

As an app grows, most failures turn out to be context failures, not wording failures:

  • Missing: the fact needed was never included (the order date).
  • Stale: an old policy or an out-of-date summary.
  • Noisy: so much loosely related text that the key line is overlooked.
  • Conflicting: two sources disagree, and nothing says which wins.
  • Untrusted: text from a web page or email treated as if it were an instruction.

Label each piece in the prompt ("Policy:", "Order record:", "Customer message:") so the model knows what it is reading, and state which source wins in a conflict: "If the policy and an older chat message disagree, follow the policy."

The shortcut

For every candidate piece of context, ask three questions: Needed? Current? Trusted? Include it only if it passes all three.

"Can I still return the helmet?"Step 1 of 4
  1. Needed

    Returns policy: yes. Helmet hygiene rule: yes. The last order's delivery date: yes. Shipping rates: no.

The trap is fixing context problems with more words in the prompt. If the fact is missing, no phrasing will conjure it.

Drills

Answer fast — trust the rule.

quick drill

The assistant has perfect instructions but never received the order date. What kind of failure is this?

quick drill

Which is the clearest example of context engineering rather than prompt engineering?

quick drill

The customer writes "it arrived last week" but the order record says five weeks ago. Which should the assistant rely on?

quick drill

Adding every policy page to every request mostly causes which problem?

Remember

  • Prompt engineering words the request; context engineering chooses what the model sees.
  • Needed? Current? Trusted? — for every piece.
  • Label each source and say which wins in a conflict.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainAssemble the context

A logged-in customer asks the Pedal Point assistant: 'Can I still return the helmet from my last order?' List the context sources you would include in this call, one you would deliberately leave out, and explain the check you used for each decision.