# RecursiveMAS: multi-agent collaboration trained through recurrent latent depth

> RecursiveMAS is a Python research framework that treats a multi-agent system as one recursive computation, links heterogeneous agents with RecursiveLink modules that exchange latent states, and ships training and inference pipelines for four collaboration patterns.

**RecursiveMAS/RecursiveMAS** — [NeurIPS 2026] Recursive Multi-Agent Systems

- Repository: https://github.com/RecursiveMAS/RecursiveMAS
- Website: https://recursivemas.github.io
- Stars: 986 · Forks: 116
- Language: Python
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/recursivemas-recursivemas

## The multi-agent system is cast as one recursive computation

Most multi-agent frameworks treat each LLM agent as a module with its own prompt, its own tools and its own output, and then wire them together with message passing. RecursiveMAS changes the framing. It is a multi-agent framework that scales agent collaboration through latent-space recursion, and the whole system is cast as a unified recursive computation rather than a set of isolated agents. The research paper behind it, arXiv 2604.25917, is titled Scaling Agent Collaboration through Recurrent Depth in Latent Space, and the project website is at recursivemas.github.io. The repository is written in Python, and the intended audience is clear from the surrounding material: the Hugging Face collection holds collaboration styles and model checkpoints, the paper was featured as a Hugging Face daily paper, and the code is organised as a training pipeline and an evaluation pipeline rather than as a library with a stable public API.

## RecursiveLink modules move latent states, not text messages

The mechanism that makes the recursion possible is a set of lightweight modules called RecursiveLink. Heterogeneous agents are connected by them, and the links let the agents exchange, refine and evolve latent states across recursion rounds. That word choice is the important part. In a message passing design, an agent hands the next agent a string it can read and quote. Here what moves between agents is a latent state that is refined and evolved over rounds, and the connection itself is a small trainable module rather than a fixed string template. Two diagrams in the repository assets, method1.png and method2.png, carry the architecture, with the overview and the link structure kept as separate figures. The practical consequence for anyone building on this is that the pipeline expects agents backed by the released checkpoints and links that expect latent representations of a particular shape, rather than an arbitrary model behind a text prompt.

## Inner-Outer Loop training warms up agents before the system is tuned

RecursiveMAS pairs its architecture with a training paradigm described as Inner-Outer Loop training for progressive co-optimization. The two loops do different jobs. The inner loop provides a preliminary model level warm start for each agent, so each agent becomes individually usable before anything system level happens. The outer loop then trains the outer RecursiveLink across agents at the system level, which is the part where the links learn to pass and refine latent state between agents that were never tuned to cooperate. The repository separates these into two scripts, train/train_inner.py and train/train_outer.py, with the outer work under a train/outer directory and data under train/data. The training data itself is published as a Hugging Face dataset, and the news entries record that the complete training implementations and data, together with inference and evaluation pipelines, became available on 2026-06-28. The two-stage design is the reason the links are described as lightweight: the heavy lifting of making an agent competent happens first, in isolation.

## One inference pipeline covers four collaboration patterns

The framework ships four collaboration patterns, all released: Sequential, Mixture, Deliberation and Distillation. The evaluation claims are made across 9 benchmarks spanning mathematics, science, medicine, search and code generation, with gains attributed to recursively refining shared latent states and delivered across all four system types. The repository layout reflects that this is a pipeline rather than a library. The inference directory holds run.py, a dataset folder, an inference_utils folder and its own README, and it is described as the inference pipeline and downstream tasks evaluation. The training directory has the parallel shape. Running the demo code needs a command line, and the README points to the repository for the commands. A VentureBeat article linked from the README carries a headline claiming 2.4 times faster multi-agent inference and 75 percent lower token usage, which is a media claim about their own experiment rather than something the repository measures for you, so treat the number as the authors' result and the checkpoint collection as the thing you would have to reproduce against.

## Installation is a conda environment with pinned torch and transformers

The environment setup is explicit and the requirements are pinned, which matters for a project built on model checkpoints. The instructions start by creating a clean Python environment from the repository root.

```bash
conda create -n recursivemas python=3.10 -y
conda activate recursivemas
```

Then the packages come from the requirements file.

```bash
pip install -r requirements.txt
```

The pins tell you what the pipeline expects. torch is pinned to 2.9.0 and transformers to 5.3.0, with datasets at 4.4.2 and huggingface-hub at 1.7.1, and there is a supporting stack of tokenizers, safetensors, sentencepiece, accelerate, tqdm, numpy, PyYAML, requests, filelock, python-dateutil and sympy. The result is a research environment rather than a deployable service: there is no container image, no REST API layer and no plugin system, only scripts that read a configuration and run an experiment.

## Deliberation runs need a Tavily key and an LLM judge endpoint

Two configuration details decide whether a run works at all, and both are easy to miss because they sit at the end of the setup section. The first is search access. For Deliberation style runs on the search datasets bamboogle and hotpotqa, the Tool-Caller agent queries a real web search API, for example Tavily, and the key has to live in a plain text file that is then passed on the command line.

```bash
# e.g., keys.txt
tvly-xxxxxxxxxxxxxxxxxxxxxxxx
```

The flag that carries it is --tavily_keys_file. The second is grading. Open-ended questions are graded by an LLM judge on an OpenAI compatible API, and the judge is configured through three environment variables.

```bash
export API_KEY=...          # bearer token for the judge endpoint
export API_BASE_URL=...     # OpenAI-compatible base or chat-completions URL
export API_MODEL=...        # judge model id
```

So the same run that scores a dataset can also spend money twice, once on the search calls and once on the judge. That is a cost and reproducibility consideration the repository does not quantify, and it is a fair question for anyone planning a benchmark sweep.

## Distribution runs through Hugging Face, not through tagged releases

The repository has no GitHub releases, so there is no version tag to pin in a requirements file and no changelog to read on the releases page. What there is instead is a set of Hugging Face assets under the RecursiveMAS organisation: a collection holding all the collaboration styles and the model checkpoints, plus separate model and dataset repositories. The project website at recursivemas.github.io and the paper page on Hugging Face act as the index for both. Distribution also has a public history: the paper was released on 2026-04-28, the collection and checkpoints followed on the same date, the paper was featured as the Hugging Face paper of the week or day on 2026-05-01, a VentureBeat article followed on 2026-05-24, a YouTube tutorial and an interactive playground demo on 2026-06-25, and the complete training and inference pipelines on 2026-06-28. The licence is MIT, which is the permissive choice that makes it easy to build on the code, and the last push to the repository was on 2026-09-28.

## The README stops before the commands you need

One limitation is worth naming plainly, because it affects everyone who starts here. The README's quick start section is cut off mid heading in the published version, so the actual inference and training commands are not visible there, even though the feature list promises demo code with commands provided. The repository tree tells you where the entry points live, inference/run.py and the two training scripts, and the inference directory has its own README, but the wiring of a first run, the checkpoint identifiers and the configuration format are not spelled out in the top level file. The same applies to the reported gains: the benchmark table lives in the paper and the assets folder rather than in the README, so the numbers 9 benchmarks, the four collaboration styles and the 2.4 times and 75 percent figures all live outside the code. If your evaluation depends on reproducing a specific result, budget time for reading the paper and the per-directory READMEs, because the repository entry point alone does not carry that information.

## Conclusion

RecursiveMAS is a research codebase for teams already working with latent state collaboration between agents, and it is not a general purpose agent framework you drop into a product this week. Before committing, verify that you can host the released checkpoints from the Hugging Face collection, that the Deliberation runs on the search datasets will have a Tavily key in a plain text file passed through --tavily_keys_file, and that your judge endpoint exposes the OpenAI-compatible variables API_KEY, API_BASE_URL and API_MODEL. The licence is MIT, the repository has no tagged releases, and the last push was on 2026-09-28.

## FAQ

### How do I set up the environment for RecursiveMAS?

Create a clean environment with conda create -n recursivemas python=3.10 -y, activate it, and install the pinned dependencies with pip install -r requirements.txt from the repository root.

### Which collaboration patterns does RecursiveMAS support?

Sequential, Mixture, Deliberation and Distillation. All four are released, with the checkpoints and the collaboration styles published as a Hugging Face collection.

### What does the Tool-Caller agent need for Deliberation runs on the search datasets?

It queries a real web search API such as Tavily. Put the search key in a plain text file and pass it with the --tavily_keys_file flag when running on the bamboogle and hotpotqa datasets.

### How is open-ended question grading configured in RecursiveMAS?

With an LLM judge on an OpenAI compatible API, configured through the API_KEY, API_BASE_URL and API_MODEL environment variables.

## Sources

- [Issues](https://github.com/RecursiveMAS/RecursiveMAS/issues)
- [License: MIT](https://github.com/RecursiveMAS/RecursiveMAS/blob/main/LICENSE)
- [Project website](https://recursivemas.github.io)
- [README](https://github.com/RecursiveMAS/RecursiveMAS/blob/main/README.md)
- [RecursiveMAS/RecursiveMAS on GitHub](https://github.com/RecursiveMAS/RecursiveMAS)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/recursivemas-recursivemas
