Skip to main content

Overview

Mastra is a powerful framework for building AI agents that can interact with GBOX’s headless browser infrastructure. It allows you to create sophisticated AI assistants that can automate tasks, perform web scraping, and interact with web applications.

Getting Started

1

Install Dependencies

Install the necessary dependencies for your project.
2

Add Environment Variables

Create a .env file in your project root and add your GBOX API key:
3

Create Tools

Create src/mastra/tools/index.ts with the following content:
4

Create Mastra Agent

Create src/mastra/agents/index.ts with the following content:
5

Initialize Mastra

Create src/mastra/index.ts with the following content:
6

Run the Agent

Add a script to run the agent in package.json:
Then, run the agent using: