TextWorld is a sandbox learning environment from Microsoft for training and evaluating reinforcement learning agents on text-based games. Open source on GitHub with about 1,450 stars and still updated in 2026, it lets researchers generate interactive fiction games and teach agents to solve them through language alone.
Text adventures are a deceptively hard testbed for AI: the agent only sees text, must build a mental model of the world, remember objects and locations, and plan long action sequences to win. TextWorld turns that into a controllable research platform. It can generate text-based games of varying difficulty โ different world sizes, quest lengths, and vocabulary โ so experiments can scale from simple puzzles to genuinely challenging problems. Agents interact through a clean Python API, and the framework integrates with standard reinforcement learning workflows, making it a common benchmark for work on language grounding, exploration, and decision-making. Because games are generated rather than fixed, researchers can test generalization instead of memorization, and can dial up complexity as agents improve. TextWorld has become a reference environment in the field and underpins a line of research and competitions on interactive fiction agents.
TextWorld is free and open source. There is no paid tier or hosted service โ you install the Python package, generate games locally, and run your experiments on your own hardware or research cluster.
Reinforcement learning and NLP researchers who need a rigorous, language-based environment for agent experiments โ and students learning how agents perceive, remember, and plan in worlds described only by text.