Blog
最新趨勢

Why AI agents get worse over time: context engineering explained

Does your AI agent get dumber and costlier after launch? The cause is often context engineering. This article explains what it is, why it decides whether an agent succeeds, and how to evaluate vendors.

AI lab
26/05/2026
Share this article
FacebookLinkedinLINE

Context engineering (also called contextual engineering) is an engineering method for systematically designing the information an AI agent receives, with the aim of keeping the agent stable across multi-step, long-running tasks. When an enterprise AI agent seems to "get dumber and costlier the longer it runs" after launch, the problem is often not the model itself but context engineering that was not done well. From the perspective of enterprise adoption, this article explains what context engineering is, why in 2026 it has replaced prompt engineering as the core of putting AI into daily use, and how it decides whether an AI agent project succeeds.

‍

‍

Context engineering (also called contextual engineering) is an engineering method for systematically designing the information an AI agent receives, with the aim of keeping the agent stable across multi-step, long-running tasks. When an enterprise AI agent seems to "get dumber and costlier the longer it runs" after launch, the problem is often not the model itself but context engineering that was not done well. From the perspective of enterprise adoption, this article explains what context engineering is, why in 2026 it has replaced prompt engineering as the core of putting AI into daily use, and how it decides whether an AI agent project succeeds.

‍

What is context engineering, and why does it decide whether an AI agent succeeds?

‍

Context engineering (also called contextual engineering) is the engineering method of systematically designing, assembling and managing "the information an AI agent actually sees before each decision." It covers the system prompt, conversation history, retrieval results, tool outputs and task state. Its goal is not to word the input nicely, but to make sure that at every step of a multi-step task the agent gets information that is "just enough and just right."

‍

If your company has already adopted an AI agent, you may have met this scene: the first week after launch looks impressive, then by the second month colleagues start complaining that "it seems to have gotten dumber." Answers drift off topic, it forgets settings given earlier, and the API bill keeps climbing. Most people's first reaction is "the model isn't strong enough" or "we should switch vendors." The reality is often the opposite: the model has not gotten worse; what it "sees" at each step has gone wrong.

‍

This is the most important shift in thinking in AI engineering in 2026. When AI evolves from a one-question-one-answer chatbot into an agent that breaks down tasks itself, calls tools and runs continuously, what decides success is no longer how well a single prompt is written, but whether the whole information environment is designed correctly. Context engineering is the discipline of designing that information environment.

‍

For companies evaluating or already running an AI agent, this idea matters because it maps directly to a very practical question: why do some AI agent projects run stably for a year, while others quietly spin out of control in the sixth month and are finally shut down? The answer often lies not in technology choice but in whether anyone took context engineering seriously.

‍

‍

Why is prompt engineering no longer enough in 2026?‍Prompt engineering falls short not because it did anything wrong, but because the way AI is used has changed. It has moved from static Q&A, where a person gives one sentence and the AI answers with one, to a dynamic process where the AI runs dozens of steps in a row and decides the next step itself. Once the input is no longer just a prompt written by a person, the scope prompt engineering can manage is not enough.

‍

Why is prompt engineering no longer enough in 2026?

‍

Prompt engineering falls short not because it did anything wrong, but because the way AI is used has changed. It has moved from static Q&A, where a person gives one sentence and the AI answers with one, to a dynamic process where the AI runs dozens of steps in a row and decides the next step itself. Once the input is no longer just a prompt written by a person, the scope prompt engineering can manage is not enough.

‍

The shift from one question, one answer to multi-step agent execution

‍

Prompt engineering was born in the chatbot era of late 2022. Interaction between people and AI was single-turn then: a user could set a prompt at the start of the conversation and effectively steer the answer toward what was expected. In that setting, "writing that one sentence well" was nearly the same as "using AI well."

‍

But in the agent era of 2026, the interaction pattern has changed completely. A production-grade AI agent completing a task may make dozens or even hundreds of tool calls, retrievals and reasoning steps in a row. The "input it sees" at each step no longer comes only from that one human sentence; it is a mix of the system prompt, every earlier turn of conversation, retrieved document fragments, tool results and the state of a task partway done.

‍

A late-2025 report by Anthropic and the research firm Material, surveying more than 500 technical decision-makers, shows [2] that 57% of companies already use AI agents for multi-step workflows, and 16% of them have progressed to complete processes spanning multiple departments; in 2026, 81% plan to take on more complex scenarios. This is the underlying reason demand for context engineering has risen sharply: the longer and more cross-departmental the process served, the more complex the information environment to manage at each step.

‍

This means one thing: the input becomes a dynamic system that keeps growing as the task advances, not a fixed piece of text. Prompt engineering deals with "what the person said," but eight in ten of an agent's troubles come from "the large pile of things the person did not say but that got stuffed in." Managing that pile takes a different method.

‍

‍

The essential difference between context engineering and prompt engineering

‍

The simplest way to understand the difference is to look at what each one manages. Prompt engineering is concerned with "what you say to the AI," such as how the instruction is given, how the format is arranged and whether to include examples. Context engineering is concerned with "what else the AI sees at that moment," including memory, retrieval results, tool outputs, task state and control flow.

‍

In other words, prompt engineering is part of context engineering, but the scope of context engineering is much larger. AI researcher Andrej Karpathy described context engineering as a delicate craft of "filling the context window with just the right information." The emphasis falls on "just right": too much dilutes attention and pushes up cost, while too little misses key constraints.

‍

The table below sets out the core division of labor between the two:

‍

This table compares the core division of labor between prompt engineering and context engineering. First, the focus differs: prompt engineering covers the sentence you say to the model, while context engineering covers the whole information environment the model sees. Second, the subject differs: the former deals with a single instruction and format, while the latter covers the system prompt, memory, retrieval and state. Third, prompt engineering suits single-turn Q&A, while context engineering suits long multi-step tasks, and the failure symptom changes from an off-topic answer to getting dumber the longer it runs.

‍

This table compares the core division of labor between prompt engineering and context engineering. First, the focus differs: prompt engineering covers the sentence you say to the model, while context engineering covers the whole information environment the model sees. Second, the subject differs: the former deals with a single instruction and format, while the latter covers the system prompt, memory, retrieval and state. Third, prompt engineering suits single-turn Q&A, while context engineering suits long multi-step tasks, and the failure symptom changes from an off-topic answer to getting dumber the longer it runs.

‍

It is worth clarifying that this is not "prompt engineering being retired" but "the center of gravity moving up." A prompt still has to be written well, but for an AI agent to run stably, the real effort goes into designing the whole information environment correctly. That is why the 2026 consensus in engineering circles has moved from "finding the magic spell" to "building a system that manages input." In July 2026 the AI Engineer World's Fair set up a separate agenda track for context engineering for the first time [6], and some speakers on site carried the job title "Context Engineer" rather than "Prompt Engineer." When a field has its own conference track and its own job title, it is no longer a trend forecast but an industry reality.

‍

‍

Most drops in AI agent performance after launch trace back to three kinds of context problems: diluted attention, runaway cost, and errors that cannot be traced to a cause. The same root cause sits behind all three: no one is managing the information the agent actually sees at each step. Here is what these three situations look like in practice.

‍

Three situations where an agent "gets dumber and costlier the longer it runs" after launch

‍

Most drops in AI agent performance after launch trace back to three kinds of context problems: diluted attention, runaway cost, and errors that cannot be traced to a cause. The same root cause sits behind all three: no one is managing the information the agent actually sees at each step. Here is what these three situations look like in practice.

‍

Diluted attention: persona drift and role confusion

‍

The first situation is an agent that "forgets who it is as it goes along." A conversational agent performs well in the first three turns, but by turn ten or fifteen the persona and role set at the start begin to loosen: a role that was meant to be rigorous becomes casual, and a role meant to ask the questions starts answering them instead.

‍

This is not a broken model, but the attention of a large language model being gradually pulled away by later conversation. The longer the conversation, the less weight the role definition at the very beginning carries in the model's "eyes." Data-DI has run into this phenomenon repeatedly in real conversational agent projects [5], and the final fix was not to write a longer persona but to design a mechanism that has the model "review" who it is before every response. This is what context engineering looks like in practice: not a fixed block of text, but one managed dynamically.

‍

Runaway cost: context sent over and over

‍

The second situation hides in the bill. At every reasoning step or tool call, the system often sends the same system prompt, policy descriptions, tool descriptions and full conversation history to the model again, unchanged. When a task runs dozens of steps, this repeated information is billed dozens of times.

‍

Datadog's State of AI Engineering 2026 report analyzed LLM call records from thousands of enterprise production environments and found [3] that as much as 69% of input tokens went to the system prompt (policy instructions, tool definitions, format rules and so on), with the user's actual input a small share of it; even for models that support caching, only 28% of calls actually used cache reads, meaning most calls were still reprocessing the same full prompt. In other words, for many companies a large part of the AI bill pays for "repeated information no one is managing." This is not theory. In July 2026 Anthropic publicly shared its own experiment [7]: when tuning Claude Code's system prompt for a new generation of models, the team cut more than 80% of the existing prompt content and replaced "load everything at once" with "load progressively on demand," and saw no drop in performance on code evaluations. This is first-hand data from the model maker's own team showing that a large system prompt does not merely waste tokens but itself interferes with the model's judgment. What context engineering sets out to solve is letting each step carry only what it should.

‍

Errors that cannot be traced: no context structure

‍

The third situation is the most hidden and the most damaging. When an agent answers wrongly, the team cannot say where the problem is. Was the retrieved document wrong? Did the conversation history lead it astray? Or did noise in the tool output drown out the real signal?

‍

When an agent's input is a soup with everything mixed together, there is nothing to take apart when it goes wrong. When the context is properly layered, with the static system prompt, dynamic retrieval results and temporary tool outputs each kept distinct, a team can quickly locate "which layer of information contaminated the decision." The structure of the context decides whether a team can or cannot fix its own AI agent. It also shifts the question from "switch to a stronger model" to "clean up the information environment," and the latter is the capability most companies actually lack.

‍

‍

The core of context engineering can be condensed into one sentence: at every step of the agent, put in only "just enough, just right" information. To do this, the industry has developed a relatively mature engineering discipline, and its principles are closely connected.

‍

Core strategies of context engineering: the engineering discipline of managing context

‍

The core of context engineering can be condensed into one sentence: at every step of the agent, put in only "just enough, just right" information. To do this, the industry has developed a relatively mature engineering discipline, and its principles are closely connected.

‍

Compress, retrieve, isolate: three basic moves for managing context

‍

Whatever platform or model you use, context engineering in practice revolves around three basic moves. Understanding them does not require an engineering background, but it helps a company judge whether a vendor is actually doing this work.

‍

The first is compression. As conversation history and tool outputs pile up, instead of sending everything to the model unchanged, it is better to summarize the long content or replace it with a pointer. For example, a tool result of several thousand characters can be condensed into a few key lines or marked "see a given record." Done well, compression solves both cost and attention. But compression carries risk too: a rough summary can filter out a key constraint such as "ask before deleting," so what to compress and what to keep is itself something to design.

‍

The second is retrieval. An agent does not need to, and should not, carry all knowledge in its context. It pulls in relevant fragments from the knowledge base when needed. This is the role retrieval-augmented generation (RAG) plays. The key to retrieval is not "fetching a lot" but "fetching accurately": pulling back a pile of loosely related documents drowns the truly useful signal in noise. Data-DI has broken down knowledge base building and retrieval quality in several articles, and for this part you can read on in ourarticle on RAG and reranking.

‍

The third is isolation. Context of different kinds is managed in layers, with the static system prompt, dynamic retrieval results and temporary tool outputs kept distinct, not mixed into one pot. Done well, isolation makes the agent's decisions cleaner and lets you quickly locate which layer went wrong when an error occurs. For complex scenarios that need several agents to work together, isolation shows up further in the architecture design, and for this part seeour explainer on multi-agent collaboration.

‍

It is worth mentioning that these three moves are no longer one vendor's private method. In a technical article published in July 2026 [8], the LangChain engineering team summarized context engineering as four operations (write, select, compress and isolate), which closely matches the classification in this article, showing that the industry has converged on a shared framework. For companies this is good news: you do not need to bet on any one platform's terminology or method, because the underlying engineering discipline is common.

‍

Context engineering is a loop, not a one-time setup

‍

The one understanding companies most need to build about this discipline is that context engineering is not work you "set up once and finish," but a loop that keeps running.

‍

In the short term, before every model inference, the context needed at that moment has to be selected in real time. In the long term, as task types evolve, the underlying model version is updated and the knowledge base grows, the whole context strategy has to be adjusted. A context architecture that is well designed today may need rebuilding half a year later. This is also why context engineering is treated as "engineering": it needs a full cycle of design, implementation, testing and tuning, not a prompt written once and then left alone.

‍

For companies, this "loop" character raises a key practical question: does anyone inside the company have the capacity to carry an engineering discipline that must keep running? That is what the next section covers, where context engineering turns from a technical term into an adoption decision.

‍

‍

What does this mean for companies evaluating an AI agent?

‍

If you are reading this not as an engineer but as someone making AI adoption decisions for your company, the most important meaning of context engineering for you comes down to one sentence: it decides whether your AI agent budget becomes an asset half a year later, or a mess no one dares to touch.

‍

Poor context engineering is the technical name for "failed adoption"

‍

The symptoms mentioned earlier, getting dumber with use, runaway bills and errors no one can explain, would not be called "context engineering problems" when laid before management. They would be called "this AI project isn't working." For most failed AI agent projects, the technical root causes are in fact highly concentrated, and context management is one of the most common among them.

‍

This also explains a frequently cited industry prediction: the research firm Gartner estimates [1] that by the end of 2027, more than 40% of agentic AI projects will be discontinued by companies, mainly because of runaway cost and unclear business value. A recent survey by the Capgemini Research Institute of 1,500 senior executives across industries confirms the same gap [4]: currently only 2% of organizations have deployed AI agents at scale, 12% at partial scale, and more than 60% are still at the pilot or wait-and-see stage, while fewer than 20% of organizations consider their data and technology infrastructure mature enough to support scaled deployment. "Runaway cost" and "immature infrastructure" correspond almost directly to the repeated-context problem and the context management gap described earlier. In other words, a considerable share of that 40% did not lose because "the AI was not strong enough," but because "no one managed the information environment well." For decision-makers this distinction is critical: the former asks you to change the technology, the latter asks you to change the way of working.

‍

What to ask vendors shifts from "features" to "methods"

‍

Once you understand context engineering, the questions a company should ask when evaluating AI agent vendors become noticeably different.

‍

In the past, companies comparing vendors mostly asked feature questions: can it be customized, does it support a certain channel, is the interface easy to use. But every vendor will give you a nice answer to these feature questions. The idea of context engineering lets you ask method questions that truly discriminate:

‍

This table contrasts the feature questions companies often ask when evaluating AI agent vendors with the method questions they should actually ask. Feature questions include whether it can be customized, whether it is No Code, how long until launch, and whether there are cases. Method questions ask instead how forgetting is prevented as conversations grow longer, how context at each step is controlled, how no regression is ensured after a model upgrade, and how to locate the context layer when an answer is wrong. Method questions tell vendors' real delivery capability apart better.

‍

This table contrasts the feature questions companies often ask when evaluating AI agent vendors with the method questions they should actually ask. Feature questions include whether it can be customized, whether it is No Code, how long until launch, and whether there are cases. Method questions ask instead how forgetting is prevented as conversations grow longer, how context at each step is controlled, how no regression is ensured after a model upgrade, and how to locate the context layer when an answer is wrong. Method questions tell vendors' real delivery capability apart better.

‍

Vendors who do this work can give concrete, structured answers to the questions on the right; vendors who only sell tools will skim past with adjectives such as "our technology is very mature." For how to judge systematically whether an AI agent vendor can really deliver, read on inhow to choose an AI agent consultant: 5 practical delivery checkpoints, which sets out the pre-contract stress-test questions in a table you can take into the meeting room.

‍

In the end, the value of context engineering to a business decision-maker is not turning you into half an engineer, but giving you a yardstick, so that before the budget is committed you can tell who can bring an AI agent to "stable operation" and who has merely "built it."

‍

‍

How AltaBots.ai turns context engineering into a deliverable capability

‍

If you are trying to solve context management problems with Codex or Claude Code, the principles above apply equally, and the only difference is scale. A company has to support AI agents across multiple departments, and the problem grows into an organizational burden. To find out how ready your team is, you can spend 3 minutes on thisAI agent adoption readiness quiz.

‍

AltaBots.ai is an enterprise AI agent platform from Data-DI. Its core differentiator is consultants working alongside you from decision to production, more than the No Code tooling itself, and context engineering is the part of that consultant-led approach that most needs consultants' experience.

‍

Why context engineering cannot be left to a tool alone

‍

As discussed above, context engineering is a loop that has to keep running: what to compress, how accurate to make retrieval, how to layer and isolate, and how to rebuild after a model upgrade. None of these can be solved by "dragging a few things in the interface." Someone has to make judgments based on the company's actual business scenario.

‍

This is why a plain No Code platform cannot truly solve context engineering. No Code solves "who builds it," letting people who cannot code assemble an agent. It does not solve "how to build it": how to set the compression strategy, how to split the knowledge base, how to prevent persona drift. Even with the tool, you will still be stuck not knowing how to manage context. This is why AltaBots.ai does not make No Code its positioning. For enterprise customers, the real value is not "I can build it myself" but "it can still produce value reliably half a year later."

‍

How consultants working alongside you put context engineering into practice

‍

In AltaBots.ai's dual-track delivery model, context engineering is not a feature thrown to the customer to figure out alone, but is broken down into every stage of consultant-led work:

‍

In the requirements interview stage, consultants first clarify which tasks the agent will handle after launch and which sources the context will come from, and plan the architecture of the information environment accordingly, instead of rushing to write prompts. In the development stage, for the real pitfalls mentioned earlier such as persona drift and role confusion, consultants design matching context-injection mechanisms, for example having the model review its role definition on every turn. In the post-launch Evals stage, consultants keep monitoring the agent's performance, locate which layer of context an error comes from, and adjust the whole strategy as model versions are updated, which means someone is actually turning that "context engineering loop."

‍

In other words, AltaBots.ai turns context engineering from an abstract technical term into a delivery process that has someone responsible, a method, and acceptance criteria. For a company adopting an AI agent for the first time, or one whose previous attempt failed and wants to start over, this is the difference between "finding a tool" and "finding a partner."

‍

‍

Conclusion: understand context first, then decide how to adopt

‍

Back to the scene at the start: in the second month after launch, colleagues complain the AI agent has gotten dumber while the bill keeps rising. Having read this article, you should now know that this is mostly not the model's fault but a lack of anyone managing context engineering.

‍

In 2026, AI has evolved from chatbots into agents that carry out tasks on their own, and what decides success has moved up from "writing one prompt well" to "designing the whole information environment well." Context engineering is not a technical term meant to make you an engineer. It is a yardstick: before the budget is committed, it lets you tell whether an AI agent project will run stably for a year or quietly spin out of control in the sixth month. For an enterprise decision-maker, understanding this yardstick matters more than understanding any feature specification.

‍

If your company is evaluating an AI agent rollout, or a previous rollout got stuck in "getting less stable the longer it runs" and you want to start over, you can book a free AI agent adoption assessment conversation. Data-DI consultants will work with you, based on your company's current stage, team setup and business scenario, to clarify how the context engineering loop should run and who should run it, and help you judge the most practical next step for now.

‍

References

[1] Gartner. (2025). Gartner Predicts Over 40% of Agentic AI Projects Will Be Canceled by End of 2027. Gartner Newsroom.
‍https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027

[2] Anthropic × Material. (2025). The 2026 State of AI Agents Report. Claude by Anthropic.
‍https://claude.com/blog/how-enterprises-are-building-ai-agents-in-2026

[3] Datadog. (2026). State of AI Engineering 2026. Datadog.
‍https://www.datadoghq.com/state-of-ai-engineering/

[4] Capgemini Research Institute. (2025). Rise of Agentic AI: How Trust Is the Key to Human-AI Collaboration.

‍https://www.capgemini.com/insights/research-library/ai-agents/

[5] Data-DI. (2026). AltaBots.ai internal project records (in Chinese). The practical pitfalls described in this article, such as persona drift and role confusion in conversational agents, and the matching fixes, are compiled from Data-DI's hands-on experience across multiple AI agent adoption projects and have been de-identified.

[6] Unblocked. (2026). Context Engineering Grew Up at the World's Fair. Unblocked Blog.
‍https://getunblocked.com/blog/context-grew-up-at-the-worlds-fair/

[7] Anthropic. (2026). The New Rules of Context Engineering for Claude 5 Generation Models. Claude by Anthropic.
‍https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models

[8] LangChain. (2026). Context Engineering for Agents. LangChain Blog.
‍https://www.langchain.com/blog/context-engineering-for-agents

FAQ

FAQ

FAQs about this article

What is the difference between context engineering and prompt engineering?

Prompt engineering is concerned with "the sentence you say to the AI" and handles a single instruction and format; context engineering is concerned with "the whole information environment the AI sees at that moment," covering the system prompt, memory, retrieval results, tool outputs and task state. Prompt engineering is part of context engineering, whose scope is much larger, and it is the core of the agent era.

Why does an AI agent "get dumber and costlier the longer it runs" after launch?

The main cause is usually not a worse model but unmanaged context. The longer the conversation, the more the model's attention is diluted, causing role and settings to drift; at the same time the system resends the same prompt and history at every step, so token cost keeps accumulating. Both problems fall within what context engineering sets out to solve.

What are the core practices of context engineering?

They can be summarized as three basic moves: compression, which summarizes or replaces long history and tool output; retrieval, which pulls relevant fragments from the knowledge base only when needed, with accuracy as the point; and isolation, which manages static prompts, dynamic retrieval and temporary output in separate layers. Used together, they let every step get just enough information.

What effect does poor context engineering have on an enterprise AI agent rollout?

The effect shows directly in whether the project succeeds. Poor context management causes runaway cost, unstable behavior and errors that cannot be located, which are common technical root causes of discontinued AI agent projects. For a company, how well context engineering is done often decides whether that budget is an asset or a burden half a year later.

Should a small or mid-sized company do context engineering itself or get help from consultants?

If the company already has a team with hands-on agent adoption experience, it can handle it itself. But context engineering is a loop that has to keep running, involving compression strategy, knowledge base design and rebuilding after model upgrades. For most companies adopting for the first time, or whose previous attempt failed, working with consultants alongside them is more practical and avoids repeating the same pitfalls.

Related articles

More articles

Newsletter

訂閱我們的電子報

每月 8 日定期發送最新趨勢與實用資訊!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.