mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
|
History
|
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| CHANGELOG.md | ||
| lint-staged.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsdown.config.ts | ||
| vitest.config.ts | ||
@mastra/agent-browser
Deterministic browser automation for Mastra agents using agent-browser.
Installation
npm install @mastra/agent-browser
Usage
import { Agent } from '@mastra/core/agent';
import { AgentBrowser } from '@mastra/agent-browser';
// Create an AgentBrowser instance
const browser = new AgentBrowser({
headless: true,
});
// Create an agent with the browser
const agent = new Agent({
name: 'web-agent',
instructions: `You are a web automation assistant.
Use browser_snapshot to see the page structure,
then interact with elements using their refs (e.g., @e5).`,
model: 'openai/gpt-5.4',
browser,
});
// Use the agent to browse the web
const result = await agent.generate('Go to example.com and click the first link');
Documentation
Changelog
See the package changelog for version history and release notes.
Support
We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.