The invention discloses a multi-agent
code generation method and
system, a storage medium and equipment, and belongs to the field of automatic
code generation, and the method comprises the steps that an initial agent generates an initial meta strategy through deep problem understanding, and constructs a meta experience
pool and a candidate strategy
pool; iterative optimization of the meta-strategy is realized through multi-agent cooperation, and a final meta-strategy is obtained; converting the final meta-strategy into an
executable code and a
test case, verifying the
executable code and the
test case, if
verification succeeds, outputting a final code, and if
verification fails, entering reflection; closed-
loop optimization of the meta-strategy is realized through
causal analysis, experience is updated to the meta-experience
pool, and the strategy is updated to the candidate strategy pool. According to the method, a four-stage closed-loop evolution framework including meta-strategy initialization, meta-strategy evolution, meta-
strategy implementation and meta-strategy causal reflection is constructed, the autonomous evolution ability of the strategy from the
primary level to the advanced level is achieved, and the method is particularly suitable for automatic solving of
complex algorithm problems and competition-level
programming challenges.