TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/browser-use/browser-use/llms.txt
Use this file to discover all available pages before exploring further.
AgentSettings class controls how the agent thinks, plans, and executes tasks.
Vision & Processing
use_vision
Controls vision mode for screenshots:
"auto"- Includes screenshot tool but only uses vision when explicitly requestedTrue- Always includes screenshots in LLM contextFalse- Never includes screenshots and excludes screenshot tool
vision_detail_level
Screenshot detail level for LLM vision models:
"auto"- Let the LLM provider choose optimal detail"low"- Faster, lower cost, reduced detail"high"- Slower, higher cost, maximum detail
page_extraction_llm
Separate LLM model for page content extraction.You can use a smaller, faster model since it only needs to extract text from pages.Default: Same as main
llm parameterActions & Behavior
max_actions_per_step
Maximum actions the agent can execute in a single step.For example, for form filling the agent can output 3 fields at once. Actions are executed until the page changes.
max_failures
Maximum number of consecutive failures before the agent stops.Each step error increments the failure counter. Successful steps reset it to 0.
final_response_after_failure
If
True, attempts one final LLM call with intermediate output after max_failures is reached.This allows the agent to provide a summary even if the task couldn’t be completed.Reasoning & Planning
use_thinking
Controls whether the agent uses its internal “thinking” field for explicit reasoning steps.When enabled, the agent outputs its thought process before choosing actions.
flash_mode
Fast mode that skips evaluation, next goal, and thinking - only uses memory.Performance: ~2x faster executionTrade-off: Reduced reasoning capabilitySee Fast Agent Example
enable_planning
Enable the agent to create and follow multi-step plans for complex tasks.
planning_replan_on_stall
Number of consecutive failures before triggering a plan revision nudge.Set to
0 to disable.planning_exploration_limit
Number of steps without a plan before nudging the agent to create one.Set to
0 to disable.System Messages
override_system_message
Completely replace the default system prompt with a custom one.Use with caution: This removes all default instructions.
extend_system_message
Add additional instructions to the default system prompt.See Custom System Prompt Example
History & Memory
max_history_items
Maximum number of last steps to keep in LLM memory.Default:
None (keeps all steps)Useful for limiting context size on very long tasks.message_compaction
Settings for summarizing older history into a compact memory block.Fields:
enabled(bool): Enable compactioncompact_every_n_steps(int): Compact every N stepstrigger_char_count(int): Minimum characters before compactionkeep_last_items(int): Recent items to keep uncompactedsummary_max_chars(int): Maximum summary size
Loop Detection
loop_detection_enabled
Enable detection of repetitive actions and nudges to the agent.
loop_detection_window
Rolling window size for tracking action similarity.
Validation & Judging
use_judge
Enable lightweight validation of agent success claims.The judge validates that the agent’s response genuinely satisfies the task requirements.
ground_truth
Ground truth answer or criteria for judge validation.When provided, the judge compares the agent’s output against this ground truth.
File & Data Management
save_conversation_path
Path to save complete conversation history as JSON.
save_conversation_path_encoding
Text encoding for saved conversation files.
generate_gif
Generate an animated GIF of agent actions.
True- Save to default locationstring- Save to specified pathFalse- Disable
include_attributes
List of HTML attributes to include in page analysis.Default: Common attributes like
id, class, href, type, etc.Performance & Limits
llm_timeout
Timeout in seconds for LLM API calls.Auto-detected values:
- 30s for Gemini models
- 90s for o3 models
- 60s default
step_timeout
Timeout in seconds for each agent step (including actions and LLM calls).
calculate_cost
Track and calculate API costs for LLM calls.
max_clickable_elements_length
Maximum characters for clickable elements in the prompt.
Example
Most settings can be passed directly to the
Agent constructor as keyword arguments.Related Configuration
- Browser Settings - Configure browser behavior
- Sandbox Settings - Configure cloud execution