News & features

News & features

News & features


Microsoft TextWorld is an open-source, extensible engine that both generates and simulates text games. You can use it to train reinforcement learning (RL) agents to learn skills such as language understanding and grounding, combined with sequential decision making.

You are navigating through a house. You've just entered a serious study. There is a gross looking mantle in the room. It has nothing on it. You see a closed rusty toolbox. Now why would someone leave that there?
Looks like there is a locked door. Find the key to unlock the door. You should try going east.
TextWorld illustration of a yellow key on a dark blue background

Unlock the door to text-based adventure

Text-based games may seem primitive next to the beautifully rendered graphics of today, but to succeed at even the simplest such game, humans must use a special set of skills. We seamlessly and simultaneously comprehend language descriptions, plan our next moves, visualize the environment, remember important information, and generalize past experiences to new situations. AI agents don’t yet possess such capabilities, but they are the key to general intelligence. We can help an AI agent to learn these skills.

TextWorld blue house with orange front door

Try TextWorld today

The default environment is a house where the RL agent can learn basic domestic skills such as putting objects in containers, opening and closing doors, eating food, and more.

You can integrate your agent in the TextWorld framework, then train your agent to solve a potentially limitless number of multi-step quests in a potentially limitless number of text-based worlds. To learn more and get the code, visit our GitHub page.

Get the code


Send your questions and feedback to textworld@microsoft.com.




  • Portrait of Mahmoud Adada

    Mahmoud Adada

    Principal Engineering Manager

  • Portrait of James Moore

    James Moore

    Software Development Engineer

  • Portrait of David Tao

    David Tao

    RSDE Intern

    McGill University


Let your imagination guide you—extend TextWorld!

Below are some ideas for how you could extend TextWorld:

Extend the action space: Cook a recipe. Bring out your agent’s inner gourmet chef by having it create meals with the action “cook.” Now, you can incorporate in the quests tasks such as cooking a savory omelet, a fancy Italian meal, or a fragrant fried rice dish. Yum.

Create a new skin for the world: A haunted castle. Forget the modern house. Imagine your agent navigating through a magical, haunted castle. Instead of cupboards and coffee, your agent will be interacting with treasure chests and potions. Don’t forget to use your wand to unlock those pesky locked doors.

Design a new quest for the agent. Need a more complex quest? Want to test an agent on specific tasks? Use TextWorld to design your own quest by defining the layout of the world, the quest goal, the tasks, the optimal route, and the rewards. Then share your quest on GitHub and see how others fare!

Get the code

Try it

Try out an example game generated by TextWorld! Type out what you want to do next and see where the game takes you. (Hint: try “go east”)


First TextWorld Problems: A Reinforcement and Language Learning Challenge

The goal of the First TextWorld Problems (FTWP) was to build an AI agent that could play efficiently and win simplified text-based games. This competition highlighted the limitation of existing reinforcement learning models when combined with natural language processing. Head over to CodaLab for further details on the past competition and to our Microsoft Research blog post to learn more about the competition winner’s strategy.

Check back soon for when the training and evaluation games are available for download.