Skip to main content
Mastra is an agentic framework that simplifies building complex AI applications with multi-agent workflows, tool integrations, and memory management.

Install

Configure Environment

Create a .env file that points Mastra to your Phoenix instance:
  1. Sign up for an Arize Phoenix account at https://app.phoenix.arize.com/login
  2. Grab your API key from the Keys option on the left bar.
  3. Find your hostname under Settings > Hostname.

Setup

Initialize the Arize exporter inside your Mastra project. Zero-config setup (reads from environment variables automatically):
Explicit configuration:

Create Agents and Tools

From here you can use Mastra as normal. Create agents with tools and run them:

Running Your Application

To test your application with Phoenix tracing:
This will:
  1. Initialize the tracing SDK with your observability configuration
  2. Start the Mastra playground at http://localhost:4111
  3. Enable trace export to Phoenix at http://localhost:6006
Interact with your agents:
  • Via Playground: Navigate to http://localhost:4111/playground to chat with agents
  • Via API: Make requests to the generated API endpoints
  • Programmatically: Create test scripts that run within the Mastra dev environment

Observe

Now that you have tracing setup, all agent runs, tool calls, and model interactions will be streamed to your running Phoenix for observability and evaluation.
Mastra traces in Phoenix

Resources