Stagehand

Active
GitHub TypeScript MIT

Description

The SDK for browser agents by Browserbase. Provides act, extract, and observe primitives for AI agents to naturally browse and interact with web pages.

Key Features

  • Three-primitive API — act (execute actions), extract (get data), observe (inspect page)
  • Hybrid natural language + code — freely switch between AI-driven and deterministic code control
  • Auto-caching and self-healing — cache repeat actions to skip LLM inference, auto-fix on page changes
  • TypeScript and Python dual SDK — TS and Python implementations for different tech stacks
  • Zod structured data extraction — define targets with Zod schemas, get type-safe structured results
  • Agent mode — built-in agent() method for autonomous multi-step complex task execution

Use Cases

💡 Building browser agents that autonomously browse and interact with web pages
💡 Automating testing of web apps requiring login or complex interactions
💡 Batch-extracting structured product or pricing data from any website
💡 Real-time web data collection layer for RAG systems
💡 Creating reusable web automation workflow scripts

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (24.0k stars)
  • Permissive open-source license (MIT)
  • Established track record (2 years in production)

Quick Start

npm install @browserbasehq/stagehand

import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
  env: "LOCAL",
});
await stagehand.init();

const page = stagehand.context.pages()[0];
await page.goto("https://github.com/browserbase");

await stagehand.act("click on the stagehand repo");

const { author, title } = await stagehand.extract(
  "extract the author and title of the latest PR",
  {
    author: z.string(),
    title: z.string(),
  }
);

console.log(author, title);
await stagehand.close();

Related Projects

OpenBrowser

9.5k · TypeScript
Stale B

AI-powered autonomous web browsing framework that enables agents to click, type, navigate, and extract data like a human, with support for OpenAI, Anthropic, and Google models.

browser-agentweb-automationplaywright +2
  • · Natural language task execution — describe what you want and the agent navigates, clicks, types, and extracts data autonomously
  • · Multi-model support via Vercel AI SDK — swap between OpenAI, Anthropic, and Google with a single flag
  • · Interactive REPL for live browser sessions — drop into a browser prompt for debugging, prototyping, and exploration

Fara

6.1k · Python
Active A

Microsoft's open-source browser and web task agent that uses large models to understand pages, plan actions, and complete real web workflows.

browser-agentweb-automationresearch
  • · 7B parameter agentic SLM designed for computer use with visual perception of webpages
  • · Direct coordinate prediction for mouse and keyboard actions without accessibility trees
  • · State-of-the-art results on WebVoyager, Online-M2W, DeepShop, and WebTailBench benchmarks

Playwriter

3.8k · HTML
Active A

Chrome extension & CLI to let agents control your browser. Runs Playwright snippets in a stateful sandbox. Available as CLI or MCP.

mcpplaywrightbrowser-automation +2
  • · Connects to your running Chrome browser instead of spawning a fresh instance, preserving logins, extensions, and cookies
  • · Full Playwright API access via a single `execute` tool, reducing context usage compared to multi-tool alternatives
  • · Vimium-style visual accessibility labels with color-coded element types for AI agent element identification

Related Articles