Your Unity scenes are now reinforcement learning gyms
Turns Unity games and simulations into environments for training intelligent agents with deep reinforcement and imitation learning.

What it does ML-Agents is Unity’s official open-source toolkit for training intelligent agents inside games and simulations. It bakes PyTorch-based implementations of algorithms like PPO, SAC, and MA-POCA into a Unity SDK, letting developers train NPCs that can adapt, automate playtesting, or prototype game design decisions without leaving the engine. Researchers get a Python API and wrappers for Gym and PettingZoo, so the same Unity scenes can feed into standard RL pipelines.
The interesting bit The toolkit treats your game loop as the environment and your NPCs as the agents, collapsing the usual wall between game development and AI research. It supports everything from solo agents to adversarial multi-agent brawls, and even lets you swap in your own Python training algorithms if the built-in trainers feel too prescriptive.
Key highlights
- Ships with 17+ example environments and supports 2D, 3D, and VR/AR scenes
- Covers single-agent, cooperative, and competitive multi-agent setups out of the box
- Includes both deep RL (PPO, SAC, MA-POCA, self-play) and imitation learning (BC, GAIL)
- Offers curriculum learning and environment randomization for training under varied conditions
- Native cross-platform inference engine and support for concurrent environment instances
- Verified Unity package for Unity 2020.1 and later
Caveats
- Primary documentation has migrated to Unity Package docs; the old web docs are deprecated, so update your bookmarks
- The
developbranch is explicitly flagged as unstable - In-editor analytics are enabled to “improve developer experience,” which may matter if you’re privacy-sensitive
Verdict A strong fit for Unity developers who need trainable NPCs, automated testing, or rapid AI prototyping; pure ML researchers without Unity scenes to spare can likely find lighter-weight alternatives.
Frequently asked
- What is Unity-Technologies/ml-agents?
- Turns Unity games and simulations into environments for training intelligent agents with deep reinforcement and imitation learning.
- Is ml-agents open source?
- Yes — Unity-Technologies/ml-agents is an open-source project tracked on heatdrop.
- What language is ml-agents written in?
- Unity-Technologies/ml-agents is primarily written in C#.
- How popular is ml-agents?
- Unity-Technologies/ml-agents has 19.6k stars on GitHub.
- Where can I find ml-agents?
- Unity-Technologies/ml-agents is on GitHub at https://github.com/Unity-Technologies/ml-agents.