Counting 2,285 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Jan. 23, 2018
Nov. 6, 2017

Build Status stability-experimental

MAgent is a research platform for many-agent reinforcement learning. Unlike previous research platforms that focus on reinforcement learning research with a single agent or only few agents, MAgent aims at supporting reinforcement learning research that scales up from hundreds to millions of agents.


MAgent supports Linux and OS X running Python 2.7 or python 3. We make no assumptions about the structure of your agents. You can write rule-based algorithms or use deep learning frameworks.

Install on Linux

git clone [email protected]:geek-ai/MAgent.git
cd MAgent

sudo apt-get install cmake libboost-system-dev libjsoncpp-dev libwebsocketpp-dev

export PYTHONPATH=$(pwd)/python:$PYTHONPATH

Install on OSX

git clone [email protected]:geek-ai/MAgent.git
cd MAgent

brew install cmake llvm boost
brew install jsoncpp argp-standalone
brew tap david-icracked/homebrew-websocketpp
brew install --HEAD david-icracked/websocketpp/websocketpp

export PYTHONPATH=$(pwd)/python:$PYTHONPATH


Get started


The training time of following tasks is about 1 day on a GTX1080-Ti card. If out-of-memory errors occur, you can tune infer_batch_size smaller in models.

Note : You should run following examples in the root directory of this repo. Do not cd to examples/.


Three examples shown in the above video. Video files will be saved every 10 rounds. You can use render to watch them.

  • pursuit

     python examples/ --train
  • gathering

     python examples/ --train
  • battle

     python examples/ --train


An interactive game to play with battle agents. You will act as a general and dispatch your soldiers.

  • battle game
    python examples/

Baseline Algorithms

The baseline algorithms parameter-sharing DQN, DRQN, a2c are implemented in Tensorflow and MXNet. DQN performs best in our large number sharing and gridworld settings.


Many thanks to Tianqi Chen for the helpful suggestions.