MEGA: Self-Evolving Agent Optimization Infrastructure via Wisdom Graph

arXiv:2608.10504 · cs.AI · Submitted 2026-08-11 · Read on arXiv

Jung Hwan Lee, Kyu Ho Lee, Gwang Hoon Yoo

cs.AI

Submitted: 2026-08-11

Updated: 2026-08-12

Comments: 29 pages, 10 figures. Technical report

Code: https://github.com/mega-edo/mega_benchmark

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 75/100

The gist: MEGA (Meta Evaluation-Grounded Adaptation) is presented as a self-evolving infrastructure for agent development that addresses three limitations of current approaches: optimization without knowledge

Terminology

Summary

MEGA (Meta Evaluation-Grounded Adaptation) is presented as a self-evolving infrastructure for agent development that addresses three limitations of current approaches: optimization without knowledge accumulation, knowledge accumulation without compositional reasoning, and a lack of self-evolution through operational evidence. The paper states: "Current approaches optimize agent systems without accumulating transferable knowledge, accumulate knowledge with-out compositional reasoning over it, and lack a mechanism for that knowledge to self-evolve through operational evidence."

The architecture consists of three layers forming a self-reinforcing cycle. Layer 1 (Session-based Wisdom Generation) distills reusable wisdom from agent sessions through two-stage clustering and multi-stage quality gating including behavioral A/B validation, transforming each process into structured, reasoning-ready material. Layer 2 (Wisdom Reasoning and Curation) "decomposes wisdom into atomic PCR triplets, performs deductive, abductive, and inductive reasoning to expand implicit relations, and assembles context-specific execution plans through compositional retrieval based on the Prize-Collecting Steiner Tree (PCST) formulation, with ROI-driven self-evolution. Layer 3 (Evaluation-Driven Optimization) performs multi-agent collaborative optimization, attributes improvement effects to specific strategy changes through controlled evaluation, and feeds evidence back to Layer 2—driving the self-evolution of both curation strategies and optimization trajectories."

The system accumulates four types of wisdom: skills (reusable procedural knowledge), strategies (decision rules and judgment criteria), curation patterns (which skills and strategies worked in what order and under what conditions), and optimization trajectories (which optimization trajectories succeeded or failed). These are stored in a typed Wisdom Graph (WG-DB) where wisdom is decomposed into atomic PCR (Primary-Context-Resultant) units with typed dependencies, and edges carry Sufficiency/Necessity scores inspired by Pearl's causal calculus.

Layer 1 uses BIRCH clustering for behavioral pattern discovery in a single O(n) pass, followed by LLM-based knowledge synthesis, structural filtering (hash deduplication, conflict detection, cross-run deduplication), and behavioral A/B validation that directly measures the causal impact of each wisdom candidate on task performance by comparing treatment (with wisdom) and control (without wisdom) groups on performance lift and token efficiency.

Layer 2 performs PCR reasoning with three modes: deduction (transitive causal inference with multiplicative score decay), abduction (reverse causal inference to discover hidden preconditions), and induction (statistical pattern discovery via hypergeometric testing). Compositional retrieval is formalized as a PCST problem that does not retrieve only skill-type wisdom but performs mixed-type subgraph assembly that cross-composes heterogeneous wisdom types. The output is not a simple top-k list but the linearization of a plan graph with assigned execution rules.

Layer 3 models agent workflows as directed graphs with heterogeneous node types (code nodes, LLM calls, tool-using agents) and optimizes the full tuple of prompt, tool configuration, code logic, and orchestration structure. It uses a Seed-Epoch regime where An evaluation dataset De = Sample(Dtrain, n, ξe) fixed by a deterministic seed ξe at epoch e eliminates data variance, making performance deltas attributable to strategy changes. Safeguards include anti-heuristic enforcement, overfitting detection, and fixability-based goal calibration.

Experimental results show MEGA achieves 46.5% pass rate with 0.566 score/Mtok efficiency on SkillsBench (84 tasks), surpassing SkillNet (41.7%, 0.424) and AgentSkillOS (41.1%, 0.345) while consuming fewer tokens. On four workflow benchmarks (HotpotQA, IFBench, HoVer, PUPA) with GPT-4.1 Mini, MEGA achieves an aggregate score of 76.55, outperforming GEPA (69.52) by +7.03 points and Feedback Descent (66.56) by +9.99 points.

The paper concludes: "Each optimization run refines not only the target system but also the curation strategies and optimization trajectories within the Wisdom Graph—the optimizer optimizes itself. As this cycle repeats across projects, the graph is intended to accumulate validated compositional patterns so that new projects begin from a baseline shaped by prior optimization rather than from scratch. In this design, optimizing an agent system and optimizing the very process by which optimization is performed are one and the same—a meta-optimization that compounds over time."

Improvements for AI systems

Improvements to AI Systems:

  1. Self-Evolving Knowledge Graphs for Agents
  • Implement a typed Wisdom Graph (WG-DB) where every agent session is distilled into atomic PCR (Primary-Context-Resultant) triplets with Sufficiency/Necessity scores.

  • The system automatically accumulates skills, strategies, curation patterns, and optimization trajectories across projects, enabling new tasks to start from a prior baseline instead of scratch.

  1. Compositional Reasoning over Heterogeneous Wisdom
  • Replace top-k retrieval with PCST-based subgraph assembly that cross-composes skills, strategies, and curation patterns into a linearized plan graph with execution rules.

  • The system can deduce implicit causal chains (deduction), infer hidden preconditions (abduction), and discover statistical patterns (induction) to generate context-specific execution plans.

  1. Causal, Evaluation-Driven Self-Optimization
  • Use a Seed-Epoch regime with deterministic evaluation datasets to eliminate data variance, making performance deltas directly attributable to specific strategy changes.

  • The optimizer attributes improvements to individual modifications (prompt, tool config, code logic, orchestration) and feeds evidence back to update the Wisdom Graph—so the optimizer itself improves over time.

  1. Behavioral A/B Validation for Knowledge Quality
  • Before adding any wisdom candidate, run controlled A/B tests (treatment vs. control) measuring performance lift and token efficiency.

  • This ensures only causally validated knowledge enters the graph, filtering out spurious or redundant patterns.

  1. Multi-Agent Collaborative Optimization with Safeguards
  • Deploy multiple agents to propose and test optimization strategies in parallel, with anti-heuristic enforcement, overfitting detection, and fixability-based goal calibration to avoid local optima and data leakage.

What the Improved AI System Can Do:

  • Accelerate Agent Development: New agent tasks inherit validated compositional patterns from prior projects, reducing trial-and-error and token consumption (e.g., 46.5% pass rate vs. 41.7% baseline with 0.566 vs. 0.424 score/Mtok efficiency).

  • Reason Across Knowledge Types: Instead of retrieving isolated skills, it assembles mixed-type plans (skills + strategies + curation patterns) that are context-aware and causally grounded.

  • Self-Improve Its Own Optimization Process: Each run refines not only the target agent but also the curation strategies and optimization trajectories—so the system becomes more efficient at optimizing itself over time.

  • Provide Explainable, Causal Improvements: Every optimization step is traceable to a specific wisdom unit and its measured causal impact, enabling transparent debugging and reliable performance gains (e.g., +7.03 points over GEPA on workflow benchmarks).

  • Operate with High Token Efficiency: By reusing validated wisdom and pruning ineffective strategies via A/B testing, it achieves superior performance with fewer tokens, making it viable for cost-sensitive production deployments.

Sources

Related papers