Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Planner update prompt

magmueller90f949a72b5c
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index 34ea2ffed..0ca004d3a 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -61,6 +61,8 @@ class SystemPrompt:
- If stuck, try alternative approaches - like going back to a previous page, new search, new tab etc.
- Handle popups/cookies by accepting or closing them
- Use scroll to find elements you are looking for
+ - If you want to research something, open a new tab instead of using the current tab
+ - If captcha pops up, and you cant solve it, either ask for human help or try to continue the task on a different page.
5. TASK COMPLETION:
- Use the done action as the last action as soon as the ultimate task is complete
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 4dc8db14d..bd0713ccc 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -103,7 +103,7 @@ class Agent:
tool_calling_method: Optional[str] = 'auto',
page_extraction_llm: Optional[BaseChatModel] = None,
planner_llm: Optional[BaseChatModel] = None,
- planning_interval: int = 1, # Run planner every N steps
+ planner_interval: int = 1, # Run planner every N steps
):
self.agent_id = str(uuid.uuid4()) # unique identifier for the agent
self.sensitive_data = sensitive_data
@@ -192,7 +192,7 @@ class Agent:
# Initialize planner
self.planner_llm = planner_llm
- self.planning_interval = planning_interval
+ self.planning_interval = planner_interval
self.last_plan = None
self.action_descriptions = self.controller.registry.get_prompt_description()
diff --git a/examples/features/planner.py b/examples/features/planner.py
index a2f1cd961..35fcd7550 100644
--- a/examples/features/planner.py
+++ b/examples/features/planner.py
@@ -17,7 +17,7 @@ planner_llm = ChatOpenAI(
)
task = 'find all information you find about the browser-use founders (minimum 10 links) and write a short message to them'
-agent = Agent(task=task, llm=llm, planner_llm=planner_llm, use_vision_for_planner=False)
+agent = Agent(task=task, llm=llm, planner_llm=planner_llm, use_vision_for_planner=False, planner_interval=4)
async def main():