Browser Agent

A powerful integration that combines the capabilities of Browserbase's Stagehand with Mastra for advanced web automation, scraping, and AI-powered web interactions.

Why we built this

This project enables AI agents to interact with web pages through the Mastra framework using Stagehand's browser automation capabilities. It provides tools for web navigation, element observation, data extraction, and action execution, all orchestrated through Mastra's agent system.

Features

  • Web Navigation: Navigate to websites programmatically
  • Element Observation: Identify and locate elements on web pages
  • Action Execution: Perform actions like clicking buttons or filling forms
  • Data Extraction: Extract structured data from web pages
  • Session Management: Smart session handling with automatic timeouts and reconnection
  • AI-Powered Interactions: Leverage OpenAI models for intelligent web interactions

Prerequisites

Quickstart 🚀

  1. Clone the template
    • Run npx create-mastra@latest --template browsing-agent to scaffold the project locally.
  2. Add your API keys
    • Copy .env.example to .env and fill in your keys.
  3. Start the dev server

Making it yours

Open Studio and select the "Web Assistant" agent.

About Mastra templates

Mastra templates are ready-to-use projects that show off what you can build — clone one, poke around, and make it yours. They live in the Mastra monorepo and are automatically synced to standalone repositories for easier cloning.

Want to contribute? See CONTRIBUTING.md.