@mastra/mcp-docs-server 1.2.11 → 1.2.12-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/.docs/docs/agents/using-tools.md +25 -0
  2. package/.docs/guides/build-your-ui/ai-sdk-ui.md +5 -5
  3. package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +8 -8
  4. package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
  5. package/.docs/guides/build-your-ui/openui.md +1 -1
  6. package/.docs/guides/concepts/multi-agent-systems.md +5 -5
  7. package/.docs/guides/concepts/streaming.md +9 -9
  8. package/.docs/guides/deployment/amazon-ec2.md +1 -1
  9. package/.docs/guides/deployment/aws-lambda.md +1 -1
  10. package/.docs/guides/deployment/azure-app-services.md +1 -1
  11. package/.docs/guides/deployment/cloudflare.md +1 -1
  12. package/.docs/guides/deployment/inngest.md +6 -6
  13. package/.docs/guides/deployment/temporal.md +1 -1
  14. package/.docs/guides/deployment/vercel.md +1 -1
  15. package/.docs/guides/getting-started/astro.md +1 -1
  16. package/.docs/guides/getting-started/electron.md +1 -1
  17. package/.docs/guides/getting-started/nestjs.md +5 -5
  18. package/.docs/guides/getting-started/vite-react.md +1 -1
  19. package/.docs/guides/guide/chef-michel.md +1 -1
  20. package/.docs/guides/guide/code-review-bot.md +1 -1
  21. package/.docs/guides/guide/coding-agent.md +4 -4
  22. package/.docs/guides/guide/dev-assistant.md +1 -1
  23. package/.docs/guides/guide/docs-manager.md +3 -3
  24. package/.docs/guides/guide/github-actions-pr-description.md +4 -4
  25. package/.docs/guides/guide/research-assistant.md +3 -3
  26. package/.docs/guides/guide/research-coordinator.md +3 -3
  27. package/.docs/guides/guide/slack-assistant.md +1 -1
  28. package/.docs/guides/guide/stock-agent.md +1 -1
  29. package/.docs/guides/index.md +1 -1
  30. package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
  31. package/.docs/guides/migrations/mastra-cloud.md +6 -6
  32. package/.docs/guides/migrations/network-to-supervisor.md +9 -9
  33. package/.docs/guides/migrations/upgrade-to-v1/agent.md +5 -5
  34. package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
  35. package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
  36. package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
  37. package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
  38. package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
  39. package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
  40. package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
  41. package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
  42. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
  43. package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
  44. package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
  45. package/.docs/models/environment-variables.md +1 -0
  46. package/.docs/models/index.md +1 -1
  47. package/.docs/models/providers/modal.md +73 -0
  48. package/.docs/models/providers.md +1 -0
  49. package/.docs/reference/acp/acp-agent.md +3 -3
  50. package/.docs/reference/acp/create-acp-tool.md +2 -2
  51. package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
  52. package/.docs/reference/agent-controller/session.md +6 -6
  53. package/.docs/reference/agents/agent.md +7 -7
  54. package/.docs/reference/agents/channels.md +3 -3
  55. package/.docs/reference/agents/durable-agent.md +3 -3
  56. package/.docs/reference/agents/generate.md +3 -3
  57. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  58. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  59. package/.docs/reference/agents/listScorers.md +1 -1
  60. package/.docs/reference/agents/listSkills.md +1 -1
  61. package/.docs/reference/agents/listSuspendedRuns.md +2 -2
  62. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  63. package/.docs/reference/ai-sdk/network-route.md +1 -1
  64. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
  65. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
  66. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
  67. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  68. package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
  69. package/.docs/reference/auth/auth0.md +1 -1
  70. package/.docs/reference/auth/fga.md +2 -2
  71. package/.docs/reference/auth/google.md +2 -2
  72. package/.docs/reference/auth/okta.md +1 -1
  73. package/.docs/reference/auth/workos.md +2 -2
  74. package/.docs/reference/browser/agent-browser.md +2 -2
  75. package/.docs/reference/browser/browser-viewer.md +3 -3
  76. package/.docs/reference/browser/mastra-browser.md +3 -3
  77. package/.docs/reference/browser/stagehand-browser.md +4 -4
  78. package/.docs/reference/channels/slack-provider.md +2 -2
  79. package/.docs/reference/cli/create-mastra.md +1 -1
  80. package/.docs/reference/cli/mastra.md +23 -23
  81. package/.docs/reference/client-js/agents.md +9 -9
  82. package/.docs/reference/client-js/memory.md +2 -2
  83. package/.docs/reference/client-js/workflows.md +1 -1
  84. package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
  85. package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
  86. package/.docs/reference/configuration.md +6 -6
  87. package/.docs/reference/core/getMCPServer.md +1 -1
  88. package/.docs/reference/core/getScorer.md +1 -1
  89. package/.docs/reference/datasets/addItem.md +1 -1
  90. package/.docs/reference/datasets/listItems.md +1 -1
  91. package/.docs/reference/deployer/netlify.md +4 -4
  92. package/.docs/reference/deployer/vercel.md +7 -7
  93. package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
  94. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
  95. package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
  96. package/.docs/reference/editor/blob-store-provider.md +1 -1
  97. package/.docs/reference/editor/browser-provider.md +3 -3
  98. package/.docs/reference/editor/filesystem-provider.md +4 -4
  99. package/.docs/reference/editor/mastra-editor.md +5 -5
  100. package/.docs/reference/editor/processor-provider.md +3 -3
  101. package/.docs/reference/editor/sandbox-provider.md +4 -4
  102. package/.docs/reference/editor/storage-browser-ref.md +6 -6
  103. package/.docs/reference/editor/storage-workspace-ref.md +4 -4
  104. package/.docs/reference/editor/tool-provider.md +1 -1
  105. package/.docs/reference/evals/answer-relevancy.md +4 -4
  106. package/.docs/reference/evals/bias.md +3 -3
  107. package/.docs/reference/evals/checks.md +3 -3
  108. package/.docs/reference/evals/completeness.md +5 -5
  109. package/.docs/reference/evals/content-similarity.md +5 -5
  110. package/.docs/reference/evals/context-precision.md +2 -2
  111. package/.docs/reference/evals/context-recall.md +8 -8
  112. package/.docs/reference/evals/context-relevance.md +4 -4
  113. package/.docs/reference/evals/create-scorer.md +1 -1
  114. package/.docs/reference/evals/faithfulness.md +3 -3
  115. package/.docs/reference/evals/filter-run.md +2 -2
  116. package/.docs/reference/evals/hallucination.md +6 -6
  117. package/.docs/reference/evals/keyword-coverage.md +6 -6
  118. package/.docs/reference/evals/mastra-scorer.md +2 -2
  119. package/.docs/reference/evals/noise-sensitivity.md +5 -5
  120. package/.docs/reference/evals/prompt-alignment.md +5 -5
  121. package/.docs/reference/evals/rubric.md +1 -1
  122. package/.docs/reference/evals/run-evals.md +3 -3
  123. package/.docs/reference/evals/scorer-utils.md +4 -4
  124. package/.docs/reference/evals/textual-difference.md +4 -4
  125. package/.docs/reference/evals/tool-call-accuracy.md +1 -1
  126. package/.docs/reference/evals/toxicity.md +4 -4
  127. package/.docs/reference/evals/trajectory-accuracy.md +10 -10
  128. package/.docs/reference/file-based-agents/instructions.md +2 -2
  129. package/.docs/reference/file-based-agents/logger.md +1 -1
  130. package/.docs/reference/file-based-agents/observability.md +1 -1
  131. package/.docs/reference/file-based-agents/processors.md +1 -1
  132. package/.docs/reference/file-based-agents/skills.md +1 -1
  133. package/.docs/reference/file-based-agents/storage.md +1 -1
  134. package/.docs/reference/file-based-agents/studio.md +1 -1
  135. package/.docs/reference/file-based-agents/subagents.md +1 -1
  136. package/.docs/reference/file-based-agents/tools.md +1 -1
  137. package/.docs/reference/file-based-agents/workspace.md +1 -1
  138. package/.docs/reference/logging/pino-logger.md +3 -3
  139. package/.docs/reference/memory/clone-utilities.md +1 -1
  140. package/.docs/reference/memory/cloneThread.md +3 -3
  141. package/.docs/reference/memory/listThreads.md +1 -1
  142. package/.docs/reference/memory/memory-class.md +1 -1
  143. package/.docs/reference/memory/observational-memory.md +11 -11
  144. package/.docs/reference/memory/recall.md +2 -2
  145. package/.docs/reference/memory/serialized-memory-config.md +4 -4
  146. package/.docs/reference/memory/summarizeConversation.md +3 -3
  147. package/.docs/reference/memory/summarizeThread.md +3 -3
  148. package/.docs/reference/observability/feedback.md +1 -1
  149. package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
  150. package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
  151. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
  152. package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
  153. package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
  154. package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
  155. package/.docs/reference/observability/tracing/interfaces.md +1 -1
  156. package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
  157. package/.docs/reference/observability/tracing/span-filtering.md +1 -1
  158. package/.docs/reference/processors/cost-guard-processor.md +1 -1
  159. package/.docs/reference/processors/pii-detector.md +1 -1
  160. package/.docs/reference/processors/processor-interface.md +12 -12
  161. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  162. package/.docs/reference/processors/provider-history-compat.md +1 -1
  163. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  164. package/.docs/reference/processors/response-cache.md +8 -8
  165. package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
  166. package/.docs/reference/processors/token-limiter-processor.md +1 -1
  167. package/.docs/reference/processors/tool-search-processor.md +7 -7
  168. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  169. package/.docs/reference/project-structure.md +1 -1
  170. package/.docs/reference/pubsub/base.md +4 -4
  171. package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
  172. package/.docs/reference/pubsub/lease-provider.md +4 -4
  173. package/.docs/reference/pubsub/redis-streams.md +1 -1
  174. package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
  175. package/.docs/reference/rag/chunk.md +5 -5
  176. package/.docs/reference/rag/database-config.md +2 -2
  177. package/.docs/reference/rag/metadata-filters.md +2 -2
  178. package/.docs/reference/schedules/overview.md +1 -1
  179. package/.docs/reference/server/register-api-route.md +1 -1
  180. package/.docs/reference/server/routes.md +1 -1
  181. package/.docs/reference/signals/signal-provider.md +8 -8
  182. package/.docs/reference/storage/clickhouse.md +4 -4
  183. package/.docs/reference/storage/cloudflare-d1.md +4 -4
  184. package/.docs/reference/storage/convex.md +4 -4
  185. package/.docs/reference/storage/dsql.md +2 -2
  186. package/.docs/reference/storage/dynamodb.md +7 -7
  187. package/.docs/reference/storage/lance.md +1 -1
  188. package/.docs/reference/storage/mongodb.md +1 -1
  189. package/.docs/reference/storage/mssql.md +1 -1
  190. package/.docs/reference/storage/postgresql.md +1 -1
  191. package/.docs/reference/storage/retention.md +33 -33
  192. package/.docs/reference/storage/spanner.md +8 -8
  193. package/.docs/reference/streaming/ChunkType.md +2 -2
  194. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  195. package/.docs/reference/streaming/agents/stream.md +1 -1
  196. package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
  197. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  198. package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
  199. package/.docs/reference/streaming/workflows/stream.md +1 -1
  200. package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
  201. package/.docs/reference/templates/overview.md +1 -1
  202. package/.docs/reference/tools/brightdata.md +1 -1
  203. package/.docs/reference/tools/create-tool.md +1 -1
  204. package/.docs/reference/tools/graph-rag-tool.md +1 -1
  205. package/.docs/reference/tools/mcp-client.md +13 -13
  206. package/.docs/reference/tools/mcp-server.md +20 -20
  207. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  208. package/.docs/reference/tools/tavily.md +1 -1
  209. package/.docs/reference/tools/vector-query-tool.md +4 -4
  210. package/.docs/reference/vectors/astra.md +1 -1
  211. package/.docs/reference/vectors/chroma.md +2 -2
  212. package/.docs/reference/vectors/convex.md +2 -2
  213. package/.docs/reference/vectors/couchbase.md +4 -4
  214. package/.docs/reference/vectors/libsql.md +1 -1
  215. package/.docs/reference/vectors/mongodb.md +1 -1
  216. package/.docs/reference/vectors/pg.md +4 -4
  217. package/.docs/reference/vectors/qdrant.md +2 -2
  218. package/.docs/reference/vectors/s3vectors.md +4 -4
  219. package/.docs/reference/vectors/turbopuffer.md +1 -1
  220. package/.docs/reference/voice/aws-nova-sonic.md +1 -1
  221. package/.docs/reference/voice/azure.md +1 -1
  222. package/.docs/reference/voice/google-gemini-live.md +4 -4
  223. package/.docs/reference/voice/inworld-realtime.md +7 -7
  224. package/.docs/reference/voice/livekit.md +13 -13
  225. package/.docs/reference/voice/mistral.md +1 -1
  226. package/.docs/reference/voice/openai-realtime.md +1 -1
  227. package/.docs/reference/voice/sarvam.md +1 -1
  228. package/.docs/reference/voice/voice.addTools.md +1 -1
  229. package/.docs/reference/voice/voice.events.md +1 -1
  230. package/.docs/reference/voice/voice.getSpeakers.md +2 -2
  231. package/.docs/reference/voice/voice.on.md +2 -2
  232. package/.docs/reference/voice/xai-realtime.md +2 -2
  233. package/.docs/reference/workflows/run-methods/cancel.md +1 -1
  234. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  235. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
  236. package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
  237. package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
  238. package/.docs/reference/workflows/workflow-state-reader.md +2 -2
  239. package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
  240. package/.docs/reference/workspace/daytona-sandbox.md +3 -3
  241. package/.docs/reference/workspace/docker-sandbox.md +2 -2
  242. package/.docs/reference/workspace/e2b-sandbox.md +2 -2
  243. package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
  244. package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
  245. package/.docs/reference/workspace/local-filesystem.md +2 -2
  246. package/.docs/reference/workspace/local-sandbox.md +2 -2
  247. package/.docs/reference/workspace/modal-sandbox.md +1 -1
  248. package/.docs/reference/workspace/platform-filesystem.md +3 -3
  249. package/.docs/reference/workspace/platform-sandbox.md +2 -2
  250. package/.docs/reference/workspace/process-manager.md +1 -1
  251. package/.docs/reference/workspace/railway-sandbox.md +4 -4
  252. package/.docs/reference/workspace/s3-filesystem.md +1 -1
  253. package/.docs/reference/workspace/sandbox.md +1 -1
  254. package/.docs/reference/workspace/vercel-sandbox.md +1 -1
  255. package/.docs/reference/workspace/workspace-class.md +10 -10
  256. package/CHANGELOG.md +7 -0
  257. package/package.json +5 -5
@@ -65,6 +65,31 @@ export const weatherAgent = new Agent({
65
65
  })
66
66
  ```
67
67
 
68
+ ## Use provider web search
69
+
70
+ Import `webSearchTool` from `@mastra/core/tools` when you want the model provider to run its native web search tool. The tool has no local `execute` function. Mastra resolves it at run time from the active model, then passes the provider-managed tool to the model.
71
+
72
+ ```typescript
73
+ import { Agent } from '@mastra/core/agent'
74
+ import { webSearchTool } from '@mastra/core/tools'
75
+
76
+ export const researchAgent = new Agent({
77
+ id: 'research-agent',
78
+ name: 'Research Agent',
79
+ instructions: `
80
+ You are a helpful research assistant.
81
+ Use web search when you need current information.`,
82
+ model: 'openai/gpt-5.5',
83
+ tools: {
84
+ webSearch: webSearchTool,
85
+ },
86
+ })
87
+ ```
88
+
89
+ `webSearchTool` supports OpenAI, Anthropic, Google Gemini, and xAI models. If Mastra can't infer one of those providers from the active model, the agent run fails with a `MastraError`.
90
+
91
+ Only the `webSearchTool` value triggers provider web search. A custom tool named `webSearch` or `web_search` stays unchanged.
92
+
68
93
  ## Define schemas
69
94
 
70
95
  You can define the tool's `inputSchema` and `outputSchema` with any library that supports [Standard JSON Schema](https://standardschema.dev/json-schema). This includes libraries like [Zod](https://zod.dev/), [Valibot](https://valibot.dev/), and [ArkType](https://arktype.io/).
@@ -44,7 +44,7 @@ You're now ready to follow the integration guides and recipes below!
44
44
 
45
45
  ## Integration guides
46
46
 
47
- Typically, you'll set up API routes that stream Mastra content in AI SDK-compatible format, and then use those routes in AI SDK UI hooks like `useChat()`. Below you'll find two main approaches to achieve this:
47
+ Typically, you'll set up API routes that stream Mastra content in AI SDK-compatible format, and then use those routes in AI SDK UI hooks like `useChat()`. Choose one of these approaches:
48
48
 
49
49
  - [Mastra's server](#mastras-server)
50
50
  - [Framework-agnostic](#framework-agnostic)
@@ -298,7 +298,7 @@ export default function Page() {
298
298
  }
299
299
  ```
300
300
 
301
- Below are two approaches to implementing the backend:
301
+ Choose a backend implementation:
302
302
 
303
303
  **Mastra Server**:
304
304
 
@@ -380,7 +380,7 @@ export async function POST(req: Request) {
380
380
 
381
381
  ## Custom UI
382
382
 
383
- Custom UI (also known as Generative UI) allows you to render custom React components based on data streamed from Mastra. Instead of displaying raw text or JSON, you can create visual components for tool outputs, workflow progress, agent network execution, and custom events.
383
+ Custom UI (also known as Generative UI) allows you to render custom React components based on data streamed from Mastra. Instead of displaying raw text or JSON, you can create visual components for tool outputs and workflow progress, including agent network execution and custom events.
384
384
 
385
385
  Use Custom UI when you want to:
386
386
 
@@ -990,7 +990,7 @@ export function ChatAdditional() {
990
990
  }
991
991
  ```
992
992
 
993
- Two examples on how to implement the backend portion of it.
993
+ Implement the backend with either of these examples.
994
994
 
995
995
  **Mastra Server**:
996
996
 
@@ -1545,7 +1545,7 @@ For a complete implementation, see the [workflow-agent-text-stream example](http
1545
1545
 
1546
1546
  ### Multi-stage progress with branching workflows
1547
1547
 
1548
- For workflows with conditional branching (e.g., express vs standard shipping), you can track progress across different branches by including a identifier in your custom events.
1548
+ For workflows with conditional branching (e.g., express vs standard delivery), you can track progress across different branches by including an identifier in your custom events.
1549
1549
 
1550
1550
  The UI Dojo example uses a `stage` field in the event data to identify which branch is executing (e.g., `"validation"`, `"standard-processing"`, `"express-processing"`). The frontend groups events by this field to show a pipeline-style progress UI.
1551
1551
 
@@ -2,23 +2,23 @@
2
2
 
3
3
  # CopilotKit generative UI
4
4
 
5
- Generative UI is the family of UI paradigms enabled by agents and useful for interacting with them. CopilotKit organizes these along a single axis, the **generative UI spectrum**, which runs from author-controlled (you decide every pixel) to agent-invented (the agent owns the rendered surface). Where you sit on the axis is a trade-off between predictability and breadth.
5
+ Generative UI describes interfaces that agents help create and that users can interact with. CopilotKit organizes these interfaces along a single axis, the **generative UI spectrum**, which runs from author-controlled (you decide every pixel) to agent-invented (the agent owns the rendered surface). Your position on the axis is a trade-off between predictability and breadth.
6
6
 
7
7
  The spectrum has three tiers:
8
8
 
9
9
  | Tier | Who controls the surface | Primitives |
10
10
  | --------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
11
- | **Controlled** | You wrote the component; the agent picks which one and what data to pass. | Tool call rendering, state rendering, reasoning, components as tools |
12
- | **Declarative** | The agent emits a structured spec; the frontend composes it from a catalog you registered. | A2UI (fixed schema and dynamic) |
11
+ | **Controlled** | You wrote the component. The agent picks which one to use and what data to pass. | Tool call rendering, state rendering, reasoning, components as tools |
12
+ | **Declarative** | The agent emits a structured spec. The frontend composes it from a catalog you registered. | A2UI (fixed-schema and flexible variants) |
13
13
  | **Open-ended** | The UI is invented elsewhere (an MCP server) and you sandbox it. | MCP Apps |
14
14
 
15
15
  Each tier is a Mastra agent exposed through `registerCopilotKit()` (see [CopilotKit overview](https://mastra.ai/guides/build-your-ui/copilotkit/overview)) plus the matching CopilotKit hook on the frontend. For the full concept, see CopilotKit's [generative UI spectrum](https://www.copilotkit.ai/generative-ui-spectrum) and [generative UI overview](https://docs.copilotkit.ai/concepts/generative-ui-overview).
16
16
 
17
- > **Tip:** Mastra's [UI Dojo](https://ui-dojo.mastra.ai/) has working CopilotKit examples; browse the source under `src/pages/copilot-kit`.
17
+ > **Tip:** Mastra's [UI Dojo](https://ui-dojo.mastra.ai/) has working CopilotKit examples. Browse the source under `src/pages/copilot-kit`.
18
18
 
19
19
  ## Controlled
20
20
 
21
- You ship a fixed set of components and the agent chooses which to render, with what data. This is the workhorse of the spectrum: predictable and brand-safe, the right tool for high-traffic surfaces. The Controlled primitives use CopilotKit's v2 API, imported from `@copilotkit/react-core/v2`.
21
+ You provide a fixed set of components. The agent chooses which component to render and supplies its data. This predictable, brand-safe approach works well for high-traffic surfaces. The Controlled primitives use CopilotKit's v2 API, imported from `@copilotkit/react-core/v2`.
22
22
 
23
23
  ### Tool call rendering
24
24
 
@@ -125,7 +125,7 @@ Reasoning is zero-config: when your Mastra agent runs a reasoning-capable model,
125
125
 
126
126
  ## Declarative
127
127
 
128
- Instead of a fixed component per tool, you register a catalog of typed building blocks and the agent assembles them into a UI tree per request. CopilotKit calls this **A2UI** (Agent-to-UI), available in a fixed-schema and a dynamic variant. It suits the long tail of secondary interactions where breadth matters more than pixel-perfection.
128
+ Instead of a fixed component per tool, you register a catalog of typed building blocks and the agent assembles them into a UI tree per request. CopilotKit calls this **A2UI** (Agent-to-UI), which has fixed-schema and flexible variants. It suits the long tail of secondary interactions where breadth matters more than pixel-perfection.
129
129
 
130
130
  The path of least resistance is to pass your catalog to the `<CopilotKit>` provider. That single prop enables A2UI rendering and injects the A2UI tool into your agent, so no backend change is needed:
131
131
 
@@ -146,11 +146,11 @@ export default function Page() {
146
146
  }
147
147
  ```
148
148
 
149
- The catalog defines the primitives (their schemas) and the renderers (how each primitive displays). In the fixed-schema variant the components are pre-authored and the agent's tool only supplies data; the dynamic variant lets the agent compose the tree more freely. See CopilotKit's [A2UI documentation](https://docs.copilotkit.ai/a2a/generative-ui/a2ui).
149
+ The catalog defines the primitives (their schemas) and the renderers (how each primitive displays). In the fixed-schema variant, the components are pre-authored and the agent's tool only supplies data. The flexible variant lets the agent compose the tree more freely. See CopilotKit's [A2UI documentation](https://docs.copilotkit.ai/a2a/generative-ui/a2ui).
150
150
 
151
151
  ## Open-ended
152
152
 
153
- At the far end of the spectrum, the agent owns the entire surface: the UI is invented elsewhere and sandboxed in your app. CopilotKit supports this through **MCP Apps**, where an MCP server ships UI that renders inside your application. This tier trades determinism for novelty and is the most experimental point on the spectrum.
153
+ At the far end of the spectrum, the agent owns the entire surface: the UI is invented elsewhere and sandboxed in your app. CopilotKit supports this through **MCP Apps**, where an MCP server provides UI that renders inside your application. This tier trades determinism for novelty and is the most experimental point on the spectrum.
154
154
 
155
155
  The path of least resistance keeps the frontend untouched: your existing `<CopilotKit>` provider is enough. On the backend, point `registerCopilotKit()` at one or more MCP servers with the `mcpApps` option (it's forwarded to the CopilotKit runtime):
156
156
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Using CopilotKit
4
4
 
5
- [CopilotKit](https://www.copilotkit.ai/) provides React components to quickly integrate customizable AI copilots into your application. Combined with Mastra, you can build sophisticated AI apps featuring bidirectional state synchronization and interactive UIs.
5
+ [CopilotKit](https://www.copilotkit.ai/) provides React components to quickly integrate customizable AI copilots into your application. Combined with Mastra, you can build AI apps with bidirectional state synchronization and interactive UIs.
6
6
 
7
7
  CopilotKit talks to Mastra through the [AG-UI protocol](https://docs.ag-ui.com/). The `@ag-ui/mastra` package exposes your Mastra agents as an AG-UI endpoint, and CopilotKit's React hooks and components consume it. This unlocks a spectrum of experiences on top of ordinary chat: [generative UI, human-in-the-loop, and frontend tools](https://mastra.ai/guides/build-your-ui/copilotkit/generative-ui), plus deploying the same agent to [messaging channels like Slack](https://mastra.ai/guides/build-your-ui/copilotkit/channels).
8
8
 
@@ -266,7 +266,7 @@ Your CopilotKit frontend now communicates with a standalone Mastra agent server.
266
266
 
267
267
  ## Chat UI options
268
268
 
269
- `CopilotChat` renders an inline, full-height chat. CopilotKit ships two other drop-in surfaces that share the same props:
269
+ `CopilotChat` renders an inline, full-height chat. CopilotKit provides two other drop-in surfaces that share the same props:
270
270
 
271
271
  - `CopilotSidebar`: a collapsible panel docked to the side of your app.
272
272
  - `CopilotPopup`: a floating button that opens a chat window.
@@ -253,7 +253,7 @@ OpenUI generates UI from a component library. The library defines which componen
253
253
 
254
254
  ### Built-in libraries
255
255
 
256
- `@openuidev/react-ui` ships two libraries you can use as-is:
256
+ `@openuidev/react-ui` provides two libraries you can use as-is:
257
257
 
258
258
  - `openuiChatLibrary`: components for chat interfaces (cards, forms, tables, charts).
259
259
  - `openuiDashboardLibrary`: components for dashboards and data-heavy surfaces.
@@ -4,7 +4,7 @@
4
4
 
5
5
  A multi-agent system distributes a task across multiple agents instead of asking one agent to do everything. In Mastra, this usually means combining agents, workflows, or both so each part of the system has a clear role.
6
6
 
7
- The goal is to assign the right context, tools, and responsibilities to the right component. When that split is clear, a multi-agent system can be easier to reason about than one agent with a long prompt, many tools, and too many responsibilities.
7
+ The goal is to assign the right context, tools, and responsibilities to the right component. When that split is clear, a multi-agent system can be easier to reason about than one agent burdened with a long prompt and too many tools or responsibilities.
8
8
 
9
9
  ## When to use multi-agent systems
10
10
 
@@ -34,9 +34,9 @@ In Mastra, implement this pattern by combining [agents](https://mastra.ai/docs/a
34
34
 
35
35
  A workflow pattern defines the execution path in code. Instead of asking an agent to decide what happens next, you define the sequence through steps, branches, loops, and parallel blocks.
36
36
 
37
- Use workflows when the task is well understood and the execution path is known in advance. The main advantage is predictability: The system is easier to debug, reason about, and audit because the structure is explicit. The tradeoff is flexibility, since workflows are less adaptive when the task changes as it unfolds.
37
+ Use workflows when the task is well understood and the execution path is known in advance. The main advantage is predictability: The explicit structure makes the system easier to debug and audit. The tradeoff is flexibility, since workflows are less adaptive when the task changes as it unfolds.
38
38
 
39
- In Mastra, [workflows](https://mastra.ai/docs/workflows/overview) can implement several coordination patterns, including handoffs and councils. What makes a workflow distinct isn't which agents it calls, but that the control logic lives in the workflow itself.
39
+ In Mastra, [workflows](https://mastra.ai/docs/workflows/overview) can implement coordination patterns such as handoffs and councils. A workflow is distinct because its control logic lives in the workflow itself, regardless of which agents it calls.
40
40
 
41
41
  ## Supervisors
42
42
 
@@ -54,7 +54,7 @@ A council pattern asks multiple agents to work on the same problem independently
54
54
 
55
55
  Use this pattern when the question is ambiguous, evaluative, or high-stakes and answer quality matters more than speed. The tradeoff is cost, since councils intentionally duplicate effort and usually take longer and use more tokens than other patterns.
56
56
 
57
- Mastra doesn't provide a dedicated council primitive. In Mastra, implement this pattern with [agents](https://mastra.ai/docs/agents/overview) and [workflows](https://mastra.ai/docs/workflows/overview): Run multiple agents in parallel, collect their outputs, and add a final synthesis or review step. Workflow control flow methods such as `.parallel()` provide the structure for this pattern.
57
+ Mastra doesn't provide a dedicated council primitive. In Mastra, implement this pattern with [agents](https://mastra.ai/docs/agents/overview) and [workflows](https://mastra.ai/docs/workflows/overview): Run multiple agents in parallel and collect their outputs. Then add a final synthesis or review step. Workflow control flow methods such as `.parallel()` provide the structure for this pattern.
58
58
 
59
59
  ## Choosing a pattern
60
60
 
@@ -64,7 +64,7 @@ These patterns differ mainly in how they distribute control:
64
64
  | ----------------- | -------------------- | ------------------------------------------------ | -------------------------------------------------------- | -------------------------------------------------------------------- |
65
65
  | Handoffs | Current specialist | Ownership should move between specialists | Context transfer becomes more important | Agents with workflows and memory |
66
66
  | Workflows | Execution graph | The path is known in advance | Less adaptive when the task changes | [Workflows](https://mastra.ai/docs/workflows/overview) |
67
- | Supervisor agents | One lead agent | The task needs dynamic delegation | Results depend on good coordination and clear boundaries | [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents) |
67
+ | Supervisor agents | One lead agent | Delegation must adapt during execution | Results depend on good coordination and clear boundaries | [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents) |
68
68
  | Council | Final synthesis step | The task needs multiple independent perspectives | Higher cost and latency | Agents with workflow parallelism |
69
69
 
70
70
  In practice, these patterns are often combined:
@@ -46,7 +46,7 @@ Here are some questions to consider:
46
46
 
47
47
  ### Agent stream properties
48
48
 
49
- An agent stream provides access to various response properties:
49
+ An agent stream provides access to these response properties:
50
50
 
51
51
  - **`stream.textStream`**: A readable stream that emits text chunks.
52
52
  - **`stream.text`**: Promise that resolves to the full text response.
@@ -124,13 +124,13 @@ The event structure includes `runId` and `from` at the top level, making it easi
124
124
 
125
125
  ### Workflow stream properties
126
126
 
127
- A workflow stream provides access to various response properties:
127
+ A workflow stream provides access to these response properties:
128
128
 
129
129
  - **`stream.status`**: The status of the workflow run.
130
130
  - **`stream.result`**: The result of the workflow run.
131
131
  - **`stream.usage`**: The total token usage of the workflow run.
132
132
 
133
- Streaming from agents or workflows provides real-time visibility into either the LLM’s output or the status of a workflow run. This feedback can be passed directly to the user, or used within applications to handle workflow status more effectively, creating a smoother and more responsive experience.
133
+ Streaming from agents or workflows provides real-time visibility into either the LLM’s output or the status of a workflow run. Pass this feedback directly to the user, or use it in an application to display workflow status as it changes.
134
134
 
135
135
  Events emitted from agents or workflows represent different stages of generation and execution, such as when a run starts, when text is produced, or when a tool is invoked.
136
136
 
@@ -193,11 +193,11 @@ Below is an example of events that may be emitted. Each event always includes a
193
193
 
194
194
  ## Writer API
195
195
 
196
- The `writer` API is shared by tools and workflow steps see the Tools and Workflows docs for feature-specific examples.
196
+ The `writer` API is shared by tools and workflow steps. See the Tools and Workflows docs for feature-specific examples.
197
197
 
198
198
  ## Agent using tool
199
199
 
200
- Agent streaming can be combined with tool calls, allowing tool outputs to be written directly into the agent’s streaming response. This makes it possible to surface tool activity as part of the overall interaction.
200
+ Agent streaming can be combined with tool calls, allowing tool outputs to be written directly into the agent’s streaming response. This surfaces tool activity as part of the interaction.
201
201
 
202
202
  ```typescript
203
203
  import { Agent } from '@mastra/core/agent'
@@ -214,7 +214,7 @@ export const testAgent = new Agent({
214
214
 
215
215
  ### Using `context.writer`
216
216
 
217
- The `context.writer` object is available in a tool's `execute()` function and can be used to emit custom events, data, or values into the active stream. This enables tools to provide intermediate results or status updates while execution is still in progress.
217
+ The `context.writer` object is available in a tool's `execute()` function and can emit custom events, data, or values into the active stream. Tools use these events to provide intermediate results or status updates during execution.
218
218
 
219
219
  > **Warning:** You must `await` the call to `writer.write()` or else you will lock the stream and get a `WritableStream is locked` error.
220
220
 
@@ -274,7 +274,7 @@ export const testTool = createTool({
274
274
 
275
275
  ### Transient data chunks
276
276
 
277
- By default, `data-*` chunks emitted with `writer.custom()` are persisted to storage as part of the message history. For chunks that are only needed during live streaming such as progress updates or verbose log output set `transient: true` to skip storage persistence. Transient chunks are still streamed to the client in real time but aren't saved to the database.
277
+ By default, `data-*` chunks emitted with `writer.custom()` are persisted to storage as part of the message history. For chunks that are only needed during live streaming, such as progress updates or verbose log output, set `transient: true` to skip storage persistence. Transient chunks are still streamed to the client in real time but aren't saved to the database.
278
278
 
279
279
  ```typescript
280
280
  await context?.writer?.custom({
@@ -284,11 +284,11 @@ await context?.writer?.custom({
284
284
  })
285
285
  ```
286
286
 
287
- Use transient chunks when the data is large or high-frequency and only relevant during the live session. After a page refresh, transient chunks are no longer available only the tool's return value and any non-transient chunks are loaded from storage.
287
+ Use transient chunks when the data is large or high-frequency and only relevant during the live session. After a page refresh, transient chunks are no longer available. Only the tool's return value and any non-transient chunks are loaded from storage.
288
288
 
289
289
  ## Using the `writer` argument
290
290
 
291
- The `writer` argument is passed to a workflow step's `execute` function and can be used to emit custom events, data, or values into the active stream. This enables workflow steps to provide intermediate results or status updates while execution is still in progress.
291
+ The `writer` argument is passed to a workflow step's `execute` function and can emit custom events, data, or values into the active stream. Workflow steps use these events to provide intermediate results or status updates during execution.
292
292
 
293
293
  > **Warning:** You must `await` the call to `writer.write(...)` or else you will lock the stream and get a `WritableStream is locked` error.
294
294
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Deploy Mastra to Amazon EC2
4
4
 
5
- Deploy your Mastra server to Amazon EC2. This gives you full control over your server environment and supports long-running agents and workflows.
5
+ Deploy your Mastra server to Amazon EC2. The server runs on infrastructure you manage and can support long-running agents and workflows.
6
6
 
7
7
  > **Info:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/mastra-server). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
8
8
 
@@ -12,7 +12,7 @@ You'll need:
12
12
 
13
13
  - A [Mastra application](https://mastra.ai/guides/getting-started/quickstart)
14
14
  - An [AWS account](https://aws.amazon.com/) with permissions for Lambda, ECR, and IAM
15
- - **[AWS CLI](https://aws.amazon.com/cli/)** installed run `aws configure` to authenticate
15
+ - **[AWS CLI](https://aws.amazon.com/cli/)** installed: Run `aws configure` to authenticate
16
16
  - **[Docker](https://www.docker.com/)** installed and running
17
17
 
18
18
  > **Warning:** On AWS Lambda, the filesystem is ephemeral, so any local database file will be lost between invocations. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a local file, configure it to use a remote LibSQL-compatible database (for example, [Turso](https://turso.tech/)) instead.
@@ -71,7 +71,7 @@ In these steps, you'll connect your Azure App Service to your GitHub repository
71
71
  run: (cd .mastra/output && zip ../../release.zip -r .)
72
72
  ```
73
73
 
74
- This ensures only the build outputs from `.mastra/output` are included in the deployment package.
74
+ The deployment package then contains only the build outputs from `.mastra/output`.
75
75
 
76
76
  5. Commit and push your workflow modifications. The build will be automatically triggered in the **Deployment Center** in your Azure dashboard. Monitor the deployment progress until it completes successfully.
77
77
 
@@ -56,7 +56,7 @@ export const mastra = new Mastra({
56
56
  })
57
57
  ```
58
58
 
59
- In order to test your Cloudflare Worker locally, also install the [`wrangler` CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/):
59
+ To test your Cloudflare Worker locally, also install the [`wrangler` CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/):
60
60
 
61
61
  **npm**:
62
62
 
@@ -8,11 +8,11 @@ For a complete example with advanced flow control features, see the [Inngest wor
8
8
 
9
9
  ## How Inngest works with Mastra
10
10
 
11
- Inngest and Mastra integrate by aligning their workflow models: Inngest organizes logic into functions composed of steps, and Mastra workflows defined using `createWorkflow()` and `createStep()` map directly onto this paradigm. Each Mastra workflow becomes an Inngest function with a unique identifier, and each step within the workflow maps to an Inngest step.
11
+ Inngest and Mastra integrate by aligning their workflow models: Inngest organizes logic into functions composed of steps, and Mastra workflows defined using `createWorkflow()` and `createStep()` map directly onto this structure. Each Mastra workflow becomes an Inngest function with a unique identifier, and each step within the workflow maps to an Inngest step.
12
12
 
13
13
  The `serve()` function bridges the two systems by registering Mastra workflows as Inngest functions and setting up the necessary event handlers for execution and monitoring.
14
14
 
15
- When an event triggers a workflow, Inngest executes it step by step, memoizing each step's result. This means if a workflow is retried or resumed, completed steps are skipped, ensuring efficient and reliable execution. Control flow primitives in Mastra, such as loops, conditionals, and nested workflows are seamlessly translated into the same Inngest's function/step model, preserving advanced workflow features like composition, branching, and suspension.
15
+ When an event triggers a workflow, Inngest executes it step by step and memoizes each result. On retry or resume, Inngest skips completed steps based on those saved results. Mastra control flow primitives, such as loops, conditionals, and nested workflows, map to the same Inngest function and step model while preserving composition, branching, and suspension.
16
16
 
17
17
  Real-time monitoring, suspend/resume, and step-level observability are enabled via Inngest's publish-subscribe system and dashboard. As each step executes, its state and output are tracked using Mastra storage and can be resumed as needed.
18
18
 
@@ -194,7 +194,7 @@ export const mastra = new Mastra({
194
194
 
195
195
  3. Open the Inngest Dashboard at <http://localhost:8288> and go to the **Apps** section in the sidebar to verify your Mastra workflow is registered
196
196
 
197
- 4. Invoke the workflow by going to **Functions**, selecting your workflow, and selecting **Invoke** with the following input:
197
+ 4. In **Functions**, open your workflow. Select **Invoke** and provide the following input:
198
198
 
199
199
  ```json
200
200
  {
@@ -256,7 +256,7 @@ Before you begin, make sure you have:
256
256
 
257
257
  > **Warning:** Inngest's auto-discover convention assumes `/api/inngest`. Because this guide uses `/inngest/api`, set the **URL** field on the Inngest app to your deployed origin plus `/inngest/api` (for example `https://your-app.vercel.app/inngest/api`). If you leave it on the default, the Inngest dashboard won't find your app's functions.
258
258
 
259
- 6. Invoke the workflow by going to **Functions**, selecting `workflow.increment-workflow`, selecting **All actions** > **Invoke**, and providing the following input:
259
+ 6. In **Functions**, open `workflow.increment-workflow`. Select **All actions** > **Invoke** and provide the following input:
260
260
 
261
261
  ```json
262
262
  {
@@ -496,7 +496,7 @@ When migrating an existing production app from `serve()` to `connect()`, test th
496
496
  - `functions`: Optional array of additional Inngest functions to register alongside Mastra workflows.
497
497
  - `instanceId`: Stable identifier for the worker, shown in the Inngest dashboard. Defaults to the machine hostname.
498
498
  - `maxWorkerConcurrency`: Maximum number of steps the worker runs at a time. Defaults to unlimited.
499
- - `registerOptions`: Forwarded to Inngest during app registration (for example `signingKey`). When a field is set both here and at the top level, `registerOptions` wins this matches the behavior of `serve()`.
499
+ - `registerOptions`: Forwarded to Inngest during app registration (for example `signingKey`). When a field is set both here and at the top level, `registerOptions` wins. This matches the behavior of `serve()`.
500
500
 
501
501
  `connect()` returns Inngest's `WorkerConnection`. The Inngest SDK handles `SIGINT` and `SIGTERM` by default. Store the returned connection and call `.close()` only when your worker needs custom shutdown control.
502
502
 
@@ -663,7 +663,7 @@ All flow control options are optional. If not specified, workflows run with Inng
663
663
 
664
664
  ## Cron scheduling
665
665
 
666
- Inngest workflows can be automatically triggered on a schedule using cron expressions. This allows you to run workflows at regular intervals, such as daily reports, hourly data syncs, or maintenance tasks.
666
+ Use cron expressions to trigger Inngest workflows on a schedule. Common uses include daily reports and hourly data syncs, as well as maintenance tasks.
667
667
 
668
668
  ### Basic cron scheduling
669
669
 
@@ -171,7 +171,7 @@ await worker.run()
171
171
 
172
172
  2. Open the Temporal UI at <http://localhost:8080> to inspect namespaces, workflows, and activities.
173
173
 
174
- 3. Start the worker. In a new terminal, run:
174
+ 3. In a new terminal, start the worker by running:
175
175
 
176
176
  ```bash
177
177
  npx tsx src/mastra/worker.ts
@@ -84,7 +84,7 @@ export const mastra = new Mastra({
84
84
  })
85
85
  ```
86
86
 
87
- After deploying, Studio is available at the root URL (`https://<your-project>.vercel.app/`) and the API remains at `/api/*`. Studio automatically connects to the API on the same origin no additional environment variables are needed.
87
+ After deploying, Studio is available at the root URL (`https://<your-project>.vercel.app/`) and the API remains at `/api/*`. Studio automatically connects to the API on the same origin, so you don't need additional environment variables.
88
88
 
89
89
  > **Warning:** Once Studio is connected to your Mastra server, it has full access to your agents, workflows, and tools. Be sure to secure it properly in production (e.g. behind authentication, VPN, etc.) to prevent unauthorized access.
90
90
 
@@ -74,7 +74,7 @@ export default defineConfig({
74
74
  })
75
75
  ```
76
76
 
77
- Lastly, edit the `tsconfig.json` to resolve paths:
77
+ Edit the `tsconfig.json` to resolve paths:
78
78
 
79
79
  ```jsonc
80
80
  {
@@ -432,7 +432,7 @@ This connects [`useChat()`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat
432
432
 
433
433
  ## Test your agent
434
434
 
435
- In order to test your agent with the chat interface, you need to run both the Mastra server and the Electron app.
435
+ To test your agent with the chat interface, run both the Mastra server and the Electron app.
436
436
 
437
437
  1. Start the mastra development server:
438
438
 
@@ -199,11 +199,11 @@ export class AgentService {
199
199
 
200
200
  `MastraService` exposes:
201
201
 
202
- - `getMastra()` returns the underlying `Mastra` instance
203
- - `getAgent(id)` shorthand for `mastra.getAgent(id)`
204
- - `getWorkflow(id)` shorthand for `mastra.getWorkflow(id)`
205
- - `getOptions()` returns the module configuration
206
- - `isShuttingDown` `true` after graceful shutdown begins
202
+ - `getMastra()`: Returns the underlying `Mastra` instance
203
+ - `getAgent(id)`: Shorthand for `mastra.getAgent(id)`
204
+ - `getWorkflow(id)`: Shorthand for `mastra.getWorkflow(id)`
205
+ - `getOptions()`: Returns the module configuration
206
+ - `isShuttingDown`: `true` after graceful shutdown begins
207
207
 
208
208
  ### MASTRA token
209
209
 
@@ -353,7 +353,7 @@ It renders the response text using the [`<MessageResponse>`](https://ai-sdk.dev/
353
353
 
354
354
  ## Test your agent
355
355
 
356
- In order to test your agent with the chat interface, you need to run both the Mastra server and the Vite development server.
356
+ To test your agent with the chat interface, run both the Mastra server and the Vite development server.
357
357
 
358
358
  1. Start the Mastra development server:
359
359
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  In this guide, you'll create a "Chef Assistant" agent that helps users cook meals with available ingredients.
6
6
 
7
- You'll learn how to create the agent and register it with Mastra. Next, you'll interact with the agent through your terminal and get to know different response formats. Lastly, you'll access the agent through Mastra's local API endpoints.
7
+ You'll learn how to create the agent and register it with Mastra. Next, you'll interact with the agent through your terminal and get to know different response formats. You'll then access the agent through Mastra's local API endpoints.
8
8
 
9
9
  ## Prerequisites
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Building a code review bot
4
4
 
5
- In this guide, you'll build a code review bot that automatically reviews pull requests using workspace skills. The bot loads coding standards from skill files and provides structured feedback. You'll learn how to create a workspace with a skills directory, define an [Agent Skill](https://agentskills.io) with review instructions and reference files, and connect it to an agent that performs automated reviews.
5
+ In this guide, you'll build a code review bot that automatically reviews pull requests using workspace skills. The bot loads coding standards from skill files and provides structured feedback. You'll create a workspace with a skills directory and define an [Agent Skill](https://agentskills.io) with review instructions and reference files. Then you'll connect the skill to an agent that performs automated reviews.
6
6
 
7
7
  ## Prerequisites
8
8
 
@@ -146,7 +146,7 @@ Open [Studio](https://mastra.ai/docs/studio/overview), select **Coding Agent**,
146
146
  Inspect project-notes.md and report the project name, status, and owner. Do not modify files.
147
147
  ```
148
148
 
149
- The response should identify the Acme support portal, its development status, and the Platform team without changing the file. Model wording may vary.
149
+ The response should identify the Acme support portal and describe its development status. It should report that the Platform team owns the project and leave the file unchanged. Model wording may vary.
150
150
 
151
151
  ## Create the agent controller
152
152
 
@@ -191,13 +191,13 @@ export async function createCodingAgentSession() {
191
191
  }
192
192
  ```
193
193
 
194
- This example uses one mode and disables the controller's additional built-in tools so the introductory UI can focus on workspace execution. This is a tutorial simplification, not a production recommendation. In a production application, enable the built-in tools your product needs and implement their UI flows: interactive tools such as `ask_user` and `submit_plan` suspend until your interface resumes them, while task and subagent tools have their own lifecycle events. See [tool approvals and suspensions](https://mastra.ai/docs/agent-controller/tool-approvals).
194
+ This example uses one mode and disables the controller's additional built-in tools so the introductory UI can focus on workspace execution. The simplified setup is intended for this tutorial. In a production application, enable the built-in tools your product needs and implement their UI flows: interactive tools such as `ask_user` and `submit_plan` suspend until your interface resumes them, while task and subagent tools have their own lifecycle events. See [tool approvals and suspensions](https://mastra.ai/docs/agent-controller/tool-approvals).
195
195
 
196
196
  The example also omits storage, so the conversation lasts only for the current process. You can add storage later when you want to resume sessions.
197
197
 
198
198
  ## Build the terminal UI
199
199
 
200
- Create `src/coding-agent-tui.ts`. The UI renders assistant message updates, shows tool activity, and asks the user to approve or decline each workspace tool call.
200
+ Create `src/coding-agent-tui.ts`. The UI renders assistant message updates and shows tool activity. It also asks the user to approve or decline each workspace tool call.
201
201
 
202
202
  ```typescript
203
203
  import { pathToFileURL } from 'node:url'
@@ -334,7 +334,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
334
334
  }
335
335
  ```
336
336
 
337
- The optional `Terminal` parameter supports automated tests while using `ProcessTerminal` during normal execution. The UI intentionally renders only the latest response; the `Session` still maintains the conversation context for follow-up prompts.
337
+ The optional `Terminal` parameter supports automated tests while using `ProcessTerminal` during normal execution. The UI intentionally renders only the latest response. The `Session` still maintains the conversation context for follow-up prompts.
338
338
 
339
339
  ## Run the coding agent
340
340
 
@@ -9,7 +9,7 @@ In this guide, you'll build a complete development assistant that combines all w
9
9
  - [Skills](https://mastra.ai/docs/workspace/skills) for coding standards
10
10
  - [Search](https://mastra.ai/docs/workspace/search) for finding examples
11
11
 
12
- You'll set up a workspace with a sample project, add coding standards as a skill, and create an agent that writes code following TDD practices. By the end, you'll have an agent that can read existing code, write new implementations, run tests in a sandbox, and iterate based on results.
12
+ You'll set up a workspace with a sample project and add coding standards as a skill. Then you'll create an agent that writes code following TDD practices. By the end, the agent can read existing code and write new implementations, then run tests in a sandbox and iterate based on the results.
13
13
 
14
14
  ## Prerequisites
15
15
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Building a docs manager
4
4
 
5
- In this guide, you'll build a documentation manager that maintains your project's docs. It creates well-structured markdown files, keeps documentation organized, and prevents accidental overwrites. You'll learn how to set up a workspace filesystem, create an agent with document management instructions, and use it to generate and update documentation through conversational prompts.
5
+ In this guide, you'll build a documentation manager that maintains your project's docs. It creates well-structured markdown files and keeps documentation organized while preventing accidental overwrites. You'll set up a workspace filesystem and create an agent with document management instructions. Then you'll use conversational prompts to generate and update documentation.
6
6
 
7
7
  ## Prerequisites
8
8
 
@@ -40,7 +40,7 @@ Inside the `workspace` directory, create the following folders:
40
40
  - `docs/api/`: For API reference documentation
41
41
  - `docs/tutorials/`: For step-by-step tutorials
42
42
 
43
- Create a `workspace/docs/README.md` file that serves as the documentation index:
43
+ Create `workspace/docs/README.md` as the documentation index:
44
44
 
45
45
  ```markdown
46
46
  # Project Documentation
@@ -217,7 +217,7 @@ Try updating an existing document:
217
217
  Update the getting started guide to include a section on configuration after the Quick Example
218
218
  ```
219
219
 
220
- The agent should read the existing `getting-started.md` file, find the right insertion point, and add the new section without disrupting existing content.
220
+ The agent should read the existing `getting-started.md` file and find the right insertion point. It should add the new section without disrupting existing content.
221
221
 
222
222
  ### Organize documentation
223
223
 
@@ -121,11 +121,11 @@ The agent will return a formatted description with sections in English, Spanish,
121
121
 
122
122
  ## GitHub actions
123
123
 
124
- GitHub Actions run your workflows in short-lived environments on GitHub's infrastructure. Each run starts with a clean virtual machine, checks out your code, installs dependencies, runs your workflow steps, and then shuts down. Nothing persists between runs unless you explicitly save it as an artifact or cache.
124
+ GitHub Actions run your workflows in short-lived environments on GitHub's infrastructure. Each run starts with a clean virtual machine and checks out your code. It installs dependencies before running your workflow steps. The environment shuts down when the run completes. Nothing persists between runs unless you explicitly save it as an artifact or cache.
125
125
 
126
126
  ### Create the workflow
127
127
 
128
- GitHub Actions workflows live in the `.github/workflows` directory. Create a `.github` directory at the root of your project, then create a `workflows` directory inside it. Add a file named `pr-description.yml`.
128
+ GitHub Actions workflows live in the `.github/workflows` directory. Create a `.github` directory at the root of your project, then create a `workflows` directory inside it. Add `pr-description.yml`.
129
129
 
130
130
  This workflow runs whenever a pull request is opened or updated. It generates a diff for the PR, calls the Mastra agent to describe the changes, and writes the description directly into the PR in the GitHub UI.
131
131
 
@@ -187,7 +187,7 @@ jobs:
187
187
 
188
188
  ### Create the workflow script
189
189
 
190
- Create a `scripts` directory inside `.github` and add a file named `generate-description.ts`.
190
+ Create a `scripts` directory inside `.github` and add `generate-description.ts`.
191
191
 
192
192
  This script reads the PR diff from `PR_DIFF_FILE`, generates a description using the Mastra agent, and writes the result to `PR_DESCRIPTION_FILE` for the workflow to publish to the pull request.
193
193
 
@@ -229,7 +229,7 @@ ${readFileSync(process.env.PR_DIFF_FILE!, 'utf-8')}
229
229
 
230
230
  You now have a GitHub Action that generates multi-language PR descriptions using a Mastra agent. Once the workflow and supporting files are merged into your main branch, the agent will run automatically the next time a pull request is created or updated. You can monitor the run in the **Actions** tab of your repository.
231
231
 
232
- From here, you can customize the agent instructions, change the output languages, or extend the workflow to handle other events.
232
+ From here, customize the agent instructions or change the output languages. You can also extend the workflow to handle other events.
233
233
 
234
234
  To learn more:
235
235
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  In this guide, you'll create an AI research assistant that can analyze academic papers and answer specific questions about their content using Retrieval Augmented Generation (RAG).
6
6
 
7
- You'll use the foundational Transformer paper ["Attention Is All You Need"](https://arxiv.org/html/1706.03762) as your example. As a database you'll use a local libSQL database.
7
+ You'll use the original Transformer paper ["Attention Is All You Need"](https://arxiv.org/html/1706.03762) as your example. As a database you'll use a local libSQL database.
8
8
 
9
9
  ## Prerequisites
10
10
 
@@ -155,7 +155,7 @@ Let's define the agent's behavior, connect it to your Mastra project, and create
155
155
 
156
156
  ## Processing documents
157
157
 
158
- In the following steps you'll fetch the research paper, split it into smaller chunks, generate embeddings for them, and store these chunks of information into the vector database.
158
+ In the following steps, you'll fetch the research paper and split it into smaller chunks. You'll then generate embeddings and store the chunks in the vector database.
159
159
 
160
160
  1. In this step the research paper is retrieved by providing an URL, then converted to a document object, and split into smaller, manageable chunks. By splitting into chunks the processing is faster and more efficient.
161
161
 
@@ -201,7 +201,7 @@ In the following steps you'll fetch the research paper, split it into smaller ch
201
201
 
202
202
  > **Note:** This metadata is crucial as it allows for returning the actual content when the vector store finds relevant matches.
203
203
 
204
- This allows the agent to efficiently search and retrieve relevant information.
204
+ The agent uses the vector index to search for and retrieve relevant information.
205
205
 
206
206
  Open the `src/store.ts` file and add the following:
207
207