TL;DR
Mastra vừa công bố AgentBrowser — package @mastra/agent-browser giúp AI agent điều khiển trình duyệt thật (Chromium qua Playwright) bằng cách target phần tử theo accessibility tree thay vì CSS selector. Agent có thể click, gõ text, chụp snapshot, trích xuất dữ liệu có schema, và đặc biệt là mọi interaction đều được stream live vào Mastra Studio. Hệ quả: agent của bạn bây giờ làm được việc end-to-end trên những site không có API — admin panel, cổng B2B, tool nội bộ legacy, e-commerce.
Có gì mới?
Cốt lõi thông điệp từ team Mastra gọn trong một câu: "Your agents can now browse and take actions on the web, just like you can." Cụ thể gồm ba mảnh:
- AgentBrowser package — cài
@mastra/agent-browserqua npm/pnpm/yarn/bun. Tự động tải Chromium qua Playwright, hoặc connect remote browser qua CDP URL. - Accessibility-first targeting — thay vì viết CSS selector giòn dễ vỡ, agent chụp snapshot trang rồi tham chiếu phần tử qua ref (
@e1,@e2...) lấy từ accessibility tree. Robust hơn nhiều khi DOM đổi. - Live streaming vào Studio — Studio là IDE/observability UI của Mastra. Mỗi lần agent click, gõ, navigate, snapshot đều hiện trực tiếp trên timeline — debug flow agent không còn phải đoán.
Tại sao đáng quan tâm?
Vấn đề cũ của agent: chỉ làm được việc qua API. Mỗi khi gặp SaaS cũ không có REST, portal nội bộ chỉ có web UI, hoặc workflow phải click qua 5 trang thì agent bó tay. AgentBrowser xoá giới hạn đó: bất cứ thứ gì con người làm được trong trình duyệt, agent làm được. Và vì Mastra là framework TypeScript model-agnostic (chạy được với OpenAI, Anthropic, model open), bạn giữ toàn quyền kiểm soát agent loop, tools, memory — không bị khoá vào một hosted black-box kiểu Operator.
Technical facts
| Thành phần | Chi tiết |
|---|---|
| Package | @mastra/agent-browser |
| Engine | Playwright (Chromium auto-download) + CDP remote tuỳ chọn |
| Element targeting | Accessibility tree refs (@e1, @e2) |
| Agent actions | snapshot, click, type, keyboard shortcut, verify |
| Stack thay thế | Stagehand tools: navigate, act, observe, extract |
| Model support | Model-agnostic (OpenAI, Anthropic, open models...) |
| Control knob | maxSteps giới hạn số bước autonomous |
| Cloud browser | Browserbase integration cho production & parallelism |
So sánh nhanh
- vs OpenAI Operator / Anthropic Computer Use: AgentBrowser là framework, không phải sản phẩm hosted. Bạn tự chọn model, tự deploy, tự tune tools. Đổi lại cần code nhiều hơn một chút.
- vs Playwright script tay: Thay vì selector cứng, agent dùng intent ngôn ngữ tự nhiên ("click the checkout button") + accessibility tree. Flow sống sót khi dev team đối thủ đổi class name.
- vs LangChain browser tools: Mastra là TypeScript-first từ team Gatsby, có Studio live-stream, Workspaces sandbox, và đã vượt 22K+ GitHub stars với 300K+ weekly npm downloads từ bản 1.0 tháng 1/2026.
Use cases thực tế
- Workflow không có API: admin dashboard của SaaS cũ, cổng procurement B2B, tool nội bộ legacy — agent làm end-to-end.
- E-commerce: demo official là agent mua quà trên Amazon (navigate, add to cart, checkout). Tự động so giá, tự động đặt hàng.
- Form filling & data entry: báo giá, expense report, đơn vận chuyển — những việc con người ghét làm.
- QA regression: agent exercise UI thật và báo anomaly thay vì maintain Cypress suite.
- Competitive intel:
stagehand_extract+ schema Zod → scrape giá, tồn kho, listing có cấu trúc. - Multi-agent: supervisor agent delegate web-browsing cho AgentBrowser sub-agent, trong khi agent khác lo RAG, email, Slack.
Limitations & pricing
- Framework free, MIT license. Package
@mastra/agent-browsermiễn phí. - Chi phí thật: (a) token LLM per step — browsing step-heavy, chuẩn bị budget; (b) Browserbase usage nếu chạy cloud browser; (c) Mastra Cloud/Studio hosting khi deploy production.
- Cần sẵn: OpenAI API key + Browserbase API key cho template mặc định. Self-host với Chromium local cũng OK.
- Anti-bot vẫn chặn: Cloudflare, hCaptcha, fingerprint detection không bị bypass — accessibility tree giúp ổn định selector, không giúp qua CAPTCHA.
- Tune
maxSteps: thấp quá agent bỏ cuộc, cao quá token bill nổ.
What's next
Mastra đang push roadmap tích hợp AgentBrowser sâu hơn với Workspaces (sandbox filesystem + shell + browser trong một môi trường isolated), thêm model provider, và làm giàu timeline browsing session trong Studio. Với tốc độ ship hiện tại — từ bản 1.0 tháng 1/2026 tới giờ đã có Observational Memory, Mastra Code, supervisor pattern, Enterprise RBAC, remote sandbox (Daytona/E2B/Blaxel), Studio Auth — AgentBrowser GA là mảnh ghép đã được chờ từ lâu. Nếu bạn đang build agent tự động hoá task có UI trình duyệt, giờ là lúc npx create-mastra@latest --template browsing-agent.
Nguồn: Mastra trên X, AgentBrowser docs, Mastra blog, Browser Agent template.