Skip to content
Diese Seite gibt es auch auf Deutsch.Zur deutschen Version

Technology · AI at work

Context Engineering: Why Context Beats the Prompt

Context engineering decides AI quality, not the prompt. The three layers explained, RAG versus fine-tuning compared, and a seven-step guide to getting started.

By Boaz Lichtenstein

Article image: Context Engineering: Why Context Beats the Prompt

When ChatGPT was new, prompts were treated like a secret science: magic phrasings that conjured better answers. That phase is over. Modern models understand plain language – what they lack is almost never the right instruction, but the right context: the documents, data, rules and tools relevant to the task. That’s exactly what context engineering deals with.

Key takeaways

  • Context (knowledge, tools, rules) beats prompt phrasing – models have long understood language well enough; what they’re missing is the material.
  • Retrieval (RAG) pulls in current, company-specific information at runtime, instead of relying on frozen training knowledge.
  • More context isn’t automatically better: relevance beats volume, and outdated context does more harm than good.
  • Without test cases with expected answers, any claimed “improvement” stays a matter of feel.
  • The biggest lever is data upkeep, not model choice.

What actually counts as context? The three layers

Context for an AI system consists of three building blocks: the knowledge it can look up, the tools it’s allowed to use, and the rules it should follow when answering. If any one of these is missing, output quality drops – no matter how elegantly the prompt is phrased.

  1. Knowledge: What does the model need to be able to look up? Product data, internal policies, contracts, history – typically connected via retrieval (RAG): the query pulls the relevant passages from a knowledge base, rather than hoping the model already knows them from training. As a side effect, this also cuts the risk of made-up answers, because the model can point to real sources instead of guessing.
  2. Tools: What is the model allowed to do? Search, calculate, query systems, write files. A model with access to the real database doesn’t hallucinate figures – it looks them up. This is exactly the building block that makes the difference between a chatbot and an agent capable of acting.
  3. Rules and examples: What should the result look like? Style guidelines, format templates, two or three gold-standard examples. This nearly always beats pages of description – a single good example often carries more weight than a paragraph of instruction.

RAG, fine-tuning or a bigger context window: comparing the options

There are three technical routes for feeding a model knowledge: retrieval (RAG) fetches matching documents at runtime, fine-tuning retrains the model on your own data, and a large context window pushes relevant material straight into the prompt. For most business cases, RAG is the most pragmatic starting point.

Approach How current? Effort When it makes sense
RAG (retrieval) Current instantly – the source is pulled fresh every query Medium (indexing, ongoing upkeep) Factual knowledge, frequently changing documents
Fine-tuning Only as current as the last training run High (training data, compute time, expertise) Style, tone, recurring specialist formats
Long context window Current, but more expensive on every single query Low (no extra system) Small, manageable knowledge base

In practice, the approaches aren’t mutually exclusive: many production systems combine RAG for factual knowledge with a handful of examples for style – fine-tuning stays the exception for special cases, because it’s the most expensive to maintain. A rule of thumb for the decision: if the underlying knowledge changes more often than the desired writing style, there’s almost no way around retrieval – fine-tuning freezes a state of knowledge that you’d likely need to update again shortly afterwards.

How to build context engineering – step by step

  1. Take stock: Where does relevant knowledge live – wikis, PDFs, tickets, CRM, email archives?
  2. Clean up: Sort out outdated and duplicate documents before anything gets indexed at all. A small, well-maintained set beats a huge, neglected one.
  3. Collect test cases: Gather twenty to fifty real tasks, each with the correct expected answer.
  4. Set up retrieval: Connect the knowledge base (RAG), define the tool access required.
  5. Test the first version against the test cases and name gaps concretely, instead of a blanket “that’s good enough”.
  6. Sharpen it in a targeted way: add missing documents, remove outdated ones – don’t just pile on more material indiscriminately.
  7. Assign ongoing ownership: who keeps the knowledge base updated as processes or products change?

The most common mistakes

Too much context: dumping a hundred documents into the prompt indiscriminately dilutes the relevant information – quality drops, costs rise. Relevance beats volume. Outdated context: a RAG system built on an unmaintained wiki confidently delivers wrong answers – keeping the source current is part of the system, not optional. No evaluation: without test cases with expected results, any “improvement” stays a matter of feel. A set of fifty real tasks with model answers is the single most valuable artefact of an AI project. No access control: context that shows every user everything, regardless of permissions, isn’t a technical detail – it’s a security risk, especially once agents with tool access are involved (more on this in our article on prompt injection and agent security).

From experience: when the effort pays off

Not every task needs an elaborate retrieval system. A simple prompt with one or two pasted-in documents is entirely sufficient for one-off tasks. Systematic context engineering pays off once a task recurs, several people use it, or mistakes become expensive – customer enquiries, internal support, or AI agents handling tasks independently, for example. For one-off cases: try whether a well-phrased prompt with copied-in context is enough before building a system that nobody will maintain afterwards. One side effect of clean context that’s easy to underrate in practice: well-curated sources also lower the risk of the model producing convincing-sounding but wrong answers – more on that in our article on AI hallucinations.

An example makes the difference tangible: a support team fields several hundred returns queries a month. Without context, a chatbot delivers generic answers that staff often have to correct by hand. Connect the same AI instead to the current returns policy and the history of similar tickets, and the amount of manual correction drops noticeably – not because the model got better, but because it suddenly knows which rules actually apply to this particular case.

The bottom line

Context engineering is unglamorous – data upkeep, interfaces, test cases. But it’s the difference between an AI that delivers impressive demos and one that works reliably. Models are becoming more interchangeable; a company’s curated context is not. Start small – one task, one well-maintained knowledge base, one set of test cases – and you’ll notice the difference faster than building a complete system would take. The long-term value doesn’t sit in any single project, though, but in the habit: a team that maintains context systematically gets automatically better with every new model – without context, every new model stays just another new promise.

FAQ

Frequently asked questions

Is prompt engineering dead, then?

No, but it has gone from craft to basic hygiene: clear instructions, examples, the desired format – all of that still matters. It’s just no longer where the bottleneck sits. Between a mediocre AI result and an excellent one, what’s missing today is almost always context – not better phrasing of the request.

What’s the first concrete step?

An honest stocktake of your own knowledge base: where does the information live that a model would need for your typical tasks – and what state is it in? Outdated wikis and scattered PDFs are the most common obstacle. Curating beats accumulating: a small, well-maintained knowledge base outperforms a huge, neglected data swamp.

What does context engineering typically cost?

Less than building a classic software project, but more than writing a good prompt. The biggest cost item is rarely the technology itself (retrieval systems are commodity kit by now) – it’s the people-time spent cleaning data and building test cases. A realistic first step can be done on a modest budget if the knowledge base isn’t starting from zero – but the effort grows the messier the source data is.

Is context engineering only relevant for businesses?

No, the principle applies at home too: anyone who hands an AI assistant their own calendar, a photo of a recipe, or the wording of a contract gets noticeably better answers than with an abstract question and no material. The only difference is systematisation – businesses need processes and upkeep for it, individuals just need the habit of supplying relevant material along with the question.

How does context engineering differ from classic knowledge management?

It builds on it, but goes one step further: classic knowledge management organises documents for people who search and read them themselves. Context engineering makes the same sources machine-readable too, and retrievable automatically at runtime. Anyone who already has a well-maintained wiki or a clean document store has done most of the work already – what’s left is mainly the technical integration.