The Problem:
Autonomous AI web agents struggle with severe reliability bottlenecks in production. When executing multi-step tasks across dynamic websites—such as navigating portals, completing forms, and processing transactions—standard Large Language Models suffer from compounding decision errors, plan divergence, and infinite loops. Without lookahead planning or self-correction, zero-shot models like base GPT-4o fail frequently, achieving only a 62.6% task completion rate on complex web tasks like online reservations.
The Approach:
The project implements the Agent Q framework to teach browser agents to self-correct. Operating via asynchronous Playwright, the system perceives web states through dual visual screenshots and pruned DOM trees. The architecture integrates three core techniques: (1) Monte Carlo Tree Search (MCTS) with UCT scoring to explore candidate actions, evaluate future trajectories, and backtrack from dead ends; (2) Process Supervision via an LLM Critic that evaluates intermediate actions and assigns step-level rewards; and (3) Direct Preference Optimization (DPO) to fine-tune the agent policy directly on MCTS preference pairs without a separate reward model.
The Results:
The framework transforms brittle web scraping into resilient, multi-step execution. In real-world OpenTable reservation benchmarks, base GPT-4o achieved 62.6% success, Agent Q without AI feedback reached 75.2%, and Agent Q without MCTS reached 81.7%. The full Agent Q system (combining MCTS, self-critique, and DPO) achieved a 95.4% success rate, successfully demonstrating robust autonomous form filling, course discovery, and multi-step workflow execution.