---
title: Stateful Multi-Agent Evolutionary Search
url: https://www.emergentmind.com/topics/stateful-multi-agent-evolutionary-search
type: topic
---

# Stateful Multi-Agent Evolutionary Search

Stateful multi-agent evolutionary search denotes a family of optimization and discovery frameworks in which multiple agents search over candidates, policies, programs, or interaction graphs while carrying forward persistent state across rounds, generations, or tasks. The persistent state may take the form of explicit memories, archives, research trees, branch histories, execution traces, long-term reflections, or learned agent states, and it is used to condition selection, mutation, crossover, orchestration, or scheduling. Across the literature, the search space ranges from NK landscapes and continuous policy parameters to multi-agent system configurations, code artifacts, and collaboration graphs; the common feature is that search is not memoryless, because later decisions depend on accumulated evidence about earlier trajectories, failures, and successes [2306.10640].

## 1. Formal scope and problem formulations

One line of work formalizes stateful search directly as a competitive multi-agent process on a dynamic landscape. In competitive multi-agent search, the search space is a bit-string space \(X=\{0,1\}^n\) with NK-model fitness
\[
F(\mathbf x)\;=\;\frac1N\sum_{i=1}^N f_i\bigl(x_i,x_{i+1},\dots,x_{i+K}\bigr),
\]
where each local contribution \(f_i:\{0,1\}^{K+1}\to[0,1]\) is chosen uniformly at random, and indices wrap mod \(N\). The landscape is dynamic because whenever any agent visits \(\mathbf x\), the fitness of \(\mathbf x\) and its Hamming-neighbors within radius \(R\) is multiplied by a flocking intensity \(\alpha>1\) or \(\alpha<1\), modeling value inflation or saturation. Agents compete for cumulative reward over \(T\) discrete time steps by visiting points in \(X\), and their interaction is mediated both by knowledge of other agents’ searches and by landscape changes induced by those searches [2306.10640].

A second formalization treats the search object not as a point in a fitness landscape but as an entire multi-agent system configuration. EvoMAS defines a configuration
\[
c = (G,\,\{A_i\}_{i=1}^k,\,V_{\mathrm{in}},\,V_{\mathrm{out}})\in\mathcal C,
\]
where \(G=(V,E)\) is a directed acyclic graph over agent nodes, each agent \(A_i=(b_i,p_i,T_i)\) has backbone model, system prompt, and tool set, and designated input and output agents specify execution flow. For a task \(q\), execution under \(c\) yields an output \(\mathrm{Exec}(c,q)\) and an execution trace \(T_q(c)\), while a judge function returns a scalar reward such as
\[
R(q,c)=\mathrm{Metric}(q,\mathrm{Exec}(c,q))-\lambda\cdot\mathrm{Cost}(c).
\]
The objective for each incoming task is to find \(c^*=\arg\max_{c\in\mathcal C}R(q,c)\), while leveraging persistent pools and memories from earlier tasks [2602.06511].

A third formulation arises in model-based stochastic search for multi-agent control. Here the black-box optimization problem is
\[
\theta^*=\arg\max_{\theta\in\Theta}J(\theta),
\]
with a parametric sampling distribution \(f(\theta;\omega)\) over policy parameters and expected return
\[
L(\omega)\coloneqq \int_\Theta J(\theta)f(\theta;\omega)\,d\theta.
\]
In multi-agent settings, each of \(M\) agents may share the same global parameter vector \(\theta\), while the return \(J(\theta)\) depends on the entire stateful trajectory \((s_0,a_0,\dots,s_T)\) generated by the simulator. This framing is stateful because the optimizer treats \(J(\theta)\) as a black-box function, but the simulator internally propagates all stateful interactions, stochastic transitions, and agent specialization [1803.01106].

A broader, process-level formalization appears in AEvo, which views agentic evolution as an interactive environment whose state is the accumulated evolution context. At round \(r\), the context is \(\mathcal C_r=(c_1,\dots,c_r)\), and the environment state can be written as \(s_r=(r,\mathcal C_r)\). A meta-agent observes a summary \(o_r=\Phi(s_r)\), samples a meta-action \(a_r\sim\pi_\phi(\cdot\mid o_r)\), and edits the search mechanism itself via \(\Pi_{r+1}=\mathsf{Edit}(\Pi_r,a_r)\). This shifts the locus of optimization from individual candidates to the procedure or agent context that governs future candidate generation [2605.13821].

## 2. Persistent state, memory, and archival structures

Statefulness is implemented through several distinct but related memory substrates. In competitive multi-agent search, each agent maintains public memory \({\cal X}_{\rm pub}(t)\), the set of all points published by any agent up to time \(t\), and private memory \({\cal X}_{\rm priv}(t)\), the points remembered only by that agent. If agent \(i\) has visited points \(\mathbf x^{(i)}_1,\dots,\mathbf x^{(i)}_t\) with fitnesses \(z(\cdot)\), its total knowledge is
\[
{\cal X}^{(i)}(t)=\{\,[\mathbf x^{(i)}_1,z(\mathbf x^{(i)}_1)],\dots,[\mathbf x^{(i)}_t,z(\mathbf x^{(i)}_t)]\,\}.
\]
At each step, the agent examines the best fitness in each memory, converts those values to binary low/high states using threshold \(0.5\), and then conditions action choice and storage decisions on those states. This is a minimal but explicit form of memory-dependent policy control [2306.10640].

EvoMAS maintains two persistent structures at task index \(t\): a pool of candidates \(C_t\subseteq\mathcal C\) and an experience memory \(M_t\) storing tuples \((q_j,c_j,R(q_j,c_j),T_{q_j}(c_j))\). Each best tuple \(e_t=(q_t,c_t^*,R(q_t,c_t^*),T_{q_t}(c_t^*))\) is appended by
\[
M_t=M_{t-1}\cup\{e_t\}.
\]
For new queries, the system retrieves sketches or summaries \(h_j=\mathrm{Consolidate}(e_j)\) by task similarity, and these retrieved patterns condition mutation and crossover so that previously learned structural motifs can be reused [2602.06511].

LoongFlow uses a hybrid evolutionary memory. Its solution memory stores lineage and summaries for every solution, including code, unique solution identifier, parent identifier, generate plan, retrospective summary, and performance metrics. After evaluation, the system samples a summary \(z\) and updates the global memory by set union,
\[
\mathcal M_{t+1}\leftarrow \mathcal M_t\cup\{z\}.
\]
Alongside this, each island maintains a MAP-Elites archive \(\mathcal A_k\) over a behavior space \(\mathcal F\), with feature mapping \(\Phi:\mathcal C\to\mathcal F\), so that each cell stores the best solution found in that region [2512.24077].

OR-Agent makes the memory structure explicitly tree-shaped. Each LeadAgent conducts a research round represented by a rooted, directed tree \(T\) of hypothesis nodes, where each node
\[
x=(\mathrm{idea}\in\mathcal L,\ \mathrm{code}\in\mathcal C,\ \mathrm{metrics}\in\mathbb R^m,\ \mathrm{features}\in\mathbb Z^d,\ \mathrm{score}\in\mathbb R,\ \mathrm{summary}\in\mathcal L).
\]
The tree is stateful because every node retains idea text, code, experimental summary, and child-expansion status; nodes with no improvement after \(k\) attempts are marked terminal, while other leaves remain eligible for expansion and backtracking. OR-Agent complements this with a persistent SolutionDatabase and compressed long-term reflection states updated by exponential moving averages [2602.13769].

Other frameworks instantiate statefulness in operational rather than symbolic form. SwarmResearch stores global context in an orchestrator as tuples \((b_i,F_i,\delta_i)\) for each branch, while each Search Agent is confined to its git worktree and, for Optimizers, its forked chat history [2607.02807]. The stateful inference-time search framework for unit-test generation represents persistent state as
\[
S_{n-1}=\bigl(\zeta_{1:n-1},\mu_{1:n-1},\kappa_{1:n-1},c_{1:n-1},R_{1:n-1}\bigr),
\]
thereby preserving earlier edge cases, mutation scores, coverage values, exception signals, and rewards [2510.07147]. HEAS adopts a global context \(C_t\), a dictionary-like shared state updated by deterministic layered streams, so that cross-scale couplings become explicit and auditable [2508.15555].

A plausible implication is that “state” is not a single design pattern but a spectrum ranging from low-dimensional policy context to fully persistent process memory. The literature uses all of these forms, often simultaneously.

## 3. Evolutionary operators and search control

The evolutionary mechanisms differ by search space but share the feature that operators are conditioned on persistent evidence. In the CMAS framework, each agent uses a stochastic strategy \(S_1\) to select one of four actions—Exploit(public), Exploit(private), Explore(public), Explore(private)—after inspecting the public and private memories. “Exploit” flips one bit until improvement, whereas “Explore” flips a random \(50\text{--}100\%\) of bits until improvement. If the new point is better than the previous point, a second strategy \(S_2\) decides whether to store it in public or private memory. Both \(S_1\) and \(S_2\) are jointly encoded in CPPNs evolved with NEAT [2306.10640].

The associated NEAT setup is concrete. A population of \(P=100\) CPPNs encodes \(S_1\) and \(S_2\) jointly; each CPPN has four inputs and two outputs, starts with only input and output nodes and minimal connectivity, and evolves through link addition, node addition, weight perturbation or redraw, link deletion, crossover within species, fitness sharing, survival threshold \(0.2\), and elitist preservation of the species champion. Each candidate is evaluated as “agent 0” against seven fixed-strategy opponents, with one evolution fitness defined as the average of that agent’s visited-point fitness over \(T=100\) steps, averaged over \(R=200\) random starts [2306.10640].

EvoMAS defines two generative kernels. Mutation proposes a locally edited offspring \(c'\) from parent \(c\), execution trace, and memory, while constraining each mutation to exactly one component type: prompts, model identifiers, tools, or topology. Crossover recombines two parents’ agent-level specifications under the requirement that the offspring inherits the full communication graph of one parent. Parent selection can be tournament-based or fitness-proportional, with a probability proportional to \(\exp(\tau\cdot R(q_t,c_i))\), and both mutation and crossover are guided by execution traces and retrieved summaries from memory [2602.06511].

LoongFlow replaces blind random mutation with a Plan-Execute-Summarize paradigm. Given parent \(s_t\) and memory \(\mathcal M_t\), it samples a plan
\[
b\sim\pi_\theta(b\mid s_t,\mathcal M_t,\mathcal I_{\mathrm{plan}}),
\]
then a new solution
\[
s'\sim\pi_\theta(s'\mid b,s_t,\mathcal I_{\mathrm{exec}}),
\]
then a summary
\[
z\sim\pi_\theta(z\mid s',r=R(s'),b,\mathcal I_{\mathrm{sum}}),
\]
followed by memory update \(\mathcal M_{t+1}\leftarrow\mathcal M_t\cup\{z\}\). Parent selection inside each island uses entropy-regularized Boltzmann selection,
\[
P(s_i)=\frac{\exp(R(s_i)/\tau)}{\sum_j \exp(R(s_j)/\tau)},
\]
with temperature adapted by archive entropy [2512.24077].

The stateful inference-time search framework adopts adversarial mutation and elite preservation. The Adversary generates \(M\) mutants \(f'_{n,1},\dots,f'_{n,M}\), and the mutation score
\[
\mu_n=\frac{\#\{j\mid \rho'_{n,j}\neq \rho_n\}}{M}
\]
measures how many mutants are killed by the candidate edge cases. Evolutionary preservation keeps the top-\(K\) edge cases across generations:
\[
\zeta_{1:n}\leftarrow \operatorname{Top\!-\!K}(\zeta_{1:n},R_{1:n}).
\]
The Critic’s reward combines exception triggering, coverage, and mutation robustness through
\[
R_n^{\mathrm{unnorm}}
=\bigl[\alpha c_n+\beta\bigl(\kappa_n+0.5\max(0,\kappa_n-\theta)\bigr)\bigr]\times \gamma \mu_n.
\]
This makes mutation testing an adversarial search operator rather than a post hoc evaluation tool [2510.07147].

AgentRevive applies state-aware evolution over agent graphs rather than candidate artifacts. Each agent occupies one of three Markov states \(S=\{A,S,T\}\): Active, Standby, or Terminated. The transition policy \(\pi_\theta\) conditions transitions on prior state, hallucination risk, message gain, and latent state. Hallucination risk is computed as a KL divergence between an agent’s message distribution and the average over active agents, and state-aware edge optimization subsequently prunes edges by survival masks derived from repeated inference passes [2605.17348].

This suggests that in stateful multi-agent evolutionary search, “variation” can target not only candidate solutions but also prompts, topologies, branches, archives, memory summaries, or agent participation states.

## 4. Multi-agent organization and orchestration patterns

The literature exhibits several recurring orchestration patterns. One is fixed-population interaction in a shared environment. In CMAS, \(M=8\) agents operate on a dynamic NK landscape; one evolvable agent competes against seven fixed agents in homogeneous or heterogeneous environments [2306.10640]. In the UAV swarm setting, each of \(M\) agents shares the same global parameter vector \(\theta\), but differing local observations naturally induce specialization such as leader-follower, flanking, and sacrifices even under shared parameters [1803.01106].

A second pattern is explicit role decomposition. The unit-test generation framework uses four cooperating agents—Actor, Adversary, Critic, and Executor—under a non-Markovian Controller. Each stage comprises proposal, execution, adversarial mutation, scalar reward assignment, and controller-mediated state update [2510.07147]. LoongFlow similarly decomposes the loop into Planner, Executor, and Summarizer modules, nested within a multi-island topology [2512.24077]. OR-Agent separates ORAgent, SolutionDatabase, multiple LeadAgents, IdeaAgent, CodeAgent, and ExperimentAgent, thereby assigning distinct responsibilities for ideation, code synthesis, experimentation, and archival management [2602.13769].

A third pattern is orchestrator-subagent search over code branches. SwarmResearch introduces a Shepherd Agent that maintains global context and steers a population of Search Agents, each operating with local context in a separate git branch. Explorer Agents attempt one new high-level idea with fresh context, whereas Optimizer Agents inherit the parent’s conversation history and perform up to \(K\) small tweak-and-test iterations. Parent selection is modeled by a softmax-style distribution over observed branch fitnesses, and the mix between Explorers and Optimizers is regulated by a schedule \(\lambda(t)\) [2607.02807].

A fourth pattern is meta-editing of the search mechanism itself. AEvo’s meta-agent does not directly propose the next candidate; rather, it edits the procedure or agent context that will govern the next segment of inner-loop evolution. Phase A performs meta-editing of code, prompts, skill files, or budgets, while Phase B executes the edited mechanism for a bounded number of inner rounds under a protected evaluator. This architecture unifies procedure-based evolution and agent-based evolution under a common harness [2605.13821].

HEAS emphasizes yet another organizational principle: separation of mechanism from orchestration. Models are represented as hierarchies of lightweight processes or streams arranged in deterministic layers that read and write a shared context. The same model can then be used for forward simulation, optimization, or tournament comparison, with uniform per-step and episode metrics and explicit persistence of seeds, logbooks, and hall-of-fame archives [2508.15555].

A common misconception is that multi-agent evolutionary search necessarily means a conventional genetic algorithm over a flat population. The surveyed systems include flat populations, tree-structured research, island models, branch-based harnesses, controller-driven role systems, and meta-editing frameworks. The shared property is persistent multi-agent coordination under evolutionary or evolution-like update rules, not a single canonical topology.

## 5. Empirical domains, behaviors, and reported outcomes

The empirical range is unusually broad. Competitive multi-agent search was studied on NK landscapes with \(N\in\{10,20\}\), \(K=3\), flocking intensity decaying linearly from \(1.05\to 0.9\) over \(10\) visits at each point, and flocking radius \(R_{\mathrm{flock}}=2\). Specialized strategies evolved one environment at a time outperform all hand-coded baselines by \(1\text{--}5\%\) on average with \(p<10^{-9}\), while general strategies across \(6+1\) environments fall only \(\sim 1\%\) below specialized strategies and still exceed the hand-coded “best overall” with \(p<10^{-7}\). Heterogeneous single-environment evolution yields nearly identical general performance at \(1/7\) the cost. A 2-ply real-time tree search is reported as less effective when resource-matched to CMAS methods and suffers from dynamic landscape mis-prediction [2306.10640].

That work also reports a distinctive behavioral phenomenon: in sparse regimes with \(N=20\), successful strategies show a strong preference for short exploit hops in private memory, characterized as “wave-riding” of the boosting front. A spherical visualization that maps Hamming-distance shells onto latitude rings and fitness to elevation or brightness reveals the agent staying on the advancing boosted frontier while leaving sunk points behind [2306.10640].

In multi-agent UAV swarm combat, model-based stochastic search and evolution strategies are applied to two tasks. The cooperative Base-Attack scenario contains 50 fixed-wing attackers versus 20 quadcopter defenders, with observation dimension \(102\), action outputs specifying target relative coordinates, and reward
\[
J=10\cdot \#\mathrm{kills}+50\cdot \#\mathrm{base\mbox{-}hits}-10^{-5}\cdot d_{\mathrm{end}}.
\]
After \(1000\) ES/CEM iterations over \(30\) runs, median Base-Attack performance is reported as 38 kills and 12 base-hits for ES \((\gamma=0.02,N=300)\), versus 24 kills and 5 base-hits for CEM. Each iteration, comprising \(300\) samples and \(200\) s episodes at \(0.1\) s step, runs in parallel on \(244\) threads in approximately \(2\) minutes; full training takes approximately \(2\) days [1803.01106].

For LLM-based multi-agent system generation, EvoMAS is evaluated on BBEH, WorkBench, and SWE-Bench. It improves task performance by \(7\text{--}12\) points over EvoAgent, including \(+10.5\) points on BBEH, \(+7.1\) points on WorkBench, and \(+7.4\) points on SWE-Bench-Verified. It achieves near-perfect execution rates of \(96\text{--}99\%\), compared with code-generation baselines MAS-GPT at \(1\text{--}71\%\), and continues to gain up to \(+15\) points with increased test-time compute while single-agent and fixed MAS baselines plateau [2602.06511].

LoongFlow is evaluated on the AlphaEvolve benchmark and Kaggle-style tasks. Reported outcomes include 14 gold medals across vision, NLP, and tabular tasks; 0.9027 versus 0.8962 on Autocorrelation II relative to the AlphaEvolve baseline; and a Circle Packing result in which the framework reaches a target \(>0.99\) in 258 evaluations versus 783 for OpenEvolve, described as a 60% improvement in efficiency [2512.24077].

SwarmResearch is tested on 15 open-ended optimization tasks spanning mathematics, systems, and heuristics. It discovers better-performing or comparable solutions on 13/15 tasks relative to state-of-the-art LLM-guided evolution and multi-agent techniques, matches or exceeds EvoX on 14/15 tasks, and matches or exceeds CORAL on 12/15 tasks under the same compute budget. The same study reports median per-attempt code changes of 48 lines of code for SwarmResearch, versus 15 for CORAL and 29 for EvoX [2607.02807].

The stateful inference-time search framework is evaluated on HumanEval and TestGenEvalMini using Llama-70B, GPT-o4-mini, and Gemma-2-27B. On HumanEval, the cold-start rule-based Actor alone solves approximately 62% of problems at first iteration, and the full evolutionary search matches or slightly exceeds few-shot baselines at approximately 90–92% coverage. On TestGenEvalMini, the method delivers a 4–7 percentage-point absolute lift in line and function coverage over the best few-shot baselines, including an example of line coverage from approximately 25% to 29.8% with Llama-70B. Branch coverage gains are described as model-dependent, and the method incurs higher compute, approximately 3.6 PFLOPs per iteration on TestGenEvalMini [2510.07147].

AEvo reports a 26 relative improvement over the strongest baseline on standard benchmarks. On Terminal-Bench, AEvo\(_{\mathrm{Proc}}\) improves from 44.3 to 53.8; on ARC-AGI-2, it improves from 31.8 to 47.0. On three open-ended optimization tasks, AEvo\(_{\mathrm{Agent}}\) achieves best or tied-best scores on all three and reaches 1138 cycles on the performance-engineering task in 100 rounds, with continued improvement to 1121 in 200 rounds [2605.13821].

AgentRevive reports up to 33.7% token savings and 6.9% performance gain on MMLU with Llama3-8B, with only \(+0.13\) s inference overhead, while framing these gains as the result of state-aware scheduling that preserves “Standby” agents instead of hard-pruning them immediately [2605.17348].

## 6. Interpretive themes, misconceptions, and open problems

Several themes recur across these systems. First, persistent state is repeatedly used to combat local myopia. In CMAS, public and private memory allow policies to exploit both shared and private information while reacting to dynamic landscape changes [2306.10640]. In EvoMAS, execution traces and experience memory make mutation and crossover feedback-conditioned rather than blind [2602.06511]. In AEvo, accumulated process-level evidence becomes actionable because the meta-agent edits the search mechanism itself [2605.13821].

Second, diversity preservation is a central design concern, but different frameworks realize it differently. MAP-Elites archives and multi-island migration preserve behavioral niches in LoongFlow [2512.24077]. Elite archives preserve top edge cases in inference-time search [2510.07147]. Solution databases, tree backtracking, and temperature-controlled sampling preserve multiple research trajectories in OR-Agent [2602.13769]. Git branches in SwarmResearch preserve competing high-level approaches that would otherwise be overwritten in a single conversational context [2607.02807]. This suggests that diversity preservation is not merely a selection heuristic; it is often encoded in the system’s memory substrate.

Third, the literature distinguishes between hard pruning and reversible attenuation. AgentRevive explicitly criticizes aggressive graph evolution that permanently removes agents based on transient failure, proposing instead Markov states Active, Standby, and Terminated so that “zombie” agents can recover in later rounds [2605.17348]. A related, though not identical, concern appears in SwarmResearch’s argument that single long-running agents tend to converge on one high-level approach and then make only low-level edits [2607.02807].

Fourth, several frameworks replace direct low-level mutation with structured reflection. LoongFlow’s Planner and Summarizer, OR-Agent’s verbal gradient and semantic momentum, and AEvo’s meta-editing of prompts, skills, and procedures all move evolutionary search toward explicitly reasoned intervention rather than undirected perturbation [2512.24077]. A plausible implication is that current stateful systems increasingly blur the line between evolutionary search, tree search, and research workflow management.

The principal limitations reported in the literature are likewise varied. Stateful systems can incur substantially higher inference-time or orchestration cost, as illustrated by the TestGenEvalMini compute figures in stateful inference-time search and the approximately \(3\times\) per-round cost noted for AEvo on standard benchmarks [2510.07147]. Some methods remain prompt-reliant or near-greedy at the orchestration level, as stated for SwarmResearch’s Shepherd Agent [2607.02807]. Others acknowledge the absence of domain-independent merge criteria, stable long-horizon policies, or broader support for multi-file and dependency-heavy environments [2510.07147].

Taken together, these works define stateful multi-agent evolutionary search as a broad research area rather than a single algorithm. It encompasses dynamic landscape search, policy optimization in simulators, evolutionary generation of multi-agent systems, branch-based code search, research-tree exploration, archive-based directed evolution, and resilient graph scheduling. The unifying principle is that evolutionary progress is mediated by persistent multi-agent state, and that this state is treated not as auxiliary logging but as a first-class control variable for future search.

Source: https://www.emergentmind.com/topics/stateful-multi-agent-evolutionary-search