Install: pip install browser-use and playwright install chromium
Import Agent and a LangChain-compatible LLM: from browser_use import Agent; from langchain_anthropic import ChatAnthropic
Instantiate the agent: agent = Agent(task='Find the latest Playwright release notes', llm=ChatAnthropic(model='claude-opus-4-5'))
Run the agent loop: result = await agent.run(max_steps=20)
Access result.final_result() for the output and result.history() for the full action trace
To reuse a browser session across multiple agent runs, pass a pre-configured BrowserContext into the Agent constructor
Known gotchas
Browser Use takes a screenshot at each step and sends it to the LLM; using a vision-capable model is required for reliable element targeting
The default max_steps is unlimited; always set a finite limit to prevent runaway loops consuming LLM credits
Browser Use 0.13+ uses a Rust-backed agent core; the Python API surface changed in that release so check the changelog before upgrading from earlier versions
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp