TL;DR
As the AI ecosystem transitions toward an open "Agent Web" via the Model Context Protocol (MCP), selecting the right tool or agent from millions of possibilities becomes a massive scalability bottleneck. This paper introduces ACE-Router, a framework that trains history-aware routers using self-mutating candidate graphs and simulated multi-turn interaction trajectories. The resulting lightweight routing agent significantly outperforms massive generalist models like GPT-4o and Gemini-2.5-Pro in navigating large-scale, noisy tool and agent ecosystems.
What Problem Does This Paper Address?
With the emergence of the Model Context Protocol (MCP), LLM agents can now access an exponentially growing repository of millions of external tools and specialized agents. However, current architectures struggle to scale. Traditional approaches rely on either Static Injection (shoving all tool schemas directly into the prompt, which quickly saturates the context window) or Embedding-based Retrieval (using static semantic similarity to match a user query to a tool description).
Embedding-based retrieval suffers from three critical flaws:
- It lacks the fine-grained discriminability needed to separate functionally similar tools (semantic overlap).
- It completely ignores multi-turn dialogue history, missing crucial context like intermediate tool outputs or prior failures.
- Compressing long histories into fixed-size vectors causes severe information loss.
To realize the vision of an open, dynamic "Agent Web," systems need a robust, context-aware router that can dynamically discover and schedule optimal collaboration nodes on demand.
Methods
The authors propose ACE-Router, a pipeline designed to train high-performance, history-aware routers through a three-stage process:
- Candidate Graph-based Extension with Self-Evolutionary Mutation: To teach the router how to distinguish between highly similar candidates, the framework mutates existing tools using operators like Parameter Redesign, Workflow Chaining, and Function Enhancement. These mutated variants act as "hard negatives" within a structured similarity graph.
- Trajectory Synthesis via Multi-Agent Simulation: The system samples subsets of tools from the candidate graph using random walks. A multi-agent framework then uses these subsets to simulate realistic, multi-turn dialogue trajectories. This environment-free simulation generates high-quality training data complete with explicit history-to-routing supervision signals.
- Light Routing Agent (LRA): At inference time, the trained router is deployed as a plug-and-play module equipped with only two minimal tools: Router Invocation and Execution. This decouples the routing logic from concrete tool definitions, keeping the host agent's context window clean and lightweight.
Datasets
- Tool Routing: The initial tool bank consisted of 627 real-world MCP tools collected from the MCP-Universe and LiveMCP benchmarks. Through self-evolutionary mutation, this was expanded to 2,005 tools, generating over 15,092 history-aware training samples.
- Agent Routing: To test cross-domain generalization, the authors collected and normalized 40+ mainstream agents into a consistent JSON format to build an Agent Bank, synthesizing 156 test samples for evaluation.
Key Insights and Ideas
- Specialization Beats Scale: A specialized 8B parameter router (built on Qwen3-8B) can comfortably outperform massive generalist models like GPT-4o. Generalist models struggle with the precise discrimination required to filter out highly confusable, semantically close distractors.
- History is Non-Negotiable: Tool routing is inherently dynamic. Routers must track sequential dependencies (e.g., ensuring a user profile is fetched before querying repository details) and handle error recovery (recognizing a failed tool call and pivoting to an alternative strategy).
- Zero-Shot Capability Transfer: Even though ACE-Router was trained primarily on tool-selection data, it successfully transfers its abstract decision-making patterns to agent-selection tasks without any additional fine-tuning. It learns the fundamental logic of "capability matching" rather than overfitting to specific tool schemas.
Key Results
- Benchmark Superiority: On the MCP-Universe benchmark, ACE-Router achieved an overall accuracy of 53.44%, outperforming Gemini-2.5-Pro (49.79%) and GPT-4o (47.41%). On MCP-Mark, it achieved 60.00% accuracy, vastly outperforming GPT-4o's 38.00%.
- Agent Routing: On the newly constructed Agent Route Benchmark, ACE-Router achieved a remarkable 91.67% accuracy in zero-shot agent selection, outperforming all baseline LLMs.
- The Impact of History: Ablation studies proved that removing historical context causes routing accuracy to plummet from 53% to 48% on MCP-Universe and from 60% to 52% on MCP-Mark, highlighting the necessity of multi-turn awareness.
- Noise Robustness: When the candidate space was intentionally flooded with noisy, irrelevant tools (+LiveMCP) or highly confusable mutations (+Mutation), competing methods suffered notable performance degradation, while ACE-Router demonstrated exceptional stability.
Limitations and Future Work
Due to computational resource constraints, the authors exclusively evaluated LoRA fine-tuning on an 8B model architecture. They note that these performance gains could scale further if applied to larger foundation models. Additionally, while the router generalizes well to agent routing, it was still predominantly trained on tool-use data. Future work will focus on developing specialized routing models explicitly tailored for complex multi-agent orchestration and universal, massive-scale retrieval tasks like long-term memory management.
Summary updated