TF-Agents

TF-Agents

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

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.

Overview

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.

Key Features

  • Implementations of DQN, DDPG, TD3, SAC, PPO, REINFORCE and more
  • Dedicated contextual bandits module with linear and neural policies
  • Composable environments, policies, drivers, replay buffers and metrics
  • Scalable training with TensorFlow distribution strategies
  • TF2-native, eager-execution friendly design
  • Comprehensive tutorials and tested, production-grade code from Google

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.

๐Ÿ’ณ Pricing

TF-Agents is free and open source under the Apache-2.0 license. There are no paid tiers; training compute is your own.

Who Is It For

Reinforcement learning researchers and engineers building agents for control, recommendation, robotics simulation or bandit-based decision systems on the TensorFlow stack.

๐Ÿš€ Visit TF-Agents Official Site

๐Ÿšฉ Report an issue