A Windows GUI automation agent powered by Vision Language Models (VLM). It understands the current screen, plans actions, executes GUI operations, and reviews progress to complete tasks.
- Added a workflow-style graph (
GRAPH_STYLE=workflow) withscreen → plan → action → executeloop. - Added Qwen3-VL backend and aliases for backend selection.
- Added screen understanding outputs (
screen_desc,task_evidence) and plan-time completion checks. - Improved action reliability with double-click heuristics and app launch shortcuts.
- Added expected outcome prediction to help review step success.
- Two execution graphs
- Default:
plan → act → reviewmulti-step pipeline. - Workflow:
screen → plan → actionsingle-goal loop with task evidence tracking.
- Default:
- Vision-based planning: VLM generates steps or a single goal based on the current screenshot.
- Action execution: Click, type, hotkeys, drag, scroll, wait (via
pyautogui). - Review & refinement: Step verification, retries, and goal revisions.
- Safety:
pyautogui.FAILSAFEenabled (move mouse to top-left to abort).
- Python 3.8+
- Windows OS (GUI automation and
PIL.ImageGrab) - CUDA-capable GPU recommended for VLM inference
pip install -r requirements.txtEnvironment variables:
MODEL_BACKEND: VLM backend (qwen3vldefault,qwen25vlsupported)MODEL_PATH: Model path or HuggingFace model IDMODEL_QUANT: Quantization mode (4/4bit,8/8bit, or empty to disable)GRAPH_STYLE:default(plan/act/review) orworkflow(screen/plan/action)TMP_DIR: Temporary screenshot directory (default:./_tmp_gui_agent)MAX_ITERS: Maximum loop iterations (default:80)MAX_STEP_FAILS: Maximum step failures before stopping (default:5)VERBOSE: Verbose logging (default:1)ALLOW_TRUNCATED: Allow truncated images (default:0)SCREENSHOT_RETRIES: Screenshot capture retries (default:6)
Run the agent:
python run_gui_agent.pyExample task prompts:
Open PowerPointSearch the today weatherOpen Google Chrome
# Windows PowerShell
$env:GRAPH_STYLE="workflow"
python run_gui_agent.py
# Windows CMD
set GRAPH_STYLE=workflow
python run_gui_agent.py# Windows PowerShell
$env:MODEL_BACKEND="qwen3vl"
$env:MODEL_PATH="Qwen/Qwen3-VL-8B-Instruct"
python run_gui_agent.py
# Windows CMD
set MODEL_BACKEND=qwen3vl
set MODEL_PATH=Qwen/Qwen3-VL-8B-Instruct
python run_gui_agent.py# 4-bit (NF4)
$env:MODEL_QUANT="4bit"
python run_gui_agent.py
# 8-bit
$env:MODEL_QUANT="8bit"
python run_gui_agent.py
# Disable quantization
Remove-Item Env:MODEL_QUANT -ErrorAction SilentlyContinue
python run_gui_agent.pyNote: 4-bit/8-bit quantization requires bitsandbytes and a compatible transformers build.
- Plan: Generate multi-step goals from the current screenshot.
- Act: Produce a GUI action for the current step.
- Execute: Perform the action and capture a new screenshot.
- Review: Verify progress, revise goals, or retry actions.
- Screen: Summarize the screen and task evidence.
- Plan: Generate a single next goal or mark task completed.
- Action: Produce and execute the next GUI action.
- Loop: Continue until completion.
AI-Agent-URP-VLILAB/
├── gui_agent/
│ ├── nodes/
│ │ ├── default/ # plan/act/review graph
│ │ ├── workflow/ # screen/plan/action graph
│ │ └── shared/ # capture/execute nodes
│ ├── policy/ # fallback policies
│ ├── tools/ # GUI primitives (click, type, press, etc.)
│ ├── utils/ # screenshot, coord, JSON extraction, logging
│ ├── vlm/ # VLM backends
│ ├── config.py # configuration
│ ├── graph.py # default graph
│ ├── graph_workflow.py # workflow graph
│ └── state.py # shared agent state
├── run_gui_agent.py # entry point
├── requirements.txt
└── README.md
- Screenshots are saved in
_tmp_gui_agent/by default. - Use
GRAPH_STYLE=workflowto enable the new screen/plan/action flow.

