yushu-fdu commited on
Commit
df4b2dc
·
verified ·
1 Parent(s): 8c61239

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +163 -3
README.md CHANGED
@@ -1,3 +1,163 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - embodied-ai
5
+ - agent
6
+ - reinforcement-learning
7
+ - minecraft
8
+ - multimodal
9
+ arxiv: 2410.22194
10
+ ---
11
+
12
+ # ADAM: An Embodied Causal Agent in Open-World Environments
13
+
14
+ <div align="center">
15
+
16
+ [[Website]](https://opencausalab.github.io/ADAM)
17
+ [[Arxiv]](https://arxiv.org/abs/2410.22194)
18
+ [[PDF]](https://arxiv.org/pdf/2410.22194)
19
+ [[GitHub]](https://github.com/OpenCausaLab/ADAM)
20
+
21
+ ______________________________________________________________________
22
+
23
+ </div>
24
+
25
+ We introduce ADAM, An emboDied causal Agent in Minecraft, that can autonomously navigate the open world, perceive multimodal contexts, learn causal world knowledge, and tackle complex tasks through lifelong learning.
26
+ ADAM is empowered by four key components: 1) an interaction module, enabling the agent to execute actions while documenting the interaction processes; 2) a causal model module, tasked with constructing an ever-growing causal graph (i.e., technology tree) from scratch, which enhances interpretability and diminishes reliance on prior knowledge; 3) a controller module, comprising a planner, an actor, and a memory pool, which uses the learned causal graph to accomplish tasks; 4) a perception module, powered by multimodal large language models, which enables ADAM to perceive like a human player. Our project page is at [https://opencausalab.github.io/ADAM](https://opencausalab.github.io/ADAM)
27
+
28
+ ![](images/Overview.png)
29
+
30
+ Extensive experiments show that ADAM accurately constructs an almost perfect causal graph, enabling effective task decomposition and execution with increased efficiency and strong interpretability. Additionally, in modified Minecraft scenarios where no prior knowledge is available, ADAM maintains its performance and shows remarkable robustness and generalization capability.
31
+
32
+ We provide the implementation of ADAM in this repo. We employ [Mineflayer](https://github.com/PrismarineJS/mineflayer),
33
+ a JavaScript-based framework designed for integration with the commercial Minecraft. For visual
34
+ processing, we utilize [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer), an API for visualizing
35
+ Minecraft content. The encapsulation of the Mineflayer uses the implementation
36
+ in [VOYAGER](https://github.com/MineDojo/Voyager).
37
+
38
+ # Installation
39
+
40
+ ADAM requires Python ≥ 3.9 and Node.js ≥ 16.13.0. Our experiment tested the Minecraft environment on the **Windows**
41
+ platform. The Azure Cloud Service is also available in the implementation.
42
+
43
+ ## Python Install
44
+
45
+ ```
46
+ git clone https://github.com/OpenCausaLab/ADAM
47
+ cd ADAM
48
+ pip install -e .
49
+ ```
50
+
51
+ ## Node.js Install
52
+
53
+ In addition to the Python dependencies, you need to install the following Node.js packages:
54
+
55
+ ```
56
+ cd env/mineflayer
57
+ npm install -g npx
58
+ npm install
59
+ cd mineflayer-collectblock
60
+ npx tsc
61
+ cd ..
62
+ npm install
63
+ ```
64
+
65
+ For users from mainland China, we recommend the following installation method:
66
+
67
+ ```
68
+ cd env/mineflayer
69
+ npm config set registry https://registry.npmmirror.com
70
+ npm install -g npx
71
+ npm install
72
+ cd mineflayer-collectblock
73
+ npx tsc
74
+ cd ..
75
+ npm install
76
+ ```
77
+
78
+ ## Minecraft Instance and Fabric Mods Install
79
+
80
+ The tutorial is from [VOYAGER](https://github.com/MineDojo/Voyager).
81
+
82
+ ### Minecraft Instance Install
83
+
84
+ Follow the instructions in [Minecraft Login Tutorial](installation/minecraft_instance_install.md) to set up your
85
+ Minecraft Instance.
86
+
87
+ ### Fabric Mods Install
88
+
89
+ Follow the instructions in [Fabric Mods Install](installation/fabric_mods_install.md) to install the mods.
90
+
91
+ # Getting Started
92
+
93
+ You can run ADAM by:
94
+
95
+ ```python
96
+ from Adam.ADAM import ADAM
97
+
98
+ with open("API_key.txt", 'r') as key_file:
99
+ openai_api_key = key_file.read()
100
+
101
+ ADAM = ADAM(
102
+ mc_port=52832,
103
+ llm_model_type='gpt-4-turbo',
104
+ use_local_llm_service=False,
105
+ openai_api_key=openai_api_key,
106
+ parallel=True
107
+ )
108
+
109
+ ADAM.explore(['diamond'], [])
110
+ ```
111
+
112
+ # Resume from a checkpoint
113
+
114
+ Our implementation has methods for automatic saving and automatic loading of checkpoints. If you want to continue from a
115
+ checkpoint, you can use the following code.
116
+
117
+ ```python
118
+ from Adam.ADAM import ADAM
119
+
120
+ with open("API_key.txt", 'r') as key_file:
121
+ openai_api_key = key_file.read()
122
+
123
+ ADAM = ADAM(
124
+ mc_port=52832,
125
+ llm_model_type='gpt-4-turbo',
126
+ use_local_llm_service=False,
127
+ openai_api_key=openai_api_key,
128
+ auto_load_ckpt=True,
129
+ parallel=True
130
+ )
131
+
132
+ ADAM.explore(['diamond'], [])
133
+ ```
134
+
135
+ If you want to continue from a specific checkpoint, you can use the following code.
136
+ ```python
137
+ from Adam.ADAM import ADAM
138
+
139
+ with open("API_key.txt", 'r') as key_file:
140
+ openai_api_key = key_file.read()
141
+
142
+ ADAM = ADAM(
143
+ mc_port=52832,
144
+ llm_model_type='gpt-4-turbo',
145
+ use_local_llm_service=False,
146
+ openai_api_key=openai_api_key,
147
+ load_ckpt_path='your_ckpt_path',
148
+ parallel=True
149
+ )
150
+
151
+ ADAM.explore(['diamond'], [])
152
+ ```
153
+
154
+ # Paper and Citation
155
+
156
+ ```bibtex
157
+ @article{yu2024adam,
158
+ title = {ADAM: An Embodied Causal Agent in Open-World Environments},
159
+ author = {Shu Yu and Chaochao Lu},
160
+ year = {2024},
161
+ journal = {arXiv preprint arXiv:2410.22194}
162
+ }
163
+ ```