@mastra/mcp-docs-server 1.0.0-beta.8 → 1.0.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 (544) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +1 -13
  2. package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -5
  3. package/.docs/organized/changelogs/%40internal%2Fplayground.md +40 -0
  4. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +8 -8
  5. package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -53
  6. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +287 -287
  7. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +315 -315
  8. package/.docs/organized/changelogs/%40mastra%2Fastra.md +53 -53
  9. package/.docs/organized/changelogs/%40mastra%2Fauth.md +38 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +66 -66
  11. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +522 -212
  12. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +658 -196
  13. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +439 -234
  14. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +450 -211
  15. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +208 -0
  16. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +448 -22
  17. package/.docs/organized/changelogs/%40mastra%2Fcore.md +3341 -271
  18. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +60 -60
  19. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +289 -289
  20. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +90 -90
  21. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +74 -74
  22. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +70 -70
  23. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +247 -220
  24. package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +70 -0
  25. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +403 -225
  26. package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +72 -0
  27. package/.docs/organized/changelogs/%40mastra%2Fevals.md +145 -145
  28. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +54 -0
  29. package/.docs/organized/changelogs/%40mastra%2Flance.md +456 -226
  30. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +604 -208
  31. package/.docs/organized/changelogs/%40mastra%2Floggers.md +71 -71
  32. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +247 -247
  33. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +28 -28
  34. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +285 -285
  35. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +354 -156
  36. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +545 -212
  37. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +481 -202
  38. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +194 -194
  39. package/.docs/organized/changelogs/%40mastra%2Fpg.md +759 -213
  40. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +198 -198
  41. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +636 -229
  42. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +163 -163
  43. package/.docs/organized/changelogs/%40mastra%2Frag.md +310 -310
  44. package/.docs/organized/changelogs/%40mastra%2Freact.md +328 -230
  45. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +64 -0
  46. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +160 -0
  47. package/.docs/organized/changelogs/%40mastra%2Fserver.md +829 -218
  48. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +57 -57
  49. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +479 -232
  50. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +53 -53
  51. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +45 -45
  52. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +45 -45
  53. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +47 -47
  54. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +110 -110
  55. package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +15 -0
  56. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +98 -0
  57. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +54 -54
  58. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +46 -46
  59. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +93 -93
  60. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +47 -47
  61. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +45 -45
  62. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +45 -45
  63. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +45 -45
  64. package/.docs/organized/changelogs/create-mastra.md +227 -227
  65. package/.docs/organized/changelogs/mastra.md +277 -277
  66. package/.docs/organized/code-examples/a2a.md +2 -2
  67. package/.docs/organized/code-examples/agent-v6.md +221 -0
  68. package/.docs/organized/code-examples/agui.md +4 -4
  69. package/.docs/organized/code-examples/ai-elements.md +3 -3
  70. package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
  71. package/.docs/organized/code-examples/ai-sdk-v5.md +3 -3
  72. package/.docs/organized/code-examples/assistant-ui.md +5 -5
  73. package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
  74. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +2 -2
  75. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +3 -3
  76. package/.docs/organized/code-examples/client-side-tools.md +4 -4
  77. package/.docs/organized/code-examples/crypto-chatbot.md +5 -5
  78. package/.docs/organized/code-examples/experimental-auth-weather-agent.md +1 -1
  79. package/.docs/organized/code-examples/fireworks-r1.md +2 -2
  80. package/.docs/organized/code-examples/heads-up-game.md +7 -7
  81. package/.docs/organized/code-examples/inngest.md +1075 -0
  82. package/.docs/organized/code-examples/mcp-configuration.md +1 -1
  83. package/.docs/organized/code-examples/mcp-server-adapters.md +3 -4
  84. package/.docs/organized/code-examples/memory-per-resource-example.md +3 -3
  85. package/.docs/organized/code-examples/memory-todo-agent.md +1 -1
  86. package/.docs/organized/code-examples/memory-with-context.md +1 -1
  87. package/.docs/organized/code-examples/memory-with-processors.md +1 -1
  88. package/.docs/organized/code-examples/openapi-spec-writer.md +3 -3
  89. package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
  90. package/.docs/organized/code-examples/quick-start.md +1 -5
  91. package/.docs/organized/code-examples/server-app-access.md +3 -3
  92. package/.docs/organized/code-examples/server-express-adapter.md +1 -1
  93. package/.docs/organized/code-examples/server-fastify-adapter.md +83 -0
  94. package/.docs/organized/code-examples/server-hono-adapter.md +3 -3
  95. package/.docs/organized/code-examples/server-koa-adapter.md +94 -0
  96. package/.docs/organized/code-examples/stock-price-tool.md +21 -2
  97. package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
  98. package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
  99. package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
  100. package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
  101. package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
  102. package/.docs/raw/agents/adding-voice.mdx +24 -6
  103. package/.docs/raw/agents/agent-approval.mdx +209 -12
  104. package/.docs/raw/agents/agent-memory.mdx +36 -32
  105. package/.docs/raw/agents/guardrails.mdx +105 -56
  106. package/.docs/raw/agents/network-approval.mdx +281 -0
  107. package/.docs/raw/agents/networks.mdx +69 -13
  108. package/.docs/raw/agents/overview.mdx +43 -25
  109. package/.docs/raw/agents/processors.mdx +234 -17
  110. package/.docs/raw/agents/structured-output.mdx +78 -8
  111. package/.docs/raw/agents/using-tools.mdx +67 -6
  112. package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
  113. package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
  114. package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +1 -2
  115. package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +1 -1
  116. package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +1 -1
  117. package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +1 -1
  118. package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +1 -1
  119. package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +1 -1
  120. package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +3 -3
  121. package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -2
  122. package/.docs/raw/course/03-agent-memory/07-understanding-memory-threads.md +35 -0
  123. package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +1 -2
  124. package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +1 -1
  125. package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +4 -5
  126. package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +1 -1
  127. package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +3 -4
  128. package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +3 -4
  129. package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +3 -4
  130. package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +3 -4
  131. package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +2 -3
  132. package/.docs/raw/deployment/cloud-providers.mdx +22 -0
  133. package/.docs/raw/deployment/mastra-server.mdx +140 -0
  134. package/.docs/raw/deployment/monorepo.mdx +106 -42
  135. package/.docs/raw/deployment/overview.mdx +35 -48
  136. package/.docs/raw/deployment/web-framework.mdx +17 -19
  137. package/.docs/raw/deployment/workflow-runners.mdx +16 -0
  138. package/.docs/raw/evals/built-in-scorers.mdx +2 -0
  139. package/.docs/raw/evals/custom-scorers.mdx +60 -12
  140. package/.docs/raw/evals/overview.mdx +6 -6
  141. package/.docs/raw/evals/running-in-ci.mdx +4 -2
  142. package/.docs/raw/getting-started/manual-install.mdx +20 -20
  143. package/.docs/raw/getting-started/mcp-docs-server.mdx +59 -2
  144. package/.docs/raw/getting-started/project-structure.mdx +2 -2
  145. package/.docs/raw/getting-started/start.mdx +17 -1
  146. package/.docs/raw/getting-started/studio.mdx +10 -37
  147. package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +151 -0
  148. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1034 -80
  149. package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
  150. package/.docs/raw/guides/build-your-ui/copilotkit.mdx +32 -11
  151. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +9 -9
  152. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +13 -16
  153. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +5 -7
  154. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/cloudflare-deployer.mdx +8 -5
  155. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +18 -23
  156. package/.docs/raw/guides/deployment/index.mdx +32 -0
  157. package/.docs/raw/guides/deployment/inngest.mdx +673 -0
  158. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/netlify-deployer.mdx +7 -3
  159. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/vercel-deployer.mdx +8 -5
  160. package/.docs/raw/guides/getting-started/astro.mdx +292 -451
  161. package/.docs/raw/guides/getting-started/express.mdx +72 -153
  162. package/.docs/raw/guides/getting-started/hono.mdx +227 -0
  163. package/.docs/raw/guides/getting-started/next-js.mdx +173 -61
  164. package/.docs/raw/guides/getting-started/nuxt.mdx +505 -0
  165. package/.docs/raw/guides/getting-started/quickstart.mdx +5 -5
  166. package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
  167. package/.docs/raw/guides/getting-started/vite-react.mdx +317 -147
  168. package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
  169. package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
  170. package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
  171. package/.docs/raw/guides/guide/research-assistant.mdx +20 -20
  172. package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
  173. package/.docs/raw/guides/guide/web-search.mdx +38 -38
  174. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
  175. package/.docs/raw/guides/index.mdx +0 -1
  176. package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
  177. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +105 -4
  178. package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +15 -1
  179. package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +170 -0
  180. package/.docs/raw/guides/migrations/upgrade-to-v1/deployment.mdx +42 -0
  181. package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +0 -35
  182. package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +40 -3
  183. package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +17 -2
  184. package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
  185. package/.docs/raw/guides/migrations/upgrade-to-v1/rag.mdx +47 -0
  186. package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +271 -25
  187. package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +3 -3
  188. package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +72 -17
  189. package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +46 -1
  190. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +50 -7
  191. package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
  192. package/.docs/raw/index.mdx +2 -2
  193. package/.docs/raw/mastra-cloud/deployment.mdx +86 -0
  194. package/.docs/raw/mastra-cloud/observability.mdx +43 -0
  195. package/.docs/raw/mastra-cloud/overview.mdx +31 -0
  196. package/.docs/raw/mastra-cloud/setup.mdx +64 -0
  197. package/.docs/raw/mastra-cloud/studio.mdx +35 -0
  198. package/.docs/raw/mcp/overview.mdx +60 -25
  199. package/.docs/raw/mcp/publishing-mcp-server.mdx +7 -4
  200. package/.docs/raw/memory/memory-processors.mdx +17 -12
  201. package/.docs/raw/memory/message-history.mdx +72 -0
  202. package/.docs/raw/memory/overview.mdx +38 -76
  203. package/.docs/raw/memory/semantic-recall.mdx +65 -52
  204. package/.docs/raw/memory/storage.mdx +248 -0
  205. package/.docs/raw/memory/working-memory.mdx +24 -13
  206. package/.docs/raw/observability/logging.mdx +16 -15
  207. package/.docs/raw/observability/overview.mdx +27 -7
  208. package/.docs/raw/observability/tracing/bridges/otel.mdx +7 -4
  209. package/.docs/raw/observability/tracing/exporters/arize.mdx +61 -24
  210. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +32 -22
  211. package/.docs/raw/observability/tracing/exporters/cloud.mdx +24 -5
  212. package/.docs/raw/observability/tracing/exporters/datadog.mdx +175 -0
  213. package/.docs/raw/observability/tracing/exporters/default.mdx +28 -7
  214. package/.docs/raw/observability/tracing/exporters/laminar.mdx +89 -0
  215. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +31 -22
  216. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +33 -3
  217. package/.docs/raw/observability/tracing/exporters/otel.mdx +194 -22
  218. package/.docs/raw/observability/tracing/exporters/posthog.mdx +32 -22
  219. package/.docs/raw/observability/tracing/exporters/sentry.mdx +198 -0
  220. package/.docs/raw/observability/tracing/overview.mdx +388 -108
  221. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +27 -7
  222. package/.docs/raw/rag/chunking-and-embedding.mdx +22 -33
  223. package/.docs/raw/rag/graph-rag.mdx +223 -0
  224. package/.docs/raw/rag/overview.mdx +6 -3
  225. package/.docs/raw/rag/retrieval.mdx +53 -57
  226. package/.docs/raw/rag/vector-databases.mdx +55 -31
  227. package/.docs/raw/reference/agents/agent.mdx +17 -14
  228. package/.docs/raw/reference/agents/generate.mdx +172 -44
  229. package/.docs/raw/reference/agents/generateLegacy.mdx +5 -3
  230. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +5 -3
  231. package/.docs/raw/reference/agents/getDefaultOptions.mdx +5 -3
  232. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +5 -3
  233. package/.docs/raw/reference/agents/getDescription.mdx +3 -1
  234. package/.docs/raw/reference/agents/getInstructions.mdx +5 -3
  235. package/.docs/raw/reference/agents/getLLM.mdx +5 -3
  236. package/.docs/raw/reference/agents/getMemory.mdx +5 -3
  237. package/.docs/raw/reference/agents/getModel.mdx +5 -3
  238. package/.docs/raw/reference/agents/getTools.mdx +4 -2
  239. package/.docs/raw/reference/agents/getVoice.mdx +4 -2
  240. package/.docs/raw/reference/agents/listAgents.mdx +4 -2
  241. package/.docs/raw/reference/agents/listScorers.mdx +5 -3
  242. package/.docs/raw/reference/agents/listTools.mdx +4 -2
  243. package/.docs/raw/reference/agents/listWorkflows.mdx +4 -2
  244. package/.docs/raw/reference/agents/network.mdx +113 -1
  245. package/.docs/raw/reference/ai-sdk/chat-route.mdx +6 -3
  246. package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +4 -2
  247. package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +4 -2
  248. package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +5 -3
  249. package/.docs/raw/reference/ai-sdk/network-route.mdx +6 -3
  250. package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +10 -6
  251. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +130 -0
  252. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +110 -0
  253. package/.docs/raw/reference/ai-sdk/with-mastra.mdx +122 -0
  254. package/.docs/raw/reference/ai-sdk/workflow-route.mdx +7 -4
  255. package/.docs/raw/reference/auth/auth0.mdx +5 -3
  256. package/.docs/raw/reference/auth/clerk.mdx +5 -3
  257. package/.docs/raw/reference/auth/firebase.mdx +6 -5
  258. package/.docs/raw/reference/auth/jwt.mdx +5 -3
  259. package/.docs/raw/reference/auth/supabase.mdx +5 -3
  260. package/.docs/raw/reference/auth/workos.mdx +5 -3
  261. package/.docs/raw/reference/cli/create-mastra.mdx +12 -10
  262. package/.docs/raw/reference/cli/mastra.mdx +63 -15
  263. package/.docs/raw/reference/client-js/agents.mdx +311 -85
  264. package/.docs/raw/reference/client-js/error-handling.mdx +3 -3
  265. package/.docs/raw/reference/client-js/logs.mdx +2 -0
  266. package/.docs/raw/reference/client-js/mastra-client.mdx +6 -4
  267. package/.docs/raw/reference/client-js/memory.mdx +47 -2
  268. package/.docs/raw/reference/client-js/observability.mdx +2 -0
  269. package/.docs/raw/reference/client-js/telemetry.mdx +2 -0
  270. package/.docs/raw/reference/client-js/tools.mdx +2 -0
  271. package/.docs/raw/reference/client-js/vectors.mdx +2 -0
  272. package/.docs/raw/reference/client-js/workflows.mdx +47 -3
  273. package/.docs/raw/reference/configuration.mdx +761 -0
  274. package/.docs/raw/reference/core/addGateway.mdx +2 -0
  275. package/.docs/raw/reference/core/getAgent.mdx +3 -1
  276. package/.docs/raw/reference/core/getAgentById.mdx +3 -1
  277. package/.docs/raw/reference/core/getDeployer.mdx +3 -1
  278. package/.docs/raw/reference/core/getGateway.mdx +2 -0
  279. package/.docs/raw/reference/core/getGatewayById.mdx +2 -0
  280. package/.docs/raw/reference/core/getLogger.mdx +3 -1
  281. package/.docs/raw/reference/core/getMCPServer.mdx +3 -1
  282. package/.docs/raw/reference/core/getMCPServerById.mdx +3 -1
  283. package/.docs/raw/reference/core/getMemory.mdx +77 -0
  284. package/.docs/raw/reference/core/getScorer.mdx +2 -0
  285. package/.docs/raw/reference/core/getScorerById.mdx +2 -0
  286. package/.docs/raw/reference/core/getServer.mdx +6 -4
  287. package/.docs/raw/reference/core/getStorage.mdx +5 -3
  288. package/.docs/raw/reference/core/getStoredAgentById.mdx +185 -0
  289. package/.docs/raw/reference/core/getTelemetry.mdx +3 -1
  290. package/.docs/raw/reference/core/getVector.mdx +3 -1
  291. package/.docs/raw/reference/core/getWorkflow.mdx +3 -1
  292. package/.docs/raw/reference/core/listAgents.mdx +3 -1
  293. package/.docs/raw/reference/core/listGateways.mdx +2 -0
  294. package/.docs/raw/reference/core/listLogs.mdx +3 -1
  295. package/.docs/raw/reference/core/listLogsByRunId.mdx +3 -1
  296. package/.docs/raw/reference/core/listMCPServers.mdx +3 -1
  297. package/.docs/raw/reference/core/listMemory.mdx +74 -0
  298. package/.docs/raw/reference/core/listScorers.mdx +2 -0
  299. package/.docs/raw/reference/core/listStoredAgents.mdx +153 -0
  300. package/.docs/raw/reference/core/listVectors.mdx +3 -1
  301. package/.docs/raw/reference/core/listWorkflows.mdx +3 -1
  302. package/.docs/raw/reference/core/mastra-class.mdx +35 -20
  303. package/.docs/raw/reference/core/mastra-model-gateway.mdx +2 -0
  304. package/.docs/raw/reference/core/setLogger.mdx +3 -1
  305. package/.docs/raw/reference/core/setStorage.mdx +6 -4
  306. package/.docs/raw/reference/deployer/cloudflare.mdx +22 -53
  307. package/.docs/raw/reference/deployer/deployer.mdx +2 -1
  308. package/.docs/raw/reference/deployer/netlify.mdx +4 -1
  309. package/.docs/raw/reference/deployer/vercel.mdx +5 -4
  310. package/.docs/raw/reference/evals/answer-relevancy.mdx +4 -1
  311. package/.docs/raw/reference/evals/answer-similarity.mdx +4 -1
  312. package/.docs/raw/reference/evals/bias.mdx +4 -1
  313. package/.docs/raw/reference/evals/completeness.mdx +4 -1
  314. package/.docs/raw/reference/evals/content-similarity.mdx +4 -1
  315. package/.docs/raw/reference/evals/context-precision.mdx +4 -1
  316. package/.docs/raw/reference/evals/context-relevance.mdx +2 -0
  317. package/.docs/raw/reference/evals/create-scorer.mdx +11 -3
  318. package/.docs/raw/reference/evals/faithfulness.mdx +4 -1
  319. package/.docs/raw/reference/evals/hallucination.mdx +4 -1
  320. package/.docs/raw/reference/evals/keyword-coverage.mdx +4 -1
  321. package/.docs/raw/reference/evals/mastra-scorer.mdx +2 -0
  322. package/.docs/raw/reference/evals/noise-sensitivity.mdx +2 -0
  323. package/.docs/raw/reference/evals/prompt-alignment.mdx +9 -7
  324. package/.docs/raw/reference/evals/run-evals.mdx +3 -1
  325. package/.docs/raw/reference/evals/scorer-utils.mdx +3 -0
  326. package/.docs/raw/reference/evals/textual-difference.mdx +4 -1
  327. package/.docs/raw/reference/evals/tone-consistency.mdx +4 -1
  328. package/.docs/raw/reference/evals/tool-call-accuracy.mdx +25 -23
  329. package/.docs/raw/reference/evals/toxicity.mdx +4 -1
  330. package/.docs/raw/reference/index.mdx +2 -1
  331. package/.docs/raw/reference/logging/pino-logger.mdx +10 -8
  332. package/.docs/raw/reference/memory/clone-utilities.mdx +345 -0
  333. package/.docs/raw/reference/memory/cloneThread.mdx +237 -0
  334. package/.docs/raw/reference/memory/createThread.mdx +6 -4
  335. package/.docs/raw/reference/memory/deleteMessages.mdx +4 -2
  336. package/.docs/raw/reference/memory/getThreadById.mdx +3 -1
  337. package/.docs/raw/reference/memory/listThreads.mdx +187 -0
  338. package/.docs/raw/reference/memory/memory-class.mdx +27 -20
  339. package/.docs/raw/reference/memory/recall.mdx +6 -4
  340. package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +6 -2
  341. package/.docs/raw/reference/observability/tracing/configuration.mdx +51 -0
  342. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +25 -6
  343. package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +23 -2
  344. package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +10 -0
  345. package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +3 -0
  346. package/.docs/raw/reference/observability/tracing/exporters/datadog.mdx +172 -0
  347. package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +10 -0
  348. package/.docs/raw/reference/observability/tracing/exporters/laminar.mdx +139 -0
  349. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +26 -4
  350. package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +10 -0
  351. package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +51 -34
  352. package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +25 -4
  353. package/.docs/raw/reference/observability/tracing/exporters/sentry.mdx +224 -0
  354. package/.docs/raw/reference/observability/tracing/instances.mdx +2 -0
  355. package/.docs/raw/reference/observability/tracing/interfaces.mdx +20 -0
  356. package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +2 -0
  357. package/.docs/raw/reference/observability/tracing/spans.mdx +2 -0
  358. package/.docs/raw/reference/processors/batch-parts-processor.mdx +4 -2
  359. package/.docs/raw/reference/processors/language-detector.mdx +6 -3
  360. package/.docs/raw/reference/processors/message-history-processor.mdx +5 -2
  361. package/.docs/raw/reference/processors/moderation-processor.mdx +6 -4
  362. package/.docs/raw/reference/processors/pii-detector.mdx +6 -4
  363. package/.docs/raw/reference/processors/processor-interface.mdx +326 -23
  364. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +5 -3
  365. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +7 -2
  366. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +5 -3
  367. package/.docs/raw/reference/processors/token-limiter-processor.mdx +62 -19
  368. package/.docs/raw/reference/processors/tool-call-filter.mdx +5 -3
  369. package/.docs/raw/reference/processors/unicode-normalizer.mdx +6 -3
  370. package/.docs/raw/reference/processors/working-memory-processor.mdx +6 -3
  371. package/.docs/raw/reference/rag/chunk.mdx +7 -6
  372. package/.docs/raw/reference/rag/database-config.mdx +8 -6
  373. package/.docs/raw/reference/rag/document.mdx +2 -0
  374. package/.docs/raw/reference/rag/embeddings.mdx +2 -0
  375. package/.docs/raw/reference/rag/extract-params.mdx +57 -3
  376. package/.docs/raw/reference/rag/graph-rag.mdx +2 -0
  377. package/.docs/raw/reference/rag/metadata-filters.mdx +27 -7
  378. package/.docs/raw/reference/rag/rerank.mdx +2 -0
  379. package/.docs/raw/reference/rag/rerankWithScorer.mdx +2 -0
  380. package/.docs/raw/reference/server/create-route.mdx +34 -18
  381. package/.docs/raw/reference/server/express-adapter.mdx +78 -50
  382. package/.docs/raw/reference/server/fastify-adapter.mdx +130 -0
  383. package/.docs/raw/reference/server/hono-adapter.mdx +78 -48
  384. package/.docs/raw/reference/server/koa-adapter.mdx +129 -0
  385. package/.docs/raw/reference/server/mastra-server.mdx +52 -34
  386. package/.docs/raw/reference/server/routes.mdx +73 -10
  387. package/.docs/raw/reference/storage/cloudflare-d1.mdx +10 -5
  388. package/.docs/raw/reference/storage/cloudflare.mdx +12 -2
  389. package/.docs/raw/reference/storage/composite.mdx +245 -0
  390. package/.docs/raw/reference/storage/convex.mdx +8 -6
  391. package/.docs/raw/reference/storage/dynamodb.mdx +134 -8
  392. package/.docs/raw/reference/storage/lance.mdx +9 -5
  393. package/.docs/raw/reference/storage/libsql.mdx +76 -54
  394. package/.docs/raw/reference/storage/mongodb.mdx +115 -16
  395. package/.docs/raw/reference/storage/mssql.mdx +11 -6
  396. package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +15 -111
  397. package/.docs/raw/reference/storage/postgresql.mdx +228 -83
  398. package/.docs/raw/reference/storage/upstash.mdx +78 -2
  399. package/.docs/raw/reference/streaming/ChunkType.mdx +31 -3
  400. package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +67 -6
  401. package/.docs/raw/reference/streaming/agents/stream.mdx +48 -51
  402. package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +5 -3
  403. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +3 -1
  404. package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +3 -1
  405. package/.docs/raw/reference/streaming/workflows/stream.mdx +37 -22
  406. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +6 -4
  407. package/.docs/raw/reference/templates/overview.mdx +3 -2
  408. package/.docs/raw/reference/tools/client.mdx +3 -0
  409. package/.docs/raw/reference/tools/create-tool.mdx +127 -5
  410. package/.docs/raw/reference/tools/document-chunker-tool.mdx +2 -0
  411. package/.docs/raw/reference/tools/graph-rag-tool.mdx +40 -3
  412. package/.docs/raw/reference/tools/mcp-client.mdx +110 -1
  413. package/.docs/raw/reference/tools/mcp-server.mdx +278 -24
  414. package/.docs/raw/reference/tools/vector-query-tool.mdx +68 -4
  415. package/.docs/raw/reference/vectors/astra.mdx +5 -3
  416. package/.docs/raw/reference/vectors/chroma.mdx +5 -3
  417. package/.docs/raw/reference/vectors/convex.mdx +14 -12
  418. package/.docs/raw/reference/vectors/couchbase.mdx +7 -5
  419. package/.docs/raw/reference/vectors/duckdb.mdx +12 -10
  420. package/.docs/raw/reference/vectors/elasticsearch.mdx +12 -4
  421. package/.docs/raw/reference/vectors/lance.mdx +6 -4
  422. package/.docs/raw/reference/vectors/libsql.mdx +66 -13
  423. package/.docs/raw/reference/vectors/mongodb.mdx +90 -10
  424. package/.docs/raw/reference/vectors/opensearch.mdx +30 -3
  425. package/.docs/raw/reference/vectors/pg.mdx +58 -6
  426. package/.docs/raw/reference/vectors/pinecone.mdx +23 -8
  427. package/.docs/raw/reference/vectors/qdrant.mdx +148 -4
  428. package/.docs/raw/reference/vectors/s3vectors.mdx +8 -6
  429. package/.docs/raw/reference/vectors/turbopuffer.mdx +6 -4
  430. package/.docs/raw/reference/vectors/upstash.mdx +60 -6
  431. package/.docs/raw/reference/vectors/vectorize.mdx +5 -3
  432. package/.docs/raw/reference/voice/azure.mdx +2 -0
  433. package/.docs/raw/reference/voice/cloudflare.mdx +2 -0
  434. package/.docs/raw/reference/voice/composite-voice.mdx +4 -0
  435. package/.docs/raw/reference/voice/deepgram.mdx +2 -0
  436. package/.docs/raw/reference/voice/elevenlabs.mdx +2 -0
  437. package/.docs/raw/reference/voice/google-gemini-live.mdx +3 -0
  438. package/.docs/raw/reference/voice/google.mdx +2 -0
  439. package/.docs/raw/reference/voice/mastra-voice.mdx +2 -0
  440. package/.docs/raw/reference/voice/murf.mdx +2 -0
  441. package/.docs/raw/reference/voice/openai-realtime.mdx +3 -0
  442. package/.docs/raw/reference/voice/openai.mdx +2 -0
  443. package/.docs/raw/reference/voice/playai.mdx +2 -0
  444. package/.docs/raw/reference/voice/sarvam.mdx +2 -0
  445. package/.docs/raw/reference/voice/speechify.mdx +2 -0
  446. package/.docs/raw/reference/voice/voice.addInstructions.mdx +3 -0
  447. package/.docs/raw/reference/voice/voice.addTools.mdx +3 -0
  448. package/.docs/raw/reference/voice/voice.answer.mdx +4 -0
  449. package/.docs/raw/reference/voice/voice.close.mdx +3 -0
  450. package/.docs/raw/reference/voice/voice.connect.mdx +5 -1
  451. package/.docs/raw/reference/voice/voice.events.mdx +2 -0
  452. package/.docs/raw/reference/voice/voice.getSpeakers.mdx +3 -0
  453. package/.docs/raw/reference/voice/voice.listen.mdx +6 -0
  454. package/.docs/raw/reference/voice/voice.off.mdx +2 -0
  455. package/.docs/raw/reference/voice/voice.on.mdx +5 -1
  456. package/.docs/raw/reference/voice/voice.send.mdx +4 -0
  457. package/.docs/raw/reference/voice/voice.speak.mdx +6 -0
  458. package/.docs/raw/reference/voice/voice.updateConfig.mdx +2 -0
  459. package/.docs/raw/reference/workflows/run-methods/cancel.mdx +55 -5
  460. package/.docs/raw/reference/workflows/run-methods/restart.mdx +3 -3
  461. package/.docs/raw/reference/workflows/run-methods/resume.mdx +6 -4
  462. package/.docs/raw/reference/workflows/run-methods/start.mdx +7 -5
  463. package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +145 -0
  464. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +10 -8
  465. package/.docs/raw/reference/workflows/run.mdx +11 -3
  466. package/.docs/raw/reference/workflows/step.mdx +56 -3
  467. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +3 -1
  468. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +3 -1
  469. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +39 -2
  470. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +3 -1
  471. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +3 -1
  472. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +71 -4
  473. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +9 -7
  474. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +3 -1
  475. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +4 -6
  476. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +4 -6
  477. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +3 -1
  478. package/.docs/raw/reference/workflows/workflow.mdx +193 -2
  479. package/.docs/raw/{auth → server/auth}/auth0.mdx +40 -21
  480. package/.docs/raw/{auth → server/auth}/clerk.mdx +37 -16
  481. package/.docs/raw/{auth → server/auth}/firebase.mdx +47 -25
  482. package/.docs/raw/{auth → server/auth}/index.mdx +8 -6
  483. package/.docs/raw/{auth → server/auth}/jwt.mdx +22 -10
  484. package/.docs/raw/{auth → server/auth}/supabase.mdx +45 -25
  485. package/.docs/raw/{auth → server/auth}/workos.mdx +39 -20
  486. package/.docs/raw/{server-db → server}/custom-adapters.mdx +40 -24
  487. package/.docs/raw/{server-db → server}/custom-api-routes.mdx +6 -6
  488. package/.docs/raw/{server-db → server}/mastra-client.mdx +35 -38
  489. package/.docs/raw/server/mastra-server.mdx +86 -0
  490. package/.docs/raw/{server-db → server}/middleware.mdx +11 -9
  491. package/.docs/raw/{server-db → server}/request-context.mdx +85 -43
  492. package/.docs/raw/server/server-adapters.mdx +410 -0
  493. package/.docs/raw/streaming/events.mdx +16 -7
  494. package/.docs/raw/streaming/overview.mdx +30 -17
  495. package/.docs/raw/streaming/tool-streaming.mdx +15 -17
  496. package/.docs/raw/streaming/workflow-streaming.mdx +8 -8
  497. package/.docs/raw/tools-mcp/advanced-usage.mdx +4 -2
  498. package/.docs/raw/tools-mcp/mcp-overview.mdx +46 -12
  499. package/.docs/raw/tools-mcp/overview.mdx +14 -13
  500. package/.docs/raw/voice/overview.mdx +17 -2
  501. package/.docs/raw/voice/speech-to-speech.mdx +5 -0
  502. package/.docs/raw/voice/speech-to-text.mdx +4 -0
  503. package/.docs/raw/voice/text-to-speech.mdx +3 -0
  504. package/.docs/raw/workflows/agents-and-tools.mdx +70 -21
  505. package/.docs/raw/workflows/control-flow.mdx +369 -34
  506. package/.docs/raw/workflows/error-handling.mdx +192 -18
  507. package/.docs/raw/workflows/human-in-the-loop.mdx +8 -7
  508. package/.docs/raw/workflows/input-data-mapping.mdx +9 -7
  509. package/.docs/raw/workflows/overview.mdx +80 -34
  510. package/.docs/raw/workflows/snapshots.mdx +19 -45
  511. package/.docs/raw/workflows/suspend-and-resume.mdx +14 -14
  512. package/.docs/raw/workflows/time-travel.mdx +25 -21
  513. package/.docs/raw/workflows/workflow-state.mdx +7 -8
  514. package/CHANGELOG.md +254 -0
  515. package/README.md +36 -0
  516. package/dist/index.d.ts.map +1 -1
  517. package/dist/logger.d.ts +3 -0
  518. package/dist/logger.d.ts.map +1 -1
  519. package/dist/stdio.js +746 -49
  520. package/dist/tools/course.d.ts.map +1 -1
  521. package/dist/tools/embedded-docs.d.ts +276 -0
  522. package/dist/tools/embedded-docs.d.ts.map +1 -0
  523. package/package.json +9 -8
  524. package/.docs/organized/changelogs/%40internal%2Fai-sdk-v4.md +0 -1
  525. package/.docs/raw/deployment/building-mastra.mdx +0 -73
  526. package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
  527. package/.docs/raw/deployment/mastra-cloud/dashboard.mdx +0 -100
  528. package/.docs/raw/deployment/mastra-cloud/observability.mdx +0 -53
  529. package/.docs/raw/deployment/mastra-cloud/overview.mdx +0 -65
  530. package/.docs/raw/deployment/mastra-cloud/setting-up.mdx +0 -105
  531. package/.docs/raw/memory/conversation-history.mdx +0 -24
  532. package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
  533. package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
  534. package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
  535. package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
  536. package/.docs/raw/memory/threads-and-resources.mdx +0 -95
  537. package/.docs/raw/reference/core/setTelemetry.mdx +0 -36
  538. package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +0 -110
  539. package/.docs/raw/reference/memory/query.mdx +0 -189
  540. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +0 -70
  541. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +0 -66
  542. package/.docs/raw/server-db/mastra-server.mdx +0 -97
  543. package/.docs/raw/server-db/server-adapters.mdx +0 -286
  544. package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
@@ -1,15 +1,34 @@
1
1
  ---
2
- title: "Monorepo Deployment | Deployment"
2
+ title: "Deploy in a Monorepo | Deployment"
3
3
  description: Learn how to deploy Mastra applications that are part of a monorepo setup
4
+ packages:
5
+ - "@mastra/deployer"
4
6
  ---
5
7
 
6
- # Monorepo Deployment
8
+ import Tabs from "@theme/Tabs";
9
+ import TabItem from "@theme/TabItem";
7
10
 
8
- Deploying Mastra in a monorepo follows the same approach as deploying a standalone application. While some [Cloud](./cloud-providers/) or [Serverless Platform](./cloud-providers/) providers may introduce extra requirements, the core setup is the same.
11
+ # Deploy in a Monorepo
9
12
 
10
- ## Example monorepo
13
+ Deploying Mastra in a monorepo follows the same process as a standalone application. This guide covers monorepo-specific considerations. For the core build and deployment steps, see [Deploy a Mastra Server](/docs/v1/deployment/mastra-server).
11
14
 
12
- In this example, the Mastra application is located at `apps/api`.
15
+ ## Supported monorepos
16
+
17
+ Mastra works with:
18
+
19
+ - npm workspaces
20
+ - pnpm workspaces
21
+ - Yarn workspaces
22
+ - Turborepo
23
+
24
+ Known limitations:
25
+
26
+ - Bun workspaces - partial support; known issues
27
+ - Nx - You can use Nx's [supported dependency strategies](https://nx.dev/concepts/decisions/dependency-management) but you need to have `package.json` files inside your workspace packages
28
+
29
+ ## Example structure
30
+
31
+ In this example, the Mastra application is located at `apps/api`:
13
32
 
14
33
  ```
15
34
  apps/
@@ -29,69 +48,114 @@ packages/
29
48
  package.json
30
49
  ```
31
50
 
32
- ## Environment variables
51
+ ## Building from a monorepo
52
+
53
+ Use your monorepo tool to run the build command from the correct package. There's no need for special flags.
54
+
55
+ Examples:
33
56
 
34
- Environment variables like `OPENAI_API_KEY` should be stored in an `.env` file at the root of the Mastra application `(apps/api)`, for example:
57
+ <Tabs>
58
+ <TabItem value="npm" label="npm">
35
59
 
60
+ ```bash
61
+ npm run build --workspace=apps/api
36
62
  ```
37
- api/
38
- ├── src/
39
- │ └── mastra/
40
- ├── .env
41
- ├── package.json
42
- └── tsconfig.json
63
+
64
+ </TabItem>
65
+
66
+ <TabItem value="pnpm" label="pnpm">
67
+
68
+ ```bash
69
+ pnpm --filter api run build
43
70
  ```
44
71
 
45
- ## Deployment configuration
72
+ </TabItem>
46
73
 
47
- The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](./mastra-cloud/overview). While the interface may differ between providers, the configuration remains the same.
74
+ <TabItem value="yarn" label="yarn">
48
75
 
49
- ![Deployment configuration](/img/monorepo/monorepo-mastra-cloud.jpg)
76
+ ```bash
77
+ yarn workspace api build
78
+ ```
50
79
 
51
- ## Dependency management
80
+ </TabItem>
52
81
 
53
- In a monorepo, keep dependencies consistent to avoid version conflicts and build errors.
82
+ <TabItem value="turborepo" label="Turborepo">
54
83
 
55
- - Use a **single lockfile** at the project root so all packages resolve the same versions.
56
- - Align versions of **shared libraries** (like Mastra or frameworks) to prevent duplicates.
84
+ ```bash
85
+ turbo run build --filter=api
86
+ ```
57
87
 
58
- ## Deployment pitfalls
88
+ </TabItem>
59
89
 
60
- Common issues to watch for when deploying Mastra in a monorepo:
90
+ </Tabs>
61
91
 
62
- - **Wrong project root**: make sure the correct package (e.g. `apps/api`) is selected as the deploy target.
92
+ Your package's `build` script should run `mastra build`:
63
93
 
64
- ## Bundler options
94
+ ```json title="apps/api/package.json"
95
+ {
96
+ "scripts": {
97
+ "build": "mastra build"
98
+ }
99
+ }
100
+ ```
65
101
 
66
- Use `transpilePackages` to compile TypeScript workspace packages or libraries. List package names exactly as they appear in each `package.json`. Use `externals` to exclude dependencies resolved at runtime, and `sourcemap` to emit readable stack traces.
102
+ ## Workspace packages
67
103
 
68
- ```typescript title="src/mastra/index.ts" showLineNumbers copy
69
- import { Mastra } from "@mastra/core";
104
+ When your Mastra application imports from other workspace packages, Mastra handles this automatically:
70
105
 
106
+ - If the package is pre-compiled (e.g., built with `tsc` or `tsdown`), Mastra imports the compiled JavaScript
107
+ - If the package contains uncompiled TypeScript, Mastra transpiles it during the build
108
+
109
+ For most setups, this works without configuration. If you encounter issues with workspace package imports, add the package to [`transpilePackages`](/reference/v1/configuration#bundlertranspilepackages):
110
+
111
+ ```typescript title="src/mastra/index.ts"
71
112
  export const mastra = new Mastra({
72
- // ...
73
113
  bundler: {
74
- transpilePackages: ["utils"],
75
- externals: ["ui"],
76
- sourcemap: true,
114
+ transpilePackages: ["@my-org/utils"],
77
115
  },
78
116
  });
79
117
  ```
80
118
 
81
- > See [Mastra Class](/reference/v1/core/mastra-class) for more configuration options.
119
+ ## Environment variables
82
120
 
83
- ## Supported monorepos
121
+ Store `.env` files in the Mastra application directory (e.g., `apps/api/.env`), not the monorepo root.
84
122
 
85
- Mastra works with:
123
+ ## Deployment configuration
86
124
 
87
- - npm workspaces
88
- - pnpm workspaces
89
- - Yarn workspaces
90
- - Turborepo
125
+ When deploying to cloud providers, ensure the correct package is selected as the deploy target. Selecting the monorepo root instead of the application directory (e.g., `apps/api`) is a common mistake.
91
126
 
92
- Known limitations:
127
+ Most providers let you specify the root directory in their dashboard or configuration file.
128
+
129
+ ### Mastra Cloud
130
+
131
+ The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](/docs/v1/mastra-cloud/overview). While the interface may differ between providers, the configuration remains the same.
132
+
133
+ ![Deployment configuration](/img/monorepo/monorepo-mastra-cloud.jpg)
134
+
135
+ ## Dependency management
136
+
137
+ Keep dependencies consistent to avoid version conflicts and build errors:
138
+
139
+ - Use a **single lockfile** at the monorepo root so all packages resolve the same versions
140
+ - Align versions of **shared libraries** (like Mastra or frameworks) to prevent duplicates
141
+
142
+ ## Troubleshooting
143
+
144
+ ### Workspace package not found
145
+
146
+ If Mastra can't resolve a workspace package, ensure:
147
+ - The package is listed in your `package.json` dependencies
148
+ - Your lockfile is up to date (`pnpm install`, `npm install`, etc.)
149
+ - The package has a valid `main` or `exports` field in its `package.json`
150
+
151
+ ### TypeScript errors from workspace packages
152
+
153
+ If you see type errors from uncompiled workspace packages, either:
154
+ - Build the package first (recommended for faster Mastra builds)
155
+ - Add the package to [`transpilePackages`](/reference/v1/configuration#bundlertranspilepackages) in your Mastra config
93
156
 
94
- - Bun workspaces — partial support; known issues
95
- - Nx — You can use Nx's [supported dependency strategies](https://nx.dev/concepts/decisions/dependency-management) but you need to have `package.json` files inside your workspace packages
157
+ ## Related
96
158
 
97
- > If you are experiencing issues with monorepos see our: [Monorepos Support mega issue](https://github.com/mastra-ai/mastra/issues/6852).
159
+ - [Deploy a Mastra Server](/docs/v1/deployment/mastra-server) - Core build and deployment guide
160
+ - [Configuration Reference](/reference/v1/configuration) - `bundler.transpilePackages` and other options
161
+ - [CLI Reference](/reference/v1/cli/mastra) - Build command flags
@@ -1,82 +1,69 @@
1
1
  ---
2
2
  title: "Deployment Overview | Deployment"
3
3
  description: Learn about different deployment options for your Mastra applications
4
+ packages:
5
+ - "@mastra/deployer"
4
6
  ---
5
7
 
6
8
  # Deployment Overview
7
9
 
8
- Mastra offers multiple deployment options to suit your application's needs, from fully-managed solutions to self-hosted options, and web framework integrations. This guide will help you understand the available deployment paths and choose the right one for your project.
10
+ Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use Mastra Cloud for managed hosting.
9
11
 
10
- ## Choosing a Deployment Option
12
+ ## Runtime support
11
13
 
12
- | Option | Best For | Key Benefits |
13
- | ------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------- |
14
- | **Mastra Cloud** | Teams wanting to ship quickly without infrastructure concerns | Fully-managed, automatic scaling, built-in observability |
15
- | **Framework Deployment** | Teams already using Next.js, Astro etc | Simplify deployment with a unified codebase for frontend and backend |
16
- | **Server Deployment** | Teams needing maximum control and customization | Full control, custom middleware, integrate with existing apps |
17
- | **Serverless Platforms** | Teams already using Vercel, Netlify, or Cloudflare | Platform integration, simplified deployment, automatic scaling |
18
-
19
- ## Deployment Options
20
-
21
- ### Runtime support
14
+ Mastra can run against any of these runtime environments:
22
15
 
23
16
  - Node.js `v22.13.0` or later
24
17
  - Bun
25
18
  - Deno
26
- - [Cloudflare](../deployment/cloud-providers/cloudflare-deployer)
19
+ - Cloudflare
27
20
 
28
- ### Mastra Cloud
21
+ ## Deployment Options
29
22
 
30
- Mastra Cloud is a deployment platform that connects to your GitHub repository, automatically deploys on code changes, and provides monitoring tools. It includes:
23
+ ### Mastra Server
31
24
 
32
- - GitHub repository integration
33
- - Deployment on git push
34
- - Agent testing interface
35
- - Comprehensive logs and traces
36
- - Custom domains for each project
25
+ Mastra provides a [server](/docs/v1/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
37
26
 
38
- [View Mastra Cloud documentation ](./mastra-cloud/overview)
27
+ Use this option when you need full control over your infrastructure, long-running processes, or WebSocket connections. The [Mastra server deployment guide](/docs/v1/deployment/mastra-server) provides more details.
39
28
 
40
- ### With a Web Framework
29
+ ### Monorepo
41
30
 
42
- Mastra can be integrated with a variety of web frameworks. For example, see one of the following for a detailed guide.
31
+ Deploy a Mastra server as part of a monorepo setup, following the same approach as standalone deployment.
43
32
 
44
- - [With Next.js](/guides/v1/getting-started/next-js)
45
- - [With Astro](/guides/v1/getting-started/astro)
33
+ Read about [monorepo deployment](/docs/v1/deployment/monorepo).
46
34
 
47
- When integrated with a framework, Mastra typically requires no additional configuration for deployment.
35
+ ### Cloud Providers
48
36
 
49
- [View Web Framework Integration →](./web-framework)
37
+ Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the build and deployment process.
50
38
 
51
- ### With a Server
39
+ Use this option for auto-scaling, minimal infrastructure management, or when you're already using one of these platforms.
52
40
 
53
- You can deploy Mastra as a standard Node.js HTTP server, which gives you full control over your infrastructure and deployment environment.
41
+ - [Amazon EC2](/guides/v1/deployment/amazon-ec2)
42
+ - [AWS Lambda](/guides/v1/deployment/aws-lambda)
43
+ - [Azure App Services](/guides/v1/deployment/azure-app-services)
44
+ - [Cloudflare](/guides/v1/deployment/cloudflare-deployer)
45
+ - [Digital Ocean](/guides/v1/deployment/digital-ocean)
46
+ - [Netlify](/guides/v1/deployment/netlify-deployer)
47
+ - [Vercel](/guides/v1/deployment/vercel-deployer)
54
48
 
55
- - Custom API routes and middleware
56
- - Configurable CORS and authentication
57
- - Deploy to VMs, containers, or PaaS platforms
58
- - Ideal for integrating with existing Node.js applications
49
+ ### Web Framework
59
50
 
60
- [Building Mastra →](./building-mastra)
51
+ When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. The guides below cover framework-specific configuration requirements for deployment.
61
52
 
62
- ### Serverless Platforms
53
+ Use these guides when adding Mastra to an existing Next.js or Astro application.
63
54
 
64
- Mastra provides platform-specific deployers for popular serverless platforms, enabling you to deploy your application with minimal configuration.
55
+ - [With Next.js on Vercel](/docs/v1/deployment/web-framework#with-nextjs-on-vercel)
56
+ - [With Astro on Vercel](/docs/v1/deployment/web-framework#with-astro-on-vercel)
57
+ - [With Astro on Netlify](/docs/v1/deployment/web-framework#with-astro-on-netlify)
65
58
 
66
- - Deploy to Cloudflare Workers, Vercel, or Netlify
67
- - Platform-specific optimizations
68
- - Simplified deployment process
69
- - Automatic scaling through the platform
59
+ ### Mastra Cloud
70
60
 
71
- [Building Mastra →](./building-mastra)
61
+ We're building Mastra Cloud to be the easiest place to deploy and observe your Mastra agents. It's currently in beta.
72
62
 
73
- ## Client Configuration
63
+ Learn more in the [Mastra Cloud docs](/docs/v1/mastra-cloud/overview).
74
64
 
75
- Once your Mastra application is deployed, you'll need to configure your client to communicate with it. The Mastra Client SDK provides a simple and type-safe interface for interacting with your Mastra server.
65
+ ## Workflow Runners
76
66
 
77
- - Type-safe API interactions
78
- - Authentication and request handling
79
- - Retries and error handling
80
- - Support for streaming responses
67
+ Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
81
68
 
82
- [Client configuration guide](/docs/v1/server-db/mastra-client)
69
+ Visit the [Workflow Runners guide](/docs/v1/deployment/workflow-runners) for execution options and the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions.
@@ -1,24 +1,28 @@
1
1
  ---
2
- title: "Web Framework Integration | Deployment"
2
+ title: "Deploy with a Web Framework | Deployment"
3
3
  description: "Learn how Mastra can be deployed when integrated with a Web Framework"
4
+ packages:
5
+ - "@mastra/deployer"
4
6
  ---
5
7
 
6
- # Web Framework Integration
8
+ # Deploy with a Web Framework
7
9
 
8
- This guide covers deploying integrated Mastra applications. Mastra can be integrated with a variety of web frameworks, see one of the following for a detailed guide.
10
+ When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. Follow the instructions below to ensure your Mastra integration deploys correctly.
11
+
12
+ :::warning
13
+ If you're deploying to a cloud provider, remove any usage of [LibSQLStore](/reference/v1/storage/libsql) from your Mastra configuration. LibSQLStore requires filesystem access and is not compatible with serverless platforms.
14
+ :::
15
+
16
+ Integration guides:
9
17
 
10
18
  - [With Next.js](/guides/v1/getting-started/next-js)
11
19
  - [With Astro](/guides/v1/getting-started/astro)
12
20
 
13
- When integrated with a framework, Mastra typically requires no additional configuration for deployment.
14
-
15
21
  ## With Next.js on Vercel
16
22
 
17
- If you've integrated Mastra with Next.js [by following our guide](/guides/v1/getting-started/next-js) and plan to deploy to Vercel, no additional setup is required.
23
+ If you've integrated Mastra with Next.js [by following our guide](/guides/v1/getting-started/next-js) and plan to deploy to Vercel, add `serverExternalPackages: ["@mastra/*"]` to your `next.config.ts`:
18
24
 
19
- The only thing to verify is that you've added the following to your `next.config.ts` and removed any usage of [LibSQLStore](/docs/v1/deployment/overview), which is not supported in serverless environments:
20
-
21
- ```typescript {4} title="next.config.ts" showLineNumbers copy
25
+ ```typescript {4} title="next.config.ts"
22
26
  import type { NextConfig } from "next";
23
27
 
24
28
  const nextConfig: NextConfig = {
@@ -30,16 +34,13 @@ export default nextConfig;
30
34
 
31
35
  ## With Astro on Vercel
32
36
 
33
- If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Vercel, no additional setup is required.
34
-
35
- The only thing to verify is that you've added the following to your `astro.config.mjs` and removed any usage of [LibSQLStore](/docs/v1/deployment/overview), which is not supported in serverless environments:
37
+ If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Vercel, add the Vercel adapter and server output to your `astro.config.mjs`:
36
38
 
37
- ```javascript {2,6,7} title="astro.config.mjs" showLineNumbers copy
39
+ ```javascript {2,5-6} title="astro.config.mjs"
38
40
  import { defineConfig } from "astro/config";
39
41
  import vercel from "@astrojs/vercel";
40
42
 
41
43
  export default defineConfig({
42
- // ...
43
44
  adapter: vercel(),
44
45
  output: "server",
45
46
  });
@@ -47,16 +48,13 @@ export default defineConfig({
47
48
 
48
49
  ## With Astro on Netlify
49
50
 
50
- If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Netlify, no additional setup is required.
51
-
52
- The only thing to verify is that you've added the following to your `astro.config.mjs` and removed any usage of [LibSQLStore](/docs/v1/deployment/overview), which is not supported in serverless environments:
51
+ If you've integrated Mastra with Astro [by following our guide](/guides/v1/getting-started/astro) and plan to deploy to Netlify, add the Netlify adapter and server output to your `astro.config.mjs`:
53
52
 
54
- ```javascript {2,6,7} title="astro.config.mjs" showLineNumbers copy
53
+ ```javascript {2,5-6} title="astro.config.mjs"
55
54
  import { defineConfig } from "astro/config";
56
55
  import netlify from "@astrojs/netlify";
57
56
 
58
57
  export default defineConfig({
59
- // ...
60
58
  adapter: netlify(),
61
59
  output: "server",
62
60
  });
@@ -0,0 +1,16 @@
1
+ ---
2
+ title: "Workflow Runners | Deployment"
3
+ description: "Deploy Mastra workflows to specialized workflow execution platforms"
4
+ packages:
5
+ - "@mastra/deployer"
6
+ ---
7
+
8
+ # Workflow Runners
9
+
10
+ Mastra [workflows](../workflows/overview.mdx) can be executed using the built-in workflow runner or deployed to specialized workflow execution platforms that handle orchestration, monitoring, and reliability.
11
+
12
+ ## Inngest
13
+
14
+ Inngest is a developer platform for running background workflows without managing infrastructure. Mastra workflows can be deployed to Inngest, which provides step memoization, automatic retries, real-time monitoring, and suspend/resume capabilities.
15
+
16
+ Visit the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions and the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest) for a complete implementation.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "Built-in Scorers | Evals"
3
3
  description: "Overview of Mastra's ready-to-use scorers for evaluating AI outputs across quality, safety, and performance dimensions."
4
+ packages:
5
+ - "@mastra/evals"
4
6
  ---
5
7
 
6
8
  # Built-in Scorers
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "Custom Scorers | Evals"
3
+ packages:
4
+ - "@mastra/core"
3
5
  ---
4
6
 
5
7
  # Custom scorers
@@ -33,17 +35,19 @@ Each step can use either **functions** or **prompt objects** (LLM-based evaluati
33
35
  - Natural language understanding tasks
34
36
  - Nuanced context evaluation
35
37
 
38
+ **What “prompt object” means:** Instead of a function, the step is an object with `description` + `createPrompt` (and `outputSchema` for `preprocess`/`analyze`). That object tells Mastra to run the judge LLM for the step and store the structured output in `results.<step>StepResult`.
39
+
36
40
  You can mix and match approaches within a single scorer - for example, use a function for preprocessing data and an LLM for analyzing quality.
37
41
 
38
42
  ### Initializing a Scorer
39
43
 
40
- Every scorer starts with the `createScorer` factory function, which requires a name and description, and optionally accepts a type specification and judge configuration.
44
+ Every scorer starts with the `createScorer` factory function, which requires an id and description, and optionally accepts a type specification and judge configuration.
41
45
 
42
46
  ```typescript
43
47
  import { createScorer } from '@mastra/core/evals';
44
48
 
45
49
  const glutenCheckerScorer = createScorer({
46
- name: 'Gluten Checker',
50
+ id: 'gluten-checker',
47
51
  description: 'Check if recipes contain gluten ingredients',
48
52
  judge: { // Optional: for prompt object steps
49
53
  model: 'openai/gpt-5.1',
@@ -59,13 +63,55 @@ const glutenCheckerScorer = createScorer({
59
63
 
60
64
  The judge configuration is only needed if you plan to use prompt objects in any step. Individual steps can override this default configuration with their own judge settings.
61
65
 
66
+ If all steps are function-based, the judge is never called and there is no judge output. To see LLM output, define at least one step as a prompt object and read the corresponding step result (for example, `results.analyzeStepResult`).
67
+
68
+ #### Minimal judge example (prompt object)
69
+
70
+ This example uses a prompt object in `analyze`, so the judge runs and its structured output is available as `results.analyzeStepResult`.
71
+
72
+ ```typescript
73
+ import { createScorer } from "@mastra/core/evals";
74
+ import { z } from "zod";
75
+
76
+ const quoteSourcesScorer = createScorer({
77
+ id: "quote-sources",
78
+ description: "Check if the response includes sources",
79
+ judge: {
80
+ model: "openai/gpt-4.1-nano",
81
+ instructions: "You are a strict evaluator.",
82
+ },
83
+ })
84
+ .analyze({
85
+ description: "Detect whether sources are present",
86
+ outputSchema: z.object({
87
+ hasSources: z.boolean(),
88
+ sources: z.array(z.string()),
89
+ }),
90
+ createPrompt: ({ run }) => `
91
+ Does the response contain sources? Extract them as a list.
92
+
93
+ Response:
94
+ ${run.output}
95
+ `,
96
+ })
97
+ .generateScore(({ results }) => (results.analyzeStepResult.hasSources ? 1 : 0));
98
+
99
+ // Run the scorer and inspect judge output
100
+ const result = await quoteSourcesScorer.run({
101
+ input: "What is the capital of France?",
102
+ output: "Paris is the capital of France [1]. Source: [1] Wikipedia",
103
+ });
104
+
105
+ console.log(result.score); // 1
106
+ console.log(result.analyzeStepResult); // { hasSources: true, sources: ["Wikipedia"] }
107
+ ```
108
+
62
109
  #### Agent Type for Agent Evaluation
63
110
 
64
111
  For type safety and compatibility with both live agent scoring and trace scoring, use `type: 'agent'` when creating scorers for agent evaluation. This allows you to use the same scorer for an agent and also use it to score traces:
65
112
 
66
113
  ```typescript
67
114
  const myScorer = createScorer({
68
- // ...
69
115
  type: "agent", // Automatically handles agent input/output types
70
116
  }).generateScore(({ run, results }) => {
71
117
  // run.output is automatically typed as ScorerRunOutputForAgent
@@ -241,9 +287,13 @@ A custom scorer in Mastra uses `createScorer` with four core components:
241
287
 
242
288
  Together, these components allow you to define custom evaluation logic using LLMs as judges.
243
289
 
244
- > See [createScorer](/reference/v1/evals/create-scorer) for the full API and configuration options.
290
+ :::info
291
+
292
+ Visit [createScorer](/reference/v1/evals/create-scorer) for the full API and configuration options.
245
293
 
246
- ```typescript title="src/mastra/scorers/gluten-checker.ts" showLineNumbers copy
294
+ :::
295
+
296
+ ```typescript title="src/mastra/scorers/gluten-checker.ts"
247
297
  import { createScorer } from "@mastra/core/evals";
248
298
  import { z } from "zod";
249
299
 
@@ -298,7 +348,7 @@ Return your response in this format:
298
348
  "This recipe is [gluten-free/contains gluten] because [explanation]"`;
299
349
 
300
350
  export const glutenCheckerScorer = createScorer({
301
- name: "Gluten Checker",
351
+ id: "gluten-checker",
302
352
  description: "Check if the output contains any gluten",
303
353
  judge: {
304
354
  model: "openai/gpt-4.1-nano",
@@ -395,11 +445,9 @@ Provides human-readable explanations for the score using another LLM call.
395
445
 
396
446
  The reason generation step creates explanations that help users understand why a particular score was assigned, using both the boolean result and the specific gluten sources identified by the analysis step.
397
447
 
398
- ````
399
-
400
448
  ## High gluten-free example
401
449
 
402
- ```typescript title="src/example-high-gluten-free.ts" showLineNumbers copy
450
+ ```typescript title="src/example-high-gluten-free.ts"
403
451
  const result = await glutenCheckerScorer.run({
404
452
  input: [{ role: 'user', content: 'Mix rice, beans, and vegetables' }],
405
453
  output: { text: 'Mix rice, beans, and vegetables' },
@@ -408,7 +456,7 @@ const result = await glutenCheckerScorer.run({
408
456
  console.log('Score:', result.score);
409
457
  console.log('Gluten sources:', result.analyzeStepResult.glutenSources);
410
458
  console.log('Reason:', result.reason);
411
- ````
459
+ ```
412
460
 
413
461
  ### High gluten-free output
414
462
 
@@ -425,7 +473,7 @@ console.log('Reason:', result.reason);
425
473
 
426
474
  ## Partial gluten example
427
475
 
428
- ```typescript title="src/example-partial-gluten.ts" showLineNumbers copy
476
+ ```typescript title="src/example-partial-gluten.ts"
429
477
  const result = await glutenCheckerScorer.run({
430
478
  input: [{ role: "user", content: "Mix flour and water to make dough" }],
431
479
  output: { text: "Mix flour and water to make dough" },
@@ -451,7 +499,7 @@ console.log("Reason:", result.reason);
451
499
 
452
500
  ## Low gluten-free example
453
501
 
454
- ```typescript title="src/example-low-gluten-free.ts" showLineNumbers copy
502
+ ```typescript title="src/example-low-gluten-free.ts"
455
503
  const result = await glutenCheckerScorer.run({
456
504
  input: [{ role: "user", content: "Add soy sauce and noodles" }],
457
505
  output: { text: "Add soy sauce and noodles" },
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  title: "Scorers overview | Evals"
3
3
  description: Overview of scorers in Mastra, detailing their capabilities for evaluating AI outputs and measuring performance.
4
+ packages:
5
+ - "@mastra/core"
6
+ - "@mastra/evals"
4
7
  ---
5
8
 
6
9
  # Scorers overview
@@ -23,7 +26,7 @@ There are different kinds of scorers, each serving a specific purpose. Here are
23
26
 
24
27
  To access Mastra's scorers feature install the `@mastra/evals` package.
25
28
 
26
- ```bash copy
29
+ ```bash
27
30
  npm install @mastra/evals@beta
28
31
  ```
29
32
 
@@ -35,7 +38,7 @@ npm install @mastra/evals@beta
35
38
 
36
39
  You can add built-in scorers to your agents to automatically evaluate their outputs. See the [full list of built-in scorers](/docs/v1/evals/built-in-scorers) for all available options.
37
40
 
38
- ```typescript title="src/mastra/agents/evaluated-agent.ts" showLineNumbers copy
41
+ ```typescript title="src/mastra/agents/evaluated-agent.ts"
39
42
  import { Agent } from "@mastra/core/agent";
40
43
  import {
41
44
  createAnswerRelevancyScorer,
@@ -43,7 +46,6 @@ import {
43
46
  } from "@mastra/evals/scorers/prebuilt";
44
47
 
45
48
  export const evaluatedAgent = new Agent({
46
- // ...
47
49
  scorers: {
48
50
  relevancy: {
49
51
  scorer: createAnswerRelevancyScorer({ model: "openai/gpt-4.1-nano" }),
@@ -61,13 +63,12 @@ export const evaluatedAgent = new Agent({
61
63
 
62
64
  You can also add scorers to individual workflow steps to evaluate outputs at specific points in your process:
63
65
 
64
- ```typescript title="src/mastra/workflows/content-generation.ts" showLineNumbers copy
66
+ ```typescript title="src/mastra/workflows/content-generation.ts"
65
67
  import { createWorkflow, createStep } from "@mastra/core/workflows";
66
68
  import { z } from "zod";
67
69
  import { customStepScorer } from "../scorers/custom-step-scorer";
68
70
 
69
71
  const contentStep = createStep({
70
- // ...
71
72
  scorers: {
72
73
  customStepScorer: {
73
74
  scorer: customStepScorer(),
@@ -115,7 +116,6 @@ To score traces, you first need to register your scorers with your Mastra instan
115
116
 
116
117
  ```typescript
117
118
  const mastra = new Mastra({
118
- // ...
119
119
  scorers: {
120
120
  answerRelevancy: myAnswerRelevancyScorer,
121
121
  responseQuality: myResponseQualityScorer,
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "Running Scorers in CI | Evals"
3
3
  description: "Learn how to run scorer experiments in your CI/CD pipeline using the runEvals function."
4
+ packages:
5
+ - "@mastra/core"
4
6
  ---
5
7
 
6
8
  # Running Scorers in CI
@@ -15,7 +17,7 @@ You can use any testing framework that supports ESM modules, such as [Vitest](ht
15
17
 
16
18
  Use `runEvals` to evaluate your agent against multiple test cases. The function accepts an array of data items, each containing an `input` and optional `groundTruth` for scorer validation.
17
19
 
18
- ```typescript copy showLineNumbers title="src/mastra/agents/weather-agent.test.ts"
20
+ ```typescript title="src/mastra/agents/weather-agent.test.ts"
19
21
  import { describe, it, expect } from 'vitest';
20
22
  import { createScorer, runEvals } from "@mastra/core/evals";
21
23
  import { weatherAgent } from "./weather-agent";
@@ -72,7 +74,7 @@ The `runEvals` function returns an object with:
72
74
 
73
75
  Create separate test cases for different evaluation scenarios:
74
76
 
75
- ```typescript copy showLineNumbers title="src/mastra/agents/weather-agent.test.ts"
77
+ ```typescript title="src/mastra/agents/weather-agent.test.ts"
76
78
  describe('Weather Agent Tests', () => {
77
79
  const locationScorer = createScorer({ /* ... */ });
78
80