# thudm/autowebglm architecture

> Architecture diagram of the GitHub repository thudm/autowebglm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thudm/autowebglm
- Repository: https://github.com/thudm/autowebglm

## Overview

AutoWebGLM is a language-model-driven web-navigation system evaluated through WebArena and MiniWob++. The WebArena workflow runs benchmark tasks, builds an agent prompt from browser state, generates and parses an action, applies it in the browser, and evaluates the resulting trajectory. MiniWob++ has a parallel task loop with HTML simplification and action generation. The README also describes HTML simplification, hybrid human-AI training, reinforcement learning/rejection sampling, and a bilingual benchmark; the supplied tree does not expose training pipelines, so those are not drawn as implemented runtime components. Edges reflect shown imports, calls, or README claims; unsampled environment internals are not inferred.

Main entry points: [`webarena/run.py`](https://github.com/thudm/autowebglm/blob/main/webarena/run.py) (WebArena runner), [`webarena/agent/prompts/prompt_constructor.py`](https://github.com/thudm/autowebglm/blob/main/webarena/agent/prompts/prompt_constructor.py) (Prompt construction), [`miniwob++/main.py`](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/main.py) (MiniWob task runner), [`webarena/agent/agent.py`](https://github.com/thudm/autowebglm/blob/main/webarena/agent/agent.py) (Action agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runner["Task execution"]
  node_webarena_run["WebArena runner<br/>[run.py]"]
  node_mini_main["MiniWob task runner<br/>[main.py]"]
  node_evaluation["Task evaluation<br/>[evaluators.py]"]
  node_eval_helpers["Evaluation helpers"]
end

subgraph group_agent["Agent reasoning"]
  node_agent["Action agent<br/>[agent.py]"]
  node_prompt["Prompt construction"]
end

subgraph group_browser["Browser interaction"]
  node_browser_env["Browser environment<br/>[envs.py]"]
  node_action_ops["Browser actions<br/>[actions.py]"]
  node_observation_processing["Observation processing<br/>[processors.py]"]
  node_browser_html["Browser HTML simplification<br/>[html_parser.py]"]
end

subgraph group_models["Model interface"]
  node_lm_config["Model configuration<br/>[lm_config.py]"]
  node_tokenizer["Tokenization<br/>[tokenizers.py]"]
  node_openai_provider["OpenAI provider<br/>[openai_utils.py]"]
end

subgraph group_miniwob["MiniWob++"]
  node_html_simplifier["HTML simplification<br/>[html_parser.py]"]
  node_element_ids["Element identification<br/>[identifier.py]"]
  node_html_prompts["HTML prompt formatting<br/>[prompt.py]"]
  node_mini_actions["MiniWob actions<br/>[action.py]"]
end

node_user(("Benchmark operator"))
node_websites(("Benchmark websites"))
node_language_model(("Language model"))
node_mini_benchmark(("MiniWob++ tasks"))

node_user -->|"starts tasks"| node_webarena_run
node_webarena_run -->|"requests actions"| node_agent
node_webarena_run -->|"sets up environment"| node_browser_env
node_webarena_run -->|"uses evaluation"| node_evaluation
node_webarena_run -.->|"runs against"| node_websites
node_agent -->|"constructs prompt"| node_prompt
node_agent -->|"parses action"| node_action_ops
node_prompt -->|"uses configuration"| node_lm_config
node_prompt -->|"uses tokenizer"| node_tokenizer
node_prompt -->|"uses browser utilities"| node_browser_html
node_browser_env -->|"exposes actions"| node_action_ops
node_browser_env -->|"exposes processing"| node_observation_processing
node_evaluation -->|"uses helpers"| node_eval_helpers
node_lm_config -.->|"selects provider"| node_openai_provider
node_language_model -.->|"generates responses"| node_agent
node_user -->|"starts tasks"| node_mini_main
node_mini_benchmark -.->|"supplies tasks"| node_mini_main
node_mini_main -->|"simplifies HTML"| node_html_simplifier
node_mini_main -->|"uses action tools"| node_mini_actions
node_html_simplifier -->|"uses identifiers"| node_element_ids
node_html_simplifier -->|"formats subtrees"| node_html_prompts
node_evaluation -->|"reads browser state"| node_browser_env
node_webarena_run -.->|"requests generation"| node_language_model

click node_webarena_run "https://github.com/thudm/autowebglm/blob/main/webarena/run.py"
click node_mini_main "https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/main.py"
click node_agent "https://github.com/thudm/autowebglm/blob/main/webarena/agent/agent.py"
click node_prompt "https://github.com/thudm/autowebglm/blob/main/webarena/agent/prompts/prompt_constructor.py"
click node_html_simplifier "https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/html_parser.py"
click node_element_ids "https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/identifier.py"
click node_html_prompts "https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/prompt.py"
click node_mini_actions "https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/miniwob_tools/action.py"
click node_browser_env "https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/envs.py"
click node_action_ops "https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/actions.py"
click node_observation_processing "https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/processors.py"
click node_browser_html "https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/html_tools/html_parser.py"
click node_evaluation "https://github.com/thudm/autowebglm/blob/main/webarena/evaluation_harness/evaluators.py"
click node_eval_helpers "https://github.com/thudm/autowebglm/blob/main/webarena/evaluation_harness/helper_functions.py"
click node_lm_config "https://github.com/thudm/autowebglm/blob/main/webarena/llms/lm_config.py"
click node_tokenizer "https://github.com/thudm/autowebglm/blob/main/webarena/llms/tokenizers.py"
click node_openai_provider "https://github.com/thudm/autowebglm/blob/main/webarena/llms/providers/openai_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webarena_run,node_mini_main,node_evaluation,node_eval_helpers toneBlue
class node_agent,node_prompt toneAmber
class node_browser_env,node_action_ops,node_observation_processing,node_browser_html toneMint
class node_lm_config,node_tokenizer,node_openai_provider,node_mini_benchmark toneRose
class node_html_simplifier,node_element_ids,node_html_prompts,node_mini_actions,node_user,node_websites,node_language_model toneIndigo
```

## Components

### Task execution

- [WebArena runner](https://github.com/thudm/autowebglm/blob/main/webarena/run.py): `webarena/run.py`
- [MiniWob task runner](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/main.py): `miniwob++/main.py`
- [Task evaluation](https://github.com/thudm/autowebglm/blob/main/webarena/evaluation_harness/evaluators.py): `webarena/evaluation_harness/evaluators.py`
- [Evaluation helpers](https://github.com/thudm/autowebglm/blob/main/webarena/evaluation_harness/helper_functions.py): `webarena/evaluation_harness/helper_functions.py`

### Agent reasoning

- [Action agent](https://github.com/thudm/autowebglm/blob/main/webarena/agent/agent.py): `webarena/agent/agent.py`
- [Prompt construction](https://github.com/thudm/autowebglm/blob/main/webarena/agent/prompts/prompt_constructor.py): `webarena/agent/prompts/prompt_constructor.py`

### Browser interaction

- [Browser environment](https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/envs.py): `webarena/browser_env/envs.py`
- [Browser actions](https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/actions.py): `webarena/browser_env/actions.py`
- [Observation processing](https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/processors.py): `webarena/browser_env/processors.py`
- [Browser HTML simplification](https://github.com/thudm/autowebglm/blob/main/webarena/browser_env/html_tools/html_parser.py): `webarena/browser_env/html_tools/html_parser.py`

### Model interface

- [Model configuration](https://github.com/thudm/autowebglm/blob/main/webarena/llms/lm_config.py): `webarena/llms/lm_config.py`
- [Tokenization](https://github.com/thudm/autowebglm/blob/main/webarena/llms/tokenizers.py): `webarena/llms/tokenizers.py`
- [OpenAI provider](https://github.com/thudm/autowebglm/blob/main/webarena/llms/providers/openai_utils.py): `webarena/llms/providers/openai_utils.py`

### MiniWob++

- [HTML simplification](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/html_parser.py): `miniwob++/html_tools/html_parser.py`
- [Element identification](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/identifier.py): `miniwob++/html_tools/identifier.py`
- [HTML prompt formatting](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/html_tools/prompt.py): `miniwob++/html_tools/prompt.py`
- [MiniWob actions](https://github.com/thudm/autowebglm/blob/main/miniwob%2B%2B/miniwob_tools/action.py): `miniwob++/miniwob_tools/action.py`

### Other components

- **Benchmark operator**
- **Benchmark websites**
- **Language model**
- **MiniWob++ tasks**

## Connections

- Benchmark operator → WebArena runner: starts tasks (evidence: `README.md`)
- WebArena runner → Action agent: requests actions (evidence: `webarena/run.py`)
- WebArena runner → Browser environment: sets up environment (evidence: `webarena/run.py`)
- WebArena runner → Task evaluation: uses evaluation (evidence: `webarena/run.py`)
- WebArena runner → Benchmark websites: runs against
- Action agent → Prompt construction: constructs prompt (evidence: `webarena/agent/agent.py`)
- Action agent → Browser actions: parses action (evidence: `webarena/agent/agent.py`)
- Prompt construction → Model configuration: uses configuration (evidence: `webarena/agent/prompts/prompt_constructor.py`)
- Prompt construction → Tokenization: uses tokenizer (evidence: `webarena/agent/prompts/prompt_constructor.py`)
- Prompt construction → Browser HTML simplification: uses browser utilities (evidence: `webarena/agent/prompts/prompt_constructor.py`)
- Browser environment → Browser actions: exposes actions (evidence: `webarena/browser_env/__init__.py`)
- Browser environment → Observation processing: exposes processing (evidence: `webarena/browser_env/__init__.py`)
- Task evaluation → Evaluation helpers: uses helpers (evidence: `webarena/evaluation_harness/evaluators.py`)
- Model configuration → OpenAI provider: selects provider
- Language model → Action agent: generates responses
- Benchmark operator → MiniWob task runner: starts tasks (evidence: `README.md`)
- MiniWob++ tasks → MiniWob task runner: supplies tasks
- MiniWob task runner → HTML simplification: simplifies HTML (evidence: `miniwob++/main.py`)
- MiniWob task runner → MiniWob actions: uses action tools (evidence: `miniwob++/main.py`)
- HTML simplification → Element identification: uses identifiers (evidence: `miniwob++/html_tools/html_parser.py`)
- HTML simplification → HTML prompt formatting: formats subtrees (evidence: `miniwob++/html_tools/html_parser.py`)
- Task evaluation → Browser environment: reads browser state (evidence: `webarena/evaluation_harness/evaluators.py`)
- WebArena runner → Language model: requests generation
