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

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