@mastra/mcp-docs-server 1.2.15-alpha.7 → 1.2.15

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 (504) hide show
  1. package/.docs/docs/agents/agent-approval.md +14 -0
  2. package/.docs/docs/agents/code-mode.md +17 -2
  3. package/.docs/docs/agents/networks.md +2 -2
  4. package/.docs/docs/agents/overview.md +2 -2
  5. package/.docs/docs/agents/processors.md +3 -3
  6. package/.docs/docs/agents/using-tools.md +1 -1
  7. package/.docs/docs/browser/overview.md +8 -8
  8. package/.docs/docs/browser/recording.md +4 -4
  9. package/.docs/docs/capabilities/{channels/overview.md → channels.md} +70 -7
  10. package/.docs/docs/capabilities/subagents.md +6 -3
  11. package/.docs/docs/datasets/running-experiments.md +49 -0
  12. package/.docs/docs/deployment/cloud-providers.md +9 -9
  13. package/.docs/docs/deployment/overview.md +9 -9
  14. package/.docs/docs/deployment/sandbox.md +3 -3
  15. package/.docs/docs/deployment/web-framework.md +6 -6
  16. package/.docs/docs/deployment/workers.md +1 -1
  17. package/.docs/docs/deployment/workflow-runners.md +2 -2
  18. package/.docs/docs/getting-started/develop.md +1 -1
  19. package/.docs/docs/harness/agent-controller.md +45 -4
  20. package/.docs/docs/harness/overview.md +2 -4
  21. package/.docs/docs/index.md +8 -8
  22. package/.docs/docs/long-running-agents/durable-agents.md +3 -3
  23. package/.docs/docs/long-running-agents/goals.md +1 -1
  24. package/.docs/docs/long-running-agents/schedules.md +1 -1
  25. package/.docs/docs/long-running-agents/signal-providers.md +3 -16
  26. package/.docs/docs/long-running-agents/signals.md +2 -2
  27. package/.docs/docs/mastra-platform/database.md +2 -2
  28. package/.docs/docs/mastra-platform/deploy.md +27 -0
  29. package/.docs/docs/mastra-platform/server.md +1 -1
  30. package/.docs/docs/mastra-platform/trace-intelligence.md +9 -13
  31. package/.docs/docs/mcp/overview.md +42 -0
  32. package/.docs/docs/memory/memory-processors.md +5 -5
  33. package/.docs/docs/memory/message-history.md +3 -3
  34. package/.docs/docs/memory/multi-user-threads.md +1 -1
  35. package/.docs/docs/memory/observational-memory.md +2 -2
  36. package/.docs/docs/memory/semantic-recall.md +2 -1
  37. package/.docs/docs/memory/working-memory.md +1 -0
  38. package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -1
  39. package/.docs/docs/observability/integrations/exporters/mastra-storage.md +16 -15
  40. package/.docs/docs/observability/integrations/overview.md +3 -3
  41. package/.docs/docs/server/auth/fga.md +1 -1
  42. package/.docs/docs/server/auth/simple-auth.md +1 -1
  43. package/.docs/docs/server/auth/workers.md +2 -0
  44. package/.docs/docs/server/auth.md +10 -8
  45. package/.docs/docs/server/custom-adapters.md +1 -1
  46. package/.docs/docs/server/custom-api-routes.md +35 -0
  47. package/.docs/docs/server/mastra-client.md +13 -13
  48. package/.docs/docs/server/mastra-server.md +1 -1
  49. package/.docs/docs/storage/overview.md +14 -12
  50. package/.docs/docs/studio/observability.md +1 -1
  51. package/.docs/docs/workflows/agents-and-tools.md +2 -2
  52. package/.docs/docs/workflows/{stored-workflows.md → dynamic-workflows.md} +24 -24
  53. package/.docs/docs/workflows/overview.md +2 -2
  54. package/.docs/docs/workflows/snapshots.md +12 -10
  55. package/.docs/docs/workflows/time-travel.md +2 -0
  56. package/.docs/docs/workspace/filesystem.md +15 -15
  57. package/.docs/docs/workspace/sandbox.md +17 -17
  58. package/.docs/docs/workspace/search.md +1 -1
  59. package/.docs/guides/agent-frameworks/ai-sdk.md +2 -2
  60. package/.docs/guides/deployment/mastra-workers.md +4 -2
  61. package/.docs/guides/getting-started/quickstart.md +3 -3
  62. package/.docs/guides/guide/signal-provider.md +1 -1
  63. package/.docs/guides/index.md +8 -8
  64. package/.docs/guides/voice/overview.md +55 -106
  65. package/.docs/guides/voice/speech-to-text.md +7 -7
  66. package/.docs/guides/voice/text-to-speech.md +9 -10
  67. package/.docs/{guides/build-your-ui → integrations/agentic-ui}/ai-sdk-ui.md +5 -5
  68. package/.docs/{guides/build-your-ui → integrations/agentic-ui}/assistant-ui.md +1 -1
  69. package/.docs/{guides/build-your-ui/copilotkit/overview.md → integrations/agentic-ui/copilotkit.md} +257 -4
  70. package/.docs/{docs/server → integrations}/auth/auth0.md +1 -1
  71. package/.docs/{docs/server → integrations}/auth/clerk.md +2 -2
  72. package/.docs/{docs/server → integrations}/auth/firebase.md +1 -1
  73. package/.docs/{docs/server → integrations}/auth/okta.md +24 -4
  74. package/.docs/{docs/server → integrations}/auth/supabase.md +2 -2
  75. package/.docs/{docs/server → integrations}/auth/workos.md +1 -1
  76. package/.docs/{docs/browser → integrations/browsers}/agent-browser.md +2 -2
  77. package/.docs/{docs/browser → integrations/browsers}/browser-viewer.md +3 -3
  78. package/.docs/{docs/browser → integrations/browsers}/firecrawl.md +2 -2
  79. package/.docs/{docs/browser → integrations/browsers}/stagehand.md +1 -1
  80. package/.docs/{docs/capabilities → integrations}/channels/discord.md +2 -2
  81. package/.docs/integrations/channels/github.md +103 -0
  82. package/.docs/{docs/capabilities → integrations}/channels/imessage.md +12 -4
  83. package/.docs/{docs/capabilities → integrations}/channels/slack.md +4 -4
  84. package/.docs/{docs/capabilities → integrations}/channels/teams.md +2 -2
  85. package/.docs/{docs/capabilities → integrations}/channels/telegram.md +2 -2
  86. package/.docs/{docs/capabilities → integrations}/channels/whatsapp.md +2 -2
  87. package/.docs/{reference/storage/dsql.md → integrations/databases/aurora-dsql.md} +1 -1
  88. package/.docs/{reference/storage → integrations/databases}/clickhouse.md +2 -2
  89. package/.docs/{reference/storage → integrations/databases}/cloudflare-d1.md +1 -1
  90. package/.docs/{reference/storage/cloudflare.md → integrations/databases/cloudflare-kv.md} +1 -1
  91. package/.docs/{reference/storage → integrations/databases}/convex.md +1 -1
  92. package/.docs/{reference/storage → integrations/databases}/duckdb.md +5 -5
  93. package/.docs/{reference/storage → integrations/databases}/dynamodb.md +1 -1
  94. package/.docs/{reference/storage/lance.md → integrations/databases/lancedb.md} +1 -1
  95. package/.docs/{reference/storage → integrations/databases}/libsql.md +2 -2
  96. package/.docs/{reference/storage → integrations/databases}/mongodb.md +1 -1
  97. package/.docs/{reference/storage → integrations/databases}/mssql.md +1 -1
  98. package/.docs/integrations/databases/neon.md +220 -0
  99. package/.docs/integrations/databases/oracledb.md +239 -0
  100. package/.docs/{reference/storage → integrations/databases}/postgresql.md +1 -1
  101. package/.docs/{reference/storage → integrations/databases}/redis.md +1 -1
  102. package/.docs/{reference/storage → integrations/databases}/spanner.md +1 -1
  103. package/.docs/{reference/storage → integrations/databases}/upstash.md +1 -1
  104. package/.docs/{guides/deployment → integrations/deploy}/amazon-ec2.md +1 -1
  105. package/.docs/{guides/deployment → integrations/deploy}/aws-bedrock-agentcore.md +1 -1
  106. package/.docs/{guides/deployment → integrations/deploy}/aws-lambda.md +2 -2
  107. package/.docs/{guides/deployment → integrations/deploy}/azure-app-services.md +2 -2
  108. package/.docs/{guides/deployment → integrations/deploy}/cloudflare.md +2 -2
  109. package/.docs/{guides/deployment → integrations/deploy}/digital-ocean.md +3 -3
  110. package/.docs/{guides/deployment → integrations/deploy}/kubernetes.md +2 -2
  111. package/.docs/{guides/deployment → integrations/deploy}/netlify.md +3 -3
  112. package/.docs/{guides/deployment → integrations/deploy}/vercel.md +3 -3
  113. package/.docs/{reference/workspace/s3-filesystem.md → integrations/file-storage/amazon-s3.md} +5 -5
  114. package/.docs/{reference/workspace/archil-filesystem.md → integrations/file-storage/archil.md} +3 -3
  115. package/.docs/{reference/workspace/azure-blob-filesystem.md → integrations/file-storage/azure-blob.md} +2 -2
  116. package/.docs/{reference/workspace/gcs-filesystem.md → integrations/file-storage/google-cloud-storage.md} +5 -5
  117. package/.docs/{reference/workspace/mesa-filesystem.md → integrations/file-storage/mesa.md} +2 -2
  118. package/.docs/{reference/workspace/files-sdk-filesystem.md → integrations/file-storage/vercel-files.md} +5 -5
  119. package/.docs/{guides/getting-started → integrations/frameworks}/astro.md +1 -1
  120. package/.docs/{guides/getting-started → integrations/frameworks}/electron.md +3 -3
  121. package/.docs/{guides/getting-started → integrations/frameworks}/next-js.md +2 -2
  122. package/.docs/{guides/getting-started → integrations/frameworks}/nuxt.md +1 -1
  123. package/.docs/{guides/getting-started → integrations/frameworks}/sveltekit.md +1 -1
  124. package/.docs/{guides/getting-started → integrations/frameworks}/vite-react.md +1 -1
  125. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/arize.md +1 -1
  126. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/arthur.md +1 -1
  127. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/braintrust.md +1 -1
  128. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/confident-ai.md +1 -1
  129. package/.docs/integrations/observability/datadog.md +538 -0
  130. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/laminar.md +1 -1
  131. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/langfuse.md +1 -1
  132. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/langsmith.md +1 -1
  133. package/.docs/{docs/observability/integrations/exporters/otel.md → integrations/observability/opentelemetry.md} +278 -46
  134. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/posthog.md +1 -1
  135. package/.docs/{docs/observability/integrations/exporters → integrations/observability}/sentry.md +1 -1
  136. package/.docs/{reference/workspace/apple-container-sandbox.md → integrations/sandboxes/apple-container.md} +1 -1
  137. package/.docs/{reference/workspace/daytona-sandbox.md → integrations/sandboxes/daytona.md} +23 -2
  138. package/.docs/{reference/workspace/docker-sandbox.md → integrations/sandboxes/docker.md} +1 -1
  139. package/.docs/{reference/workspace/e2b-sandbox.md → integrations/sandboxes/e2b.md} +3 -3
  140. package/.docs/{reference/workspace/modal-sandbox.md → integrations/sandboxes/modal.md} +2 -2
  141. package/.docs/{reference/workspace/railway-sandbox.md → integrations/sandboxes/railway.md} +8 -0
  142. package/.docs/{reference/workspace/vercel-sandbox.md → integrations/sandboxes/vercel.md} +141 -12
  143. package/.docs/{reference → integrations}/tools/brightdata.md +1 -1
  144. package/.docs/{reference → integrations}/tools/perplexity.md +1 -1
  145. package/.docs/{reference → integrations}/tools/tavily.md +1 -1
  146. package/.docs/{reference → integrations}/voice/aws-nova-sonic.md +1 -1
  147. package/.docs/{reference → integrations}/voice/cloudflare.md +3 -3
  148. package/.docs/{reference/voice/google-gemini-live.md → integrations/voice/google.md} +305 -30
  149. package/.docs/{reference/voice/inworld-realtime.md → integrations/voice/inworld.md} +163 -25
  150. package/.docs/{reference → integrations}/voice/livekit.md +437 -34
  151. package/.docs/{reference/voice/openai-realtime.md → integrations/voice/openai.md} +117 -20
  152. package/.docs/integrations.md +147 -0
  153. package/.docs/models/embeddings.md +3 -3
  154. package/.docs/models/environment-variables.md +1 -0
  155. package/.docs/models/gateways/custom-gateways.md +4 -0
  156. package/.docs/models/gateways/neon.md +1 -1
  157. package/.docs/models/gateways/netlify.md +1 -1
  158. package/.docs/models/gateways/openrouter.md +9 -3
  159. package/.docs/models/gateways/vercel.md +7 -4
  160. package/.docs/models/index.md +3 -3
  161. package/.docs/models/providers/302ai.md +1 -1
  162. package/.docs/models/providers/abacus.md +1 -1
  163. package/.docs/models/providers/abliteration-ai.md +1 -1
  164. package/.docs/models/providers/agentrouter.md +1 -1
  165. package/.docs/models/providers/ai-router.md +1 -1
  166. package/.docs/models/providers/aiand.md +1 -1
  167. package/.docs/models/providers/aki-io.md +1 -1
  168. package/.docs/models/providers/alibaba-cn.md +1 -1
  169. package/.docs/models/providers/alibaba-coding-plan-cn.md +1 -1
  170. package/.docs/models/providers/alibaba-coding-plan.md +1 -1
  171. package/.docs/models/providers/alibaba-token-plan-cn.md +1 -1
  172. package/.docs/models/providers/alibaba-token-plan.md +1 -1
  173. package/.docs/models/providers/alibaba.md +7 -5
  174. package/.docs/models/providers/ambient.md +2 -2
  175. package/.docs/models/providers/anyapi.md +1 -1
  176. package/.docs/models/providers/atomic-chat.md +1 -1
  177. package/.docs/models/providers/auriko.md +1 -1
  178. package/.docs/models/providers/bailing.md +1 -1
  179. package/.docs/models/providers/baseten.md +2 -2
  180. package/.docs/models/providers/berget.md +1 -1
  181. package/.docs/models/providers/blueclaw.md +1 -1
  182. package/.docs/models/providers/chutes.md +1 -1
  183. package/.docs/models/providers/clarifai.md +1 -1
  184. package/.docs/models/providers/claudinio.md +1 -1
  185. package/.docs/models/providers/cline-pass.md +1 -1
  186. package/.docs/models/providers/cloudferro-sherlock.md +1 -1
  187. package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
  188. package/.docs/models/providers/coralbricks.md +75 -0
  189. package/.docs/models/providers/cortecs.md +3 -5
  190. package/.docs/models/providers/crof.md +1 -1
  191. package/.docs/models/providers/crossmodel.md +2 -3
  192. package/.docs/models/providers/daoxe.md +1 -1
  193. package/.docs/models/providers/databricks.md +1 -1
  194. package/.docs/models/providers/deepinfra.md +6 -5
  195. package/.docs/models/providers/digitalocean.md +5 -5
  196. package/.docs/models/providers/dinference.md +1 -1
  197. package/.docs/models/providers/drun.md +1 -1
  198. package/.docs/models/providers/ebcloud.md +1 -1
  199. package/.docs/models/providers/empiriolabs.md +3 -2
  200. package/.docs/models/providers/evroc.md +3 -4
  201. package/.docs/models/providers/fastrouter.md +1 -1
  202. package/.docs/models/providers/firepass.md +1 -1
  203. package/.docs/models/providers/fireworks-ai.md +1 -1
  204. package/.docs/models/providers/firmware.md +1 -1
  205. package/.docs/models/providers/freemodel.md +1 -1
  206. package/.docs/models/providers/friendli.md +1 -1
  207. package/.docs/models/providers/frogbot.md +1 -1
  208. package/.docs/models/providers/github-models.md +1 -1
  209. package/.docs/models/providers/gmicloud.md +1 -1
  210. package/.docs/models/providers/google.md +1 -1
  211. package/.docs/models/providers/greenpt.md +1 -1
  212. package/.docs/models/providers/helicone.md +1 -1
  213. package/.docs/models/providers/hetzner.md +8 -5
  214. package/.docs/models/providers/hpc-ai.md +1 -1
  215. package/.docs/models/providers/huggingface.md +1 -1
  216. package/.docs/models/providers/hyper.md +7 -7
  217. package/.docs/models/providers/iflowcn.md +1 -1
  218. package/.docs/models/providers/impossibl.md +1 -1
  219. package/.docs/models/providers/inception.md +1 -1
  220. package/.docs/models/providers/inceptron.md +1 -1
  221. package/.docs/models/providers/inference.md +1 -1
  222. package/.docs/models/providers/inferx.md +1 -1
  223. package/.docs/models/providers/infomaniak.md +1 -1
  224. package/.docs/models/providers/io-intelligence.md +1 -1
  225. package/.docs/models/providers/io-net.md +1 -1
  226. package/.docs/models/providers/jiekou.md +1 -1
  227. package/.docs/models/providers/kenari.md +1 -1
  228. package/.docs/models/providers/kilo.md +16 -11
  229. package/.docs/models/providers/kimi-for-coding.md +1 -1
  230. package/.docs/models/providers/kiro.md +1 -1
  231. package/.docs/models/providers/kuae-cloud-coding-plan.md +1 -1
  232. package/.docs/models/providers/lilac.md +1 -1
  233. package/.docs/models/providers/llama.md +1 -1
  234. package/.docs/models/providers/llmgateway.md +2 -7
  235. package/.docs/models/providers/llmtr.md +1 -1
  236. package/.docs/models/providers/lmstudio.md +1 -1
  237. package/.docs/models/providers/longcat.md +1 -1
  238. package/.docs/models/providers/lucidquery.md +1 -1
  239. package/.docs/models/providers/lynkr.md +1 -1
  240. package/.docs/models/providers/meganova.md +1 -1
  241. package/.docs/models/providers/meta.md +1 -1
  242. package/.docs/models/providers/minimax-cn-coding-plan.md +1 -1
  243. package/.docs/models/providers/minimax-cn.md +1 -1
  244. package/.docs/models/providers/minimax-coding-plan.md +1 -1
  245. package/.docs/models/providers/minimax.md +1 -1
  246. package/.docs/models/providers/mixlayer.md +1 -1
  247. package/.docs/models/providers/moark.md +1 -1
  248. package/.docs/models/providers/modal.md +1 -1
  249. package/.docs/models/providers/model-oracle-ai.md +1 -1
  250. package/.docs/models/providers/modelis.md +1 -1
  251. package/.docs/models/providers/modelscope.md +1 -1
  252. package/.docs/models/providers/moonshotai-cn.md +1 -1
  253. package/.docs/models/providers/moonshotai.md +1 -1
  254. package/.docs/models/providers/morph.md +1 -1
  255. package/.docs/models/providers/nano-gpt.md +8 -4
  256. package/.docs/models/providers/nearai.md +1 -1
  257. package/.docs/models/providers/nebius.md +3 -2
  258. package/.docs/models/providers/neuralwatt.md +1 -1
  259. package/.docs/models/providers/nova.md +1 -1
  260. package/.docs/models/providers/novita-ai.md +1 -1
  261. package/.docs/models/providers/nvidia.md +3 -2
  262. package/.docs/models/providers/ofox.md +4 -3
  263. package/.docs/models/providers/ollama-cloud.md +1 -1
  264. package/.docs/models/providers/opencode-go.md +1 -1
  265. package/.docs/models/providers/opencode.md +65 -64
  266. package/.docs/models/providers/orcarouter.md +1 -1
  267. package/.docs/models/providers/ovhcloud.md +1 -1
  268. package/.docs/models/providers/perplexity-agent.md +1 -1
  269. package/.docs/models/providers/pioneer.md +1 -1
  270. package/.docs/models/providers/poe.md +1 -1
  271. package/.docs/models/providers/poolside.md +1 -1
  272. package/.docs/models/providers/privatemode-ai.md +12 -10
  273. package/.docs/models/providers/qihang-ai.md +1 -1
  274. package/.docs/models/providers/qiniu-ai.md +1 -1
  275. package/.docs/models/providers/regolo-ai.md +26 -21
  276. package/.docs/models/providers/requesty.md +3 -3
  277. package/.docs/models/providers/routing-run.md +1 -1
  278. package/.docs/models/providers/sakana.md +1 -1
  279. package/.docs/models/providers/sarvam.md +1 -1
  280. package/.docs/models/providers/scaleway.md +1 -1
  281. package/.docs/models/providers/scx.md +1 -1
  282. package/.docs/models/providers/siliconflow-cn.md +1 -1
  283. package/.docs/models/providers/siliconflow.md +1 -1
  284. package/.docs/models/providers/snowflake-cortex.md +6 -2
  285. package/.docs/models/providers/stackit.md +1 -1
  286. package/.docs/models/providers/stepfun-ai-step-plan.md +1 -1
  287. package/.docs/models/providers/stepfun-ai.md +1 -1
  288. package/.docs/models/providers/stepfun-step-plan.md +1 -1
  289. package/.docs/models/providers/stepfun.md +1 -1
  290. package/.docs/models/providers/subconscious.md +1 -1
  291. package/.docs/models/providers/submodel.md +1 -1
  292. package/.docs/models/providers/synthetic.md +1 -1
  293. package/.docs/models/providers/tencent-coding-plan.md +1 -1
  294. package/.docs/models/providers/tencent-token-plan.md +1 -1
  295. package/.docs/models/providers/tencent-tokenhub.md +1 -1
  296. package/.docs/models/providers/tensorx.md +1 -1
  297. package/.docs/models/providers/the-grid-ai.md +1 -1
  298. package/.docs/models/providers/thinkingmachines.md +1 -1
  299. package/.docs/models/providers/tinfoil.md +2 -2
  300. package/.docs/models/providers/togetherai.md +1 -1
  301. package/.docs/models/providers/trustedrouter.md +1 -1
  302. package/.docs/models/providers/umans-ai-coding-plan.md +1 -1
  303. package/.docs/models/providers/umans-ai.md +1 -1
  304. package/.docs/models/providers/unorouter.md +1 -1
  305. package/.docs/models/providers/upstage.md +1 -1
  306. package/.docs/models/providers/venice.md +1 -1
  307. package/.docs/models/providers/vivgrid.md +1 -1
  308. package/.docs/models/providers/vultr.md +1 -1
  309. package/.docs/models/providers/wafer.ai.md +1 -1
  310. package/.docs/models/providers/wandb.md +3 -2
  311. package/.docs/models/providers/xiaomi-token-plan-ams.md +1 -1
  312. package/.docs/models/providers/xiaomi-token-plan-cn.md +1 -1
  313. package/.docs/models/providers/xiaomi-token-plan-sgp.md +1 -1
  314. package/.docs/models/providers/xiaomi.md +1 -1
  315. package/.docs/models/providers/xpersona.md +1 -1
  316. package/.docs/models/providers/zai-coding-plan.md +1 -1
  317. package/.docs/models/providers/zai.md +1 -1
  318. package/.docs/models/providers/zeldoc.md +8 -8
  319. package/.docs/models/providers/zenifra.md +1 -1
  320. package/.docs/models/providers/zenmux.md +1 -16
  321. package/.docs/models/providers/zhipuai-coding-plan.md +1 -1
  322. package/.docs/models/providers/zhipuai.md +1 -1
  323. package/.docs/models/providers.md +1 -0
  324. package/.docs/reference/agent-controller/agent-controller-class.md +35 -4
  325. package/.docs/reference/agent-controller/session.md +5 -3
  326. package/.docs/reference/agents/channels.md +2 -2
  327. package/.docs/reference/agents/durable-agent.md +2 -0
  328. package/.docs/reference/agents/generateLegacy.md +2 -2
  329. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  330. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  331. package/.docs/reference/agents/inngest-agent.md +3 -1
  332. package/.docs/reference/agents/network.md +1 -1
  333. package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
  334. package/.docs/reference/ai-sdk/network-route.md +1 -1
  335. package/.docs/reference/auth/auth0.md +1 -1
  336. package/.docs/reference/auth/better-auth.md +1 -1
  337. package/.docs/reference/auth/clerk.md +1 -1
  338. package/.docs/reference/auth/firebase.md +1 -1
  339. package/.docs/reference/auth/google.md +1 -1
  340. package/.docs/reference/auth/okta.md +5 -1
  341. package/.docs/reference/auth/supabase.md +1 -1
  342. package/.docs/reference/auth/workos.md +1 -1
  343. package/.docs/reference/browser/agent-browser.md +2 -2
  344. package/.docs/reference/browser/browser-viewer.md +1 -1
  345. package/.docs/reference/browser/firecrawl-browser.md +1 -1
  346. package/.docs/reference/browser/mastra-browser.md +1 -1
  347. package/.docs/reference/browser/stagehand-browser.md +2 -2
  348. package/.docs/reference/channels/channel-provider.md +1 -1
  349. package/.docs/reference/channels/slack-provider.md +2 -2
  350. package/.docs/reference/cli/mastra.md +6 -6
  351. package/.docs/reference/client-js/agents.md +2 -1
  352. package/.docs/reference/client-js/workflows.md +21 -21
  353. package/.docs/reference/code-sdk/mount-agent-controller.md +1 -1
  354. package/.docs/reference/configuration.md +21 -27
  355. package/.docs/reference/core/{addStoredWorkflow.md → addDynamicWorkflow.md} +10 -10
  356. package/.docs/reference/core/{addStoredWorkflows.md → addDynamicWorkflows.md} +9 -9
  357. package/.docs/reference/core/getStorage.md +1 -1
  358. package/.docs/reference/core/getVector.md +2 -2
  359. package/.docs/reference/core/listVectors.md +2 -2
  360. package/.docs/reference/core/setStorage.md +1 -1
  361. package/.docs/reference/datasets/startExperiment.md +8 -0
  362. package/.docs/reference/editor/tool-provider.md +26 -1
  363. package/.docs/reference/file-based-agents/config.md +2 -0
  364. package/.docs/reference/file-based-agents/instructions.md +2 -0
  365. package/.docs/reference/file-based-agents/logger.md +2 -0
  366. package/.docs/reference/file-based-agents/memory.md +2 -0
  367. package/.docs/reference/file-based-agents/observability.md +2 -0
  368. package/.docs/reference/file-based-agents/processors.md +2 -0
  369. package/.docs/reference/file-based-agents/schedules.md +2 -0
  370. package/.docs/reference/file-based-agents/scorers.md +2 -0
  371. package/.docs/reference/file-based-agents/server.md +2 -0
  372. package/.docs/reference/file-based-agents/skills.md +2 -0
  373. package/.docs/reference/file-based-agents/storage.md +3 -1
  374. package/.docs/reference/file-based-agents/studio.md +3 -1
  375. package/.docs/reference/file-based-agents/subagents.md +2 -0
  376. package/.docs/reference/file-based-agents/tools.md +2 -0
  377. package/.docs/reference/file-based-agents/workflows.md +2 -0
  378. package/.docs/reference/file-based-agents/workspace.md +2 -0
  379. package/.docs/reference/index.md +32 -57
  380. package/.docs/{guides/getting-started → reference}/manual-install.md +2 -2
  381. package/.docs/{guides → reference}/migrations/ai-sdk-v4-to-v5.md +1 -1
  382. package/.docs/{guides → reference}/migrations/mastra-cloud.md +2 -2
  383. package/.docs/{guides → reference}/migrations/upgrade-to-v1/cli.md +1 -1
  384. package/.docs/{guides → reference}/migrations/upgrade-to-v1/memory.md +1 -1
  385. package/.docs/{guides → reference}/migrations/upgrade-to-v1/overview.md +41 -41
  386. package/.docs/{guides → reference}/migrations/upgrade-to-v1/tools.md +1 -1
  387. package/.docs/{guides → reference}/migrations/upgrade-to-v1/tracing.md +10 -10
  388. package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
  389. package/.docs/reference/observability/tracing/bridges/otel.md +2 -2
  390. package/.docs/reference/observability/tracing/exporters/arize.md +1 -1
  391. package/.docs/reference/observability/tracing/exporters/arthur.md +1 -1
  392. package/.docs/reference/observability/tracing/exporters/confident-ai.md +1 -1
  393. package/.docs/reference/observability/tracing/exporters/datadog.md +1 -1
  394. package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +12 -0
  395. package/.docs/reference/observability/tracing/exporters/otel.md +2 -2
  396. package/.docs/reference/processors/pii-detector.md +2 -0
  397. package/.docs/reference/processors/prompt-injection-detector.md +2 -0
  398. package/.docs/reference/processors/regex-filter-processor.md +20 -0
  399. package/.docs/reference/processors/response-cache.md +2 -0
  400. package/.docs/reference/processors/tool-search-processor.md +33 -1
  401. package/.docs/reference/pubsub/lease-provider.md +1 -1
  402. package/.docs/{guides → reference}/rag/chunking-and-embedding.md +16 -19
  403. package/.docs/reference/rag/database-config.md +1 -1
  404. package/.docs/{guides/rag/graph-rag.md → reference/rag/graph-rag-guide.md} +1 -1
  405. package/.docs/reference/rag/metadata-filters.md +13 -4
  406. package/.docs/{guides → reference}/rag/overview.md +2 -2
  407. package/.docs/{guides → reference}/rag/retrieval.md +18 -1
  408. package/.docs/{guides → reference}/rag/vector-databases.md +42 -1
  409. package/.docs/reference/schedules/overview.md +2 -0
  410. package/.docs/reference/server/create-route.md +27 -1
  411. package/.docs/reference/server/register-api-route.md +2 -0
  412. package/.docs/reference/server/routes.md +9 -9
  413. package/.docs/reference/signals/create-notification-inbox-tool.md +2 -0
  414. package/.docs/reference/signals/signal-provider.md +2 -0
  415. package/.docs/reference/signals/task-signal-provider.md +2 -0
  416. package/.docs/reference/signals/webhook-signal-provider.md +2 -0
  417. package/.docs/reference/storage/composite.md +4 -4
  418. package/.docs/reference/storage/overview.md +9 -9
  419. package/.docs/reference/storage/retention.md +5 -5
  420. package/.docs/reference/streaming/ChunkType.md +3 -3
  421. package/.docs/reference/streaming/agents/stream.md +1 -1
  422. package/.docs/reference/streaming/agents/streamLegacy.md +3 -3
  423. package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
  424. package/.docs/reference/tools/create-code-mode.md +3 -1
  425. package/.docs/reference/tools/isolated-vm-transport.md +1 -1
  426. package/.docs/reference/tools/mcp-client.md +51 -0
  427. package/.docs/reference/tools/mcp-server.md +1 -1
  428. package/.docs/reference/tools/quickjs-transport.md +92 -0
  429. package/.docs/reference/vectors/chroma.md +1 -1
  430. package/.docs/reference/vectors/convex.md +2 -2
  431. package/.docs/reference/vectors/oracledb.md +347 -0
  432. package/.docs/reference/workers/overview.md +10 -8
  433. package/.docs/reference/workflows/{stored-workflow-definition.md → dynamic-workflow-definition.md} +9 -7
  434. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -0
  435. package/.docs/reference/workflows/workflow-methods/agent.md +3 -3
  436. package/.docs/reference/workflows/workflow-methods/tool.md +3 -3
  437. package/.docs/reference/workflows/workflow.md +18 -0
  438. package/.docs/reference/workspace/local-sandbox.md +1 -1
  439. package/.docs/reference/workspace/platform-filesystem.md +3 -3
  440. package/.docs/reference/workspace/platform-sandbox.md +11 -3
  441. package/.docs/reference/workspace/process-manager.md +3 -3
  442. package/.docs/reference/workspace/sandbox.md +10 -0
  443. package/CHANGELOG.md +97 -0
  444. package/dist/index.js +1 -1
  445. package/dist/{src-BZcgzbk9.js → src-D-W-bx5t.js} +2 -2
  446. package/dist/{src-BZcgzbk9.js.map → src-D-W-bx5t.js.map} +1 -1
  447. package/dist/stdio.js +1 -1
  448. package/package.json +6 -6
  449. package/.docs/docs/capabilities/channels/other-adapters.md +0 -68
  450. package/.docs/docs/observability/integrations/bridges/datadog.md +0 -219
  451. package/.docs/docs/observability/integrations/bridges/otel.md +0 -234
  452. package/.docs/docs/observability/integrations/exporters/datadog.md +0 -321
  453. package/.docs/guides/build-your-ui/copilotkit/channels.md +0 -86
  454. package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +0 -174
  455. package/.docs/guides/guide/chef-michel.md +0 -211
  456. package/.docs/guides/guide/publishing-mcp-server.md +0 -137
  457. package/.docs/guides/guide/slack-assistant.md +0 -193
  458. package/.docs/guides/guide/stock-agent.md +0 -132
  459. package/.docs/guides/guide/web-search.md +0 -322
  460. package/.docs/guides/guide/whatsapp-chat-bot.md +0 -407
  461. package/.docs/guides/voice/realtime-voice.md +0 -430
  462. package/.docs/reference/voice/google.md +0 -290
  463. package/.docs/reference/voice/inworld.md +0 -137
  464. package/.docs/reference/voice/openai.md +0 -96
  465. package/.docs/reference/voice/playai.md +0 -82
  466. package/.docs/reference/workspace/vercel-serverless.md +0 -128
  467. /package/.docs/{guides/concepts → docs/guides}/multi-agent-systems.md +0 -0
  468. /package/.docs/{guides/concepts → docs/guides}/streaming.md +0 -0
  469. /package/.docs/{guides/build-your-ui → integrations/agentic-ui}/openui.md +0 -0
  470. /package/.docs/{docs/server → integrations}/auth/better-auth.md +0 -0
  471. /package/.docs/{docs/server → integrations}/auth/google.md +0 -0
  472. /package/.docs/{guides/deployment → integrations/deploy}/inngest.md +0 -0
  473. /package/.docs/{guides/deployment → integrations/deploy}/temporal.md +0 -0
  474. /package/.docs/{reference/workspace/agentfs-filesystem.md → integrations/file-storage/agentfs.md} +0 -0
  475. /package/.docs/{reference/workspace/google-drive-filesystem.md → integrations/file-storage/google-drive.md} +0 -0
  476. /package/.docs/{guides/getting-started → integrations/frameworks}/express.md +0 -0
  477. /package/.docs/{guides/getting-started → integrations/frameworks}/hono.md +0 -0
  478. /package/.docs/{guides/getting-started → integrations/frameworks}/nestjs.md +0 -0
  479. /package/.docs/{reference/workspace/agentcore-runtime-sandbox.md → integrations/sandboxes/agentcore.md} +0 -0
  480. /package/.docs/{reference/workspace/blaxel-sandbox.md → integrations/sandboxes/blaxel.md} +0 -0
  481. /package/.docs/{guides/guide → integrations/tools}/firecrawl.md +0 -0
  482. /package/.docs/{reference → integrations}/voice/azure.md +0 -0
  483. /package/.docs/{reference → integrations}/voice/deepgram.md +0 -0
  484. /package/.docs/{reference → integrations}/voice/elevenlabs.md +0 -0
  485. /package/.docs/{reference → integrations}/voice/mistral.md +0 -0
  486. /package/.docs/{reference → integrations}/voice/murf.md +0 -0
  487. /package/.docs/{reference → integrations}/voice/sarvam.md +0 -0
  488. /package/.docs/{reference → integrations}/voice/speechify.md +0 -0
  489. /package/.docs/{reference/voice/xai-realtime.md → integrations/voice/xai.md} +0 -0
  490. /package/.docs/{guides → reference}/migrations/agentnetwork.md +0 -0
  491. /package/.docs/{guides → reference}/migrations/network-to-supervisor.md +0 -0
  492. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/agent.md +0 -0
  493. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/client.md +0 -0
  494. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/deployment.md +0 -0
  495. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/evals.md +0 -0
  496. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/mastra.md +0 -0
  497. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/mcp.md +0 -0
  498. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/processors.md +0 -0
  499. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/rag.md +0 -0
  500. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/storage.md +0 -0
  501. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/vectors.md +0 -0
  502. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/voice.md +0 -0
  503. /package/.docs/{guides → reference}/migrations/upgrade-to-v1/workflows.md +0 -0
  504. /package/.docs/{guides → reference}/migrations/vnext-to-standard-apis.md +0 -0
@@ -1,430 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Realtime voice
4
-
5
- Realtime voice turns a Mastra agent into a live call a user can talk over, in the browser or over the phone. Mastra builds it on [LiveKit](https://livekit.io), an open source WebRTC platform for realtime audio and video.
6
-
7
- The [`@mastra/livekit`](https://mastra.ai/reference/voice/livekit) package connects Mastra agents to the [LiveKit Agents framework](https://docs.livekit.io/agents/): LiveKit owns the audio loop like voice activity detection, streaming speech-to-text, semantic turn detection, barge-in, and text-to-speech. Your Mastra agent generates every reply with its own model, tools, and memory.
8
-
9
- Use realtime voice when you need low-latency, interruptible voice conversations. For provider-based speech-to-speech without LiveKit, see [Speech to Speech](https://mastra.ai/guides/voice/speech-to-speech).
10
-
11
- ## Quickstart
12
-
13
- These steps take you from an empty project to a voice agent you can talk to. A voice session has two moving parts you set up here: an API route on your Mastra server that hands out access tokens, and a separate worker process that runs the audio pipeline and calls your agent each turn.
14
-
15
- 1. Install the integration package along with the LiveKit plugins for voice activity detection and turn detection:
16
-
17
- **npm**:
18
-
19
- ```bash
20
- npm install @mastra/livekit @livekit/agents @livekit/agents-plugin-silero @livekit/agents-plugin-livekit
21
- ```
22
-
23
- **pnpm**:
24
-
25
- ```bash
26
- pnpm add @mastra/livekit @livekit/agents @livekit/agents-plugin-silero @livekit/agents-plugin-livekit
27
- ```
28
-
29
- **Yarn**:
30
-
31
- ```bash
32
- yarn add @mastra/livekit @livekit/agents @livekit/agents-plugin-silero @livekit/agents-plugin-livekit
33
- ```
34
-
35
- **Bun**:
36
-
37
- ```bash
38
- bun add @mastra/livekit @livekit/agents @livekit/agents-plugin-silero @livekit/agents-plugin-livekit
39
- ```
40
-
41
- 2. Set your LiveKit credentials inside an `.env` file. Create a free project on [LiveKit Cloud](https://cloud.livekit.io), or run a local server with [`livekit-server --dev`](https://docs.livekit.io/home/self-hosting/local/):
42
-
43
- ```bash
44
- LIVEKIT_URL=wss://your-project.livekit.cloud
45
- LIVEKIT_API_KEY=your-api-key
46
- LIVEKIT_API_SECRET=your-api-secret
47
- ```
48
-
49
- 3. Add a voice agent to your Mastra instance and expose a connection route. The `liveKitConnectionRoute()` helper adds a `POST /voice/livekit/connection-details` endpoint that mints a LiveKit token and dispatches your agent into a room:
50
-
51
- ```typescript
52
- import { Mastra } from '@mastra/core/mastra'
53
- import { Agent } from '@mastra/core/agent'
54
- import { liveKitConnectionRoute } from '@mastra/livekit'
55
-
56
- const supportAgent = new Agent({
57
- id: 'support',
58
- name: 'Support',
59
- instructions: 'You are a friendly phone support agent. Keep replies short and conversational.',
60
- model: 'openai/gpt-5-mini',
61
- })
62
-
63
- export const mastra = new Mastra({
64
- agents: { support: supportAgent },
65
- server: {
66
- apiRoutes: [liveKitConnectionRoute({ agentName: 'mastra-voice' })],
67
- },
68
- })
69
- ```
70
-
71
- 4. Create the worker. It runs as a separate process, answers LiveKit sessions, and calls your agent each turn. Worker APIs live on the `@mastra/livekit/worker` entry point, so the Mastra server never loads the LiveKit agents runtime. This example uses LiveKit Inference model strings for speech-to-text and text-to-speech, so no provider plugins are required:
72
-
73
- ```typescript
74
- import { fileURLToPath } from 'node:url'
75
- import { createLiveKitWorker, runLiveKitWorker } from '@mastra/livekit/worker'
76
- import { mastra } from './index'
77
-
78
- export default createLiveKitWorker({
79
- mastra,
80
- agent: 'support',
81
- stt: 'deepgram/nova-3',
82
- tts: 'cartesia/sonic-3',
83
- turnDetection: 'multilingual',
84
- greeting: 'Hi! How can I help you today?',
85
- })
86
-
87
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
88
- runLiveKitWorker({ entry: import.meta.url, agentName: 'mastra-voice' })
89
- }
90
- ```
91
-
92
- The `agent` option selects which Mastra agent answers each session. Pass a fixed key as shown, or omit it to use the `agentId` from the dispatch metadata, so one worker can serve every agent on your Mastra instance.
93
-
94
- 5. Download the turn detection and voice activity detection models once. Then run the worker in one terminal and your Mastra server in another:
95
-
96
- ```bash
97
- npx livekit-agents download-files
98
- npx tsx src/mastra/voice-worker.ts dev
99
- ```
100
-
101
- **npm**:
102
-
103
- ```bash
104
- npm run dev
105
- ```
106
-
107
- **pnpm**:
108
-
109
- ```bash
110
- pnpm run dev
111
- ```
112
-
113
- **Yarn**:
114
-
115
- ```bash
116
- yarn dev
117
- ```
118
-
119
- **Bun**:
120
-
121
- ```bash
122
- bun run dev
123
- ```
124
-
125
- The worker registers with your LiveKit server and waits for sessions, while `mastra dev` serves the connection route.
126
-
127
- 6. Talk to your agent. Open the hosted [LiveKit Agents Playground](https://agents-playground.livekit.io) and connect it to your project to start a call without building a frontend.
128
-
129
- To wire up your own app instead, call the connection route for a token. `POST /voice/livekit/connection-details` accepts optional `agentId`, `threadId`, and `resourceId` fields in the request body and returns:
130
-
131
- ```json
132
- {
133
- "serverUrl": "wss://your-project.livekit.cloud",
134
- "roomName": "mastra-voice-a1b2c3d4",
135
- "participantName": "user-1",
136
- "participantToken": "eyJhbGci..."
137
- }
138
- ```
139
-
140
- This response matches the contract used by LiveKit's frontend starters, so apps built from [agent-starter-react](https://github.com/livekit-examples/agent-starter-react) or the [LiveKit React components](https://docs.livekit.io/reference/components/react/) work without changes.
141
-
142
- ## Turn detection and interruptions
143
-
144
- LiveKit decides when the user finished speaking and when the agent was interrupted. The defaults work well; tune them with `turnHandling`:
145
-
146
- ```typescript
147
- export default createLiveKitWorker({
148
- mastra,
149
- agent: 'support',
150
- stt: 'deepgram/nova-3',
151
- tts: 'cartesia/sonic-3',
152
- turnDetection: 'multilingual',
153
- turnHandling: {
154
- endpointing: { mode: 'dynamic', minDelay: 300, maxDelay: 3000 },
155
- interruption: { minDuration: 500, resumeFalseInterruption: true },
156
- },
157
- })
158
- ```
159
-
160
- - `turnDetection: 'multilingual'`: Runs LiveKit's semantic end-of-turn model locally on CPU. It reads the live transcript to avoid cutting users off mid-thought. Use `'vad'` or `'stt'` for silence-based endpointing instead.
161
- - `endpointing`: Bounds how long the agent waits after the user stops speaking.
162
- - `interruption`: Controls barge-in. When the user speaks over the agent, LiveKit stops playback and cancels the in-flight Mastra stream, so token generation stops too.
163
- - `preemptiveGeneration`: Starts the Mastra agent's reply while the user is still finishing, hiding time-to-first-token. The worker disables it by default: each preemptive attempt runs the Mastra agent on an interim transcript, and every run persists the user message, which duplicates messages in the thread. Re-enable it with `preemptiveGeneration: { enabled: true }` if latency matters more than exact thread history.
164
-
165
- See the [LiveKit turn detection docs](https://docs.livekit.io/agents/logic/turns/) for all options.
166
-
167
- ## Per-call voices and transcription
168
-
169
- The top-level `stt` and `tts` options apply to every call. To pick them per call, one voice or language per tenant, set the `configuration.stt` and `configuration.tts` resolvers instead. Each resolver runs once per call with the dispatch metadata, request context, room name, and job context, and returns a value accepted by the matching top-level option. The value is either a plugin instance or an inference model string. Return `undefined` to fall back to the top-level option.
170
-
171
- The following example gives each tenant its own text-to-speech voice, keyed off the `tenant` entry in the dispatch metadata:
172
-
173
- ```typescript
174
- import * as cartesia from '@livekit/agents-plugin-cartesia'
175
-
176
- // One voice id per tenant, resolved from the dispatch metadata on each call.
177
- const tenantVoices: Record<string, string> = {
178
- meridian: 'your-cartesia-voice-id-1',
179
- coastal: 'your-cartesia-voice-id-2',
180
- }
181
- // The resolver runs during call setup, so cache plugin instances across calls.
182
- const ttsByVoice = new Map<string, cartesia.TTS>()
183
-
184
- export default createLiveKitWorker({
185
- mastra,
186
- agent: 'support',
187
- stt: 'deepgram/nova-3',
188
- tts: 'cartesia/sonic-3',
189
- configuration: {
190
- tts: ({ requestContext }) => {
191
- const voice = tenantVoices[requestContext?.tenant as string]
192
- if (!voice) return undefined // fall back to the top-level `tts`
193
- let tts = ttsByVoice.get(voice)
194
- if (!tts) {
195
- tts = new cartesia.TTS({ voice })
196
- ttsByVoice.set(voice, tts)
197
- }
198
- return tts
199
- },
200
- },
201
- })
202
- ```
203
-
204
- `configuration.stt` works the same way for per-call transcription, for example a different transcription model or language per tenant. The greeting has a matching per-call form: `configuration.greeting.text` accepts a resolver with the same call context, so one worker can open with each tenant's own phrasing.
205
-
206
- ## Memory and threads
207
-
208
- When the resolved Mastra agent has memory configured, each call becomes one memory thread:
209
-
210
- - `thread` defaults to the `threadId` from dispatch metadata, then to the room name.
211
- - `resource` defaults to the `resourceId` from dispatch metadata, then to the thread. Send your end user's id here so calls group under the right user. Mastra Studio sends the agent id, matching how its sidebar lists threads.
212
- - When the thread doesn't exist yet, the worker creates it titled "Voice call" with metadata `{ source: 'livekit' }`, and the spoken greeting is saved as the first assistant message so the thread reads as a full call transcript (disable with `persistGreeting: false`).
213
-
214
- Each turn sends only the new user input; Mastra Memory supplies history, semantic recall, and working memory. Pin a session to an existing thread by passing `threadId` in the connection request body, which is useful for continuing a text conversation by voice. In Studio, starting a call from an open chat binds the call to that thread, and the transcript fills into the chat after each exchange.
215
-
216
- When a user interrupts the agent, the in-flight generation aborts and nothing from that turn is persisted at that moment. LiveKit keeps the part the user actually heard in its transcript, and on the next turn the worker re-sends that heard-only fragment so the thread backfills to match the call. A user who hangs up right after interrupting leaves that final fragment unrecorded. See [interrupted turns](https://mastra.ai/reference/voice/livekit) for the details and a reconciliation recipe.
217
-
218
- ## Speak while tools run
219
-
220
- Voice conversations can't go silent while a slow tool runs. Use `toolFeedback` to speak a short phrase when the Mastra agent starts a tool call:
221
-
222
- ```typescript
223
- export default createLiveKitWorker({
224
- mastra,
225
- agent: 'support',
226
- stt: 'deepgram/nova-3',
227
- tts: 'cartesia/sonic-3',
228
- toolFeedback: ({ toolName }) =>
229
- toolName === 'searchOrders' ? 'Let me look that up.' : undefined,
230
- })
231
- ```
232
-
233
- The phrase is spoken as part of the reply and recorded in the transcript.
234
-
235
- ## Generate replies with a workflow
236
-
237
- By default the worker generates each reply with a Mastra agent. To run multi-step logic per turn (for example classify intent, route, call tools in sequence, then compose a reply), generate replies with a Mastra [workflow](https://mastra.ai/docs/workflows/overview) instead. Set `workflow` in place of `agent`.
238
-
239
- LiveKit still owns the audio loop and calls into Mastra once per turn, so the workflow runs to completion each turn. The workflow can't suspend or resume, and no conversation state carries between turns. Pass the transcript in through `workflowInput` so the workflow stays stateless:
240
-
241
- ```typescript
242
- import { createLiveKitWorker, chatContextToMessages } from '@mastra/livekit/worker'
243
- import { mastra } from './index'
244
-
245
- export default createLiveKitWorker({
246
- mastra,
247
- workflow: 'phoneConversation',
248
- workflowInput: ({ chatCtx }) => ({ history: chatContextToMessages(chatCtx) }),
249
- replyStep: 'generateResponse',
250
- stt: 'deepgram/nova-3',
251
- tts: 'cartesia/sonic-3',
252
- turnDetection: 'multilingual',
253
- })
254
- ```
255
-
256
- A workflow streams structured step events, not text. To speak tokens as they generate, the reply step pipes its agent's text into the step `writer`:
257
-
258
- ```typescript
259
- const generateResponse = createStep({
260
- id: 'generateResponse',
261
- // input and output schemas omitted
262
- execute: async ({ inputData, mastra, writer, abortSignal }) => {
263
- const stream = await mastra.getAgent('voice').stream(inputData.history, { abortSignal })
264
- await stream.textStream.pipeTo(writer)
265
- return { assistantMessage: await stream.text }
266
- },
267
- })
268
- ```
269
-
270
- - `replyStep`: Restricts spoken output to one step. Omit it to speak every step that writes to its `writer`.
271
- - `resultText`: A fallback that derives the reply from the final run result when no step streams text. Streaming through `writer` gives lower time-to-first-token, so prefer it.
272
- - `abortSignal`: Forward the step's `abortSignal` into `agent.stream()` so barge-in stops generation promptly. When the user interrupts, the worker cancels the run.
273
- - `generate`: For full control, pass a `generate` function instead. It can be any reply generator that turns a turn into a text stream.
274
-
275
- With a workflow, the worker doesn't persist turns automatically the way an agent's `stream()` does. Persist conversation history inside the workflow, or keep the LiveKit transcript as the source of truth and pass it in each turn.
276
-
277
- ## Use Mastra as the LLM component
278
-
279
- `createLiveKitWorker()` owns the LiveKit session for you. To own the session yourself, use [`MastraLLM`](https://mastra.ai/reference/voice/livekit) instead: a standard LiveKit LLM plugin that puts a Mastra agent in the `llm` slot of your own `voice.AgentSession`. The Mastra app, agent loop, tools, memory, observability, runs on your Mastra server, and the worker reaches it over HTTP. The worker process needs no Mastra app, database, or model provider keys.
280
-
281
- ```typescript
282
- import { fileURLToPath } from 'node:url'
283
- import { defineAgent, voice } from '@livekit/agents'
284
- import * as silero from '@livekit/agents-plugin-silero'
285
- import { MastraLLM } from '@mastra/livekit/plugin'
286
- import { runLiveKitWorker } from '@mastra/livekit/worker'
287
-
288
- export default defineAgent({
289
- entry: async ctx => {
290
- await ctx.connect()
291
-
292
- const session = new voice.AgentSession({
293
- llm: new MastraLLM({
294
- remote: { baseUrl: process.env.MASTRA_URL!, agentId: 'support' },
295
- memory: { thread: ctx.room.name!, resource: 'user-7' },
296
- }),
297
- stt: 'deepgram/nova-3',
298
- tts: 'cartesia/sonic-3',
299
- vad: await silero.VAD.load(),
300
- // Required with `memory`: LiveKit enables preemptive generation by default.
301
- turnHandling: { preemptiveGeneration: { enabled: false } },
302
- })
303
-
304
- await session.start({
305
- // These instructions never reach the Mastra agent; its own instructions apply.
306
- agent: new voice.Agent({ instructions: 'Replies come from the Mastra agent.' }),
307
- room: ctx.room,
308
- })
309
-
310
- session.say('Hi! How can I help you today?')
311
- },
312
- })
313
-
314
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
315
- runLiveKitWorker({ entry: import.meta.url, agentName: 'mastra-voice' })
316
- }
317
- ```
318
-
319
- Both paths share the same reply pipeline underneath; choose by who should own the session:
320
-
321
- | | `createLiveKitWorker()` | `MastraLLM` |
322
- | ------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
323
- | Session ownership | The worker helper builds and manages the `AgentSession` | Your code builds the session; every LiveKit option and hook is yours |
324
- | Where the Mastra app runs | In the worker process | On your Mastra server, reached over HTTP (or in-process via `agent`) |
325
- | Worker process needs | Your Mastra app, storage, and model provider keys | Only the LiveKit SDK and network access to your server |
326
- | Built-in conveniences | Greeting, consent gating, agent-initiated hang-up, thread bootstrap, observability roll-up | Rebuild what you need with the [session helpers](https://mastra.ai/reference/voice/livekit) |
327
- | Best for | Fastest path to a working voice agent; Studio voice mode | Existing LiveKit apps and full control over the session |
328
-
329
- Tools stay on the Mastra agent and execute on the server. LiveKit-side tools passed to the session are ignored. Tool activity reaches the worker through `toolFeedback` (spoken filler), `onToolCall` (fires as each tool call starts), and `onTurnComplete` (fires after each reply with the text, tool calls, and token usage). Agent-initiated hang-up takes a few lines: pair `onToolCall` with [`runEndCall()`](https://mastra.ai/reference/voice/livekit).
330
-
331
- > **Warning:** Don't combine the `memory` option with LiveKit's `preemptiveGeneration`, which LiveKit enables by default in sessions you build yourself. A speculative turn that completes before LiveKit discards it persists a user message and a never-spoken reply to the thread. Set `turnHandling: { preemptiveGeneration: { enabled: false } }`, or run without `memory` and pass the full transcript each turn.
332
-
333
- `MastraLLM` also accepts an in-process Mastra `agent` instance, session ownership without a second deployment, or a custom `generate` function. The remote transport is available standalone as [`createRemoteAgentReplyGenerator()`](https://mastra.ai/reference/voice/livekit), which also plugs into `createLiveKitWorker`'s `generate` option to run the batteries-included worker against a remote server.
334
-
335
- ## Server-initiated sessions
336
-
337
- Use `dispatchVoiceSession()` to add a voice agent to a room from your own code, for example to join an existing room or to drive an outbound [SIP call](https://docs.livekit.io/sip/):
338
-
339
- ```typescript
340
- import { dispatchVoiceSession } from '@mastra/livekit'
341
-
342
- await dispatchVoiceSession({
343
- roomName: 'support-call-42',
344
- agentName: 'mastra-voice',
345
- metadata: { agentId: 'support', threadId: 'thread-42', resourceId: 'user-7' },
346
- })
347
- ```
348
-
349
- ## Observability
350
-
351
- When the Mastra instance has [observability](https://mastra.ai/docs/observability/overview) configured, the worker traces each call. It opens one `voice call` span per session and nests everything under it:
352
-
353
- - Every turn's Mastra agent run, with model generation, tool calls, and memory operations, exactly as a text chat records them.
354
- - A child span for each LiveKit pipeline metric: speech-to-text, text-to-speech, end-of-utterance (turn detection), voice activity detection, and the model's time-to-first-token. These carry the latency and audio measurements that text traces can't show.
355
- - A per-model usage roll-up (token, character, and audio totals for the whole call) written to the span when the session ends.
356
-
357
- The worker is a separate process, so point storage at a backend that accepts concurrent writes from both the server and the worker. SQLite-backed [LibSQL](https://mastra.ai/reference/storage/libsql) works. Single-writer stores don't. Traces, memory, and threads can share one store:
358
-
359
- ```typescript
360
- import { Mastra } from '@mastra/core/mastra'
361
- import { LibSQLStore } from '@mastra/libsql'
362
- import { Observability, MastraStorageExporter } from '@mastra/observability'
363
-
364
- export const mastra = new Mastra({
365
- storage: new LibSQLStore({ id: 'voice-agent-storage', url: 'file:./voice-agent.db' }),
366
- observability: new Observability({
367
- configs: {
368
- default: {
369
- serviceName: 'voice-agent',
370
- exporters: [new MastraStorageExporter()],
371
- },
372
- },
373
- }),
374
- })
375
- ```
376
-
377
- Tracing is on by default. Pass `observability: false` to `createLiveKitWorker` to turn it off.
378
-
379
- ## Deployment
380
-
381
- The worker is a separate process from your Mastra server, so `mastra build` needs to emit it as its own entry. Add it to [`bundler.entries`](https://mastra.ai/reference/configuration):
382
-
383
- ```typescript
384
- import { Mastra } from '@mastra/core'
385
-
386
- export const mastra = new Mastra({
387
- bundler: {
388
- entries: { 'voice-worker': './voice-worker.ts' },
389
- // Keep LiveKit's native modules out of the bundle. `mastra build` only applies
390
- // this default when you set no other bundler options, so set it explicitly here.
391
- externals: true,
392
- },
393
- })
394
- ```
395
-
396
- `mastra build` now writes both processes into `.mastra/output`, sharing one `package.json` and one dependency install:
397
-
398
- ```text
399
- .mastra/output/
400
- index.mjs # Mastra server
401
- voice-worker.mjs # LiveKit worker
402
- ```
403
-
404
- Deploy that directory as a single artifact and start each process with its own command:
405
-
406
- ```bash
407
- node .mastra/output/index.mjs # server
408
- node .mastra/output/voice-worker.mjs start # worker
409
- ```
410
-
411
- The worker needs the same environment variables as the server, plus `LIVEKIT_URL`, `LIVEKIT_API_KEY`, and `LIVEKIT_API_SECRET`.
412
-
413
- LiveKit's guidance on sizing, graceful shutdown, and hosting applies unchanged. See [Deploying agents](https://docs.livekit.io/agents/ops/deployment/). Workers connect outbound to LiveKit, so they don't need inbound ports.
414
-
415
- ## How it works
416
-
417
- A LiveKit voice session involves three pieces:
418
-
419
- 1. Your Mastra server mints a LiveKit access token and dispatches your agent into a room. The dispatch carries metadata such as the Mastra agent id, memory thread, and resource.
420
- 2. A LiveKit agent worker (a separate long-running process) receives the job and runs the audio pipeline. Audio flows between the browser and the worker over WebRTC and never passes through your Mastra HTTP server.
421
- 3. Each time the user finishes a turn, the worker calls the Mastra agent's `stream()` with the new input and speaks the streamed text. When the user interrupts, LiveKit cancels the stream and Mastra stops generating.
422
-
423
- Conversation history lives in Mastra Memory, so voice sessions and text chat can share one thread.
424
-
425
- ## Related
426
-
427
- - [`@mastra/livekit` reference](https://mastra.ai/reference/voice/livekit)
428
- - [Speech to Speech](https://mastra.ai/guides/voice/speech-to-speech)
429
- - [Agent Memory](https://mastra.ai/docs/memory/overview)
430
- - [LiveKit Agents docs](https://docs.livekit.io/agents/)