Introduction to Browser Use Web UI
Relevant source files
The following files were used as context for generating this wiki page:
The Browser Use Web UI is a comprehensive interface built on Gradio designed to facilitate interaction between AI agents and web browsers. It builds upon the browser-use foundation to make websites accessible for AI agents, providing a user-friendly environment for task execution, deep research, and browser management.
The system supports a wide range of Large Language Models (LLMs), including OpenAI, Anthropic, Google, and Ollama, and offers specialized features such as persistent browser sessions, custom browser integration, and real-time visual feedback of agent actions.
Sources: README.md:14-30, webui.py:1-40
System Architecture and Components
The Web UI serves as the orchestration layer for several specialized modules. It manages the lifecycle of the browser, the configuration of the LLM, and the execution state of the AI agent.
Core Modules
| Component | Description |
|---|---|
| WebUI (Gradio) | The primary interface for user configuration and real-time monitoring. |
| CustomAgent | An enhanced agent class that extends standard capabilities with advanced prompt management and "Deep Thinking" support. |
| Deep Research | A specialized module for iterative information gathering and autonomous report generation. |
| Browser Controller | Manages the browser instance (Playwright), supporting both standard and persistent sessions. |
Sources: webui.py:380-550, src/agent/custom_agent.py:44-120, src/utils/deep_research.py:30-60
Execution Flow
The following diagram illustrates the interaction between the Web UI, the Agent, and the Browser during a typical task execution.
The system utilizes a global state to manage browser persistence and allows users to stop agents mid-task through a safe-point halt mechanism.
Sources: webui.py:46-150, webui.py:202-280
Agent Capabilities
The system features two primary agent types: "org" (original) and "custom". The CustomAgent implementation provides advanced state tracking and memory management.
Custom Prompting Logic
The CustomSystemPrompt enforces a strict JSON response format that requires the agent to evaluate previous actions, record important contents (Memory), and outline future plans in every step.
# src/agent/custom_prompts.py:22-38
{
"current_state": {
"prev_action_evaluation": "Success|Failed|Unknown",
"important_contents": "Memory content...",
"task_progress": "Summary of completed items",
"future_plans": "Remaining steps",
"thought": "Reasoning and reflection",
"summary": "Brief description of next actions"
},
"action": [ { "action_name": "action_params" } ]
}
Sources: src/agent/custom_prompts.py:20-50, src/agent/custom_agent.py:122-155
Deep Research Module
Deep Research is an iterative system that performs multi-step information gathering. It follows a loop of planning, searching, recording, and summarizing.
Sources: src/utils/deep_research.py:155-240
Configuration and Deployment
Browser Settings
Users can configure browser behavior via the UI or environment variables. Key features include:
- Persistent Sessions: Keeps the browser open between tasks to maintain history and login states.
- Custom Browser Path: Allows using a local Chrome installation by providing
CHROME_PATHandCHROME_USER_DATA. - Visual Feedback: Supports real-time screenshot streaming and video recording of sessions.
Sources: README.md:120-150, webui.py:730-780, src/utils/default_config_settings.py:10-35
Deployment Options
The project supports local installation via uv or pip, and containerized deployment via Docker.
| Setting | Docker Default | Description |
|---|---|---|
VNC_PASSWORD | vncpassword | Password for noVNC browser viewing. |
RESOLUTION | 1920x1080x24 | Screen resolution for the virtual display. |
CHROME_PERSISTENT_SESSION | false | Controls if browser stays open between tasks. |
Sources: docker-compose.yml:18-35, supervisord.conf:75-90
Conclusion
The Browser Use Web UI provides a robust framework for automating complex web tasks through AI agents. By integrating advanced prompting strategies, iterative research capabilities, and flexible browser management, it enables developers to build and monitor sophisticated autonomous web workflows.
Sources: README.md:14-25, webui.py:380-400