
A brand new framework from Stanford University and SambaNova addresses a important problem in constructing strong AI brokers: context engineering. Referred to 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 good points 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 means of retraining or fine-tuning the mannequin, builders use the LLM’s in-context learning abilities to information its conduct by modifying the enter prompts with particular directions, reasoning steps, or domain-specific data. This extra data is often obtained because the agent interacts with its surroundings and gathers new knowledge and expertise. The important thing purpose of context engineering is to prepare 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, may be up to date with new data at runtime, and may be shared throughout totally different fashions. Context engineering additionally advantages from ongoing {hardware} and software program advances, such because the growing context windows of LLMs and environment friendly inference methods like immediate and context caching.
There are numerous automated context-engineering methods, however most of them face two key limitations. The primary is a “brevity bias,” the place immediate optimization strategies are likely to favor concise, generic directions over complete, detailed ones. This could undermine efficiency in advanced domains.
The second, extra extreme challenge is "context collapse." When an LLM is tasked with repeatedly rewriting its whole gathered context, it will possibly undergo from a form of digital amnesia.
“What we name ‘context collapse’ occurs when an AI tries to rewrite or compress all the things it has realized right into a single new model of its immediate or reminiscence,” the researchers mentioned in written feedback to VentureBeat. “Over time, that rewriting course of erases necessary particulars—like overwriting a doc so many occasions that key notes disappear. In customer-facing methods, this might imply a help agent abruptly shedding consciousness of previous interactions… inflicting erratic or inconsistent conduct.”
The researchers argue that “contexts ought to perform not as concise summaries, however as complete, evolving playbooks—detailed, inclusive, and wealthy with area insights.” This strategy leans into the power of contemporary 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 prompt optimization, and on-line situations, akin to real-time reminiscence updates for brokers. Moderately 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 be taught—experimenting, reflecting, and consolidating—whereas avoiding the bottleneck of overloading a single mannequin with all tasks,” in line 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 stop context collapse and brevity bias, ACE incorporates two key design ideas. 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 modifications and retrieve essentially 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 frequently 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 data. For top-stakes industries like finance, the advantages lengthen past pure efficiency. Because the researchers mentioned, the framework is “much more clear: a compliance officer can actually learn what the AI realized, because it’s saved in human-readable textual content relatively than hidden in billions of parameters.”
The outcomes confirmed that ACE persistently outperformed robust baselines akin to GEPA and basic in-context studying, attaining common efficiency good points 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 be aware that this means is a "key ingredient for self-improving LLMs and brokers." On the general public AppWorld benchmark, designed to guage 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 harder take a look at set.
The takeaway for companies is critical. “This implies corporations don’t need to rely on huge proprietary fashions to remain aggressive,” the analysis crew mentioned. “They will deploy native fashions, defend delicate knowledge, and nonetheless get top-tier outcomes by constantly 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 may be achieved with each larger 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 larger prices. Trendy serving infrastructures are more and more optimized for long-context workloads with methods like KV cache reuse, compression, and offloading, which amortize the price of dealing with intensive context.
In the end, ACE factors towards a future the place AI methods are dynamic and constantly enhancing. "At this time, solely AI engineers can replace fashions, however context engineering opens the door for area specialists—legal professionals, analysts, medical doctors—to instantly form what the AI is aware of by enhancing its contextual playbook," the researchers mentioned. This additionally makes governance extra sensible. "Selective unlearning turns into far more tractable: if a chunk of data is outdated or legally delicate, it will possibly merely be eliminated or changed within the context, with out retraining the mannequin.”