From prompt engineering to context engineering

A prompt is just one part of what the AI sees. Context engineering is deciding everything that goes into the context window: instructions, your data, chat history, retrieved documents and tool results, and what to leave out. Too little and the AI guesses; too much and it gets confused.

Everyday analogy

Packing a small suitcase for a trip: you can't take everything, so you choose what matters most for this journey and fold the rest away.

Example

A support bot doesn't send its entire 2-year chat history. It keeps a short summary of earlier conversations, the last few messages, the customer's account details and the two most relevant help articles.

What goes into the AI's context❓ Your questionwhat you ask right now📎 Documents and datafacts it can use🧠 Memory and historywhat it remembers🧰 Toolswhat it can do🧾 Instructionsits role and rules
Context engineering means choosing everything the AI sees, not just the question.
InstructionsRole, rules, format
DataDocuments, tables, code
Chat historyRecent messages, summaries of older ones
Retrieved infoSearch or RAG results
Tool resultsAnswers from APIs and tools
→
LLMTargeted, accurate output

Good habits

  • Treat context as a budget: include what's needed for this task
  • Summarise long histories instead of pasting them
  • Put the most important instructions clearly at the start
  • Balance recent information with the most relevant

Watch out: context rot

Very long contexts can make answers worse: the AI may miss details buried in the middle. More context isn't always better context.

Try it yourself

About 15 min

Give the AI the right background

  1. Ask an AI chatbot to plan your week with no other information.
  2. Start a new chat and first give it your goals, fixed meetings and energy levels, then ask again.
  3. Compare the two plans.

What you should see: The quality of the answer depends far more on the context you give than on clever wording.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectPrompt lab: build a prompt pack for your real workAbout 90 min · No coding needed · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.