stagehand: Build AI Agents That Use Websites

stagehand: Build AI Agents That Use Websites

Summary

Stagehand is a browser automation SDK for AI agents, combining Playwright-style controls with natural-language actions and structured data extraction. It supports TypeScript, Python, and Go, and can run with a local browser or Browserbase.

At a glance

Language
TypeScript
License
MIT
Stars
25.5k
Forks
1.8k
Added to OSRepos
October 11, 2025
Last analyzed
October 3, 2026
View on GitHub

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Overview

Stagehand helps developers build agents that interact with websites and extract data from them. It combines familiar browser-driver APIs with model-assisted actions, page observation, and schema-based extraction, addressing the brittleness of scripts that depend on fixed selectors and page layouts.

Use it when an application needs an AI model to interpret or adapt to changing web pages while retaining direct browser controls. The project offers SDKs for TypeScript, Python, and Go, with options for local browser sessions or Browserbase-hosted sessions.

Key Features

  • act() performs browser actions described in natural language.
  • observe() identifies page elements and returns selectors that can be used with browser locators.
  • extract() returns data validated against a supplied schema.
  • Playwright-style APIs support direct navigation, locators, and other browser operations.
  • Browser sessions can preserve cookies using a local user data directory.
  • Includes WebMCP support, clipboard support, batch commands, and locators for nested iframes and closed Shadow DOMs.
  • Provides TypeScript, Python, and Go SDKs, plus a hosted MCP server integration.
  • Offers search and URL-fetch add-ons that can retrieve web content without a browser session.

Use Cases

  • Build an agent that signs in to a web application and gathers structured records from tables.
  • Automate browser workflows where page changes make fixed selectors unreliable.
  • Let coding agents navigate and interact with websites through an MCP client.
  • Collect information from web pages using browser sessions, or use search and fetch for lighter-weight retrieval.

Project Facts

  • Language: TypeScript
  • License: MIT
  • Stars: 25.5k
  • Forks: 1.8k
  • Topics: agents, ai, ai-agents, browser-agent, browser-automation, cdp, cloud-browser, data-extraction, headless-chrome, playwright, python, typescript, web-automation, web-scraping
  • Archived: no

Getting Started

Install the TypeScript SDK and its documented Zod dependency:

pnpm add @browserbasehq/stagehand 'zod@~4.4.3'

Local runs require Chrome. See the quickstart and README for setup and Python or Go instructions.

Alternatives

  • PinchTab: PinchTab is a Go-based Chrome control bridge and multi-instance orchestrator, rather than a cross-language SDK pairing Playwright-style controls with natural-language actions.
  • CloakBrowser: CloakBrowser focuses on fingerprint changes to evade bot detection and exposes Playwright- and Puppeteer-compatible APIs, rather than adding natural-language browser actions.
  • Browserable: Browserable is a self-hostable browser automation library for agent tasks, while Stagehand emphasizes a developer SDK with Playwright-style controls and structured extraction.
  • browser-rs-mcp: browser-rs-mcp exposes browser controls as MCP tools for agents sharing a persistent Chrome instance, rather than as a browser automation SDK.

Considerations

  • AI-powered actions require a configured model and API key for local use. Browserbase can provide a Model Gateway option for hosted sessions.
  • Local browser runs require Chrome; hosted browser sessions require a Browserbase API key.
  • Natural-language automation still depends on model behavior and the state of the target website, so validate workflows and extracted data for your application.
  • The repository is actively maintained and has a substantial open issue count; check the issue tracker for current bugs and limitations.

Comparisons

Source repository

Open the original repository on GitHub.

20 counted GitHub visits

View on GitHub

Related repositories

Similar repositories that may be relevant next.

OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️