Skip to content

Official implementation for "WebDART: Dynamic Decomposition and Re-planning for Complex Web Tasks"

Notifications You must be signed in to change notification settings

UCSB-NLP-Chang/WebDART

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

WebDART: Dynamic Decomposition and Re-planning for Complex Web Tasks

This is the official implementation of the paper "WebDART: Dynamic Decomposition and Re-planning for Complex Web Tasks."

Table of Contents


Overview

WebDART.svg

Overview of the WebDART framework. A complex web task is dynamically decomposed into three sequential subtasks. (1) Navigation: the agent explores the site—issuing actions such as click, type, and go_back—to gather every page that could contain the required information. (2) Information extraction: given these pages, a dedicated module isolates task-relevant content and converts it into a standardised, structured form based on the objective. (3) Execution: the extracted data are analysed to meet the task constraints, e.g., by generating and running Python code on the fly to perform filtering, aggregation, or other computations.


Environment Setup

Web Environment

The web environment set up is same as WebArena.

Shopping Website (OneStopShop)

Download the image tar from the following mirrors:

docker load --input shopping_final_0712.tar
docker run --name shopping -p 7770:80 -d shopping_final_0712
# wait ~1 min to wait all services to start

docker exec shopping /var/www/magento2/bin/magento setup:store-config:set --base-url="http://<your-server-hostname>:7770" # no trailing slash
docker exec shopping mysql -u magentouser -pMyPassword magentodb -e  'UPDATE core_config_data SET value="http://<your-server-hostname>:7770/" WHERE path = "web/secure/base_url";'
docker exec shopping /var/www/magento2/bin/magento cache:flush

Now you can visit http://<your-server-hostname>:7770.

E-commerce Content Management System (CMS)

Download the image tar from the following mirrors:

docker load --input shopping_admin_final_0719.tar
docker run --name shopping_admin -p 7780:80 -d shopping_admin_final_0719
# wait ~1 min to wait all services to start

docker exec shopping_admin /var/www/magento2/bin/magento setup:store-config:set --base-url="http://<your-server-hostname>:7780" # no trailing slash
docker exec shopping_admin mysql -u magentouser -pMyPassword magentodb -e  'UPDATE core_config_data SET value="http://<your-server-hostname>:7780/" WHERE path = "web/secure/base_url";'
docker exec shopping_admin /var/www/magento2/bin/magento cache:flush

Now you can visit http://<your-server-hostname>:7780/admin.

Social Forum Website (Reddit)

Download the image tar from the following mirrors:

docker load --input postmill-populated-exposed-withimg.tar
docker run --name forum -p 9999:80 -d postmill-populated-exposed-withimg

Now you can visit http://<your-server-hostname>:9999/.

Gitlab Website

Download the image tar from the following mirrors:

docker load --input gitlab-populated-final-port8023.tar
docker run --name gitlab -d -p 8023:8023 gitlab-populated-final-port8023 /opt/gitlab/embedded/bin/runsvdir-start

# wait at least 5 mins for services to boot
docker exec gitlab sed -i "s|^external_url.*|external_url 'http://<your-server-hostname>:8023'|" /etc/gitlab/gitlab.rb
docker exec gitlab gitlab-ctl reconfigure

It might take 5 mins to start and then you can visit http://<your-server-hostname>:8023/explore.

Dependencies

cd WebDART
git clone https://github.com/web-arena-x/webarena.git
cd webarena
conda create -n webdart python=3.10; conda activate webdart
pip install -r requirements.txt
pip install --upgrade transformers
pip install --upgrade openai
pip install numpy==1.26.4
playwright install
cd ~/AgentOccam
pip install -r requirements.txt
mkdir .auth

URLs and Tasks

You need to replace <your_base_url> in files with your actual URL. To achieve this, run the following command:

python utils/replace_script.py --your_url "your url (e.g., ec2..)"

Run the following command to create the task JSON file specific to your URL.

source scripts/env_setup.sh
cd config_files
python generate_test_data_new_shopping_admin.py
python generate_test_data_new_shopping.py
python generate_test_data_new_reddit.py
python generate_test_data_new_gitlab.py
cd ../

Evaluation

Run the decomposition and navigation.

python decomp_navi.py --config_file AgentOccam/configs/navigation.yml

Extract the needed information and execute it based on navigation trajectory. Modify the result directory accordingly before running the script.

python ie_exec.py

Acknowledgement

Some of our implementations are based on WebArena, WebChoreArena, and AgentOccam. We Appreciate their great work.

About

Official implementation for "WebDART: Dynamic Decomposition and Re-planning for Complex Web Tasks"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published