Classification & Routing
- Intent Classification
- Sentiment analysis
- Topic routing
- Conditional routing
Which prompts and decision boundaries survived edge cases, and which collapsed. Accuracy grows across runs instead of resetting.
Optimization is not a one-shot improvement. It's a continuous loop that runs until performance stops improving.
Each cycle compounds on the last. The system gets better at the job every time it runs the job.
Whether your agent is already in production or still mid-build, point MEGA at the repo. It picks up your evaluation method and dataset, then runs the loop — every iteration from there is automated.
Every epoch starts smarter than the last. The Wisdom Graph is the memory that makes compounding possible.
Sample Training Set (Seed k)
A fixed subset of the dataset is sampled for this epoch. This stable target is what every iteration has to beat.
Baseline Measurement
Performance is measured before any changes. This is iter_0. The number every future iteration is scored against.
Wisdom Curation
The Wisdom Graph assembles the best-fit execution structure for this task. Not a retrieval dump. A curated orchestration.
Iterative Refinement
Execute. Validate. Refine. Repeat. Each iteration adjusts from feedback and compounds gains on the fixed subset until saturation.
Validation Data Test
Gains are verified against unseen data. Confirms improvements generalize — not overfit to the subset. Validated gains close the epoch.
A new subset is sampled (Seed k+1)
When the loop restarts, the Wisdom Graph carries forward everything learned from epoch k. Gains compound across epochs, not within them.
sample: 50 / 3,247
iter_0: pending

Every production LLM pipeline has some way of knowing what “working” looks like. A correct label, a retrieved document that belonged, a passing test, a trajectory that completed. That signal is what lets an optimization loop learn. These are the patterns MEGA Code runs on most often, but not the only ones it works for.
Which prompts and decision boundaries survived edge cases, and which collapsed. Accuracy grows across runs instead of resetting.
Every corrected extraction — wrong span, missing entity, mis-linked relation — becomes a reusable pattern. Quality improves the more you run it.
Which documents matter for which query types, and which retrieval strategies fail on which edges. Precision compounds with use.
Patterns in what gets corrected, rejected, or re-written. Generation tightens across runs, not just for one prompt.
Which phrasings mapped to which structures, and which hallucinated arguments got rejected. Reliability grows per session.
Successful trajectories become reusable strategies. The agent stops re-discovering what already worked.
Every serious tool can tune a prompt. The deeper the optimization reaches, into the workflow structure,
the evaluation data, the curation logic, and eventually the optimization strategy itself.
The fewer systems still operate there. MEGA Code is the only one that reaches every layer.
MIPROv2, COPRO, Bootstrap*
Reflective + Pareto
LLM rewriter loop (no formal algorithm)
via register_param
Joint prompt tuning inside the optimization loop.
Configuration only
Single node only
optimize_structure proposes code/graph edits
Redesign Agent + Scaffold-mode Workflow Agent; 5-signal architectural verdict
From-scratch / reference-based synthesis
Wraps user CSV + platform data; only trajectories synthesized
PRD-driven Data Agent with parallel difficulty-stratified workers and a human seed-approval gate
three-type evaluator classification → dimension discovery → density/diversity/baseline analysis → targeted synthesis
Compositional retrieval over a typed Wisdom Graph with role-differentiated plan assembly (seed + bridging + fallback)
ROI curation with transfer-rate calibration τ, evidence confidence η, and frequency-quality promotion of curation patterns
Meta-learning Agent extracts optimization trajectories as a wisdom type; next project starts from a validated path instead of cold search