Create README.md
Browse files# TCAndon-Router
<p align="center">
<img src="https://raw.githubusercontent.com/Tencent/TCAndon-Router/refs/heads/main/assets/router.png?raw=true" width="500"/>
</p>
<p align="center">
<a href="https://github.com/Tencent/TCAndon-Router">Github</a> | 📑 <a href="https://arxiv.org/abs/TCAndonRouter">Paper</a>
</p>
## 🌟 Introduction
In multi-agent systems, the ability to select the appropriate agent(s) to handle a user query is a key determinant of overall system performance.
TCAndonRouter is a reasoning-centric multi-intent routing module whose primary role is to perform agent routing in multi-agent systems.
Beyond agent routing, TCAndonRouter can be applied to any intent-routing scenario, including agent skill selection.
The main advantages of TCAndonRouter include:
+ Designed specifically for real-world enterprise applications
+ Supports dynamic onboarding of new agents (intents) New agents can be added simply by appending their descriptions, without retraining
+ Provides transparent and interpretable routing decisions, improving explainability, robustness, and cross-domain generalization, and making post-deployment bad-case analysis easier
+ Effectively resolves agent conflicts caused by overlapping responsibilities, leading to higher-quality final responses. When multiple agents are applicable, TCAndonRouter preserves all relevant agents. Each downstream agent generates its own response, and a Refining Agent subsequently merges these outputs into a single final answer
TCAndonRouter is trained using Supervised Fine-Tuning (SFT) followed by Reinforcement Learning (DAPO), and achieves strong performance on large-scale and real-world datasets, including CLINC150, HWU64, MINDS14, SGD, and Tencent Cloud ITSM (QCloud).
| **Models** | **CLINC150** | **HWU64** | **MINDS14** | **SGD** | **QCloud** |
|------------------------|--------------|-----------|-------------|-----------|-----------------|
| GPT-5.1 | 93.84 | 85.59 | 95.59 | 73.90 | 92.80/93.06 |
| Claude-Sonnet-4.5 | **94.21** | 87.40 | 96.20 | 76.02 | 88.82/94.25 |
| DeepSeek-v3.1-terminus | 88.29 | 88.10 | 95.72 | 79.70 | 94.09/91.89 |
| ArcRouter | 62.98 | 69.33 | 91.79 | 65.59 | - |
| Qwen3-Embedding-4B | 57.21 | 54.27 | 94.12 | 37.02 | - |
| Qwen3-4B-Instruct-2507 | 70.12 | 80.29 | 90.08 | 58.74 | 82.23/79.44 |
| **TCAndonRouter** | 91.25 | **91.63** | **96.70** | **91.58** | **95.21/92.78** |
## 🔧 How to use
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from prompt import router_prompt
from utils import load_config
tokenizer = AutoTokenizer.from_pretrained("tencent/TCAndon-Router")
model = AutoModelForCausalLM.from_pretrained("tencent/TCAndon-Router")
agents = load_config('config/hwu64_config.xml')
query = "Can you recommend any pub in mg road"
prompt = router_prompt.format(agents=agents) + 'user:' + query
response = model.generate(prompt)
print(response)
```
## 🤝 Citation
If you use TCAndonRouter in your work, please cite our paper:
```
@article
{zhao2025TCAndonRouter,
title={TCAndonRouter: Adaptive Reasoning Router for Multi-Agent Collaboration},
author={Jiuzhou Zhao et al.},
journal={arXiv},
year={2025}
}
```