A brand new framework from Stanford College and SambaNova addresses a important problem in constructing sturdy AI brokers: context engineering. Known as Agentic Context Engineering (ACE), the framework mechanically populates and modifies the context window of enormous language mannequin (LLM) functions by treating it as an “evolving playbook” that creates and refines methods because the agent features expertise in its surroundings.
ACE is designed to beat key limitations of different context-engineering frameworks, stopping the mannequin’s context from degrading because it accumulates extra data. Experiments present that ACE works for each optimizing system prompts and managing an agent's reminiscence, outperforming different strategies whereas additionally being considerably extra environment friendly.
The problem of context engineering
Superior AI functions that use LLMs largely depend on "context adaptation," or context engineering, to information their conduct. As an alternative of the expensive strategy of retraining or fine-tuning the mannequin, builders use the LLM’s in-context studying talents to information its conduct by modifying the enter prompts with particular directions, reasoning steps, or domain-specific information. This extra data is often obtained because the agent interacts with its surroundings and gathers new knowledge and expertise. The important thing objective of context engineering is to arrange this new data in a approach that improves the mannequin’s efficiency and avoids complicated it. This strategy is turning into a central paradigm for constructing succesful, scalable, and self-improving AI methods.
Context engineering has a number of benefits for enterprise functions. Contexts are interpretable for each customers and builders, might be up to date with new information at runtime, and might be shared throughout completely different fashions. Context engineering additionally advantages from ongoing {hardware} and software program advances, such because the rising context home windows of LLMs and environment friendly inference strategies like immediate and context caching.
There are numerous automated context-engineering strategies, however most of them face two key limitations. The primary is a “brevity bias,” the place immediate optimization strategies are inclined to favor concise, generic directions over complete, detailed ones. This will undermine efficiency in advanced domains.
The second, extra extreme concern is "context collapse." When an LLM is tasked with repeatedly rewriting its whole amassed context, it could possibly undergo from a sort of digital amnesia.
“What we name ‘context collapse’ occurs when an AI tries to rewrite or compress every part it has realized right into a single new model of its immediate or reminiscence,” the researchers stated in written feedback to VentureBeat. “Over time, that rewriting course of erases vital particulars—like overwriting a doc so many instances that key notes disappear. In customer-facing methods, this might imply a help agent immediately dropping consciousness of previous interactions… inflicting erratic or inconsistent conduct.”
The researchers argue that “contexts ought to operate not as concise summaries, however as complete, evolving playbooks—detailed, inclusive, and wealthy with area insights.” This strategy leans into the energy of recent LLMs, which may successfully distill relevance from lengthy and detailed contexts.
How Agentic Context Engineering (ACE) works
ACE is a framework for complete context adaptation designed for each offline duties, like system immediate optimization, and on-line situations, similar to real-time reminiscence updates for brokers. Quite than compressing data, ACE treats the context like a dynamic playbook that gathers and organizes methods over time.
The framework divides the labor throughout three specialised roles: a Generator, a Reflector, and a Curator. This modular design is impressed by “how people study—experimenting, reflecting, and consolidating—whereas avoiding the bottleneck of overloading a single mannequin with all duties,” in keeping with the paper.
The workflow begins with the Generator, which produces reasoning paths for enter prompts, highlighting each efficient methods and customary errors. The Reflector then analyzes these paths to extract key classes. Lastly, the Curator synthesizes these classes into compact updates and merges them into the prevailing playbook.
To forestall context collapse and brevity bias, ACE incorporates two key design rules. First, it makes use of incremental updates. The context is represented as a set of structured, itemized bullets as an alternative of a single block of textual content. This permits ACE to make granular adjustments and retrieve probably the most related data with out rewriting your entire context.
Second, ACE makes use of a “grow-and-refine” mechanism. As new experiences are gathered, new bullets are appended to the playbook and present ones are up to date. A de-duplication step often removes redundant entries, guaranteeing the context stays complete but related and compact over time.
ACE in motion
The researchers evaluated ACE on two kinds of duties that profit from evolving context: agent benchmarks requiring multi-turn reasoning and power use, and domain-specific monetary evaluation benchmarks demanding specialised information. For prime-stakes industries like finance, the advantages lengthen past pure efficiency. Because the researchers stated, the framework is “way more clear: a compliance officer can actually learn what the AI realized, because it’s saved in human-readable textual content quite than hidden in billions of parameters.”
The outcomes confirmed that ACE constantly outperformed sturdy baselines similar to GEPA and traditional in-context studying, reaching common efficiency features of 10.6% on agent duties and eight.6% on domain-specific benchmarks in each offline and on-line settings.
Critically, ACE can construct efficient contexts by analyzing the suggestions from its actions and surroundings as an alternative of requiring manually labeled knowledge. The researchers notice that this means is a "key ingredient for self-improving LLMs and brokers." On the general public AppWorld benchmark, designed to judge agentic methods, an agent utilizing ACE with a smaller open-source mannequin (DeepSeek-V3.1) matched the efficiency of the top-ranked, GPT-4.1-powered agent on common and surpassed it on the tougher take a look at set.
The takeaway for companies is critical. “This implies corporations don’t must rely upon huge proprietary fashions to remain aggressive,” the analysis crew stated. “They will deploy native fashions, shield delicate knowledge, and nonetheless get top-tier outcomes by repeatedly refining context as an alternative of retraining weights.”
Past accuracy, ACE proved to be extremely environment friendly. It adapts to new duties with a mean 86.9% decrease latency than present strategies and requires fewer steps and tokens. The researchers level out that this effectivity demonstrates that “scalable self-improvement might be achieved with each increased accuracy and decrease overhead.”
For enterprises involved about inference prices, the researchers level out that the longer contexts produced by ACE don’t translate to proportionally increased prices. Fashionable serving infrastructures are more and more optimized for long-context workloads with strategies like KV cache reuse, compression, and offloading, which amortize the price of dealing with intensive context.
Finally, ACE factors towards a future the place AI methods are dynamic and repeatedly bettering. "In the present day, solely AI engineers can replace fashions, however context engineering opens the door for area specialists—legal professionals, analysts, docs—to instantly form what the AI is aware of by enhancing its contextual playbook," the researchers stated. This additionally makes governance extra sensible. "Selective unlearning turns into rather more tractable: if a chunk of data is outdated or legally delicate, it could possibly merely be eliminated or changed within the context, with out retraining the mannequin.”