AI Browser Agents That Automate an Electronic-Music Marketplace
A leading electronic-music marketplace
Overview
An agentic automation brain that drives a leading electronic-music marketplace through real browser sessions. It pairs the Mastra agent framework with Playwright/Stagehand browser control and an LLM tool-calling layer to simulate end-to-end shopper journeys, discovery, playlisting, cart and checkout, at scale.
The Challenge
Exercising a complex music-commerce storefront the way real users do, searching, browsing genre grids and sliders, building playlists, adding tracks to a cart, registering accounts and completing billing, is tedious and brittle to script by hand. The goal was an LLM-driven agent that could understand the live page and accomplish high-level goals without hard-coded selectors, then run that across many synthetic users.
What We Built
A TypeScript automation layer organized around Mastra. A dedicated agent set (search-agent, browse-genre-agent, discovery-agent, playlist-agent, top-songs-agent, clear-cart-agent, data-enrich-agent) is coordinated by a top-level network orchestrator. Each agent draws on a large library of fine-grained tools, login-tool, search-anything-tool, select-genre-tool, get-available-gridsliders-tool, interact-with-slider-tool, add-grid-song-to-cart-tool, create-playlist-tool, add-song-to-playlist-tool, checkout-cart-tool, and more, that act on the live DOM via Playwright and Stagehand (Browserbase). Durable, multi-step workflows encode whole journeys: register-workflow, setup-billing-workflow, search-and-buy-workflow, surf-workflow/top-surf-workflow, and registration/purchase verification flows. Top-level driver scripts (create-users.ts, create-users-billing.ts, create-users-buy.ts, enrich-users.ts, create_csv_report.ts) batch-run the agents over user lists, with Firebase Admin/Firestore for state and reporting and a Firebase Functions module alongside. Agent memory uses Mastra’s libsql store; the app ships with a Dockerfile and CSV-driven inputs.
Technologies & Approach
Mastra provides the agent/tool/workflow abstractions and memory; the Vercel AI SDK and OpenAI power the reasoning and tool selection; Stagehand on Browserbase plus Playwright give resilient, vision/DOM-aware browser control that tolerates UI changes far better than selector scripts. Firebase/Firestore handles user records, run state, and reporting.
Outcome / Impact
A working proof that LLM agents can autonomously operate a real, intricate e-commerce frontend end-to-end and be fanned out across many synthetic users, validating agentic browser automation for testing, data enrichment, and marketplace simulation.
Capabilities Demonstrated
- LLM browser agents that operate live web UIs without brittle selectors
- Multi-agent orchestration with a tool/workflow architecture (Mastra)
- Headless automation at scale via Stagehand/Browserbase + Playwright
- Synthetic-user simulation of full commerce journeys (browse → playlist → checkout)
- Firebase-backed run state, enrichment, and CSV reporting