Unity ML-Agents Toolkit is an open-source framework that enables games and simulations built in Unity to serve as training environments for intelligent agents using deep reinforcement learning and imitation learning.
The toolkit addresses the challenge of training AI agents by providing a bridge between game development and machine learning research. It supplies PyTorch-based implementations of state-of-the-art algorithms that allow developers to train agents directly within Unity environments. The approach works by exposing game state to a Python training API, enabling agents to learn through reinforcement learning, imitation learning from demonstrations, or neuroevolution. Trained agents can then be deployed back into games for NPC control, automated testing, or design evaluation.
Game developers and hobbyists should consider this toolkit if they need to train agents for 2D, 3D, or VR/AR games without building training infrastructure from scratch. It suits projects requiring single-agent, multi-agent cooperative, or competitive scenarios. The toolkit supports multiple deep reinforcement learning algorithms including PPO, SAC, and MA-POCA, along with imitation learning through behavioral cloning and GAIL. Researchers benefit from the simple Python API and the ability to wrap environments as gym or PettingZoo instances, making it compatible with standard reinforcement learning workflows. The included example environments and curriculum learning support help accelerate development of complex agent behaviors.
The project maintains active development with regular releases and comprehensive documentation hosted through Unity's official package documentation system. The toolkit provides native cross-platform support through its inference engine, allowing trained agents to run efficiently across different platforms without requiring the full training pipeline at runtime.