Wanderer: An Open-Ended Embodied Agent with Large Language Models
Wanderer is an LLM-powered embodied lifelong learning agent for Minecraft that continuously explores the world, acquires diverse skills, and makes novel discoveries without human intervention. It is a re-imagined, rebranded distribution of the Voyager research project, packaged as a pip-installable Python package.
Wanderer consists of three key components:
- Automatic Curriculum – a curriculum agent that maximizes exploration and proposes the next task to learn.
- Ever-Growing Skill Library – an executable-code skill library that stores and retrieves complex behaviors.
- Iterative Prompting Mechanism – a self-verifying loop that incorporates environment feedback, execution errors, and critique to iteratively improve generated programs.
Wanderer interacts with LLMs (e.g., GPT-4) via blackbox API queries, bypassing the need for model parameter fine-tuning. The skills it develops are temporally extended, interpretable, and compositional — compounding the agent's abilities rapidly while alleviating catastrophic forgetting.
Highlights
- Open-ended, lifelong learning agent for Minecraft (Java 1.19)
- Automatic curriculum + skill library + iterative self-verification
- Minimal, hackable Python API (
Wandererclass) - MIT licensed, research-ready codebase
Installation
Wanderer requires Python ≥ 3.9 and Node.js ≥ 16.13.0. Tested on Ubuntu 20.04, Windows 11, and macOS.
From PyPI (recommended)
pip install wanderer-kada
Note: the package is published as
wanderer-kadaon PyPI, but you import it aswanderer.
From source
git clone https://github.com/orewamash/Wanderer
cd Wanderer
pip install -e .
Node.js Install
In addition to the Python dependencies, you need to install the following Node.js packages:
cd wanderer/env/mineflayer
npm install -g npx
npm install
cd mineflayer-collectblock
npx tsc
cd ..
npm install
Minecraft Instance Install
Wanderer depends on the Minecraft game. You need to install Minecraft and set up a Minecraft instance.
Follow the instructions in Minecraft Login Tutorial to set up your Minecraft Instance.
Fabric Mods Install
You need to install fabric mods to support all the features in Wanderer. Remember to use the correct Fabric version of all the mods.
Follow the instructions in Fabric Mods Install to install the mods.
Getting Started
Wanderer uses an LLM (e.g., OpenAI's GPT-4) as the language model. You need to have an OpenAI API key to use Wanderer. You can get one from here.
After the installation process, you can run Wanderer by:
from wanderer import Wanderer
# You can also use mc_port instead of azure_login, but azure_login is highly recommended
azure_login = {
"client_id": "YOUR_CLIENT_ID",
"redirect_url": "https://127.0.0.1/auth-response",
"secret_value": "[OPTIONAL] YOUR_SECRET_VALUE",
"version": "fabric-loader-0.14.18-1.19", # the version Wanderer is tested on
}
openai_api_key = "YOUR_API_KEY"
wanderer = Wanderer(
azure_login=azure_login,
openai_api_key=openai_api_key,
)
# start lifelong learning
wanderer.learn()
- If you are running with
Azure Loginfor the first time, it will ask you to follow the command line instruction to generate a config file. - For
Azure Login, you also need to select the world and open the world to LAN by yourself. After you runwanderer.learn()the game will pop up soon, you need to:- Select
Singleplayerand pressCreate New World. - Set Game Mode to
Creativeand Difficulty toPeaceful. - After the world is created, press
Esckey and pressOpen to LAN. - Select
Allow cheats: ONand pressStart LAN World. You will see the bot join the world soon.
- Select
Resume from a checkpoint during learning
If you stop the learning process and want to resume from a checkpoint later, you can instantiate Wanderer by:
from wanderer import Wanderer
wanderer = Wanderer(
azure_login=azure_login,
openai_api_key=openai_api_key,
ckpt_dir="YOUR_CKPT_DIR",
resume=True,
)
Run Wanderer for a specific task with a learned skill library
If you want to run Wanderer for a specific task with a learned skill library, you should first pass the skill library directory to Wanderer:
from wanderer import Wanderer
# First instantiate Wanderer with skill_library_dir.
wanderer = Wanderer(
azure_login=azure_login,
openai_api_key=openai_api_key,
skill_library_dir="./skill_library/trial1", # Load a learned skill library.
ckpt_dir="YOUR_CKPT_DIR", # Feel free to use a new dir. Do not use the same dir as skill library because new events will still be recorded to ckpt_dir.
resume=False, # Do not resume from a skill library because this is not learning.
)
Then, you can run task decomposition. Notice: Occasionally, the task decomposition may not be logical. If you notice the printed sub-goals are flawed, you can rerun the decomposition.
# Run task decomposition
task = "YOUR TASK" # e.g. "Craft a diamond pickaxe"
sub_goals = wanderer.decompose_task(task=task)
Finally, you can run the sub-goals with the learned skill library:
wanderer.inference(sub_goals=sub_goals)
For all valid skill libraries, see Learned Skill Libraries.
FAQ
If you have any questions, please check our FAQ first before opening an issue.
Credits
Wanderer is a rebranded, packaging-focused distribution of Voyager: An Open-Ended Embodied Agent with Large Language Models by Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar (NVIDIA / Stanford / UT Austin).
If you find this work useful, please consider citing the original paper:
@article{wang2023voyager,
title = {Voyager: An Open-Ended Embodied Agent with Large Language Models},
author = {Guanzhi Wang and Yuqi Xie and Yunfan Jiang and Ajay Mandlekar and Chaowei Xiao and Yuke Zhu and Linxi Fan and Anima Anandkumar},
year = {2023},
journal = {arXiv preprint arXiv: Arxiv-2305.16291}
}
Disclaimer: This project is for research and educational purposes, and is not an official product from NVIDIA.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wanderer_kada-0.1.0.tar.gz.
File metadata
- Download URL: wanderer_kada-0.1.0.tar.gz
- Upload date:
- Size: 73.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd39dce486c0a4ed0c25d7f328c75356ee642086a9fb9224881ee2baa7e92886
|
|
| MD5 |
47380a734be6bc0720893354e26c8803
|
|
| BLAKE2b-256 |
2635dd84be447e9158b82766e217ac3071549ef2dd44197f748091f24e192ca1
|
File details
Details for the file wanderer_kada-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wanderer_kada-0.1.0-py3-none-any.whl
- Upload date:
- Size: 93.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
086d466c405a2c6730e73aefb06516c81b06dc79c6ba668e1ee07058fe333b8c
|
|
| MD5 |
049e265a666fa360dd4039e4d0c702d5
|
|
| BLAKE2b-256 |
a38ac24adb9c8c6d782c80e129b4a10acc75b9a6c43e9199fcb4615fa61d3c6b
|