# minghchen/automanual architecture

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

- Interactive diagram: https://gitdiagram.com/minghchen/automanual
- Repository: https://github.com/minghchen/automanual

## Overview

AutoManual uses LLM agents to learn reusable environment rules through task interaction, then formulates those rules into a human-readable manual that can guide later task attempts. The principal workflow is build rules from demonstrations and task outcomes, formulate the manual, and test it across ALFWorld, MiniWoB++, and WebArena. The graph distinguishes each domain’s interaction layer and the rule/skill management layer. Some domain modules are unsampled, so their internal links are omitted where the evidence does not establish them.

Main entry points: [`automanual_alfworld/main_build.py`](https://github.com/minghchen/automanual/blob/main/automanual_alfworld/main_build.py) (Build runner), [`automanual_miniwob/autobuild_case_trail.py`](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_case_trail.py) (Rule builder), [`automanual_miniwob/autobuild_trail.py`](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_trail.py) (LLM planner), [`alfworld/alfworld/gen/planner/ff_planner_handler.py`](https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/planner/ff_planner_handler.py) (Symbolic planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["AutoManual workflow"]
  node_build["Build runner<br/>[main_build.py]"]
  node_formulator["Manual formulation"]
  node_testing["Task testing"]
  node_webarena_build["WebArena builder<br/>[main_build.py]"]
end

subgraph group_learning["Rule learning"]
  node_builder["Rule builder"]
  node_planner["LLM planner<br/>[autobuild_trail.py]"]
  node_rule_skill["Rules and skills<br/>[autobuild_utils.py]"]
  node_prompts["Builder prompts"]
end

subgraph group_domains["Environment adapters"]
  node_alfworld_env["ALFWorld environment"]
  node_alfworld_tasks["Task goals and reward<br/>[tasks.py]"]
  node_miniwob_env["MiniWoB environment"]
  node_miniwob_history["Interaction history<br/>[env_history.py]"]
  node_webarena_env["WebArena browser"]
end

subgraph group_alfworld["ALFWorld planning"]
  node_alfworld_planner["Symbolic planner"]
  node_ff_search["FF search engine<br/>[search.c]"]
  node_game_util["World and plan utilities<br/>[game_util.py]"]
end

node_user(("Task user"))
node_llm["OpenAI API"]

node_user -->|"starts build"| node_build
node_build -->|"runs learning"| node_builder
node_builder -->|"reviews trajectory"| node_planner
node_planner -->|"executes actions"| node_miniwob_history
node_miniwob_history -->|"steps environment"| node_miniwob_env
node_builder -.->|"updates knowledge"| node_rule_skill
node_builder -->|"uses prompts"| node_prompts
node_planner -->|"requests plans"| node_llm
node_builder -.->|"requests rule updates"| node_llm
node_build -->|"initializes environment"| node_alfworld_env
node_alfworld_env -.->|"evaluates task"| node_alfworld_tasks
node_alfworld_tasks -->|"queries objects"| node_game_util
node_alfworld_planner -->|"uses plan utilities"| node_game_util
node_alfworld_planner -.->|"invokes planner"| node_ff_search
node_build -->|"supports domain run"| node_webarena_build
node_webarena_build -->|"runs browser tasks"| node_webarena_env
node_build -->|"formulates rules"| node_formulator
node_formulator -->|"provides manual"| node_testing
node_testing -->|"returns task results"| node_user

click node_build "https://github.com/minghchen/automanual/blob/main/automanual_alfworld/main_build.py"
click node_formulator "https://github.com/minghchen/automanual/tree/main/automanual_alfworld"
click node_testing "https://github.com/minghchen/automanual/tree/main/automanual_alfworld"
click node_builder "https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_case_trail.py"
click node_planner "https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_trail.py"
click node_rule_skill "https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_utils.py"
click node_prompts "https://github.com/minghchen/automanual/blob/main/automanual_miniwob/prompts/builder_case_prompt.py"
click node_alfworld_env "https://github.com/minghchen/automanual/tree/main/alfworld/alfworld/agents/environment"
click node_alfworld_tasks "https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/env/tasks.py"
click node_alfworld_planner "https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/planner/ff_planner_handler.py"
click node_ff_search "https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/ff_planner/search.c"
click node_game_util "https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/utils/game_util.py"
click node_miniwob_env "https://github.com/minghchen/automanual/tree/main/automanual_miniwob/computergym/miniwob"
click node_miniwob_history "https://github.com/minghchen/automanual/blob/main/automanual_miniwob/env_history.py"
click node_webarena_env "https://github.com/minghchen/automanual/tree/main/automanual_webarena"
click node_webarena_build "https://github.com/minghchen/automanual/blob/main/automanual_webarena/main_build.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_build,node_formulator,node_testing,node_webarena_build toneBlue
class node_builder,node_planner,node_rule_skill,node_prompts toneAmber
class node_alfworld_env,node_alfworld_tasks,node_miniwob_env,node_miniwob_history,node_webarena_env,node_llm toneMint
class node_alfworld_planner,node_ff_search,node_game_util,node_user toneRose
```

## Components

### AutoManual workflow

- [Build runner](https://github.com/minghchen/automanual/blob/main/automanual_alfworld/main_build.py): `automanual_alfworld/main_build.py`
- [Manual formulation](https://github.com/minghchen/automanual/tree/main/automanual_alfworld): `automanual_alfworld`
- [Task testing](https://github.com/minghchen/automanual/tree/main/automanual_alfworld): `automanual_alfworld`
- [WebArena builder](https://github.com/minghchen/automanual/blob/main/automanual_webarena/main_build.py): `automanual_webarena/main_build.py`

### Rule learning

- [Rule builder](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_case_trail.py): `automanual_miniwob/autobuild_case_trail.py`
- [LLM planner](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_trail.py): `automanual_miniwob/autobuild_trail.py`
- [Rules and skills](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/autobuild_utils.py): `automanual_miniwob/autobuild_utils.py`
- [Builder prompts](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/prompts/builder_case_prompt.py): `automanual_miniwob/prompts/builder_case_prompt.py`

### Environment adapters

- [ALFWorld environment](https://github.com/minghchen/automanual/tree/main/alfworld/alfworld/agents/environment): `alfworld/alfworld/agents/environment`
- [Task goals and reward](https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/env/tasks.py): `alfworld/alfworld/env/tasks.py`
- [MiniWoB environment](https://github.com/minghchen/automanual/tree/main/automanual_miniwob/computergym/miniwob): `automanual_miniwob/computergym/miniwob`
- [Interaction history](https://github.com/minghchen/automanual/blob/main/automanual_miniwob/env_history.py): `automanual_miniwob/env_history.py`
- [WebArena browser](https://github.com/minghchen/automanual/tree/main/automanual_webarena): `automanual_webarena`

### ALFWorld planning

- [Symbolic planner](https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/planner/ff_planner_handler.py): `alfworld/alfworld/gen/planner/ff_planner_handler.py`
- [FF search engine](https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/ff_planner/search.c): `alfworld/alfworld/gen/ff_planner/search.c`
- [World and plan utilities](https://github.com/minghchen/automanual/blob/main/alfworld/alfworld/gen/utils/game_util.py): `alfworld/alfworld/gen/utils/game_util.py`

### Other components

- **Task user**
- **OpenAI API**

## Connections

- Task user → Build runner: starts build
- Build runner → Rule builder: runs learning (evidence: `automanual_alfworld/main_build.py`)
- Rule builder → LLM planner: reviews trajectory (evidence: `automanual_miniwob/autobuild_case_trail.py`)
- LLM planner → Interaction history: executes actions (evidence: `automanual_miniwob/autobuild_trail.py`)
- Interaction history → MiniWoB environment: steps environment (evidence: `automanual_miniwob/env_history.py`)
- Rule builder → Rules and skills: updates knowledge
- Rule builder → Builder prompts: uses prompts (evidence: `automanual_miniwob/autobuild_case_trail.py`)
- LLM planner → OpenAI API: requests plans (evidence: `automanual_miniwob/autobuild_trail.py`)
- Rule builder → OpenAI API: requests rule updates
- Build runner → ALFWorld environment: initializes environment (evidence: `automanual_alfworld/main_build.py`)
- ALFWorld environment → Task goals and reward: evaluates task
- Task goals and reward → World and plan utilities: queries objects (evidence: `alfworld/alfworld/env/tasks.py`)
- Symbolic planner → World and plan utilities: uses plan utilities (evidence: `alfworld/alfworld/gen/planner/ff_planner_handler.py`)
- Symbolic planner → FF search engine: invokes planner
- Build runner → WebArena builder: supports domain run
- WebArena builder → WebArena browser: runs browser tasks (evidence: `automanual_webarena/main_build.py`)
- Build runner → Manual formulation: formulates rules
- Manual formulation → Task testing: provides manual
- Task testing → Task user: returns task results
