# Create an agent that can browse the web with Managed Deep Agents and Browserbase's Stagehand

## Executive summary

This video demonstrates building a production-ready web browsing agent by integrating Managed Deep Agents (LangSmith) with Stagehand v4 and BrowserStack. The resulting agent can interact with live websites—performing actions like scrolling, clicking, and navigating—using specialized tools exposed by Stagehand to connect the AI model to scalable browser infrastructure.

## Key takeaways

- Agent Architecture Overview: The solution uses Managed Deep Agents as the core agent harness (LangSmith), which is augmented with tools from Stagehand v4. Stagehand, in turn, connects to web browsing infrastructure provided by BrowserStack for production-grade scalability.
- Stagehand V4 Tools: The agent is given three core tools from Stagehand: `screenshot` (visually inspects the rendered page), `snapshot` (inspects the active page and hydrates element IDs for simple interactions), and `run` (accepts snapshot actions or JavaScript via the Playwright-shaped page API, ideal for multi-step workflows).
- Development Workflow (Local vs. Production): The development process involves running `mda dev` locally to test the agent in a managed deep agent studio environment. For production, the deployment is finalized using `mda deploy`, which creates a serverless deployment within LangSmith's Context Hub.

## Technical details

- Agent Infrastructure: Managed Deep Agents is described as an open-source, model-agnostic agent harness running inside LangSmith deployments. It allows connecting to the Context Hub for managing skills and instructions.
- Browser Integration: Stagehand v4 is an open-source library that supports two types of web browsing infrastructure: Playwright (for controlling local browsers) and BrowserStack (for managed, production-scale browser execution).
- Deployment Commands: Local testing is performed using `mda dev` within the dedicated example folder. Production deployment requires running `mda deploy`, which establishes a serverless deployment type in LangSmith.

## Practical implications

- The architecture provides a scalable solution for integrating complex, non-API web interactions (like scraping or form filling) into AI agents.
- By separating the agent logic (LangSmith Context Hub/Prompt) from the code deployment, prompt updates can be made without requiring full agent redeployment.
- This setup allows build engineers to deploy and test sophisticated, browser-dependent automation workflows in a controlled, production environment.

## Topics

Agent Engineering, Web Scraping, LangChain, Browser Automation, CI/CD, Serverless Deployment, LangSmith, BrowserStack, Stagehand v4

Source: https://www.youtube.com/watch?v=O0hkpChFBkM
