Managed Deep Agents + Stagehand v4: browser agent setup
Build a browser agent with Stagehand v4 and Browserbase, test it with mda dev, inspect session replays, and deploy it to LangSmith.
Player not loading? Watch on YouTube
This tutorial builds a web browsing AI agent with LangSmith Managed Deep Agents, Stagehand v4 and Browserbase. The presenter describes Deep Agents as an open source, model-agnostic harness. The demonstrated setup uses managed services; running the development server locally still requires API keys for LangSmith, OpenAI and Browserbase. The speaker also says Managed Deep Agents requires a Plus or paid plan.
The walkthrough starts in the managed example within Stagehand's Deep Agents integration. It covers model selection and three browser tools: snapshot, run and screenshot. Snapshot supplies element IDs for the active page, run accepts snapshot actions or JavaScript through a Playwright-shaped page API, and screenshot provides a visual view. Element IDs apply only to the latest snapshot, so the agent needs another snapshot after navigation or when an ID becomes stale.
The presenter launches the development studio with mda dev, asks the agent to retrieve ESPN headlines and find comments on Hacker News, then inspects Browserbase sessions and replays. The session replays show how the agent navigates between pages and retrieves the requested information.
The final section uses mda deploy to create a LangSmith deployment. Agent instructions live in Context Hub, which the presenter says allows prompt edits without redeploying the code. A final ESPN request tests the deployed agent.