Taming elusive policies across PyTorch, TensorFlow, and MindSpore
XuanCe corrals dozens of deep RL algorithms into a single, backend-agnostic library so researchers can swap between PyTorch, TensorFlow, and MindSpore without rewriting agents.

What it does
XuanCe is a modular deep reinforcement learning library that implements a wide catalog of single-agent, multi-agent, model-based, and contrastive RL algorithms. It wraps environments ranging from CartPole and MuJoCo to StarCraft II and Google Research Football in one codebase, so you can switch between DQN, MAPPO, or DreamerV3 without switching repos.
The interesting bit
The project’s name translates roughly to “elusive policy,” an honest admission that deep RL is notoriously sensitive to hyperparameters and unstable training. Rather than pretending otherwise, the library offers automatic hyperparameter tuning and parallel environments as built-in safeguards. Its more unusual twist is trilingual backend support: the library explicitly targets PyTorch, TensorFlow 2, and MindSpore, which is rare in a field where most libraries pick one framework and dig in.
Key highlights
- Covers single-agent (
PPO,SAC,TD3), multi-agent (QMIX,MADDPG,MAPPO), model-based (DreamerV2,DreamerV3), and contrastive (CURL,SPR,DrQ) methods. - Targets cross-platform use—Linux, Windows, and macOS—with CPU, GPU, and multi-GPU distributed training.
- Supports automatic hyperparameter tuning and visualization via TensorBoard or Weights & Biases.
- Publishes benchmark results in a separate repository and maintains full documentation in both English and Chinese.
Verdict Researchers who need to prototype across single-agent, multi-agent, and model-based methods without switching libraries should start here. If you are already locked into one framework and only need a single algorithm, it may be more toolbox than you need.
Frequently asked
- What is agi-brain/xuance?
- XuanCe corrals dozens of deep RL algorithms into a single, backend-agnostic library so researchers can swap between PyTorch, TensorFlow, and MindSpore without rewriting agents.
- Is xuance open source?
- Yes — agi-brain/xuance is open source, released under the MIT license.
- What language is xuance written in?
- agi-brain/xuance is primarily written in Python.
- How popular is xuance?
- agi-brain/xuance has 1.1k stars on GitHub.
- Where can I find xuance?
- agi-brain/xuance is on GitHub at https://github.com/agi-brain/xuance.