The End of Prompt Engineering: Why Context Frameworks Are the Real AI Workhorse
Written at the beginning: Today, the teacher took us from "Prompt Engineering" to "Context Engineering." Before, when I used ChatGPT, I would write a long, carefully designed prompt, but it would still often "speak plausible nonsense with a straight face." The teacher said: That's because you only gave it a "task," not "background" and "constraints." It's like asking someone to cook a dish by only telling them "make a dish," versus telling them "I'm from Jiangxi, I love spicy food, and my budget is 20 yuan" — the results are completely different.
1. The Three Evolutions of AI Engineering: From Gacha to Harness
1.1 2022-23: Prompt Engineering — "The Gacha Era"
The teacher said:
"2022-23 Prompt Engineering, uncertainty, correct-sounding nonsense."
Back then, we used ChatGPT and GitHub Copilot, desperately researching how to write prompts.
- "You are a senior front-end engineer..."
- "Please answer step by step..."
- "The following are examples..."
After writing a long passage, the AI could still spout nonsense. It was like a gacha game — writing a good prompt only increased the probability of "drawing a good answer."
The teacher said:
"AIGC is based on a portion of pre-training data. By designing perfect prompts, it was upgraded to an engineering level."
But the problem is — even the most perfect prompt might not yield a good result.
1.2 2024-25: Context Engineering — "The Remedial Era"
The teacher said:
"2024-25 Context Engineering, LLM hallucinations. Completing the context, context engineering, more reliable, more accurate."
The core idea of Context Engineering: Instead of directly using pre-trained knowledge to answer, first retrieve some materials and add them to the prompt before answering.
| Stage | Core | Problem Solved |
|---|---|---|
| Prompt Engineering | Write good prompts | Uncertain output quality |
| Context Engineering | Complete the context | LLM hallucinations, insufficient knowledge |
The teacher said:
"It's not about directly using pre-trained answers. Before answering, first retrieve some materials and add them to the prompt."
RAG (Retrieval-Augmented Generation) is the most common and highest-level implementation of Context Engineering.
"Cursor / Trae / Legal Expert RAG. Cursor is based on VSCode, yet it has killed VSCode. It takes our entire codebase as context (technical architecture, code style, functional modules...) letting it develop while we assist."
Why is Cursor better at writing code than ChatGPT? Because it uses the entire project codebase as context. The AI knows your tech stack, code style, and dependencies — rather than writing blindly from scratch.
1.3 2025-26: Harness Engineering — "The Horse-Taming Era"
The teacher said:
"2025-26 Harness Engineering. LLMs are incredibly powerful. Claude 4.6, Gemini 3 are like thousand-mile horses. With a saddle and reins, they run fast and well in designated environments and scenarios."
Harness = Rules + Guardrails + Safety + Reliability + Loop + Skills + MCP.
The teacher said:
"Engineering similar to the deterministic delivery of traditional software. LLM engineering has finally matured in 2025-26. Enterprises are all embracing AI digitalization, and FDEs are in high demand."
From "gacha" to "remedial" to "horse-taming," AI engineering has finally matured.
2. Why is Prompt Engineering No Longer Enough?
2.1 LLMs Have Evolved, They Don't Need You to "Teach Them Step-by-Step"
The teacher mentioned a key change:
"Early on, detailed and accurate instructions were needed. Now, with the development of AI, there is less dependence on that."
The old GPT-3.5:
- You needed to write super long and detailed prompts.
- "Identity + detailed accurate task + steps + examples..."
- Long, engineering-designed prompts were needed to improve the quality of generated code.
The current Claude 4.6 / Gemini 3 / GPT-5:
- A simple prompt can achieve results better than previously complex prompts.
- Why?
The teacher said:
"LLMs are more powerful, with stronger reasoning abilities. AI and humans have interacted for several years, accumulating massive amounts of prompt data. For new powerful models from OpenAI, Google, Claude, the user's prompt is not used for direct generation. The LLM automatically optimizes your prompt. AI has already understood common human demand patterns."
Current LLMs automatically "mind-read" your needs; you don't need to write hundreds of words of prompts anymore.
2.2 Then Why is Context Engineering Still Needed?
Because no matter how smart an LLM is, it has two fatal weaknesses:
- Knowledge is cut off at the training time point — it doesn't know your company's internal documents or the latest data.
- It doesn't know your specific scenario — it's a general model, not your personal assistant.
Context Engineering solves exactly these two problems.
3. Context Engineering in Practice: Giving AI a "Persona" + "Scenario" + "Constraints"
3.1 The Idea of Structuring Context
The teacher said:
"The essence of context engineering is not writing a single prompt, but building a framework that includes 'background, constraints,' with the goal of completing AI tasks accurately and reliably."
Look at the code:
const context = {
// Demand Background: Who are you? The purpose of doing this.
background:
'I am the owner of a milk tea shop near a university. Most customers are students aged 17-22, with an average spend of 15-20 yuan.',
// Constraints
constraints: "Summer drink, must be refreshing, cost controlled within 8 yuan",
outputRequirements: `Must be visually appealing (suitable for posting on social media), please output in JSON format, including drink name, ingredients, cost, and price.`
}
The three elements of a context framework:
| Field | Role | Analogy |
|---|---|---|
| background | Demand background, who you are, what you do | Telling the chef your restaurant's positioning |
| constraints | Constraint conditions, limits and boundaries | Telling the chef the budget and taste preferences |
| outputRequirements | Output requirements, format and specifications | Telling the chef how to plate the dish |
3.2 Assembling into a systemPrompt
const systemPrompt = `
You are a professional beverage R&D expert. Please complete the task based on the following context information.
【Background】 ${context.background}
【Constraints】 ${context.constraints}
【Requirements】 ${context.outputRequirements}
`
Structuring the context into a systemPrompt is much more reliable than just throwing the AI a line like "Help me design a milk tea."
It's like:
- Ordinary Prompt: "Help me make a dish." → The chef might make you Buddha Jumps Over the Wall, but you just want a bowl of noodles.
- Context Engineering: "I run a noodle shop, customers are office workers, budget is 15 yuan, it needs to be fast, filling, and not spicy." → The chef makes you a bowl of braised beef noodles, a perfect match.
3.3 Calling DeepSeek to Generate Results
async function generateNewTea() {
try {
console.log(`Requesting large model, context engineering is ready...`);
const completion = await client.chat.completions.create({
model: 'deepseek-v4-pro',
messages: [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: "Please start your R&D design" }
],
temperature: 0.7, // Creativity
});
const aiResponse = completion.choices[0].message.content;
console.log(`\nAI R&D Result:`);
console.log(aiResponse);
// Fault tolerance: Attempt to parse JSON
try {
const jsonData = JSON.parse(aiResponse);
console.log(`\nSuccessfully parsed JSON object:`, jsonData);
} catch (err) {
console.log(`The returned format is not JSON`);
}
} catch (err) {
console.error(err.message);
}
}
generateNewTea();
Note temperature: 0.7:
| temperature | Effect | Applicable Scenarios |
|---|---|---|
| 0.0-0.3 | Conservative, high determinism | Code generation, data analysis |
| 0.5-0.7 | Balanced, creative | Copywriting, product design |
| 0.8-1.0 | Divergent, highly creative | Brainstorming, story creation |
Designing milk tea requires creativity, so 0.7 is used.
3.4 Fault Tolerance: An Important Part of Code Engineering
The teacher said:
"Fault tolerance is an important part of code engineering."
There are two layers of try-catch in the code:
- Outer layer: Catches API call failures (network issues, invalid Key, etc.).
- Inner layer: Catches JSON parsing failures (AI did not return standard JSON).
The content returned by AI is not 100% guaranteed to meet expectations; the code must have fault tolerance capabilities.
It's like asking someone to help you with something:
- They might not show up (API failure).
- They might show up but do it wrong (incorrect format).
- You must have a contingency plan for both.
4. Where Did the User's Prompt Go? It Was "Optimized" by the LLM
The teacher mentioned a particularly interesting phenomenon:
"The user's prompt is not used for direct generation; the LLM automatically optimizes your prompt."
You think you entered:
"Help me design a milk tea"
What the LLM actually processes internally is:
"The user is a milk tea shop owner who needs to design a summer drink suitable for university students, costing within 8 yuan, refreshing, visually appealing for social media, output in JSON format..."
The LLM automatically completes and optimizes your prompt based on context. This is why simple prompts can also yield great results in Cursor/Trae/Claude Code.
The teacher said:
"User prompt -> (LLM optimized prompt, context technology, MCP, Skills) -> Transformer Generation -> Loop Engineer + Harness Engineer -> FDE (AI Engineering Implementation)"
Your prompt is just the entry point; what truly drives the AI is a complete set of engineered context systems.
5. Summary: Context Engineering is the "Foundation" of AI Implementation
| Stage | Era | Core | Problem Solved |
|---|---|---|---|
| Prompt Engineering | 22-23 | Writing good prompts | Output quality |
| Context Engineering | 24-25 | Completing context | Hallucinations, insufficient knowledge |
| Harness Engineering | 25-26 | Rules + Guardrails + Loop | Deterministic delivery |
| Context Element | Role |
|---|---|
| background | Demand background, tells AI who you are and what you do |
| constraints | Constraint conditions, defines boundaries |
| outputRequirements | Output requirements, specifies format and specifications |
| temperature | Controls creativity |
| Fault tolerance handling | Deals with AI's uncertainty |
The essence of Context Engineering: It's not about writing a perfect prompt, but building a complete context framework so that AI can give reliable answers within the correct background, constraints, and requirements.
Written at the End
The biggest takeaway today was understanding the mindset of "Context Engineering." Before, writing prompts felt like "drawing a gacha" — writing a long passage, praying the AI gives a good answer. Now I know to give the AI sufficient background, constraints, and requirements, letting it work within the correct framework. AI is not magic; it needs a clear "job description."
Next time an interviewer asks you: "What is Context Engineering? How is it different from Prompt Engineering?"
You can calmly say:
"Prompt Engineering was the paradigm of 2022-23, centered on improving output quality through carefully designed prompts, but the results were uncertain and prone to hallucinations. Context Engineering is the upgrade of 2024-25, centered on completing the context for the LLM — including background information, constraints, and output requirements — so the AI works within the correct framework. RAG is a typical implementation of Context Engineering. Current LLMs are more powerful and automatically optimize user prompts, but context engineering remains crucial because it solves the problems of LLM knowledge cutoffs and missing scenarios."
Then look at the interviewer's satisfied expression and silently think: Nailed it, again.
All code examples in this article are from classroom learning materials and are genuinely runnable.