Building AI That Builds AI: A Systems Engineering Approach to Self-Evolving Agents
This article explores the engineering practices behind self-evolving AI agents that automate the research process itself, rather than just playing games. Using an eight-player auto-battler as the technical background, it breaks down a three-layer architecture (research, environment, and agent layers), the division of labor across six specialized agent roles, and a shared versioned memory system for collaboration. It also covers key requirements for environment fidelity, training and evaluation constraints, and deployment practices, showing that the real moat of a self-evolving system lies in role separation, shared memory, environment accuracy, and an auditable feedback loop.
Building AI That Builds AI: A Systems Engineering Approach to Self-Evolving Agents
In gaming and game theory, teaching a single agent to play a card game is not remarkable. The genuinely hard problem is getting a group of agents to learn “how to build an agent that can play cards.” The essence of this challenge is automating the research process itself: environment replication, opponent modeling, training plan design, evaluation and auditing, and deployment are all carried out collaboratively by agents that stay online over the long term. Using an eight-player free-for-all auto-battler as the technical background, this article abstracts the general engineering paradigm behind it and discusses how to build a research system that can continuously evolve on its own.
1. Why “AI that builds AI” Is Harder Than “AI that plays games”
1.1 Overlapping Decision Spaces and Uncertainty
The complexity of this type of gameplay comes from three overlapping factors: incomplete information, randomness, and delayed feedback. Eight participants compete at the same time, and each can only see their own board plus the lineup clues left behind by opponents in the previous round of combat. With nearly a thousand cards and a large number of synergy effects among them, a single match requires hundreds of decisions, while the final ranking is only revealed after the match is completely over.
In engineering terms, this is a multi-agent sequential decision problem with partial observability: the state space grows close to combinatorial explosion as card combinations multiply, the observation function exposes only local information, and the reward signal is sparse and delayed. No single-point model can converge reliably.
1.2 Environment Replication Is a Prerequisite
Two common approaches in the past had clear limitations: one implemented only combat resolution while ignoring hero skills and the economic decisions of the recruitment phase; the other relied on a large model to give advice to human players on the side, with execution still done by people. To train agents that can independently play a full match and participate in ranked ladder battles, you first need a simulation environment with complete rules that can run in batch and in parallel. If the environment is not faithful, training is meaningless; if the environment is not reproducible, experiments cannot be compared.
1.3 The Research Process Itself Is the Bottleneck
Even with the environment ready, research still has to answer a series of questions: should the next step change the rules or the rewards? Is the opponent distribution close to real players? Does the training configuration introduce leakage? Are the evaluation results contaminated by random seeds? These questions require role-based division of labor and traceable records, rather than one monolithic model repeatedly trying things out.
2. Overall Architecture: Three Interlocking Layers
The system can be abstracted into three layers:
- Self-evolving research layer: responsible for “deciding what to research and how to validate it,” composed of multiple functional agents;
- Environment layer: a high-fidelity game simulator that is replicable, verifiable, and parallelizable;
- Agent layer: the policy models trained in the environment, which ultimately connect to the real client.
The closed loop among the three works like this: the research layer produces the environment, the environment supports training, and the training output flows back as research conclusions after evaluation, driving the next iteration. The value of this loop is that it turns “research experience” into reusable assets rather than one-off scripts.
Illustrative pseudocode can express this cycle:
while not budget_exhausted():env = research_agents.build_or_patch_env(memory.read("findings"))opponents = research_agents.synthesize_opponents(memory.read("stats"))policy = trainer.train(env, opponents, config=memory.read("lessons"))report = auditor.evaluate(policy, env, seeds=fixed_seeds)memory.append(report) # versioned write for the next round to readif report.promoted:deployer.release(policy)
3. Division of Labor: Six Agents, Each with Its Own Domain
Effective automated research depends on a multi-agent organization with clear responsibility boundaries, not a single giant prompt. It can be abstracted into six roles:
- Research lead: maintains the roadmap, decides the priority of the next round of experiments, and controls budget and risk;
- Environment agent: implements rules, writes validation cases, and adjudicates edge cases to ensure the simulation matches the real rules;
- Opponent modeling agent: fits opponent behavior distributions based on real match statistics to avoid “overfitting to fixed sparring partners”;
- Training agent: designs curricula, reward shaping, and hyperparameters, and manages parallel experiments;
- Evaluation and audit agent: checks for data leakage, randomness control, and metric credibility, and outputs reproducible reports;
- Deployment agent: connects the model to the real client, runs canary releases, and collects online feedback.
The key design principle is “separation of duties plus cross-auditing”: the trainer cannot evaluate itself, the environment implementer cannot self-certify, and the evaluator is independent of the trainer. This is consistent with the separation of code review, testing, and release responsibilities in software engineering.
4. Collaboration Mechanism: A Shared Research Memory Store
The six roles do not chat directly with one another. Instead, they exchange information through a versioned, typed shared memory store, such as a findings ledger, a rule-adjudication registry, handoff notes, an experiment registry, and a lessons-learned library. All collaboration is expressed as reads and writes to these files.
This approach brings three engineering benefits:
- Traceability: every conclusion can be traced to an experiment ID, configuration, and data version;
- Concurrency: multiple experiments can proceed in parallel without overwriting each other, isolated by version numbers and namespaces;
- Reusability: failed experiences are explicitly recorded, preventing the same class of mistakes from recurring.
A minimal memory entry structure can be expressed like this:
id: EXP-2024-0731-03type: experimenthypothesis: Adjusting the recruitment-phase reward can improve stable rankingconfig_ref: configs/reward_v3.yamlenv_version: env-1.4.2metrics: {mean_place: 3.42, std: 0.51}verdict: rejectedlessons: Overly dense rewards make the policy conservative and increase health risk in the early and mid game
5. Key Points for Environment Construction and Validation
The credibility of the environment layer determines the ceiling of the entire system. It is worth focusing on:
- Rule completeness: full coverage of hero skills, card synergies, economy and upgrades, and combat resolution;
- Determinism control: fixed random seeds to ensure experiments are reproducible;
- High-performance parallelism: support for large-scale parallel matches to shorten the cycle of a single round of experiments;
- Consistency validation: comparing replay cases against a human-adjudicated table to handle ambiguous rules;
- Observation interface specification: strictly limiting the information visible to agents to prevent information leakage.
6. Engineering Constraints for Training and Evaluation
A common mistake on the training side is looking only at win rate. A more robust approach is to combine multiple metrics: average placement, variance, robustness against specific opponent distributions, and performance differences between long and short matches. On the evaluation side, you should insist on separating training and evaluation environment versions, fixing evaluation seeds, and including confidence intervals in reports.
On the deployment side, canary release and feedback loops are recommended: first connect a small amount of traffic, collect real match data, and then use it to correct the opponent model, forming a data flywheel. If you rely on a cloud platform, you can use a container platform to host parallel training, object storage to keep versioned memory and checkpoints, a message queue to decouple experiment scheduling, and logging and monitoring services to track anomalies. These are all general capability categories and do not constitute a binding to a specific implementation.
7. Conclusion
“Building an AI that can play well” is a single-point problem, while “letting AI learn to build AI” is a systems engineering problem. The core of the latter lies not in some larger model, but in role separation, shared memory, environment fidelity, and an auditable closed loop. Productizing and making the research process itself traceable is the real moat of a self-evolving system, and it is also a direction that cloud services such as Baidu AI Cloud can support on general computing and engineering platforms.
