Mastra Agents

Mastra agents define behavior with a model, instructions, tools, memory, and processors, then expose .generate() and .stream() for typed text, object, and structured output generation. Agents support multi-step tool calls, dynamic instructions, runtime context, scoped memory, and Vercel AI SDK v5 message format.

API entry from apis.yml

apis.yml Raw ↑
aid: mastra-ai:mastra-agents
name: Mastra Agents
description: Mastra agents define behavior with a model, instructions, tools, memory, and processors,
  then expose .generate() and .stream() for typed text, object, and structured output generation. Agents
  support multi-step tool calls, dynamic instructions, runtime context, scoped memory, and Vercel AI SDK
  v5 message format.
humanURL: https://mastra.ai/docs/agents/overview
tags:
- Agents
- Artificial Intelligence
properties:
- type: Documentation
  url: https://mastra.ai/docs/agents/overview
- type: SourceCode
  url: https://github.com/mastra-ai/mastra/tree/main/packages/core/src/agent