Overview

Browser Use has a native integration with Laminar for tracing browser agents.

Laminar excels at tracing browser agents by providing unified visibility into both browser session recordings and agent execution steps.

Usage

Simply initialize Laminar at the top of your project and both Browser Use agent’s steps and session recordings will be automatically traced and synced.

from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio

from lmnr import Laminar
# this line auto-instruments Browser Use and any browser you use (local or remote)
Laminar.initialize(project_api_key="...") # you can also pass project api key here

async def main():
    agent = Agent(
        task="open google, search Laminar AI",
        llm=ChatOpenAI(model="gpt-4o-mini"),
    )
    result = await agent.run()
    print(result)

asyncio.run(main())

Viewing Traces

You can view traces in the Laminar UI by going to the traces tab in your project. When you select a trace, you can see both the browser session recording and the agent execution steps.

Timeline of the browser session is synced with the agent execution steps, timeline highlights indicate the agent’s current step synced with the browser session.