Test-time self-evolution for multi-agent systems

Agents that learn from each other, within an episode and across episodes.

EvolveMAS pairs every agent with a MemoryAgent. It keeps structured memory while the agents interact, then turns each outcome into knowledge about partners and strategies for the next episode. Model weights stay frozen; your system adds three calls.

pip install "evolvemas[anthropic] @ git+https://github.com/WuYalun/EvolveMAS"
Recorded run · GSM8K multiagent debate · problem Step through it →
Loading the recording…

The loop

Execute, evaluate, evolve

Every agent runs the same three steps in every episode. Below, each step shows the call your system makes and what it actually produced in the recorded episode above.

1 · within the episode, before each action

Execute

Agents interact as usual. Before an agent acts, context() hands it its memory and knowledge; after it sees new messages, observe() lets its MemoryAgent update the memory.

memory = plugin.context("agent_c")
reply  = agent_c.solve(problem, memory)
plugin.observe("agent_c", round_messages)
What context() returned to Agent C in round 2
…
2 · when the episode ends

Evaluate

Your task scores the episode its own way. EvolveMAS never sees how; it only receives the result, here the answer check.

result = check(final_answers, answer_key)
# task-native: accuracy, deal value, win/loss…
The result handed over
…
3 · across episodes

Evolve

end_episode() distills the memory and the result into knowledge: interaction strategies and a profile of each partner. Working memory resets; knowledge carries into the next episode.

plugin.end_episode("agent_a", result)
Agent A's profile of Agent C afterwards
…

Memory and knowledge

Two speeds of learning

Memory is updated during an episode from what the agent sees. When the next episode starts, working memory and facts marked as belonging to the last episode are cleared; past events and longer-lived facts stay, and a fact that is not seen again for a few episodes expires. Knowledge outlives the episode and is revised by each outcome. Here is Agent A's state across three consecutive problems of the recorded run.

Loading…

Try it

Run the plug-in in your browser

The real evolvemas package runs here with Pyodide. Scripted agents need no key; switch to a live model to use your own.

Three agents debate a GSM8K math problem Multiagent debate (Du et al., ICML 2024) on GSM8K test problems, checked against the answer key. All three agents run with EvolveMAS. Agent C answers fast and skips steps.
Agents
EvolveMAS
Loading the Python runtime (about 10 MB, first visit only)…

Conversation

Waiting for the runtime

The first episode starts as soon as the runtime loads.

Memory

Nothing yet.

Plug-in calls

blue: within an episode · green: across episodes

Right first answers per problem

out of 3 agents, before they read each other
EvolveMAS onEvolveMAS off

What to watch. After each round, observe gives every agent's MemoryAgent the three solutions, and it updates that agent's MEMORY.md. When the answer is checked, end_episode distills the result into each agent's KNOWLEDGE.md: strategies for itself and a profile of each partner. Before every answer, context hands the agent both. Switch EvolveMAS off and run again to compare.

Simulated mode: the problems and the answer key are real GSM8K, and the plug-in is the real Python package running in your browser, but the three agents and the MemoryAgent are scripted rules, so the numbers only show the mechanics. Agent C's script reads the knowledge the plug-in writes for it, which is why its first answers change. Use Live model to run real agents with your own key, or see a recorded run with real models.

Results

One protocol across cooperative, mixed-motive and adversarial settings

From the paper

Six configurations across five benchmarks. Each baseline is a method family from one setting, transferred to the others under the same protocol.

MethodBBHHumanEvalSOTOPIADeliberationWW-VWW-WAvg.
Strongest setting-specific baselineLLM-Deliberation family67.5
Self-Memory8295.70.5764.9058.042.069.5
EvolveMAS8397.00.6135.4062.070.077.2

Avg. is the mean of six percentage-scaled metrics. Full table and baselines are in the paper.

Use it

Three calls around the loop you already have

Your system keeps its agents, its message routing and its scoring. EvolveMAS only sees what you hand it, so hidden information stays hidden.

context(agent)Memory and knowledge to add to the agent's prompt before it acts.
observe(agent, events)What the agent saw. Its MemoryAgent updates Episodic, Semantic and Working memory.
end_episode(agent, result)Your task's own result. Interaction Strategies and Partner Profiles are revised from it.

Backends: Claude, any OpenAI-compatible endpoint, or any function llm(system, user) -> str. Turn online or evolve off to ablate either phase.

from evolvemas import EvolveMAS, AnthropicLLM

plugin = EvolveMAS("runs/memory", AnthropicLLM())
for a in agents:
    plugin.register(a.name, profile=a.profile)

for problem in problems:
    for a in agents: plugin.begin_episode(a.name)
    for rnd in range(2):
        replies = {a.name: a.solve(problem, plugin.context(a.name))
                   for a in agents}
        events = [{"speaker": name, "content": text}
                  for name, text in replies.items()]
        for a in agents:
            plugin.observe(a.name, events)
    result = check(replies, problem.answer)
    for a in agents: plugin.end_episode(a.name, result)

Paper

EvolveMAS: A Unified Self-Evolution Framework for Decentralized Multi-Agent Systems

Yalun Wu1, Qiwei Ma2, Bingbing Xu3, Dan Zhang1, Long Bai3, Boyang Wang4, Jiatong Li1, Zheqi Lv5, Shaozu Yuan6, Peiying Wang6, An Zhang7, Jiawei Wang1†, Tat-Seng Chua1†
1National University of Singapore2Hunan University3VIPL, Institute of Computing Technology, Chinese Academy of Sciences4Beihang University5Cornell University6Independent Researcher7University of Science and Technology of China† Corresponding authors
Overview of EvolveMAS. Upper lane: the main agent's Execute, Evaluate, Evolve cycle. Lower lane: the MemoryAgent maintaining Structured Memory with Episodic, Semantic and Working regions.
Overview from the paper. Blue arrows are within-episode updates, green arrows cross-episode evolution.

Decentralized multi-agent systems let LLM agents interact without central control, across cooperative, mixed-motive and adversarial settings. EvolveMAS supports test-time adaptation within and across episodes with one protocol: a dedicated MemoryAgent keeps each agent's Structured Memory outside its reasoning context, and each episode's outcome is distilled into reusable partner profiles and interaction strategies. Across five benchmarks and six configurations it reaches the highest normalized average score among the compared methods, 77.2.

The plug-in on this site is a compact, host-agnostic implementation of the protocol. It is not the paper's experiment code.

BibTeX
@article{wu2026evolvemas,
  title   = {EvolveMAS: A Unified Self-Evolution Framework for Decentralized Multi-Agent Systems},
  author  = {Wu, Yalun and Ma, Qiwei and Xu, Bingbing and Zhang, Dan and Bai, Long and
             Wang, Boyang and Li, Jiatong and Lv, Zheqi and Yuan, Shaozu and Wang, Peiying and
             Zhang, An and Wang, Jiawei and Chua, Tat-Seng},
  journal = {arXiv preprint arXiv:XXXX.XXXXX},
  year    = {2026}
}