@mastra/mcp-docs-server 0.0.0-bundle-recursion-20251030002519 → 0.0.0-bundle-version-20260121091645
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.
- package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +1 -15
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -7
- package/.docs/organized/changelogs/%40internal%2Fplayground.md +60 -0
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +201 -1
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -55
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +368 -168
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +362 -162
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +52 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +701 -191
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +400 -200
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +596 -191
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +629 -190
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +235 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +502 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +376 -176
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +360 -160
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +377 -177
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +112 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +575 -197
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +133 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +211 -11
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +64 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +621 -191
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +788 -192
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +336 -136
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +384 -184
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +576 -178
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +729 -196
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +670 -191
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +231 -31
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +913 -167
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +248 -48
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +376 -176
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +204 -4
- package/.docs/organized/changelogs/%40mastra%2Frag.md +414 -214
- package/.docs/organized/changelogs/%40mastra%2Freact.md +358 -158
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +101 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +220 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +363 -163
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +640 -193
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +107 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +183 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +201 -1
- package/.docs/organized/changelogs/create-mastra.md +291 -91
- package/.docs/organized/changelogs/mastra.md +365 -165
- package/.docs/organized/code-examples/a2a.md +6 -4
- package/.docs/organized/code-examples/agent-v6.md +221 -0
- package/.docs/organized/code-examples/agui.md +16 -12
- package/.docs/organized/code-examples/ai-elements.md +4 -4
- package/.docs/organized/code-examples/ai-sdk-useChat.md +16 -22
- package/.docs/organized/code-examples/ai-sdk-v5.md +9 -6
- package/.docs/organized/code-examples/assistant-ui.md +7 -7
- package/.docs/organized/code-examples/bird-checker-with-express.md +7 -6
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +8 -7
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +8 -7
- package/.docs/organized/code-examples/client-side-tools.md +6 -5
- package/.docs/organized/code-examples/crypto-chatbot.md +7 -7
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +9 -178
- package/.docs/organized/code-examples/fireworks-r1.md +5 -5
- package/.docs/organized/code-examples/heads-up-game.md +8 -5
- package/.docs/organized/code-examples/inngest.md +1075 -0
- package/.docs/organized/code-examples/mcp-configuration.md +6 -7
- package/.docs/organized/code-examples/mcp-registry-registry.md +3 -2
- package/.docs/organized/code-examples/mcp-server-adapters.md +720 -0
- package/.docs/organized/code-examples/memory-per-resource-example.md +7 -5
- package/.docs/organized/code-examples/memory-todo-agent.md +2 -1
- package/.docs/organized/code-examples/memory-with-context.md +3 -2
- package/.docs/organized/code-examples/memory-with-libsql.md +4 -2
- package/.docs/organized/code-examples/memory-with-mongodb.md +4 -2
- package/.docs/organized/code-examples/memory-with-pg.md +4 -2
- package/.docs/organized/code-examples/memory-with-processors.md +15 -10
- package/.docs/organized/code-examples/memory-with-upstash.md +5 -3
- package/.docs/organized/code-examples/openapi-spec-writer.md +36 -35
- package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
- package/.docs/organized/code-examples/quick-start.md +8 -39
- package/.docs/organized/code-examples/server-app-access.md +342 -0
- package/.docs/organized/code-examples/server-express-adapter.md +87 -0
- package/.docs/organized/code-examples/server-fastify-adapter.md +83 -0
- package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
- package/.docs/organized/code-examples/server-koa-adapter.md +94 -0
- package/.docs/organized/code-examples/stock-price-tool.md +27 -27
- package/.docs/organized/code-examples/weather-agent.md +21 -16
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +5 -4
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +11 -14
- package/.docs/organized/code-examples/workflow-with-memory.md +18 -17
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +4 -4
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +5 -4
- package/.docs/raw/agents/adding-voice.mdx +92 -23
- package/.docs/raw/agents/agent-approval.mdx +386 -0
- package/.docs/raw/agents/agent-memory.mdx +53 -41
- package/.docs/raw/agents/guardrails.mdx +141 -68
- package/.docs/raw/agents/network-approval.mdx +281 -0
- package/.docs/raw/agents/networks.mdx +79 -19
- package/.docs/raw/agents/overview.mdx +69 -194
- package/.docs/raw/agents/processors.mdx +496 -0
- package/.docs/raw/agents/structured-output.mdx +294 -0
- package/.docs/raw/agents/using-tools.mdx +86 -22
- package/.docs/raw/community/contributing-templates.mdx +1 -1
- package/.docs/raw/community/discord.mdx +2 -2
- package/.docs/raw/community/licensing.mdx +1 -1
- package/.docs/raw/course/01-first-agent/04-project-structure.md +2 -0
- package/.docs/raw/course/01-first-agent/05-running-playground.md +5 -5
- package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
- package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +2 -1
- package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
- package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +3 -3
- package/.docs/raw/course/01-first-agent/15-installing-memory.md +1 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/17-testing-memory.md +2 -2
- package/.docs/raw/course/02-agent-tools-mcp/04-initializing-mcp-tools.md +2 -2
- package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +5 -3
- package/.docs/raw/course/02-agent-tools-mcp/32-conclusion.md +1 -1
- package/.docs/raw/course/03-agent-memory/03-installing-memory.md +1 -1
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +2 -2
- package/.docs/raw/course/03-agent-memory/07-understanding-memory-threads.md +35 -0
- package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +1 -2
- package/.docs/raw/course/03-agent-memory/10-storage-configuration.md +2 -3
- package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +3 -1
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +6 -5
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +2 -1
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +5 -4
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +4 -4
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +4 -4
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +4 -4
- package/.docs/raw/course/04-workflows/07-using-playground.md +1 -1
- package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +2 -2
- package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +2 -3
- package/.docs/raw/deployment/cloud-providers.mdx +22 -0
- package/.docs/raw/deployment/mastra-server.mdx +140 -0
- package/.docs/raw/deployment/monorepo.mdx +106 -42
- package/.docs/raw/deployment/overview.mdx +37 -50
- package/.docs/raw/deployment/web-framework.mdx +18 -20
- package/.docs/raw/deployment/workflow-runners.mdx +16 -0
- package/.docs/raw/evals/built-in-scorers.mdx +54 -0
- package/.docs/raw/{scorers → evals}/custom-scorers.mdx +68 -22
- package/.docs/raw/{scorers → evals}/overview.mdx +19 -20
- package/.docs/raw/evals/running-in-ci.mdx +113 -0
- package/.docs/raw/getting-started/{installation.mdx → manual-install.mdx} +30 -103
- package/.docs/raw/getting-started/mcp-docs-server.mdx +57 -32
- package/.docs/raw/getting-started/project-structure.mdx +4 -4
- package/.docs/raw/getting-started/start.mdx +88 -0
- package/.docs/raw/getting-started/studio.mdx +39 -56
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +151 -0
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1581 -0
- package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/assistant-ui.mdx +75 -23
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +227 -0
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +13 -13
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +18 -19
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +7 -9
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/cloudflare-deployer.mdx +10 -7
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +22 -27
- package/.docs/raw/guides/deployment/index.mdx +32 -0
- package/.docs/raw/guides/deployment/inngest.mdx +673 -0
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/netlify-deployer.mdx +52 -17
- package/.docs/raw/{deployment/serverless-platforms → guides/deployment}/vercel-deployer.mdx +10 -7
- package/.docs/raw/guides/getting-started/astro.mdx +441 -0
- package/.docs/raw/guides/getting-started/express.mdx +128 -0
- package/.docs/raw/guides/getting-started/hono.mdx +227 -0
- package/.docs/raw/guides/getting-started/next-js.mdx +388 -0
- package/.docs/raw/guides/getting-started/nuxt.mdx +505 -0
- package/.docs/raw/guides/getting-started/quickstart.mdx +97 -0
- package/.docs/raw/guides/getting-started/sveltekit.mdx +329 -0
- package/.docs/raw/guides/getting-started/vite-react.mdx +425 -0
- package/.docs/raw/guides/guide/ai-recruiter.mdx +263 -0
- package/.docs/raw/guides/guide/chef-michel.mdx +268 -0
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +450 -0
- package/.docs/raw/guides/guide/research-assistant.mdx +379 -0
- package/.docs/raw/guides/guide/stock-agent.mdx +183 -0
- package/.docs/raw/guides/guide/web-search.mdx +293 -0
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
- package/.docs/raw/guides/index.mdx +10 -0
- package/.docs/raw/guides/migrations/agentnetwork.mdx +114 -0
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/_template.mdx +50 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +416 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +62 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +363 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/deployment.mdx +42 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +260 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +160 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +306 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +120 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +73 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/rag.mdx +47 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +596 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +180 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +335 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +92 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/voice.mdx +39 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +353 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +365 -0
- package/.docs/raw/index.mdx +9 -9
- package/.docs/raw/mastra-cloud/deployment.mdx +86 -0
- package/.docs/raw/mastra-cloud/observability.mdx +17 -25
- package/.docs/raw/mastra-cloud/overview.mdx +15 -49
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +393 -0
- package/.docs/raw/mcp/publishing-mcp-server.mdx +142 -0
- package/.docs/raw/memory/memory-processors.mdx +273 -82
- package/.docs/raw/memory/message-history.mdx +72 -0
- package/.docs/raw/memory/overview.mdx +42 -76
- package/.docs/raw/memory/semantic-recall.mdx +77 -59
- package/.docs/raw/memory/storage.mdx +248 -0
- package/.docs/raw/memory/working-memory.mdx +41 -21
- package/.docs/raw/observability/logging.mdx +21 -20
- package/.docs/raw/observability/overview.mdx +37 -35
- package/.docs/raw/observability/tracing/bridges/otel.mdx +203 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/arize.mdx +89 -24
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +40 -20
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/cloud.mdx +34 -21
- package/.docs/raw/observability/tracing/exporters/datadog.mdx +175 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/default.mdx +45 -28
- package/.docs/raw/observability/tracing/exporters/laminar.mdx +89 -0
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +205 -0
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +121 -0
- package/.docs/raw/observability/tracing/exporters/otel.mdx +457 -0
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +137 -0
- package/.docs/raw/observability/tracing/exporters/sentry.mdx +198 -0
- package/.docs/raw/observability/tracing/overview.mdx +1128 -0
- package/.docs/raw/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +40 -20
- package/.docs/raw/rag/chunking-and-embedding.mdx +37 -49
- package/.docs/raw/rag/graph-rag.mdx +223 -0
- package/.docs/raw/rag/overview.mdx +11 -17
- package/.docs/raw/rag/retrieval.mdx +110 -97
- package/.docs/raw/rag/vector-databases.mdx +150 -29
- package/.docs/raw/reference/agents/agent.mdx +54 -50
- package/.docs/raw/reference/agents/generate.mdx +410 -146
- package/.docs/raw/reference/agents/generateLegacy.mdx +13 -11
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +24 -16
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +71 -0
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +25 -17
- package/.docs/raw/reference/agents/getDescription.mdx +4 -2
- package/.docs/raw/reference/agents/getInstructions.mdx +12 -10
- package/.docs/raw/reference/agents/getLLM.mdx +14 -12
- package/.docs/raw/reference/agents/getMemory.mdx +13 -11
- package/.docs/raw/reference/agents/getModel.mdx +14 -12
- package/.docs/raw/reference/agents/getTools.mdx +11 -9
- package/.docs/raw/reference/agents/getVoice.mdx +12 -10
- package/.docs/raw/reference/agents/listAgents.mdx +13 -11
- package/.docs/raw/reference/agents/listScorers.mdx +71 -0
- package/.docs/raw/reference/agents/listTools.mdx +71 -0
- package/.docs/raw/reference/agents/listWorkflows.mdx +71 -0
- package/.docs/raw/reference/agents/network.mdx +134 -60
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +130 -0
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +119 -0
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +66 -0
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +118 -0
- package/.docs/raw/reference/ai-sdk/network-route.mdx +102 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +293 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +130 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +110 -0
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +122 -0
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +113 -0
- package/.docs/raw/reference/auth/auth0.mdx +9 -7
- package/.docs/raw/reference/auth/clerk.mdx +9 -7
- package/.docs/raw/reference/auth/firebase.mdx +12 -11
- package/.docs/raw/reference/auth/jwt.mdx +9 -7
- package/.docs/raw/reference/auth/supabase.mdx +9 -7
- package/.docs/raw/reference/auth/workos.mdx +9 -7
- package/.docs/raw/reference/cli/create-mastra.mdx +13 -11
- package/.docs/raw/reference/cli/mastra.mdx +72 -23
- package/.docs/raw/reference/client-js/agents.mdx +316 -86
- package/.docs/raw/reference/client-js/error-handling.mdx +4 -4
- package/.docs/raw/reference/client-js/logs.mdx +4 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +20 -18
- package/.docs/raw/reference/client-js/memory.mdx +116 -20
- package/.docs/raw/reference/client-js/observability.mdx +14 -12
- package/.docs/raw/reference/client-js/telemetry.mdx +3 -1
- package/.docs/raw/reference/client-js/tools.mdx +4 -2
- package/.docs/raw/reference/client-js/vectors.mdx +3 -1
- package/.docs/raw/reference/client-js/workflows.mdx +132 -87
- package/.docs/raw/reference/configuration.mdx +761 -0
- package/.docs/raw/reference/core/addGateway.mdx +61 -0
- package/.docs/raw/reference/core/getAgent.mdx +4 -2
- package/.docs/raw/reference/core/getAgentById.mdx +4 -2
- package/.docs/raw/reference/core/getDeployer.mdx +4 -2
- package/.docs/raw/reference/core/getGateway.mdx +61 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +64 -0
- package/.docs/raw/reference/core/getLogger.mdx +5 -3
- package/.docs/raw/reference/core/getMCPServer.mdx +34 -16
- package/.docs/raw/reference/core/getMCPServerById.mdx +83 -0
- package/.docs/raw/reference/core/getMemory.mdx +50 -9
- package/.docs/raw/reference/core/getScorer.mdx +6 -4
- package/.docs/raw/reference/core/getScorerById.mdx +81 -0
- package/.docs/raw/reference/core/getServer.mdx +7 -5
- package/.docs/raw/reference/core/getStorage.mdx +6 -4
- package/.docs/raw/reference/core/getStoredAgentById.mdx +185 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +6 -4
- package/.docs/raw/reference/core/getVector.mdx +4 -2
- package/.docs/raw/reference/core/getWorkflow.mdx +4 -2
- package/.docs/raw/reference/core/{getAgents.mdx → listAgents.mdx} +8 -6
- package/.docs/raw/reference/core/listGateways.mdx +55 -0
- package/.docs/raw/reference/core/{getLogs.mdx → listLogs.mdx} +9 -7
- package/.docs/raw/reference/core/{getLogsByRunId.mdx → listLogsByRunId.mdx} +9 -7
- package/.docs/raw/reference/core/listMCPServers.mdx +67 -0
- package/.docs/raw/reference/core/listMemory.mdx +74 -0
- package/.docs/raw/reference/core/listScorers.mdx +45 -0
- package/.docs/raw/reference/core/listStoredAgents.mdx +153 -0
- package/.docs/raw/reference/core/{getVectors.mdx → listVectors.mdx} +8 -6
- package/.docs/raw/reference/core/{getWorkflows.mdx → listWorkflows.mdx} +8 -6
- package/.docs/raw/reference/core/mastra-class.mdx +47 -23
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +229 -0
- package/.docs/raw/reference/core/setLogger.mdx +5 -3
- package/.docs/raw/reference/core/setStorage.mdx +8 -5
- package/.docs/raw/reference/deployer/cloudflare.mdx +24 -55
- package/.docs/raw/reference/deployer/deployer.mdx +3 -8
- package/.docs/raw/reference/deployer/netlify.mdx +6 -4
- package/.docs/raw/reference/deployer/vercel.mdx +8 -7
- package/.docs/raw/reference/evals/answer-relevancy.mdx +99 -128
- package/.docs/raw/reference/evals/answer-similarity.mdx +196 -0
- package/.docs/raw/reference/evals/bias.mdx +91 -112
- package/.docs/raw/reference/evals/completeness.mdx +93 -118
- package/.docs/raw/reference/evals/content-similarity.mdx +73 -117
- package/.docs/raw/reference/evals/context-precision.mdx +195 -137
- package/.docs/raw/reference/{scorers → evals}/context-relevance.mdx +19 -17
- package/.docs/raw/reference/{scorers → evals}/create-scorer.mdx +80 -63
- package/.docs/raw/reference/evals/faithfulness.mdx +94 -122
- package/.docs/raw/reference/evals/hallucination.mdx +89 -134
- package/.docs/raw/reference/evals/keyword-coverage.mdx +94 -126
- package/.docs/raw/reference/{scorers → evals}/mastra-scorer.mdx +9 -5
- package/.docs/raw/reference/{scorers → evals}/noise-sensitivity.mdx +22 -20
- package/.docs/raw/reference/evals/prompt-alignment.mdx +606 -182
- package/.docs/raw/reference/{scorers/run-experiment.mdx → evals/run-evals.mdx} +21 -20
- package/.docs/raw/reference/evals/scorer-utils.mdx +365 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +80 -118
- package/.docs/raw/reference/evals/tone-consistency.mdx +80 -126
- package/.docs/raw/reference/{scorers → evals}/tool-call-accuracy.mdx +37 -33
- package/.docs/raw/reference/evals/toxicity.mdx +93 -97
- package/.docs/raw/reference/index.mdx +2 -0
- package/.docs/raw/reference/{observability/logging → logging}/pino-logger.mdx +12 -10
- package/.docs/raw/reference/memory/clone-utilities.mdx +345 -0
- package/.docs/raw/reference/memory/cloneThread.mdx +237 -0
- package/.docs/raw/reference/memory/createThread.mdx +7 -5
- package/.docs/raw/reference/memory/deleteMessages.mdx +10 -8
- package/.docs/raw/reference/memory/getThreadById.mdx +4 -2
- package/.docs/raw/reference/memory/listThreads.mdx +187 -0
- package/.docs/raw/reference/memory/memory-class.mdx +38 -29
- package/.docs/raw/reference/memory/{query.mdx → recall.mdx} +60 -61
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +181 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +292 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/arize.mdx +66 -18
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +35 -11
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/cloud-exporter.mdx +32 -20
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/console-exporter.mdx +53 -18
- package/.docs/raw/reference/observability/tracing/exporters/datadog.mdx +172 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/default-exporter.mdx +53 -42
- package/.docs/raw/reference/observability/tracing/exporters/laminar.mdx +139 -0
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +184 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +38 -9
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/otel.mdx +87 -80
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +153 -0
- package/.docs/raw/reference/observability/tracing/exporters/sentry.mdx +224 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +166 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/interfaces.mdx +165 -94
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +6 -4
- package/.docs/raw/reference/observability/{ai-tracing/span.mdx → tracing/spans.mdx} +60 -44
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +22 -18
- package/.docs/raw/reference/processors/language-detector.mdx +41 -37
- package/.docs/raw/reference/processors/message-history-processor.mdx +134 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +66 -35
- package/.docs/raw/reference/processors/pii-detector.mdx +67 -37
- package/.docs/raw/reference/processors/processor-interface.mdx +805 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +40 -35
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +202 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +38 -36
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +80 -40
- package/.docs/raw/reference/processors/tool-call-filter.mdx +127 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +26 -19
- package/.docs/raw/reference/processors/working-memory-processor.mdx +224 -0
- package/.docs/raw/reference/rag/chunk.mdx +7 -13
- package/.docs/raw/reference/rag/database-config.mdx +12 -10
- package/.docs/raw/reference/rag/document.mdx +3 -1
- package/.docs/raw/reference/rag/embeddings.mdx +8 -6
- package/.docs/raw/reference/rag/extract-params.mdx +58 -4
- package/.docs/raw/reference/rag/graph-rag.mdx +3 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +32 -9
- package/.docs/raw/reference/rag/rerank.mdx +4 -3
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +3 -2
- package/.docs/raw/reference/server/create-route.mdx +330 -0
- package/.docs/raw/reference/server/express-adapter.mdx +221 -0
- package/.docs/raw/reference/server/fastify-adapter.mdx +130 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +204 -0
- package/.docs/raw/reference/server/koa-adapter.mdx +129 -0
- package/.docs/raw/reference/server/mastra-server.mdx +334 -0
- package/.docs/raw/reference/server/routes.mdx +313 -0
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +44 -2
- package/.docs/raw/reference/storage/cloudflare.mdx +13 -3
- package/.docs/raw/reference/storage/composite.mdx +245 -0
- package/.docs/raw/reference/storage/convex.mdx +166 -0
- package/.docs/raw/reference/storage/dynamodb.mdx +135 -13
- package/.docs/raw/reference/storage/lance.mdx +40 -3
- package/.docs/raw/reference/storage/libsql.mdx +92 -31
- package/.docs/raw/reference/storage/mongodb.mdx +149 -11
- package/.docs/raw/reference/storage/mssql.mdx +53 -6
- package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +15 -90
- package/.docs/raw/reference/storage/postgresql.mdx +268 -80
- package/.docs/raw/reference/storage/upstash.mdx +80 -3
- package/.docs/raw/reference/streaming/ChunkType.mdx +33 -5
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +68 -7
- package/.docs/raw/reference/streaming/agents/stream.mdx +126 -156
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +11 -9
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +13 -13
- package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +60 -18
- package/.docs/raw/reference/streaming/workflows/stream.mdx +112 -38
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +172 -0
- package/.docs/raw/reference/templates/overview.mdx +6 -8
- package/.docs/raw/reference/tools/client.mdx +5 -3
- package/.docs/raw/reference/tools/create-tool.mdx +306 -36
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +3 -1
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +59 -22
- package/.docs/raw/reference/tools/mcp-client.mdx +248 -31
- package/.docs/raw/reference/tools/mcp-server.mdx +442 -56
- package/.docs/raw/reference/tools/vector-query-tool.mdx +106 -42
- package/.docs/raw/reference/vectors/astra.mdx +6 -4
- package/.docs/raw/reference/vectors/chroma.mdx +87 -5
- package/.docs/raw/reference/vectors/convex.mdx +431 -0
- package/.docs/raw/reference/vectors/couchbase.mdx +39 -24
- package/.docs/raw/reference/vectors/duckdb.mdx +464 -0
- package/.docs/raw/reference/vectors/elasticsearch.mdx +318 -0
- package/.docs/raw/reference/vectors/lance.mdx +45 -27
- package/.docs/raw/reference/vectors/libsql.mdx +102 -15
- package/.docs/raw/reference/vectors/mongodb.mdx +133 -14
- package/.docs/raw/reference/vectors/opensearch.mdx +68 -20
- package/.docs/raw/reference/vectors/pg.mdx +105 -43
- package/.docs/raw/reference/vectors/pinecone.mdx +90 -8
- package/.docs/raw/reference/vectors/qdrant.mdx +185 -6
- package/.docs/raw/reference/vectors/s3vectors.mdx +10 -8
- package/.docs/raw/reference/vectors/turbopuffer.mdx +81 -5
- package/.docs/raw/reference/vectors/upstash.mdx +62 -7
- package/.docs/raw/reference/vectors/vectorize.mdx +6 -4
- package/.docs/raw/reference/voice/azure.mdx +98 -81
- package/.docs/raw/reference/voice/cloudflare.mdx +3 -1
- package/.docs/raw/reference/voice/composite-voice.mdx +76 -29
- package/.docs/raw/reference/voice/deepgram.mdx +3 -1
- package/.docs/raw/reference/voice/elevenlabs.mdx +3 -1
- package/.docs/raw/reference/voice/google-gemini-live.mdx +6 -3
- package/.docs/raw/reference/voice/google.mdx +162 -21
- package/.docs/raw/reference/voice/mastra-voice.mdx +3 -1
- package/.docs/raw/reference/voice/murf.mdx +3 -1
- package/.docs/raw/reference/voice/openai-realtime.mdx +6 -3
- package/.docs/raw/reference/voice/openai.mdx +3 -1
- package/.docs/raw/reference/voice/playai.mdx +3 -1
- package/.docs/raw/reference/voice/sarvam.mdx +3 -1
- package/.docs/raw/reference/voice/speechify.mdx +3 -1
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +6 -4
- package/.docs/raw/reference/voice/voice.addTools.mdx +8 -5
- package/.docs/raw/reference/voice/voice.answer.mdx +6 -2
- package/.docs/raw/reference/voice/voice.close.mdx +5 -2
- package/.docs/raw/reference/voice/voice.connect.mdx +7 -3
- package/.docs/raw/reference/voice/voice.events.mdx +3 -1
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +4 -1
- package/.docs/raw/reference/voice/voice.listen.mdx +93 -53
- package/.docs/raw/reference/voice/voice.off.mdx +4 -2
- package/.docs/raw/reference/voice/voice.on.mdx +7 -3
- package/.docs/raw/reference/voice/voice.send.mdx +6 -2
- package/.docs/raw/reference/voice/voice.speak.mdx +82 -41
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +4 -2
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +59 -9
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +63 -17
- package/.docs/raw/reference/workflows/run-methods/start.mdx +68 -22
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +145 -0
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +312 -0
- package/.docs/raw/reference/workflows/run.mdx +38 -15
- package/.docs/raw/reference/workflows/step.mdx +73 -7
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +5 -3
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +45 -14
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +72 -5
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +80 -3
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +5 -7
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +5 -7
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +4 -2
- package/.docs/raw/reference/workflows/workflow.mdx +207 -11
- package/.docs/raw/{auth → server/auth}/auth0.mdx +47 -28
- package/.docs/raw/{auth → server/auth}/clerk.mdx +42 -21
- package/.docs/raw/{auth → server/auth}/firebase.mdx +54 -32
- package/.docs/raw/{auth → server/auth}/index.mdx +9 -7
- package/.docs/raw/{auth → server/auth}/jwt.mdx +29 -17
- package/.docs/raw/{auth → server/auth}/supabase.mdx +52 -32
- package/.docs/raw/{auth → server/auth}/workos.mdx +48 -29
- package/.docs/raw/server/custom-adapters.mdx +396 -0
- package/.docs/raw/{server-db → server}/custom-api-routes.mdx +11 -11
- package/.docs/raw/{server-db → server}/mastra-client.mdx +41 -44
- package/.docs/raw/server/mastra-server.mdx +86 -0
- package/.docs/raw/{server-db → server}/middleware.mdx +43 -41
- package/.docs/raw/server/request-context.mdx +235 -0
- package/.docs/raw/server/server-adapters.mdx +410 -0
- package/.docs/raw/streaming/events.mdx +18 -9
- package/.docs/raw/streaming/overview.mdx +52 -28
- package/.docs/raw/streaming/tool-streaming.mdx +75 -33
- package/.docs/raw/streaming/workflow-streaming.mdx +15 -21
- package/.docs/raw/tools-mcp/advanced-usage.mdx +11 -9
- package/.docs/raw/tools-mcp/mcp-overview.mdx +72 -27
- package/.docs/raw/tools-mcp/overview.mdx +21 -20
- package/.docs/raw/voice/overview.mdx +124 -42
- package/.docs/raw/voice/speech-to-speech.mdx +14 -7
- package/.docs/raw/voice/speech-to-text.mdx +8 -4
- package/.docs/raw/voice/text-to-speech.mdx +7 -4
- package/.docs/raw/workflows/agents-and-tools.mdx +73 -26
- package/.docs/raw/workflows/control-flow.mdx +697 -134
- package/.docs/raw/workflows/error-handling.mdx +198 -42
- package/.docs/raw/workflows/human-in-the-loop.mdx +161 -210
- package/.docs/raw/workflows/input-data-mapping.mdx +11 -9
- package/.docs/raw/workflows/overview.mdx +202 -83
- package/.docs/raw/workflows/snapshots.mdx +28 -50
- package/.docs/raw/workflows/suspend-and-resume.mdx +125 -208
- package/.docs/raw/workflows/time-travel.mdx +317 -0
- package/.docs/raw/workflows/workflow-state.mdx +189 -0
- package/CHANGELOG.md +419 -4
- package/README.md +47 -2
- package/dist/{chunk-TUAHUTTB.js → chunk-4CM2BQNP.js} +27 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/package-changes.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/prompts/migration.d.ts +6 -0
- package/dist/prompts/migration.d.ts.map +1 -0
- package/dist/stdio.js +1107 -40
- package/dist/tools/course.d.ts.map +1 -1
- package/dist/tools/embedded-docs.d.ts +276 -0
- package/dist/tools/embedded-docs.d.ts.map +1 -0
- package/dist/tools/migration.d.ts +40 -0
- package/dist/tools/migration.d.ts.map +1 -0
- package/package.json +17 -17
- package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
- package/.docs/raw/deployment/server-deployment.mdx +0 -81
- package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -55
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +0 -671
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -123
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +0 -382
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -176
- package/.docs/raw/frameworks/servers/express.mdx +0 -209
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +0 -602
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -379
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +0 -486
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +0 -255
- package/.docs/raw/getting-started/templates.mdx +0 -65
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -100
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -105
- package/.docs/raw/memory/conversation-history.mdx +0 -23
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
- package/.docs/raw/observability/ai-tracing/exporters/langfuse.mdx +0 -122
- package/.docs/raw/observability/ai-tracing/exporters/langsmith.mdx +0 -88
- package/.docs/raw/observability/ai-tracing/exporters/otel.mdx +0 -263
- package/.docs/raw/observability/ai-tracing/overview.mdx +0 -812
- package/.docs/raw/observability/nextjs-tracing.mdx +0 -109
- package/.docs/raw/observability/otel-tracing.mdx +0 -189
- package/.docs/raw/reference/agents/getScorers.mdx +0 -69
- package/.docs/raw/reference/agents/getWorkflows.mdx +0 -69
- package/.docs/raw/reference/client-js/workflows-legacy.mdx +0 -143
- package/.docs/raw/reference/core/getMCPServers.mdx +0 -36
- package/.docs/raw/reference/core/getScorerByName.mdx +0 -78
- package/.docs/raw/reference/core/getScorers.mdx +0 -43
- package/.docs/raw/reference/core/setTelemetry.mdx +0 -36
- package/.docs/raw/reference/evals/context-position.mdx +0 -197
- package/.docs/raw/reference/evals/context-relevancy.mdx +0 -196
- package/.docs/raw/reference/evals/contextual-recall.mdx +0 -196
- package/.docs/raw/reference/evals/summarization.mdx +0 -212
- package/.docs/raw/reference/legacyWorkflows/after.mdx +0 -89
- package/.docs/raw/reference/legacyWorkflows/afterEvent.mdx +0 -79
- package/.docs/raw/reference/legacyWorkflows/commit.mdx +0 -33
- package/.docs/raw/reference/legacyWorkflows/createRun.mdx +0 -76
- package/.docs/raw/reference/legacyWorkflows/else.mdx +0 -68
- package/.docs/raw/reference/legacyWorkflows/events.mdx +0 -305
- package/.docs/raw/reference/legacyWorkflows/execute.mdx +0 -110
- package/.docs/raw/reference/legacyWorkflows/if.mdx +0 -108
- package/.docs/raw/reference/legacyWorkflows/resume.mdx +0 -158
- package/.docs/raw/reference/legacyWorkflows/resumeWithEvent.mdx +0 -133
- package/.docs/raw/reference/legacyWorkflows/snapshots.mdx +0 -207
- package/.docs/raw/reference/legacyWorkflows/start.mdx +0 -87
- package/.docs/raw/reference/legacyWorkflows/step-class.mdx +0 -100
- package/.docs/raw/reference/legacyWorkflows/step-condition.mdx +0 -137
- package/.docs/raw/reference/legacyWorkflows/step-function.mdx +0 -93
- package/.docs/raw/reference/legacyWorkflows/step-options.mdx +0 -69
- package/.docs/raw/reference/legacyWorkflows/step-retries.mdx +0 -196
- package/.docs/raw/reference/legacyWorkflows/suspend.mdx +0 -70
- package/.docs/raw/reference/legacyWorkflows/then.mdx +0 -72
- package/.docs/raw/reference/legacyWorkflows/until.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/watch.mdx +0 -124
- package/.docs/raw/reference/legacyWorkflows/while.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/workflow.mdx +0 -234
- package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +0 -79
- package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +0 -110
- package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +0 -186
- package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +0 -238
- package/.docs/raw/reference/observability/ai-tracing/exporters/langfuse.mdx +0 -116
- package/.docs/raw/reference/observability/otel-tracing/otel-config.mdx +0 -117
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-ax.mdx +0 -81
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-phoenix.mdx +0 -121
- package/.docs/raw/reference/observability/otel-tracing/providers/braintrust.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/dash0.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/index.mdx +0 -20
- package/.docs/raw/reference/observability/otel-tracing/providers/keywordsai.mdx +0 -73
- package/.docs/raw/reference/observability/otel-tracing/providers/laminar.mdx +0 -41
- package/.docs/raw/reference/observability/otel-tracing/providers/langfuse.mdx +0 -84
- package/.docs/raw/reference/observability/otel-tracing/providers/langsmith.mdx +0 -48
- package/.docs/raw/reference/observability/otel-tracing/providers/langwatch.mdx +0 -43
- package/.docs/raw/reference/observability/otel-tracing/providers/new-relic.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/signoz.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/traceloop.mdx +0 -40
- package/.docs/raw/reference/scorers/answer-relevancy.mdx +0 -227
- package/.docs/raw/reference/scorers/answer-similarity.mdx +0 -439
- package/.docs/raw/reference/scorers/bias.mdx +0 -228
- package/.docs/raw/reference/scorers/completeness.mdx +0 -214
- package/.docs/raw/reference/scorers/content-similarity.mdx +0 -197
- package/.docs/raw/reference/scorers/context-precision.mdx +0 -352
- package/.docs/raw/reference/scorers/faithfulness.mdx +0 -241
- package/.docs/raw/reference/scorers/hallucination.mdx +0 -252
- package/.docs/raw/reference/scorers/keyword-coverage.mdx +0 -229
- package/.docs/raw/reference/scorers/prompt-alignment.mdx +0 -668
- package/.docs/raw/reference/scorers/textual-difference.mdx +0 -203
- package/.docs/raw/reference/scorers/tone-consistency.mdx +0 -211
- package/.docs/raw/reference/scorers/toxicity.mdx +0 -228
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
- package/.docs/raw/reference/workflows/run-methods/watch.mdx +0 -73
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +0 -70
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +0 -66
- package/.docs/raw/scorers/evals-old-api/custom-eval.mdx +0 -24
- package/.docs/raw/scorers/evals-old-api/overview.mdx +0 -106
- package/.docs/raw/scorers/evals-old-api/running-in-ci.mdx +0 -85
- package/.docs/raw/scorers/evals-old-api/textual-evals.mdx +0 -58
- package/.docs/raw/scorers/off-the-shelf-scorers.mdx +0 -50
- package/.docs/raw/server-db/production-server.mdx +0 -89
- package/.docs/raw/server-db/runtime-context.mdx +0 -193
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
- package/.docs/raw/workflows-legacy/control-flow.mdx +0 -774
- package/.docs/raw/workflows-legacy/dynamic-workflows.mdx +0 -239
- package/.docs/raw/workflows-legacy/error-handling.mdx +0 -187
- package/.docs/raw/workflows-legacy/nested-workflows.mdx +0 -360
- package/.docs/raw/workflows-legacy/overview.mdx +0 -182
- package/.docs/raw/workflows-legacy/runtime-variables.mdx +0 -156
- package/.docs/raw/workflows-legacy/steps.mdx +0 -115
- package/.docs/raw/workflows-legacy/suspend-and-resume.mdx +0 -406
- package/.docs/raw/workflows-legacy/variables.mdx +0 -318
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Using
|
|
2
|
+
title: "Using Assistant UI | Frameworks"
|
|
3
3
|
description: "Learn how to integrate Assistant UI with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Steps from "@site/src/components/Steps";
|
|
7
7
|
import StepItem from "@site/src/components/StepItem";
|
|
8
8
|
|
|
9
|
-
# Using
|
|
9
|
+
# Using Assistant UI
|
|
10
10
|
|
|
11
|
-
[Assistant UI](https://assistant-ui.com) is the TypeScript/React library for AI Chat.
|
|
12
|
-
Built on shadcn/ui and Tailwind CSS, it enables developers to create beautiful, enterprise-grade chat experiences in minutes.
|
|
11
|
+
[Assistant UI](https://assistant-ui.com) is the TypeScript/React library for AI Chat. Built on shadcn/ui and Tailwind CSS, it enables developers to create beautiful, enterprise-grade chat experiences in minutes.
|
|
13
12
|
|
|
14
13
|
:::info
|
|
15
14
|
|
|
@@ -17,6 +16,12 @@ For a full-stack integration approach where Mastra runs directly in your Next.js
|
|
|
17
16
|
|
|
18
17
|
:::
|
|
19
18
|
|
|
19
|
+
:::tip
|
|
20
|
+
|
|
21
|
+
Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of Assistant UI integrated with Mastra.
|
|
22
|
+
|
|
23
|
+
:::
|
|
24
|
+
|
|
20
25
|
## Integration Guide
|
|
21
26
|
|
|
22
27
|
Run Mastra as a standalone server and connect your Next.js frontend (with Assistant UI) to its API endpoints.
|
|
@@ -33,18 +38,23 @@ project-root
|
|
|
33
38
|
│ ├── src
|
|
34
39
|
│ │ └── mastra
|
|
35
40
|
│ └── package.json
|
|
36
|
-
└──
|
|
41
|
+
└── my-app
|
|
37
42
|
└── package.json
|
|
38
43
|
```
|
|
39
44
|
|
|
40
45
|
Bootstrap your Mastra server:
|
|
41
46
|
|
|
42
|
-
```bash
|
|
47
|
+
```bash
|
|
43
48
|
npx create-mastra@latest
|
|
44
49
|
```
|
|
45
50
|
|
|
46
|
-
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations.
|
|
47
|
-
|
|
51
|
+
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations. Follow the prompts to create your server project.
|
|
52
|
+
|
|
53
|
+
Navigate to your newly created Mastra server directory:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd mastra-server # Replace with the actual directory name you provided
|
|
57
|
+
```
|
|
48
58
|
|
|
49
59
|
You now have a basic Mastra server project ready. You should have the following files and folders:
|
|
50
60
|
|
|
@@ -53,6 +63,8 @@ src
|
|
|
53
63
|
└── mastra
|
|
54
64
|
├── agents
|
|
55
65
|
│ └── weather-agent.ts
|
|
66
|
+
├── scorers
|
|
67
|
+
│ └── weather-scorer.ts
|
|
56
68
|
├── tools
|
|
57
69
|
│ └── weather-tool.ts
|
|
58
70
|
├── workflows
|
|
@@ -70,21 +82,58 @@ Ensure that you have set the appropriate environment variables for your LLM prov
|
|
|
70
82
|
|
|
71
83
|
<StepItem>
|
|
72
84
|
|
|
85
|
+
Create a chat route for the Assistant UI frontend by using the `chatRoute()` helper from `@mastra/ai-sdk`. Add it to your Mastra project:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install @mastra/ai-sdk@latest
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
In your `src/mastra/index.ts` file, register the chat route:
|
|
92
|
+
|
|
93
|
+
```typescript title="src/mastra/index.ts" {2,7-13}
|
|
94
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
95
|
+
import { chatRoute } from '@mastra/ai-sdk';
|
|
96
|
+
// Rest of the imports...
|
|
97
|
+
|
|
98
|
+
export const mastra = new Mastra({
|
|
99
|
+
// Rest of the configuration...
|
|
100
|
+
server: {
|
|
101
|
+
apiRoutes: [
|
|
102
|
+
chatRoute({
|
|
103
|
+
path: '/chat/:agentId'
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This will make all agents available in AI SDK-compatible formats, including the `weatherAgent` at the endpoint `/chat/weatherAgent`.
|
|
111
|
+
|
|
112
|
+
</StepItem>
|
|
113
|
+
|
|
114
|
+
<StepItem>
|
|
115
|
+
|
|
73
116
|
Run the Mastra server using the following command:
|
|
74
117
|
|
|
75
|
-
```bash
|
|
118
|
+
```bash
|
|
76
119
|
npm run dev
|
|
77
120
|
```
|
|
78
121
|
|
|
79
|
-
By default, the Mastra server will run on `http://localhost:4111`.
|
|
122
|
+
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps where we'll set up the Assistant UI frontend to connect to it.
|
|
80
123
|
|
|
81
124
|
</StepItem>
|
|
82
125
|
|
|
83
126
|
<StepItem>
|
|
84
127
|
|
|
128
|
+
Go up one directory to your project root.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
cd ..
|
|
132
|
+
```
|
|
133
|
+
|
|
85
134
|
Create a new `assistant-ui` project with the following command.
|
|
86
135
|
|
|
87
|
-
```bash
|
|
136
|
+
```bash
|
|
88
137
|
npx assistant-ui@latest create
|
|
89
138
|
```
|
|
90
139
|
|
|
@@ -100,19 +149,22 @@ For detailed setup instructions, including adding API keys, basic configuration,
|
|
|
100
149
|
|
|
101
150
|
The default Assistant UI setup configures the chat runtime to use a local API route (`/api/chat`) within the Next.js project. Since our Mastra agent is running on a separate server, we need to update the frontend to point to that server's endpoint.
|
|
102
151
|
|
|
103
|
-
|
|
152
|
+
Open the file in your assistant-ui frontend project that contains the `useChatRuntime` hook (usually `app/assistant.tsx` or `src/app/assistant.tsx`). Find the `useChatRuntime` hook and change the `api` property to the full URL of your Mastra agent's stream endpoint:
|
|
104
153
|
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
useChatRuntime,
|
|
108
|
-
AssistantChatTransport,
|
|
109
|
-
} from "@assistant-ui/react-ai-sdk";
|
|
154
|
+
```tsx {8} title="app/assistant.tsx"
|
|
155
|
+
"use client";
|
|
110
156
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
157
|
+
// Rest of the imports...
|
|
158
|
+
|
|
159
|
+
export const Assistant = () => {
|
|
160
|
+
const runtime = useChatRuntime({
|
|
161
|
+
transport: new AssistantChatTransport({
|
|
162
|
+
api: "http://localhost:4111/chat/weatherAgent",
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Rest of the component...
|
|
167
|
+
};
|
|
116
168
|
```
|
|
117
169
|
|
|
118
170
|
Now, the Assistant UI frontend will send chat requests directly to your running Mastra server.
|
|
@@ -123,7 +175,7 @@ Now, the Assistant UI frontend will send chat requests directly to your running
|
|
|
123
175
|
|
|
124
176
|
You're ready to connect the pieces! Make sure both the Mastra server and the Assistant UI frontend are running. Start the Next.js development server:
|
|
125
177
|
|
|
126
|
-
```bash
|
|
178
|
+
```bash
|
|
127
179
|
npm run dev
|
|
128
180
|
```
|
|
129
181
|
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Using CopilotKit | Frameworks"
|
|
3
|
+
description: "Learn how to integrate CopilotKit with Mastra"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import Tabs from "@theme/Tabs";
|
|
7
|
+
import TabItem from "@theme/TabItem";
|
|
8
|
+
import Steps from "@site/src/components/Steps";
|
|
9
|
+
import StepItem from "@site/src/components/StepItem";
|
|
10
|
+
|
|
11
|
+
# Using CopilotKit
|
|
12
|
+
|
|
13
|
+
[CopilotKit](https://www.copilotkit.ai/) provides React components to quickly integrate customizable AI copilots into your application. Combined with Mastra, you can build sophisticated AI apps featuring bidirectional state synchronization and interactive UIs.
|
|
14
|
+
|
|
15
|
+
Visit the [CopilotKit documentation](https://docs.copilotkit.ai/) to learn more about CopilotKit concepts, components, and advanced usage patterns.
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
For a full-stack integration approach where Mastra runs directly in your Next.js API routes, see the [CopilotKit Quickstart](https://docs.copilotkit.ai/mastra/quickstart) guide.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
:::tip
|
|
24
|
+
|
|
25
|
+
Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of CopilotKit integrated with Mastra.
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
## Integration Guide
|
|
30
|
+
|
|
31
|
+
Run Mastra as a standalone server and connect your Next.js frontend (with CopilotKit) to its API endpoints.
|
|
32
|
+
|
|
33
|
+
<Steps>
|
|
34
|
+
|
|
35
|
+
<StepItem>
|
|
36
|
+
|
|
37
|
+
Set up your directory structure. A possible directory structure could look like this:
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
project-root
|
|
41
|
+
├── mastra-server
|
|
42
|
+
│ ├── src
|
|
43
|
+
│ │ └── mastra
|
|
44
|
+
│ └── package.json
|
|
45
|
+
└── my-copilot-app
|
|
46
|
+
└── package.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Bootstrap your Mastra server:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx create-mastra@latest
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations. Follow the prompts to create your server project.
|
|
56
|
+
|
|
57
|
+
Navigate to your newly created Mastra server directory:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cd mastra-server # Replace with the actual directory name you provided
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
You now have a basic Mastra server project ready. You should have the following files and folders:
|
|
64
|
+
|
|
65
|
+
```shell
|
|
66
|
+
src
|
|
67
|
+
└── mastra
|
|
68
|
+
├── agents
|
|
69
|
+
│ └── weather-agent.ts
|
|
70
|
+
├── scorers
|
|
71
|
+
│ └── weather-scorer.ts
|
|
72
|
+
├── tools
|
|
73
|
+
│ └── weather-tool.ts
|
|
74
|
+
├── workflows
|
|
75
|
+
│ └── weather-workflow.ts
|
|
76
|
+
└── index.ts
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
:::note
|
|
80
|
+
|
|
81
|
+
Ensure that you have set the appropriate environment variables for your LLM provider in the `.env` file.
|
|
82
|
+
|
|
83
|
+
:::
|
|
84
|
+
|
|
85
|
+
</StepItem>
|
|
86
|
+
|
|
87
|
+
<StepItem>
|
|
88
|
+
|
|
89
|
+
Create a chat route for the CopilotKit frontend by using the `registerCopilotKit()` helper from `@ag-ui/mastra`. Add it to your Mastra project (and its peer dependencies):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install --legacy-peer-deps @ag-ui/mastra @copilotkit/runtime @ag-ui/core @ag-ui/client @ag-ui/encoder @ag-ui/langgraph @ag-ui/proto
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
In your `src/mastra/index.ts` file, register the chat route:
|
|
96
|
+
|
|
97
|
+
```typescript title="src/mastra/index.ts" {2,7-19}
|
|
98
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
99
|
+
import { registerCopilotKit } from '@ag-ui/mastra/copilotkit';
|
|
100
|
+
// Rest of the imports...
|
|
101
|
+
|
|
102
|
+
export const mastra = new Mastra({
|
|
103
|
+
// Rest of the configuration...
|
|
104
|
+
server: {
|
|
105
|
+
cors: {
|
|
106
|
+
origin: "*",
|
|
107
|
+
allowMethods: ["*"],
|
|
108
|
+
allowHeaders: ["*"],
|
|
109
|
+
},
|
|
110
|
+
apiRoutes: [
|
|
111
|
+
registerCopilotKit({
|
|
112
|
+
path: '/chat',
|
|
113
|
+
resourceId: 'weatherAgent'
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This will make the `weatherAgent` available at `/chat` in a CopilotKit-compatible format. You have to add the CORS configuration to allow the CopilotKit frontend to access the Mastra server. For production deployments, make sure to restrict the CORS origins to only your frontend domain.
|
|
121
|
+
|
|
122
|
+
</StepItem>
|
|
123
|
+
|
|
124
|
+
<StepItem>
|
|
125
|
+
|
|
126
|
+
Run the Mastra server using the following command:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm run dev
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps where we'll set up the CopilotKit frontend to connect to it.
|
|
133
|
+
|
|
134
|
+
</StepItem>
|
|
135
|
+
|
|
136
|
+
<StepItem>
|
|
137
|
+
|
|
138
|
+
Go up one directory to your project root.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cd ..
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Create a new Next.js project with the name `my-copilot-app`:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx create-next-app@latest my-copilot-app
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Navigate to your newly created Next.js project directory:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd my-copilot-app
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
</StepItem>
|
|
157
|
+
|
|
158
|
+
<StepItem>
|
|
159
|
+
|
|
160
|
+
Install the CopilotKit UI packages which you'll use to display a chat interface:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm install @copilotkit/react-ui @copilotkit/react-core
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Open the home route of the Next.js app (usually `app/page.tsx` or `src/app/page.tsx`) and replace the existing contents with the following code to set up a basic CopilotKit chat interface:
|
|
167
|
+
|
|
168
|
+
```typescript title="app/page.tsx"
|
|
169
|
+
import { CopilotChat } from "@copilotkit/react-ui";
|
|
170
|
+
import { CopilotKit } from "@copilotkit/react-core";
|
|
171
|
+
import "@copilotkit/react-ui/styles.css";
|
|
172
|
+
|
|
173
|
+
export default function Home() {
|
|
174
|
+
return (
|
|
175
|
+
<CopilotKit
|
|
176
|
+
runtimeUrl="http://localhost:4111/chat"
|
|
177
|
+
agent="weatherAgent"
|
|
178
|
+
>
|
|
179
|
+
<CopilotChat
|
|
180
|
+
labels={{
|
|
181
|
+
title: "Weather Agent",
|
|
182
|
+
initial: "Hi! 👋 Ask me about the weather, forecasts, and climate.",
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
</CopilotKit>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
</StepItem>
|
|
191
|
+
|
|
192
|
+
<StepItem>
|
|
193
|
+
|
|
194
|
+
You're ready to connect the pieces! Make sure both the Mastra server and the CopilotKit frontend are running. Start the Next.js development server:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run dev
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
You should now be able to chat with your agent in the browser.
|
|
201
|
+
|
|
202
|
+
</StepItem>
|
|
203
|
+
|
|
204
|
+
</Steps>
|
|
205
|
+
|
|
206
|
+
Congratulations! You have successfully integrated Mastra with CopilotKit using a separate server approach. Your CopilotKit frontend now communicates with a standalone Mastra agent server.
|
|
207
|
+
|
|
208
|
+
## Deployment
|
|
209
|
+
|
|
210
|
+
When deploying your Mastra server with CopilotKit, you must exclude `@copilotkit/runtime` from the bundle. This package contains dependencies that are not compatible with bundling and will cause 500 errors if included.
|
|
211
|
+
|
|
212
|
+
:::note
|
|
213
|
+
|
|
214
|
+
This issue doesn't occur during development with `mastra dev` since it doesn't require bundling. However, anyone running `mastra build` for deployment will encounter this issue.
|
|
215
|
+
|
|
216
|
+
:::
|
|
217
|
+
|
|
218
|
+
Add the `@copilotkit/runtime` package to your bundler externals configuration:
|
|
219
|
+
|
|
220
|
+
```typescript title="src/mastra/index.ts"
|
|
221
|
+
export const mastra = new Mastra({
|
|
222
|
+
bundler: {
|
|
223
|
+
externals: ['@copilotkit/runtime'],
|
|
224
|
+
},
|
|
225
|
+
// Rest of the configuration...
|
|
226
|
+
});
|
|
227
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Amazon EC2 | Deployment
|
|
2
|
+
title: "Amazon EC2 | Deployment"
|
|
3
3
|
description: "Deploy your Mastra applications to Amazon EC2."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ Deploy your Mastra applications to Amazon EC2 (Elastic Cloud Compute).
|
|
|
16
16
|
This guide assumes your Mastra application has been created using the default
|
|
17
17
|
`npx create-mastra@latest` command.
|
|
18
18
|
For more information on how to create a new Mastra application,
|
|
19
|
-
refer to our [getting started guide](/
|
|
19
|
+
refer to our [getting started guide](/guides/getting-started/quickstart)
|
|
20
20
|
:::
|
|
21
21
|
|
|
22
22
|
## Prerequisites
|
|
@@ -26,7 +26,7 @@ refer to our [getting started guide](/docs/getting-started/installation)
|
|
|
26
26
|
- A domain name with an A record pointing to your instance
|
|
27
27
|
- A reverse proxy configured (e.g., using [nginx](https://nginx.org/))
|
|
28
28
|
- SSL certificate configured (e.g., using [Let's Encrypt](https://letsencrypt.org/))
|
|
29
|
-
- Node.js
|
|
29
|
+
- Node.js 22.13.0 or later installed on your instance
|
|
30
30
|
|
|
31
31
|
## Deployment Steps
|
|
32
32
|
|
|
@@ -39,7 +39,7 @@ Connect to your EC2 instance and clone your repository:
|
|
|
39
39
|
<Tabs>
|
|
40
40
|
<TabItem value="public" label="Public Repository">
|
|
41
41
|
|
|
42
|
-
```bash
|
|
42
|
+
```bash
|
|
43
43
|
git clone https://github.com/<your-username>/<your-repository>.git
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -47,7 +47,7 @@ git clone https://github.com/<your-username>/<your-repository>.git
|
|
|
47
47
|
|
|
48
48
|
<TabItem value="private" label="Private Repository">
|
|
49
49
|
|
|
50
|
-
```bash
|
|
50
|
+
```bash
|
|
51
51
|
git clone https://<your-username>:<your-personal-access-token>@github.com/<your-username>/<your-repository>.git
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -56,7 +56,7 @@ git clone https://<your-username>:<your-personal-access-token>@github.com/<your-
|
|
|
56
56
|
|
|
57
57
|
Navigate to the repository directory:
|
|
58
58
|
|
|
59
|
-
```bash
|
|
59
|
+
```bash
|
|
60
60
|
cd "<your-repository>"
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ cd "<your-repository>"
|
|
|
66
66
|
|
|
67
67
|
Install dependencies:
|
|
68
68
|
|
|
69
|
-
```bash
|
|
69
|
+
```bash
|
|
70
70
|
npm install
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -76,13 +76,13 @@ npm install
|
|
|
76
76
|
|
|
77
77
|
Create a `.env` file and add your environment variables:
|
|
78
78
|
|
|
79
|
-
```bash
|
|
79
|
+
```bash
|
|
80
80
|
touch .env
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Edit the `.env` file and add your environment variables:
|
|
84
84
|
|
|
85
|
-
```bash
|
|
85
|
+
```bash
|
|
86
86
|
OPENAI_API_KEY=<your-openai-api-key>
|
|
87
87
|
# Add other required environment variables
|
|
88
88
|
```
|
|
@@ -93,7 +93,7 @@ OPENAI_API_KEY=<your-openai-api-key>
|
|
|
93
93
|
|
|
94
94
|
Build the application:
|
|
95
95
|
|
|
96
|
-
```bash
|
|
96
|
+
```bash
|
|
97
97
|
npm run build
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -103,8 +103,8 @@ npm run build
|
|
|
103
103
|
|
|
104
104
|
Run the application:
|
|
105
105
|
|
|
106
|
-
```bash
|
|
107
|
-
node --
|
|
106
|
+
```bash
|
|
107
|
+
node --env-file=".env" .mastra/output/index.mjs
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
:::note
|
|
@@ -121,7 +121,7 @@ You can now connect to your Mastra server from your client application using a `
|
|
|
121
121
|
|
|
122
122
|
Refer to the [`MastraClient` documentation](/reference/client-js/mastra-client) for more information.
|
|
123
123
|
|
|
124
|
-
```typescript
|
|
124
|
+
```typescript
|
|
125
125
|
import { MastraClient } from "@mastra/client-js";
|
|
126
126
|
|
|
127
127
|
const mastraClient = new MastraClient({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "AWS Lambda | Deployment
|
|
2
|
+
title: "AWS Lambda | Deployment"
|
|
3
3
|
description: "Deploy your Mastra applications to AWS Lambda using Docker containers and the AWS Lambda Web Adapter."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -15,7 +15,7 @@ This approach allows you to run your Mastra server as a containerized Lambda fun
|
|
|
15
15
|
This guide assumes your Mastra application has been created using the default
|
|
16
16
|
`npx create-mastra@latest` command.
|
|
17
17
|
For more information on how to create a new Mastra application,
|
|
18
|
-
refer to our [getting started guide](/
|
|
18
|
+
refer to our [getting started guide](/guides/getting-started/quickstart)
|
|
19
19
|
:::
|
|
20
20
|
|
|
21
21
|
## Prerequisites
|
|
@@ -29,21 +29,19 @@ Before deploying to AWS Lambda, ensure you have:
|
|
|
29
29
|
|
|
30
30
|
## Memory Configuration
|
|
31
31
|
|
|
32
|
-
:::
|
|
33
|
-
AWS Lambda uses an ephemeral file system,
|
|
34
|
-
meaning that any files written to the file system are short-lived and may be lost.
|
|
35
|
-
Avoid using a Mastra storage provider that uses the file system,
|
|
36
|
-
such as `LibSQLStore` with a file URL.
|
|
32
|
+
:::warning
|
|
33
|
+
AWS Lambda uses an ephemeral file system, meaning that any files written to the file system are short-lived and may be lost. Remove any usage of [LibSQLStore](/reference/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
37
34
|
:::
|
|
38
35
|
|
|
39
36
|
Lambda functions have limitations with file system storage. Configure your Mastra application to use either in-memory or external storage providers:
|
|
40
37
|
|
|
41
38
|
### Option 1: In-Memory (Simplest)
|
|
42
39
|
|
|
43
|
-
```typescript title="src/mastra/index.ts"
|
|
40
|
+
```typescript title="src/mastra/index.ts"
|
|
44
41
|
import { LibSQLStore } from "@mastra/libsql";
|
|
45
42
|
|
|
46
43
|
const storage = new LibSQLStore({
|
|
44
|
+
id: 'mastra-storage',
|
|
47
45
|
url: ":memory:", // in-memory storage
|
|
48
46
|
});
|
|
49
47
|
```
|
|
@@ -52,10 +50,11 @@ const storage = new LibSQLStore({
|
|
|
52
50
|
|
|
53
51
|
For persistent memory across Lambda invocations, use external storage providers like `LibSQLStore` with Turso or other storage providers like `PostgreStore`:
|
|
54
52
|
|
|
55
|
-
```typescript title="src/mastra/index.ts"
|
|
53
|
+
```typescript title="src/mastra/index.ts"
|
|
56
54
|
import { LibSQLStore } from "@mastra/libsql";
|
|
57
55
|
|
|
58
56
|
const storage = new LibSQLStore({
|
|
57
|
+
id: 'mastra-storage',
|
|
59
58
|
url: "libsql://your-database.turso.io", // External Turso database
|
|
60
59
|
authToken: process.env.TURSO_AUTH_TOKEN,
|
|
61
60
|
});
|
|
@@ -67,7 +66,7 @@ For more memory configuration options, see the [Memory documentation](/docs/memo
|
|
|
67
66
|
|
|
68
67
|
Create a `Dockerfile` in your Mastra project root directory:
|
|
69
68
|
|
|
70
|
-
```dockerfile title="Dockerfile"
|
|
69
|
+
```dockerfile title="Dockerfile"
|
|
71
70
|
FROM node:22-alpine
|
|
72
71
|
|
|
73
72
|
WORKDIR /app
|
|
@@ -90,7 +89,7 @@ ENV READINESS_CHECK_PATH="/api"
|
|
|
90
89
|
|
|
91
90
|
EXPOSE 8080
|
|
92
91
|
|
|
93
|
-
CMD ["node", "
|
|
92
|
+
CMD ["node", ".mastra/output/index.mjs"]
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
## Building and Deploying
|
|
@@ -101,7 +100,7 @@ CMD ["node", "--import=./.mastra/output/instrumentation.mjs", ".mastra/output/in
|
|
|
101
100
|
|
|
102
101
|
Set up your environment variables for the deployment process:
|
|
103
102
|
|
|
104
|
-
```bash
|
|
103
|
+
```bash
|
|
105
104
|
export PROJECT_NAME="your-mastra-app"
|
|
106
105
|
export AWS_REGION="us-east-1"
|
|
107
106
|
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
|
|
@@ -113,7 +112,7 @@ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output tex
|
|
|
113
112
|
|
|
114
113
|
Build your Docker image locally:
|
|
115
114
|
|
|
116
|
-
```bash
|
|
115
|
+
```bash
|
|
117
116
|
docker build -t "$PROJECT_NAME" .
|
|
118
117
|
```
|
|
119
118
|
|
|
@@ -123,7 +122,7 @@ docker build -t "$PROJECT_NAME" .
|
|
|
123
122
|
|
|
124
123
|
Create an Amazon ECR repository to store your Docker image:
|
|
125
124
|
|
|
126
|
-
```bash
|
|
125
|
+
```bash
|
|
127
126
|
aws ecr create-repository --repository-name "$PROJECT_NAME" --region "$AWS_REGION"
|
|
128
127
|
```
|
|
129
128
|
|
|
@@ -133,7 +132,7 @@ aws ecr create-repository --repository-name "$PROJECT_NAME" --region "$AWS_REGIO
|
|
|
133
132
|
|
|
134
133
|
Log in to Amazon ECR:
|
|
135
134
|
|
|
136
|
-
```bash
|
|
135
|
+
```bash
|
|
137
136
|
aws ecr get-login-password --region "$AWS_REGION" | docker login --username AWS --password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com"
|
|
138
137
|
```
|
|
139
138
|
|
|
@@ -143,7 +142,7 @@ aws ecr get-login-password --region "$AWS_REGION" | docker login --username AWS
|
|
|
143
142
|
|
|
144
143
|
Tag your image with the ECR repository URI and push it:
|
|
145
144
|
|
|
146
|
-
```bash
|
|
145
|
+
```bash
|
|
147
146
|
docker tag "$PROJECT_NAME":latest "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$PROJECT_NAME":latest
|
|
148
147
|
docker push "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$PROJECT_NAME":latest
|
|
149
148
|
```
|
|
@@ -187,7 +186,7 @@ Add your environment variables in the Lambda function configuration:
|
|
|
187
186
|
2. Add the required variables for your Mastra application:
|
|
188
187
|
- `OPENAI_API_KEY`: Your OpenAI API key (if using OpenAI)
|
|
189
188
|
- `ANTHROPIC_API_KEY`: Your Anthropic API key (if using Anthropic)
|
|
190
|
-
- `TURSO_AUTH_TOKEN`: Your Turso auth token (if using
|
|
189
|
+
- `TURSO_AUTH_TOKEN`: Your Turso auth token (if using libSQL with Turso)
|
|
191
190
|
- Other provider-specific API keys as needed
|
|
192
191
|
|
|
193
192
|
</StepItem>
|
|
@@ -214,13 +213,13 @@ Once deployed, test your Lambda function:
|
|
|
214
213
|
2. Visit the URL in your browser to see your Mastra's server home screen
|
|
215
214
|
3. Test your agents and workflows using the generated API endpoints
|
|
216
215
|
|
|
217
|
-
For more information about available API endpoints, see the [Server documentation](/docs/deployment/server
|
|
216
|
+
For more information about available API endpoints, see the [Server documentation](/docs/deployment/mastra-server).
|
|
218
217
|
|
|
219
218
|
## Connecting your client
|
|
220
219
|
|
|
221
220
|
Update your client application to use the Lambda function URL:
|
|
222
221
|
|
|
223
|
-
```typescript title="src/client.ts"
|
|
222
|
+
```typescript title="src/client.ts"
|
|
224
223
|
import { MastraClient } from "@mastra/client-js";
|
|
225
224
|
|
|
226
225
|
const mastraClient = new MastraClient({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Azure App Services | Deployment
|
|
2
|
+
title: "Azure App Services | Deployment"
|
|
3
3
|
description: "Deploy your Mastra applications to Azure App Services."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -14,7 +14,11 @@ Deploy your Mastra applications to Azure App Services.
|
|
|
14
14
|
This guide assumes your Mastra application has been created using the default
|
|
15
15
|
`npx create-mastra@latest` command.
|
|
16
16
|
For more information on how to create a new Mastra application,
|
|
17
|
-
refer to our [getting started guide](/
|
|
17
|
+
refer to our [getting started guide](/guides/getting-started/quickstart)
|
|
18
|
+
:::
|
|
19
|
+
|
|
20
|
+
:::warning
|
|
21
|
+
Azure App Services uses an ephemeral filesystem for some pricing tiers. Remove any usage of [LibSQLStore](/reference/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
18
22
|
:::
|
|
19
23
|
|
|
20
24
|
## Prerequisites
|
|
@@ -143,7 +147,7 @@ You can now connect to your Mastra server from your client application using a `
|
|
|
143
147
|
|
|
144
148
|
Refer to the [`MastraClient` documentation](/reference/client-js/mastra-client) for more information.
|
|
145
149
|
|
|
146
|
-
```typescript
|
|
150
|
+
```typescript
|
|
147
151
|
import { MastraClient } from "@mastra/client-js";
|
|
148
152
|
|
|
149
153
|
const mastraClient = new MastraClient({
|
|
@@ -151,12 +155,6 @@ const mastraClient = new MastraClient({
|
|
|
151
155
|
});
|
|
152
156
|
```
|
|
153
157
|
|
|
154
|
-
:::note
|
|
155
|
-
Azure App Services uses an ephemeral file system for some pricing tiers.
|
|
156
|
-
For production applications, avoid using Mastra storage providers that rely on the local file system,
|
|
157
|
-
such as `LibSQLStore` with a file URL. Consider using cloud-based storage solutions instead.
|
|
158
|
-
:::
|
|
159
|
-
|
|
160
158
|
## Next steps
|
|
161
159
|
|
|
162
160
|
- [Mastra Client SDK](/reference/client-js/mastra-client)
|