name: mastra-streaming description: Mastra Streaming patterns - agent streams, workflow streams, tool streaming, SSE events, and AI SDK integration for React/Next.js UIs
Mastra Streaming Patterns
Comprehensive guide for real-time streaming with Mastra. Covers agent streaming (textStream, fullStream), workflow streaming, tool streaming with context.writer, SSE events, and AI SDK integration (chatRoute, toAISdkStream, handleChatStream) for React and Next.js UIs.
Usage
/mastra-streaming
Provides context for:
agent.stream()returningMastraModelOutputwithtextStream,fullStream- Workflow
run.stream()with event types - Tool streaming via
context.writer.custom() - AI SDK:
toAISdkStream(),chatRoute(),handleChatStream() networkRoute(),workflowRoute()- React
useChathook integration streamLegacy()for v1 model compatibility