Graph-Regularized Agentic Context Evolution (GRACE)
- The paper introduces GRACE, which replaces flat-text prompt editing with a structured, typed semantic graph to maintain and update persistent system-level instructions.
- It employs localized structural validation and a graph editing algebra to manage instruction evolution, reducing verification difficulty and preventing redundancy and contradictions.
- Experimental results in a telecom harness show that GRACE achieves a 7.4× improvement in strict reliability compared to flat-text baselines, underlining its practical benefits.
Graph-Regularized Agentic Context Evolution (GRACE) is a framework for reliable long-horizon evolution of the persistent system-level instruction in a deployed LLM agent. Rather than editing that instruction as a single flat prompt, GRACE maintains the mutable instruction component as a typed semantic graph, validates proposed updates within local typed neighborhoods of modified nodes, and reconstructs accepted graph updates as incremental edits to the textual instruction checkpoint actually used at deployment. In the formulation introduced for a fixed telecom agent harness derived from -bench, the model, tools, and harness remain fixed while only the persistent instruction evolves across batches of experience, with the goal of improving strict reliability under controlled distribution shift (Hsu et al., 10 Jul 2026).
1. Problem formulation and scope
GRACE is defined over agentic context, the model-external textual control content assembled by an operational harness. In the target setting, each model call receives a context composed of a system-level instruction, task input, tool-call traces or environment state, and harness-provided metadata. The method isolates the persistent system-level instruction as the only mutable component. Context assembly is written as
where denotes harness information and the task-specific input (Hsu et al., 10 Jul 2026).
Evolution proceeds batchwise. At batch , tasks are drawn from a batch distribution , experience is collected under the previous checkpoint , and a diagnosis signal is produced:
An evolution operator then updates both an internal substrate 0 and the deployed instruction:
1
For flat-text evolution, 2; for GRACE, the substrate is a graph 3 (Hsu et al., 10 Jul 2026).
The motivating failure mode is long-horizon flat-text maintenance. The paper identifies four consequences of repeated direct prompt editing: verification difficulty over an ever-growing document, interacting instructions that can contradict or undermine one another, prompt bloat and redundancy, and brittleness under distribution shift. GRACE addresses these issues by shifting the evolution substrate from unstructured text to a typed graph, while preserving a textual instruction checkpoint for deployment (Hsu et al., 10 Jul 2026).
2. Typed semantic graph substrate
At update step 4, GRACE maintains a directed typed graph
5
with object-type mapping 6, relation-type mapping 7, and content map 8, where 9 is natural-language text content. The node-type set is
0
and the relation-type set is
1
Here, identity encodes agent identity and mandate, norm encodes conduct rules, and knowledge encodes domain facts and assumptions. The relations mean, respectively, grounding or justification, same-type specialization, and procedural order among norms (Hsu et al., 10 Jul 2026).
The graph is constrained by a network schema
2
where each 3 specifies the allowed source-target type pairs for relation type 4. For any edge 5 of type 6, GRACE requires
7
The schema permits, for example, 8 edges such as identity 9 norm and knowledge 0 norm, requires 1 to connect same-type nodes, and restricts 2 to norm 3 norm (Hsu et al., 10 Jul 2026).
This typed structure is the central regularizing device. It makes relationships among instruction fragments explicit, limits admissible edits to schema-conformant operations, and turns verification into a neighborhood-scoped problem rather than a full-document rereading problem. A plausible implication is that the graph serves simultaneously as representation, constraint system, and search space for instruction updates.
3. Update planning and scoped structural validation
The graph-based evolution operator is
4
GRACE decomposes this into Operation Planning, Structural Validation, and Delta Reconstruction (Hsu et al., 10 Jul 2026).
Operation Planning uses a graph editing algebra
5
An LLM-based edit planner proposes
6
which is applied to produce a provisional graph 7 and a set of touched nodes 8. A relation-maintenance module then proposes relation-focused edits
9
yielding a candidate graph 0 and a touched-node set 1 (Hsu et al., 10 Jul 2026).
Structural Validation is scoped to local typed neighborhoods. Let
2
For radius 3, the 4-hop neighborhood is
5
GRACE uses a progressive schedule starting at 6 and increasing by 7, and defines the validation neighborhood 8 as the induced subgraph on the final radius (Hsu et al., 10 Jul 2026).
Within 9, Structural Analysis (SA) detects contradictions and redundancy. Contradiction is defined by overlapping scope plus unsatisfiable joint content:
0
Redundancy is defined only for same-type nodes and requires overlap plus entailment:
1
2
The issue set is
3
and repairs are performed through schema-conformant edit operations such as merge, modify, or remove (Hsu et al., 10 Jul 2026).
The local scope is not merely an efficiency heuristic. The ablation in the paper shows that graph structure without SA improves early but does not sustain reliability, whereas full GRACE continues improving. This indicates that consolidation and conflict resolution are integral to the method rather than ancillary checks.
4. Reconstruction into deployed instruction text
GRACE does not deploy the graph directly. After validation, it reconstructs an updated textual checkpoint from graph deltas. Let the graph-level change log be
4
where 5 is the component-wise symmetric difference between graph states. Delta reconstruction is
6
This produces the new persistent instruction actually fed to the agent at deployment (Hsu et al., 10 Jul 2026).
The reconstruction is incremental rather than generative-from-scratch. Added nodes insert new text in appropriate sections, modified nodes rewrite aligned spans, and merged or removed nodes delete or consolidate text. The typed structure guides document organization: identity content appears early, knowledge is grouped by topic or support relations, and norms are ordered using sequence and refinement structure (Hsu et al., 10 Jul 2026).
This reconstruction layer is crucial to the overall architecture. GRACE uses the graph as an internal evolution substrate, but retains textual instructions as the operational interface to a fixed harness and fixed model. This suggests a separation between internal control representation and deployment surface form: structure is used where verification is needed, while text is used where compatibility is required.
5. Experimental evaluation and empirical profile
GRACE is evaluated in a telecom customer-service harness derived from 7-bench, with Gemini 2.5 Flash as the fixed agent model, fixed tools and tool interfaces, a fixed diagnosis pipeline, GPT-4.1 as user simulator, and a held-out evaluation set of 66 tasks. Evolution uses 10 experience batches of 42 tasks each, with alternating intent mixtures: Phase A batches emphasize MMS and downweight Mobile Data, Phase B batches emphasize Mobile Data and downweight MMS, while Service intent is held constant. Each primary condition is run for five independent evolution trajectories. At each reported checkpoint, evaluation uses 66 tasks with 3 trials each, for 198 episodes per run (Hsu et al., 10 Jul 2026).
Strict reliability is measured by 8, while pass@3 and pass@1 measure less stringent success criteria. The shared initial instruction 9 for Gemini 2.5 Flash has 0, pass@3 1, and pass@1 2. At the final checkpoint 3, GRACE reaches 4, pass@3 5, and pass@1 6 (Hsu et al., 10 Jul 2026).
| Condition | Final 7 |
|---|---|
| GRACE | 0.673 ± 0.136 |
| GRACE w/o SA | 0.248 ± 0.144 |
| HCE | 0.191 ± 0.051 |
| Gemini 3.1 Pro zero-shot | 0.242 |
| Gemini 2.5 Flash zero-shot | 0.091 |
The paper states that GRACE’s strict reliability of 8 is approximately 9 the Gemini 2.5 Flash zero-shot value and exceeds the Gemini 3.1 Pro zero-shot reference of 0 on the same held-out set (Hsu et al., 10 Jul 2026). Across checkpoints, GRACE is the only method showing monotone improvement in later stages: 1 gives 2, 3 gives 4, and 5 gives 6. By contrast, GRACE without SA improves initially to 7 at 8 but falls to 9 at 0, while the flat-text HCE baseline rises modestly and then regresses to 1 (Hsu et al., 10 Jul 2026).
Instruction growth and post-hoc audits support the same interpretation. Deployed instruction size at 2 is 51,413 characters for GRACE, 54,893 for GRACE without SA, and 82,592 for HCE. HCE shows the highest contradiction count in the audit, while GRACE without SA shows more redundancy than full GRACE. Backward transfer under alternating shift is mostly non-negative for GRACE, whereas HCE shows persistent negative backward transfer and the graph-only ablation does not maintain strong retention (Hsu et al., 10 Jul 2026).
6. Intellectual context, distinctions, and open problems
GRACE belongs to a broader 2025–2026 turn toward graph-structured agent state, memory, and context control, but its specific substrate is unusual. ACE introduced Agentic Context Evolution as a retrieve-versus-think controller over a growing working memory 3, without an explicit graph representation (Chen et al., 13 Jan 2026). VimRAG modeled multimodal reasoning as a dynamic DAG of epistemic states and used graph-modulated memory allocation plus graph-guided policy optimization (Wang et al., 13 Feb 2026). HAGE treated memory retrieval as sequential, query-conditioned traversal over a weighted multi-relational graph with trainable edge features and anchor regularization (Jiang et al., 11 May 2026). ContextNav used an Operational Grammar Graph to constrain multimodal contextualization workflows (Fu et al., 6 Oct 2025). AEvo cast accumulated evolution context as process-level state edited by a meta-agent, and Graphectory represented agent trajectories as graphs for process-centric analysis (Zhang et al., 13 May 2026, Liu et al., 2 Dec 2025). This suggests that GRACE is best understood as a specific instance of a wider methodological shift: from flat histories and flat prompts toward structured substrates that make accumulation, verification, and adaptation tractable.
GRACE differs from those adjacent lines in one decisive respect: it targets the persistent system-level instruction itself as the evolving object. It does not primarily optimize retrieval paths, multimodal token budgets, or software-agent trajectories. Instead, it regularizes long-horizon prompt evolution by storing instruction content as typed graph objects, validating only the typed neighborhoods touched by an update, and then reconstructing deployment text. A plausible implication is that GRACE occupies a control-layer position above many earlier graph-memory methods.
The paper also states several limitations. Experiments are limited to the telecom domain of 4-bench; the schema is deliberately simple, with only three node types and three relation types; graph size may still become large even with local validation; and edit planning, relation maintenance, and structural analysis all depend on LLM judgments. Future directions include richer typing systems and logics, stronger verification through symbolic or formal methods, evaluation in more domains and harnesses, comparison with other context-evolution systems under matched budgets, and multi-agent extensions (Hsu et al., 10 Jul 2026).