What is context engineering, and how is it different from prompt engineering?
Prompt engineering optimises the instructions you give a model. Context engineering optimises everything the model sees before it answers: which documents are retrieved, how they were chunked, how they are ordered and truncated, what is excluded, what the model may conclude. Prompt engineering is the smallest part of it.
Context engineering is defined as the systematic design of the information, tools, memory and instructions supplied to a model at inference time, together with the ordering, filtering and truncation applied to them, in order to maximise answer correctness under a cost and latency budget.
| Dimension | Prompt engineering | Context engineering |
|---|---|---|
| What is optimised | The wording of the instruction | Input assembly: documents, history, tools, permissions, format |
| When it applies | At request construction, after context exists | Across indexing, retrieval, ranking, assembly, generation |
| Typical failure | Ambiguous instruction, wrong format, missing step | Right document truncated, mis-ranked, out of scope, or unindexed |
| Diagnosis | Read the instruction; run it by hand | Trace the request: retrieved, filtered, sent, cited |
| Who owns it | Usually the application team | Application, data and platform teams, with one named owner |
The practical test is simple: if you improve the prompt and the answer does not change, the problem was never the prompt. In enterprise RAG across Singapore, Hong Kong SAR and Asia Pacific, most failures sit upstream — the document was never chunked retrievably, the right passage was out-ranked, or retrieval was never permission-filtered.