A starter project for browser automation using the Browser-Use framework.
- Clone this repository
- Create a virtual environment using uv:
uv venv --python 3.11
- Activate the virtual environment:
- Windows:
.venv\Scripts\activate
- macOS/Linux:
source .venv/bin/activate
- Windows:
- Install dependencies using uv:
uv sync
- Copy
.env.example
to.env
and add your API keys
This project uses a centralized configuration system in config.py
. You can customize the following settings:
GOOGLE_API_KEY
: Your Google API key for Gemini models
LLM_CONFIG
: Settings for the main language modelPLANNER_LLM_CONFIG
: Settings for the planner language model
BROWSER_CONFIG
: General browser settings (headless mode, security settings)LOCAL_BROWSER_CONFIG
: Settings for using a local browser instanceUSE_LOCAL_BROWSER
: Toggle between using your local browser (with saved cookies/sessions) or a clean browser instance
AGENT_CONFIG
: Settings for the agent (vision, planning interval, logs)SENSITIVE_DATA
: Credentials and sensitive informationDEFAULT_TASK
: The default task for the agent to perform
To run the agent with your configuration:
uv run agent.py
To add a new package to your project:
uv add <package-name>
To change the default task, edit the DEFAULT_TASK
variable in config.py
:
DEFAULT_TASK = "Search for flights from New York to London on March 15, 2025."
To use your local browser with saved cookies and sessions, set:
USE_LOCAL_BROWSER = True
LOCAL_BROWSER_CONFIG = {
"chrome_instance_path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
}
Logs are saved in the logs/
directory:
- Conversation logs:
logs/conversation
- History summary:
logs/history_summary.json