# Building recursive agent systems

By **leerob** · Artículos

Research synthesis covering two 2025 papers on recursive multi-agent systems: RecursiveMAS and RAH, for developers building agentic pipelines.

- Source: https://x.com/leerob/status/2065469795529588940
- Tags: multi-agent, recursion, agent-systems, llm, scaling, research, open-source, code-generation
- Upvotes: 0

---

## The big picture

Two independent 2025 papers, RecursiveMAS (arXiv:2604.25917, UIUC/Stanford/MIT/NVIDIA) and Recursive Agent Harnesses (arXiv:2606.13643, PwC), each argue that recursion is the underexplored scaling axis for multi-agent systems. RecursiveMAS reports a consistent average accuracy gain of 8.3% across 9 benchmarks, plus up to 2.4x inference speedup and 75.6% token reduction. RAH lifts a GPT-5 coding-agent baseline from 71.75% to 81.36% on Oolong-Synthetic, a gain the authors attribute entirely to the harness structure, not the model.

## Why it matters

Most production multi-agent pipelines scale horizontally: more agents, more calls, more tokens. Both papers challenge that assumption directly. Recursion lets a fixed set of agents deepen computation across rounds rather than widen the team, which cuts cost and latency simultaneously. That is a rare tradeoff in systems design.

## How it works

The two papers pursue different recursive units. RecursiveMAS replaces token-level communication between agents with latent-state transfer. A lightweight two-layer residual module called RecursiveLink maps an agent's last-layer hidden states directly into the next agent's input embedding space. No token projection happens, so the system stays in continuous latent space across recursion rounds.

RAH takes the opposite direction: the recursive unit is a full agent harness. A parent agent writes an executable script that spawns subagent harnesses in parallel. Each subagent carries the same filesystem tools, code execution, and planning capabilities as its parent, enabling recursive decomposition bounded by a configurable depth limit.

## Yes, but

Neither approach ships as a drop-in library today. RecursiveMAS requires fine-tuning access to participate in its inner-outer loop credit assignment, so it is not a prompt-engineering trick. For builders working with existing OSS orchestration frameworks, RAH patterns are closer to what LangGraph or AutoGen already support conceptually: a parent agent that spawns child agents with shared tool access. The key RAH addition is code-execution spawning (writing a runnable script) as the primary branching mechanism, not just JSON tool calls.

## The bottom line

Reach for RAH patterns if your task has more than roughly 100 parallel entries with independent per-entry LLM reasoning and you need results within a single context budget. RecursiveMAS requires fine-tuning access but delivers the stronger efficiency gains when training is on the table. Both papers are worth reading together: arXiv:2604.25917 for the latent-space theory, arXiv:2606.13643 for the code-first practitioner view.

## FAQ

### What is RecursiveMAS and what problem does it solve?

RecursiveMAS (arXiv:2604.25917) is a multi-agent framework that replaces text-based communication between agents with latent-state recursion, treating the entire system as a unified recursive computation graph. Standard multi-agent systems pass token strings between agents, which is slow and token-expensive. RecursiveMAS instead transfers hidden states directly via a two-layer residual module called RecursiveLink, enabling agents to collaborate in continuous latent space across multiple recursion rounds. The result across 9 benchmarks is an average 8.3% accuracy gain, up to 2.4x speedup, and up to 75.6% fewer tokens versus text-based baselines.

### What is a Recursive Agent Harness (RAH) and how does it differ from RecursiveMAS?

A Recursive Agent Harness (RAH), introduced in arXiv:2606.13643 by PwC researchers, makes the recursive unit a full agent harness complete with filesystem tools, code execution, and planning, rather than a bare model call or latent state. A parent agent writes an executable script that spawns subagent harnesses in parallel. Each subagent carries the same spawning capability as its parent, so decomposition is genuinely recursive and bounded only by a configurable depth limit. Where RecursiveMAS requires fine-tuning to share gradients across recursion rounds, RAH is code-first and closer to patterns already expressible in existing orchestration frameworks.

### What benchmarks and results do these papers report?

RecursiveMAS evaluates across 9 benchmarks spanning mathematics, science, medicine, search, and code generation, reporting a consistent average accuracy improvement of 8.3%, end-to-end inference speedup of 1.2x to 2.4x, and token usage reduction of 34.6% to 75.6% versus text-based multi-agent and recursive computation baselines. The RAH paper uses the Oolong-Synthetic benchmark (199 samples across 13 context-length buckets up to 4M tokens) to evaluate long-context reasoning. With GPT-5 as the backbone, RAH improves the Codex coding-agent baseline from 71.75% to 81.36%. With Claude Sonnet 4.5 as the backbone, the same RAH design reaches 89.77%.

### What is RecursiveLink and why is it central to RecursiveMAS?

RecursiveLink is a lightweight two-layer residual module that connects heterogeneous agents in RecursiveMAS by transmitting latent states across two transition types. The inner link maps an agent's last-layer hidden state back into its input embedding space so the agent continues generating in continuous latent space without projecting to tokens. The outer link performs cross-agent latent state transfer, passing the hidden stream from one agent to the next. Because no tokenization happens between agents, the system avoids the computational overhead of sampling and re-encoding, which is the primary source of the reported speedup and token savings.

### Can I use these recursive patterns with existing orchestration frameworks like LangGraph or AutoGen?

RAH patterns are conceptually close to what frameworks like LangGraph and AutoGen already support: a parent agent that spawns child agents with shared tool access. The key RAH addition is using code-execution spawning (writing a runnable script as the branching mechanism) rather than relying solely on JSON tool calls, which the authors argue is better suited for fine-grained parallel workloads with thousands of independent entries. RecursiveMAS, by contrast, requires fine-tuning access to participate in its inner-outer loop gradient-based credit assignment, so it cannot be replicated purely through prompt engineering or standard orchestration wiring.

### What are the main limitations or risks of recursive agent architectures?

RecursiveMAS requires training access to the underlying models to co-optimize the system via shared gradients across recursion rounds, making it inaccessible for teams working exclusively with closed APIs. RAH's recursive decomposition is bounded by a configurable depth limit, but the authors note that tasks requiring per-entry LLM reasoning across thousands of independent entries are the target use case, and simpler tasks may not benefit from the added complexity. Neither paper ships as a production library at the time of writing, so builders would need to implement the patterns themselves. The RAH paper also notes that coding agents currently reduce per-entry reasoning to regex heuristics

---
[View on Analog](https://analoghq.ai/es/leerob/articles/building-recursive-agent-systems)