TF-Agents is Google’s TensorFlow library for contextual bandits and reinforcement learning: a reliable, scalable and well-tested toolkit for training RL agents. Released under the Apache-2.0 license, it has about 3,030 stars on GitHub and continues to receive updates in 2026. It is the reference RL companion to TensorFlow, designed so researchers can compose agents, environments, policies, replay buffers and metrics like building blocks.
The library implements a wide range of algorithms, including DQN and its variants, DDPG, TD3, SAC, PPO and REINFORCE, plus a dedicated bandits suite for contextual bandit problems with linear and neural policies. Standardised components handle the messy parts of RL engineering: trajectory collection with drivers, replay buffers, checkpoints, evaluation metrics and distribution across machines with tf.distribute strategies and TF2 eager execution. Extensive tutorials cover everything from a first DQN on CartPole to multi-agent and bandit scenarios.
TF-Agents also ships environment suites and wrappers for common benchmarks, including OpenAI Gym and DeepMind Control Suite tasks, along with batched environments for faster data collection. Its bandits sub-package deserves special mention: contextual bandits sit behind many production recommendation and personalisation systems, and TF-Agents provides tested agents, policies and evaluation metrics for them within the same framework. Because every component follows common interfaces, swapping an algorithm or moving from a simulated environment to a custom one usually means changing configuration rather than rewriting training code.
TF-Agents is free and open source under the Apache-2.0 license. There are no paid tiers; training compute is your own.
Reinforcement learning researchers and engineers building agents for control, recommendation, robotics simulation or bandit-based decision systems on the TensorFlow stack.