If you're new to context or prompts, please read Understanding Tokens and Context first. This post assumes you already know that everything you include has a cost in tokens.
Context engineering and prompt engineering are both related concepts, but they’re different. They both let us engineer an input for the model so that it can do its thing and give us a response. Usually people understand prompt engineering but ignore context. This post tries to unpack the differences between them.
Prompt engineering is about steering Roles, rules, output format, tone or tool usage policy. A prompt is an instruction.
Some examples
Context engineering is about feeding the model with required information along with the prompt. It could be the history of the conversation, or adding files, media, etc.
In a very basic chatbot, the history is already included as part of the context everytime you prompt the model to do something . The single thread of back and forth between you and the model is always sent to the model every time you ask a question. Slightly more advanced chatbots like ChatGPT do additional context engineering such as adding relevant bits of text from other conversations based on your query, get information from a website, etc.
As AI users, we most often are doing a bit of both. When you construct a question, you’re engineering the prompt. When you add a file, or reference image, you’re engineering the context.
All the AI apps, whether it’s a customer support chatbot, ChatGPT app, Cursor, Lovable, or even RabbitHoles AI, the apps do context and prompt enhancements on top of your prompt and context. This mostly happens behind the scenes. The important thing to know is that the degree of control over context and prompt engineering varies across different kinds of apps built for different usecases.
This is where we need to understand the difference between a linear chat versus non-linear chat