Skip to main content

Mastra Integration

Mastra is a TypeScript-first AI agent framework. Wrap your agent for automatic tracing.

Quick Start

Session & User Tracking

Sessions are created per conversation/request:

With Prompt Management

Pull prompts from Fallom and use them with your agent:

With Prompt A/B Testing

Run A/B tests on your agent prompts:

With Tools

Tool calls are automatically captured in traces:

With Mastra Instance

If using a Mastra instance with multiple agents:

What Gets Traced

Alternative: OTLP with mastra dev

If you’re running with mastra dev, you can use OTLP environment variables:
Note: This only works when running via mastra dev. For standalone deployments, use session.wrapMastraAgent().

Prompt Management

Manage and version your prompts

Vercel AI SDK

Use Vercel AI SDK directly

OpenRouter

Route to multiple providers

Session Tracking

Learn more about session context