{"id":17526896,"url":"https://github.com/kohjingyu/search-agents","last_synced_at":"2026-02-02T13:55:57.151Z","repository":{"id":245204230,"uuid":"816641710","full_name":"kohjingyu/search-agents","owner":"kohjingyu","description":"Code for the paper 🌳 Tree Search for Language Model Agents","archived":false,"fork":false,"pushed_at":"2024-07-25T01:54:49.000Z","size":32433,"stargazers_count":106,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-07-25T03:14:44.209Z","etag":null,"topics":["agents","llms","machine-learning"],"latest_commit_sha":null,"homepage":"https://jykoh.com/search-agents","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kohjingyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-18T06:20:53.000Z","updated_at":"2024-07-25T03:14:46.702Z","dependencies_parsed_at":"2024-07-25T03:24:56.432Z","dependency_job_id":null,"html_url":"https://github.com/kohjingyu/search-agents","commit_stats":null,"previous_names":["kohjingyu/search-agents"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohjingyu%2Fsearch-agents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohjingyu%2Fsearch-agents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohjingyu%2Fsearch-agents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohjingyu%2Fsearch-agents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kohjingyu","download_url":"https://codeload.github.com/kohjingyu/search-agents/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242161475,"owners_count":20081880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","llms","machine-learning"],"created_at":"2024-10-20T15:02:36.149Z","updated_at":"2026-02-02T13:55:57.142Z","avatar_url":"https://github.com/kohjingyu.png","language":"Python","funding_links":[],"categories":["Python","Papers","4. Web Browsing Agents"],"sub_categories":["Models","4.3 Tree Search + Web Agents"],"readme":"# Tree Search for Language Model Agents\n\n[\u003ca href=\"https://jykoh.com/search-agents\"\u003eWebsite\u003c/a\u003e] \n[\u003ca href=\"http://arxiv.org/abs/2407.01476\"\u003ePaper\u003c/a\u003e] \n\n![Overview](media/search_overview.gif)\n\nWe propose an inference-time tree search algorithm to enable language model agents to perform exploration and multi-step planning in interactive web environments. This repository demonstrates how to run our method on the [VisualWebArena](https://jykoh.com/vwa) and [WebArena](https://webarena.dev/) benchmarks.\n\n## TODOs\n- [ ] Add other options besides gpt-4o for the value function\n\n## News\n- [07/24/2024]: Released [trajectories](#agent-trajectories) of the gpt-4o agent.\n- [06/19/2024]: GitHub repo released.\n\n## Install\n```bash\n# Python 3.10 or 3.11 recommended\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\nplaywright install\npip install -e .\n```\n\n## End-to-end Evaluation on (V)WA\n1. Setup the standalone environments.\nPlease check out [this page](environment_docker/README.md) for details.\n\n2. Configurate the urls for each website.\nFirst, export the `DATASET` to be `visualwebarena`:\n```bash\nexport DATASET=visualwebarena\n```\nThen, set the URL for the websites\n\n```bash\nexport CLASSIFIEDS=\"\u003cyour_classifieds_domain\u003e:9980\"\nexport CLASSIFIEDS_RESET_TOKEN=\"4b61655535e7ed388f0d40a93600254c\"  # Default reset token for classifieds site, change if you edited its docker-compose.yml\nexport SHOPPING=\"\u003cyour_shopping_site_domain\u003e:7770\"\nexport REDDIT=\"\u003cyour_reddit_domain\u003e:9999\"\nexport WIKIPEDIA=\"\u003cyour_wikipedia_domain\u003e:8888\"\nexport HOMEPAGE=\"\u003cyour_homepage_domain\u003e:4399\"\n```\n\nIf you want to run on the WebArena tasks instead, make sure to also set up the [CMS](https://github.com/web-arena-x/webarena/blob/main/environment_docker/README.md#e-commerce-content-management-system-cms), [GitLab](https://github.com/web-arena-x/webarena/blob/main/environment_docker/README.md#gitlab-website), and [map](https://github.com/web-arena-x/webarena/blob/main/environment_docker/README.md#map) environments, and then set their respective environment variables:\n```bash\nexport DATASET=webarena\nexport SHOPPING_ADMIN=\"\u003cyour_e_commerce_cms_domain\u003e:7780/admin\"\nexport GITLAB=\"\u003cyour_gitlab_domain\u003e:8023\"\nexport MAP=\"\u003cyour_map_domain\u003e:3000\"\n```\n\n3. Generate config files for each test example:\n```bash\npython scripts/generate_test_data.py\n```\nYou will see `*.json` files generated in the [config_files](./config_files) folder. Each file contains the configuration for one test example.\n\n4. Obtain and save the auto-login cookies for all websites:\n```\nbash prepare.sh\n```\n\n5. Set up API keys.\n\nIf using OpenAI models, set a valid OpenAI API key (starting with `sk-`) as the environment variable:\n```\nexport OPENAI_API_KEY=your_key\n```\n\n6. Launch the evaluation. For example, to reproduce our GPT-4o + Search agent, you can run the script provided:\n\n```bash\nbash scripts/run_vwa_shopping_search.sh\n```\n\nThis script will run the search agent with the default hyperparams from our paper on the full set of VWA shopping tasks. Note that the baselines that include a captioning model run on GPU by default (e.g., BLIP-2-T5XL as the captioning model will take up approximately 12GB of GPU VRAM). Similarly, the other bash scripts in `scripts/` reproduce the results on the other VWA sites and the text-only WA environment.\n\nBy default, the scripts run experiments with the agents with search. If you wish to reproduce the baseline results (without search), set  `--agent_type  prompt` when executing `run.py`.\n\n### Running Llama-3 models\n\nIf you wish to run the Llama-3 models we have in our paper, first set up a [vLLM OpenAI compatible server](https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html). Then, update the `OPENAI_BASE_URL` environment variable in `scripts/run_llama_vwa_shopping_search.sh` to reflect the URL that the vLLM server is running on. This particular script shows how to run the Llama-3 agent on the VWA shopping environment; it is otherwise very similar to the OpenAI scripts for running on the other environments.\n\n\n## Agent Trajectories\n\nWe release the agent trajectories and results of the gpt-4o agent (with gpt-4o as the reward function) [here](https://drive.google.com/file/d/127GqJ19qxpAcWlUKXlr5zBeAIW5Pi_0H/view). They are saved in the same format specified in [run.py](run.py).\n\n## Citation\nIf you methods or code useful, please consider citing our paper:\n```\n@article{koh2024tree,\n  title={Tree Search for Language Model Agents},\n  author={Koh, Jing Yu and McAleer, Stephen and Fried, Daniel and Salakhutdinov, Ruslan},\n  journal={arXiv preprint arXiv:2407.01476},\n  year={2024}\n}\n```\n\n## Acknowledgements\n\nOur code is heavily based off the \u003ca href=\"https://github.com/web-arena-x/visualwebarena\" target=\"_blank\"\u003eVisualWebArena codebase\u003c/a\u003e and the \u003ca href=\"https://github.com/web-arena-x/webarena\" target=\"_blank\"\u003eWebArena codebase\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkohjingyu%2Fsearch-agents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkohjingyu%2Fsearch-agents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkohjingyu%2Fsearch-agents/lists"}