Library / SDK
agi-brain/xuance avatar
agi-brain/xuance

Three backends is a maintenance claim, and the pins show it

XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library

1,113 stars162 forksPythonMIT

At a glance

What is it?
XuanCe is a deep reinforcement learning library whose stated purpose is to make a family of algorithms reproducible rather than merely available, and it pursues that with three things a smaller library would not attempt: implementations for PyTorch, TensorFlow and MindSpore, a whole configuration system shipped as packaged YAML, and a separate benchmark repository. The dependency pins in pyproject are where the cost of the first of those shows up.
Who is it for?
Adopt XuanCe if you want one API across single-agent and multi-agent tasks, if you need to compare algorithms on identical configurations rather than on someone else's, and if you can live with a beta library whose dependency pins will move under you.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • agi-brain/xuance1,113 ★ · +26
Star history
Repository2026-10-012026-11-22
agi-brain/xuance1.1k1.1k

26 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem stated is reproducibility, not coverage

The README explains the project's existence in a way most libraries do not. Deep reinforcement learning algorithms are sensitive to hyper-parameter tuning, they vary in performance with different tricks, and they suffer from unstable training processes, so they can seem elusive. The stated aim is to give a thorough, high-quality and easy-to-understand implementation of those algorithms, and the hope is that reading the implementation gives a hint on the magics of reinforcement learning. That framing matters for what you should expect from the project. It is not a claim to have found a better algorithm. It is a claim to have made the same algorithm behave the same way in your hands, which is a claim about code quality and defaults rather than about research. The paper is linked for the record at an arXiv identifier, and the name is a pun worth knowing about, since the project is called XuanCe and the Chinese characters mean incredible and magic box for the first half and policy for the second, which is a fairly direct statement of intent about both the field and the method.

The algorithm list is long and deliberately paired with papers

The single-agent section alone runs past twenty entries, and the pattern is that every one of them is a variant someone has published rather than a new idea. DQN, then Double DQN, Dueling DQN, PER, NoisyDQN, DRQN, QRDQN and C51, which is the value-based family with its replay and exploration and distribution variants. Then the policy family: PG, NPG, PPG, A2C, SAC, SAC-Discrete, PPO-Clip, PPO-KL, DDPG and TD3, with P-DQN, MP-DQN and SP-DQN for parameterised action spaces. A model-based section starts below the visible part of the README with DreamerV2. Each entry links to its paper, and several also link to an existing implementation, which is the useful detail, because it tells you where the reference behaviour comes from when you want to check a result. The multi-agent side exists too, and the repository topics name the families, with QMIX, MADDPG and MAPPO among them. A library with this many variants is only useful if switching between them is cheap, which is the job the configuration system does.

Configurations are packaged YAML, three directories deep

The mechanism behind the modularity claim is visible in the packaging. setup.py lists package data that includes config files at three different depths, a top-level configs directory, one level of subdirectories, and two. That means the library ships its entire configuration hierarchy inside the package, and a user's job is to copy the relevant tree and edit it rather than to assemble a configuration object in code. It also explains the documentation links, since an installation page and a basic usage page are the two things a YAML-driven library needs and an object-driven library does not. The feature list puts it as highly modularized and flexible for model combination, and this is what that means in practice: you can hold the algorithm, the policy network, the representation and the environment configuration in separate files, change one, and see what moves. The cost is that configuration becomes a thing you have to learn, and a YAML file with a typo produces a configuration error rather than a traceback, which is the everyday friction nobody puts in a feature list.

MAgent2 arrives as a compiled library per platform

The package data list has one entry that is not a configuration file, and it is the most consequential line in the file. Three native binaries are shipped for the MAgent2 environment: a shared object for Linux, a dynamic link library for Windows, and a dylib for macOS, where the comment adds that the macOS one is for Intel processors. So a substantial part of one environment's implementation is a prebuilt binary that the project compiles per platform and hands to pip, which means it is not inspectable, not rebuildable by you, and versioned separately from the Python code. MAgent2 is a multi-agent environment, and the repository topics also list MAgent, so the library supports that family of simulations. The honest way to read this is that the library is not pure Python, and if your work depends on that environment specifically, the compatibility question is about the binary rather than about the library's Python code. For everyone else it is a footnote in an otherwise pure Python package.

Benchmarks live in a second repository

There is a badge labelled Benchmarks that points at a separate repository, agi-brain/xuance-benchmarks. In a field where the stated problem is that results vary with tuning tricks, a library that publishes a benchmark harness is making a specific and unusual claim, namely that the comparison is the artefact and not any individual result. That claim is also falsifiable, which is what makes it valuable: anyone can run the same suite and check. The more interesting question is where the benchmark harness is relative to the library, and the answer is outside it, which is the right design. Results that live in the same repository as the code drift with the code, and a separate results repository makes it obvious when numbers are stale. If you are evaluating whether the project is credible, the benchmark repository is the place to look, and the question to ask of it is simple: does it reproduce on hardware you have, and does it pin the environment the way it pins the algorithm.

Automatic hyper-parameter tuning is a feature, and that is the tell

Two items in the feature list deserve to be read as admissions. The first is support for automatic hyper-parameter tuning, and the example tree has a directory named for it. A library ships automatic tuning because its defaults are not a configuration you can rely on, which is entirely consistent with the README's own statement that these algorithms are sensitive to tuning and unstable. The second is fast running speed with parallel environments alongside distributed training across multiple GPUs, which is the operational half of the same problem, because an algorithm that is sensitive to tuning is also an algorithm you need to run many times. Both features follow from taking reproducibility seriously rather than from feature-box filling. The reasonable expectation to set is that the library gives you the machinery to do a careful comparison rather than a well-tuned default that happens to work, and the example directory structure supports that reading, since a directory called HyperparameterTuning sits alongside the algorithm examples rather than in a separate tool.

The example tree is a curriculum

The examples directory is organised as eight named directories, and the naming is the documentation. StartHere is the on-ramp, DRL is single-agent work, MARL is multi-agent, OfflineRL is learning from a fixed dataset, Drones is a physical or simulated robot, HyperparameterTuning is the comparison work, and then NewAlgorithm and NewEnvironments, which are contribution targets rather than lessons. That ordering is a design decision: the project wants a user to arrive at the same configuration three separate ways, once to read, once to run, and once to extend. NewAlgorithm and NewEnvironments as examples also tell you what the project wants from contributors, which is a new algorithm or a new environment implementing an existing interface, rather than a patch. The entry point in the repository root is a single quick start script, and the documentation site carries installation and basic usage pages, so the first thirty minutes of a user's time are structured rather than improvised.

Beta status, a three-year Python floor, and a Chinese mirror

The packaging metadata is more informative than the release history, so read it. The declared floor is Python 3.6, and the classifier list runs from 3.6 through 3.12, which is a wide and slightly optimistic claim given that the dependencies are held at numeric ceilings:

toml
"numpy>=1.21.0, <2.0.0",
"gymnasium>=0.28.0, <1.3.0",
"torch>=2.0.0, <3.0.0",

The inline comments in that same list suggest minimum versions the maintainers actually tested, 1.21.6 for numpy, 1.1.1 for the gymnasium variant and 1.15.3 for scipy, and one dependency is pinned to an exact version, pyglet at 1.5.15. Those suggestions are unusual and useful, because they tell you the tested versions rather than the ranges the package is willing to resolve. The installation instructions themselves live on the documentation site rather than in the README, at the page the features section links to:

bash
https://xuance.org/documents/usage/installation.html

The development status classifier says beta, the current version is 1.4.4, and the last three releases are 1.4.2 and 1.4.3 on the same day in May 2026 followed by 1.4.4 in July, with the last push to master on 2026-09-17. The documentation is bilingual, with a Chinese site, a Chinese readme file and a separate Chinese contributing guide, which matters more than it sounds for a library whose user base is visibly international. The optional dependency groups are separate, with a torch group and a tensorflow group, so you install the backend you want rather than all of them.

Editorial conclusion

Adopt XuanCe if you want one API across single-agent and multi-agent tasks, if you need to compare algorithms on identical configurations rather than on someone else's, and if you can live with a beta library whose dependency pins will move under you. Do not adopt it for a production training run you cannot restart, since the project itself names unstable training and hyper-parameter sensitivity as the reason it exists, and a library whose defaults need automatic tuning is telling you something about those defaults. Verify four things first: that your Python is recent enough for the pinned stack, since pyproject declares 3.6 as a floor while numpy is held below 2 and torch below 3, that the environment you need is actually in the topic set, which covers Atari, MuJoCo, StarCraft II, Google Research Football, PettingZoo multi-agent and MAgent2, that the benchmark repository actually reproduces on your hardware before you trust a comparison, and which backend extra you are installing, since the optional groups are separate. The licence is MIT, version 1.4.4 shipped on 2026-07-18, and the last push to master was 2026-09-17.

Frequently asked questions

Which deep reinforcement learning algorithms does XuanCe implement?

The README lists more than twenty single-agent variants with paper links, including DQN, Double DQN, Dueling DQN, PER, NoisyDQN, DRQN, QRDQN, C51, PG, NPG, PPG, A2C, SAC, SAC-Discrete, PPO-Clip, PPO-KL, DDPG, TD3 and parameterised Q-network variants, plus a model-based section starting with DreamerV2. Multi-agent families such as QMIX, MADDPG and MAPPO appear in the repository topics.

Which deep learning backends does XuanCe support?

PyTorch, TensorFlow and MindSpore, each with a badge showing a minimum version. They are exposed as optional dependency groups, so you install the backend you want, and the project expects to be compatible with all three.

How does XuanCe configure a run?

With YAML. The packaging includes configuration files at three directory depths inside the package, so a run is configured by editing a hierarchy of files rather than by constructing objects in code, and the documentation has separate installation and basic usage pages for that reason.

Which environments does XuanCe support?

The repository topics name Atari, MuJoCo, StarCraft II, Google Research Football, the PettingZoo multi-agent particle environments and MAgent2. MAgent2 is shipped as a prebuilt native library per platform, with separate binaries for Linux, Windows and macOS, the macOS one noted as for Intel processors.

What licence is XuanCe released under?

MIT, declared in the packaging metadata with a LICENSE.txt at the repository root. The current version is 1.4.4, released on 2026-07-18, and the last push to master was 2026-09-17.

Official sources

  1. agi-brain/xuance on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/agi-brain-xuance.svg)](https://hysenlabs.com/projects/agi-brain-xuance)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/agi-brain-xuance.svg)](https://hysenlabs.com/projects/agi-brain-xuance)

Was this useful?