
Stagehand
The SDK for browser agents
Developers and automation engineers building resilient web scrapers, QA suites, or autonomous browser agents who want AI-driven selectors on top of Playwright.
Non-technical users wanting a no-code RPA builder, or high-volume scraping jobs where per-call LLM cost and latency outweigh the maintenance savings.
Stagehand is an open-source SDK from Browserbase for building AI browser agents that drive real webpages via natural language instead of brittle CSS or XPath selectors. It sits on top of Playwright, so you keep full access to the underlying page object when you need deterministic control, and layers four AI primitives on top: act() executes plain-English steps like 'click the sign-in button' or 'fill the email field with [email protected]', extract() pulls structured data validated against a Zod schema, observe() previews the actionable elements on a page before you commit to acting, and agent() hands off a multi-step goal to an autonomous loop that plans and executes until the task is done. The intended user is a developer or automation engineer building web scrapers, QA flows, RPA replacements, or LLM agents that need to shop, book, file forms, or gather data from sites that change frequently and would otherwise break a Playwright script every week. Stagehand is model-agnostic through the Vercel AI SDK, so you can point it at OpenAI, Anthropic, Google Gemini, or a Browserbase-hosted gateway model, and it works both locally in Node/TypeScript or Python and in the cloud on Browserbase's managed headless-browser infrastructure with stealth, proxies, session replay, and captcha handling. Common workflows include resilient data extraction from listing sites, end-to-end UI test suites that survive redesigns, competitor price monitoring, form-filling automations, and long-running research agents that navigate multi-step flows autonomously.
The most pragmatic AI-browser-agent SDK I've tried — it doesn't try to replace Playwright, it augments it, so you get natural-language resilience without giving up the deterministic escape hatch when a flow really has to work. Pair it with Browserbase for stealth and it's a serious alternative to hand-rolled scrapers.
— The AI Tool Bible editorial team
Pros
- ✅ Open-source (MIT) and built directly on Playwright, so you never lose escape-hatch access to the raw page, frame, and network APIs
- ✅ Natural-language act/extract/observe primitives eliminate most brittle selectors and dramatically reduce maintenance when target sites change
- ✅ Zod-schema extraction returns typed, validated data instead of loose JSON, which fits cleanly into typed backends
- ✅ Model-agnostic via the Vercel AI SDK — swap OpenAI, Anthropic, Gemini, or a self-hosted model without rewriting the agent
- ✅ Optional Browserbase cloud provides stealth browsers, residential proxies, session replay, and captcha handling out of the box
- ✅ TypeScript and Python SDKs with good docs, a growing example library, and an active Discord
- ✅ observe() lets you inspect proposed actions before executing, which makes debugging and human-in-the-loop review practical
Cons
- ⚠️ Every act/extract call issues an LLM request, so token costs and latency add up fast on large crawls compared with hand-written Playwright
- ⚠️ Non-deterministic by nature — the same prompt can occasionally pick a different element, so critical flows still need assertions and retries
- ⚠️ Cloud features (stealth, proxies, captcha) require a paid Browserbase plan; running purely local means you handle those problems yourself
- ⚠️ Still a young project — API surface and best practices are evolving and breaking changes appear between minor versions
- ⚠️ Requires developer skills (Node/TS or Python) — no visual builder for non-technical automators
Use cases
Explore related
Compare with similar tools
All in Agents →
LangGraph
FeaturedStateful, graph-based agent orchestration from LangChain.

CrewAI
FeaturedPython framework for multi-agent orchestration.

Ernie Bot
Baidu's Mandarin-first ChatGPT rival, powered by the ERNIE model family

Moveworks
The enterprise AI assistant that searches, answers, and takes action across your business systems

AWS Bedrock
Build and scale generative AI applications with foundation models

Claude Agent SDK
Anthropic's official SDK for building autonomous Claude agents.