@mastra/mcp-docs-server 1.1.8 → 1.1.9-alpha.1
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/docs/agents/adding-voice.md +4 -4
- package/.docs/docs/agents/agent-approval.md +3 -3
- package/.docs/docs/agents/agent-memory.md +3 -3
- package/.docs/docs/agents/guardrails.md +3 -3
- package/.docs/docs/agents/network-approval.md +5 -2
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +42 -24
- package/.docs/docs/agents/structured-output.md +2 -2
- package/.docs/docs/agents/supervisor-agents.md +3 -3
- package/.docs/docs/agents/using-tools.md +3 -3
- package/.docs/docs/build-with-ai/mcp-docs-server.md +5 -5
- package/.docs/docs/build-with-ai/skills.md +2 -2
- package/.docs/docs/community/contributing-templates.md +1 -1
- package/.docs/docs/community/discord.md +3 -3
- package/.docs/docs/community/licensing.md +2 -2
- package/.docs/docs/deployment/cloud-providers.md +2 -2
- package/.docs/docs/deployment/mastra-server.md +2 -2
- package/.docs/docs/deployment/monorepo.md +1 -1
- package/.docs/docs/deployment/overview.md +3 -3
- package/.docs/docs/deployment/studio.md +3 -3
- package/.docs/docs/deployment/web-framework.md +2 -2
- package/.docs/docs/deployment/workflow-runners.md +1 -1
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +6 -6
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/evals/running-in-ci.md +6 -6
- package/.docs/docs/getting-started/build-with-ai.md +3 -3
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/getting-started/project-structure.md +2 -2
- package/.docs/docs/index.md +63 -17
- package/.docs/docs/mastra-cloud/deployment.md +1 -1
- package/.docs/docs/mastra-cloud/studio.md +1 -1
- package/.docs/docs/mcp/overview.md +1 -1
- package/.docs/docs/mcp/publishing-mcp-server.md +4 -4
- package/.docs/docs/memory/memory-processors.md +9 -9
- package/.docs/docs/memory/message-history.md +4 -4
- package/.docs/docs/memory/observational-memory.md +11 -7
- package/.docs/docs/memory/semantic-recall.md +9 -9
- package/.docs/docs/memory/storage.md +1 -1
- package/.docs/docs/memory/working-memory.md +20 -20
- package/.docs/docs/observability/datasets/overview.md +1 -1
- package/.docs/docs/observability/datasets/running-experiments.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/overview.md +5 -5
- package/.docs/docs/observability/tracing/bridges/otel.md +9 -9
- package/.docs/docs/observability/tracing/exporters/arize.md +3 -3
- package/.docs/docs/observability/tracing/exporters/braintrust.md +1 -1
- package/.docs/docs/observability/tracing/exporters/cloud.md +2 -2
- package/.docs/docs/observability/tracing/exporters/datadog.md +3 -3
- package/.docs/docs/observability/tracing/exporters/default.md +8 -8
- package/.docs/docs/observability/tracing/exporters/laminar.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langfuse.md +3 -3
- package/.docs/docs/observability/tracing/exporters/langsmith.md +4 -4
- package/.docs/docs/observability/tracing/exporters/otel.md +8 -8
- package/.docs/docs/observability/tracing/exporters/posthog.md +2 -2
- package/.docs/docs/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/docs/observability/tracing/overview.md +24 -24
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +13 -13
- package/.docs/docs/rag/chunking-and-embedding.md +5 -5
- package/.docs/docs/rag/overview.md +2 -2
- package/.docs/docs/rag/retrieval.md +4 -4
- package/.docs/docs/rag/vector-databases.md +13 -13
- package/.docs/docs/server/auth/auth0.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/composite-auth.md +9 -9
- package/.docs/docs/server/auth/custom-auth-provider.md +12 -12
- package/.docs/docs/server/auth/firebase.md +3 -3
- package/.docs/docs/server/auth/jwt.md +1 -1
- package/.docs/docs/server/auth/simple-auth.md +9 -9
- package/.docs/docs/server/auth/supabase.md +1 -1
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/auth.md +2 -2
- package/.docs/docs/server/custom-adapters.md +7 -7
- package/.docs/docs/server/custom-api-routes.md +2 -2
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/mastra-server.md +2 -2
- package/.docs/docs/server/request-context.md +2 -2
- package/.docs/docs/server/server-adapters.md +3 -3
- package/.docs/docs/streaming/events.md +2 -2
- package/.docs/docs/streaming/overview.md +2 -2
- package/.docs/docs/streaming/tool-streaming.md +46 -32
- package/.docs/docs/streaming/workflow-streaming.md +1 -1
- package/.docs/docs/voice/overview.md +3 -3
- package/.docs/docs/voice/speech-to-speech.md +1 -1
- package/.docs/docs/voice/speech-to-text.md +2 -2
- package/.docs/docs/voice/text-to-speech.md +2 -2
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/control-flow.md +45 -3
- package/.docs/docs/workflows/error-handling.md +4 -4
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +3 -3
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/docs/workspace/filesystem.md +3 -3
- package/.docs/docs/workspace/overview.md +53 -8
- package/.docs/docs/workspace/sandbox.md +72 -13
- package/.docs/docs/workspace/search.md +1 -1
- package/.docs/docs/workspace/skills.md +4 -4
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +2 -2
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit.md +2 -2
- package/.docs/guides/deployment/digital-ocean.md +1 -1
- package/.docs/guides/deployment/inngest.md +4 -4
- package/.docs/guides/getting-started/astro.md +1 -1
- package/.docs/guides/getting-started/electron.md +1 -1
- package/.docs/guides/getting-started/next-js.md +1 -1
- package/.docs/guides/getting-started/vite-react.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +4 -4
- package/.docs/guides/guide/chef-michel.md +4 -4
- package/.docs/guides/guide/code-review-bot.md +3 -3
- package/.docs/guides/guide/dev-assistant.md +5 -5
- package/.docs/guides/guide/docs-manager.md +3 -3
- package/.docs/guides/guide/github-actions-pr-description.md +4 -4
- package/.docs/guides/guide/notes-mcp-server.md +4 -4
- package/.docs/guides/guide/research-assistant.md +4 -4
- package/.docs/guides/guide/research-coordinator.md +1 -1
- package/.docs/guides/guide/stock-agent.md +6 -6
- package/.docs/guides/guide/web-search.md +2 -2
- package/.docs/guides/guide/whatsapp-chat-bot.md +1 -1
- package/.docs/guides/migrations/agentnetwork.md +1 -1
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +3 -3
- package/.docs/guides/migrations/network-to-supervisor.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/mastra.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +4 -4
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/vectors.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +6 -6
- package/.docs/guides/migrations/vnext-to-standard-apis.md +3 -3
- package/.docs/models/embeddings.md +4 -4
- package/.docs/models/gateways/custom-gateways.md +4 -4
- package/.docs/models/gateways/netlify.md +2 -3
- package/.docs/models/gateways/openrouter.md +9 -2
- package/.docs/models/gateways/vercel.md +11 -2
- package/.docs/models/gateways.md +2 -2
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/302ai.md +3 -3
- package/.docs/models/providers/abacus.md +24 -14
- package/.docs/models/providers/aihubmix.md +10 -5
- package/.docs/models/providers/alibaba-cn.md +83 -74
- package/.docs/models/providers/alibaba-coding-plan-cn.md +78 -0
- package/.docs/models/providers/alibaba-coding-plan.md +78 -0
- package/.docs/models/providers/alibaba.md +3 -3
- package/.docs/models/providers/anthropic.md +4 -4
- package/.docs/models/providers/bailing.md +3 -3
- package/.docs/models/providers/baseten.md +3 -3
- package/.docs/models/providers/berget.md +3 -3
- package/.docs/models/providers/cerebras.md +4 -4
- package/.docs/models/providers/chutes.md +7 -6
- package/.docs/models/providers/clarifai.md +81 -0
- package/.docs/models/providers/cloudferro-sherlock.md +8 -7
- package/.docs/models/providers/cloudflare-workers-ai.md +6 -5
- package/.docs/models/providers/cortecs.md +10 -8
- package/.docs/models/providers/deepinfra.md +11 -6
- package/.docs/models/providers/deepseek.md +4 -4
- package/.docs/models/providers/drun.md +73 -0
- package/.docs/models/providers/evroc.md +3 -3
- package/.docs/models/providers/fastrouter.md +3 -3
- package/.docs/models/providers/fireworks-ai.md +3 -3
- package/.docs/models/providers/firmware.md +31 -23
- package/.docs/models/providers/friendli.md +3 -3
- package/.docs/models/providers/github-models.md +3 -3
- package/.docs/models/providers/google.md +7 -5
- package/.docs/models/providers/groq.md +4 -4
- package/.docs/models/providers/helicone.md +3 -3
- package/.docs/models/providers/huggingface.md +3 -3
- package/.docs/models/providers/iflowcn.md +3 -3
- package/.docs/models/providers/inception.md +7 -5
- package/.docs/models/providers/inference.md +3 -3
- package/.docs/models/providers/io-net.md +3 -3
- package/.docs/models/providers/jiekou.md +3 -3
- package/.docs/models/providers/kilo.md +6 -4
- package/.docs/models/providers/kimi-for-coding.md +4 -4
- package/.docs/models/providers/kuae-cloud-coding-plan.md +3 -3
- package/.docs/models/providers/llama.md +3 -3
- package/.docs/models/providers/lmstudio.md +3 -3
- package/.docs/models/providers/lucidquery.md +3 -3
- package/.docs/models/providers/meganova.md +3 -3
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -4
- package/.docs/models/providers/minimax-cn.md +4 -4
- package/.docs/models/providers/minimax-coding-plan.md +4 -4
- package/.docs/models/providers/minimax.md +4 -4
- package/.docs/models/providers/mistral.md +4 -4
- package/.docs/models/providers/moark.md +3 -3
- package/.docs/models/providers/modelscope.md +3 -3
- package/.docs/models/providers/moonshotai-cn.md +3 -3
- package/.docs/models/providers/moonshotai.md +3 -3
- package/.docs/models/providers/morph.md +3 -3
- package/.docs/models/providers/nano-gpt.md +523 -42
- package/.docs/models/providers/nebius.md +37 -37
- package/.docs/models/providers/nova.md +3 -3
- package/.docs/models/providers/novita-ai.md +3 -3
- package/.docs/models/providers/nvidia.md +7 -5
- package/.docs/models/providers/ollama-cloud.md +4 -5
- package/.docs/models/providers/openai.md +7 -5
- package/.docs/models/providers/opencode-go.md +3 -3
- package/.docs/models/providers/opencode.md +39 -36
- package/.docs/models/providers/ovhcloud.md +3 -3
- package/.docs/models/providers/perplexity-agent.md +4 -4
- package/.docs/models/providers/perplexity.md +4 -4
- package/.docs/models/providers/poe.md +11 -5
- package/.docs/models/providers/privatemode-ai.md +3 -3
- package/.docs/models/providers/qihang-ai.md +3 -3
- package/.docs/models/providers/qiniu-ai.md +23 -8
- package/.docs/models/providers/requesty.md +20 -4
- package/.docs/models/providers/scaleway.md +3 -3
- package/.docs/models/providers/siliconflow-cn.md +10 -4
- package/.docs/models/providers/siliconflow.md +3 -3
- package/.docs/models/providers/stackit.md +3 -3
- package/.docs/models/providers/stepfun.md +3 -3
- package/.docs/models/providers/submodel.md +3 -3
- package/.docs/models/providers/synthetic.md +3 -3
- package/.docs/models/providers/togetherai.md +5 -7
- package/.docs/models/providers/upstage.md +3 -3
- package/.docs/models/providers/vivgrid.md +4 -4
- package/.docs/models/providers/vultr.md +3 -3
- package/.docs/models/providers/wandb.md +3 -3
- package/.docs/models/providers/xai.md +34 -31
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers/zai-coding-plan.md +3 -3
- package/.docs/models/providers/zai.md +3 -3
- package/.docs/models/providers/zenmux.md +7 -5
- package/.docs/models/providers/zhipuai-coding-plan.md +3 -3
- package/.docs/models/providers/zhipuai.md +3 -3
- package/.docs/models/providers.md +4 -0
- package/.docs/reference/agents/agent.md +3 -3
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/getDescription.md +1 -1
- package/.docs/reference/agents/network.md +5 -3
- package/.docs/reference/ai-sdk/handle-chat-stream.md +2 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
- package/.docs/reference/ai-sdk/network-route.md +2 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/auth/auth0.md +7 -7
- package/.docs/reference/auth/better-auth.md +2 -2
- package/.docs/reference/auth/clerk.md +1 -1
- package/.docs/reference/auth/firebase.md +5 -5
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/supabase.md +1 -1
- package/.docs/reference/auth/workos.md +6 -6
- package/.docs/reference/cli/mastra.md +5 -5
- package/.docs/reference/client-js/agents.md +22 -22
- package/.docs/reference/client-js/error-handling.md +2 -2
- package/.docs/reference/client-js/logs.md +2 -2
- package/.docs/reference/client-js/mastra-client.md +2 -2
- package/.docs/reference/client-js/memory.md +6 -6
- package/.docs/reference/client-js/observability.md +4 -4
- package/.docs/reference/client-js/telemetry.md +1 -1
- package/.docs/reference/client-js/tools.md +3 -3
- package/.docs/reference/client-js/vectors.md +2 -2
- package/.docs/reference/client-js/workflows.md +12 -12
- package/.docs/reference/configuration.md +62 -6
- package/.docs/reference/core/getDeployer.md +1 -1
- package/.docs/reference/core/getGatewayById.md +1 -1
- package/.docs/reference/core/getLogger.md +1 -1
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +2 -2
- package/.docs/reference/core/getMemory.md +1 -1
- package/.docs/reference/core/getScorer.md +4 -4
- package/.docs/reference/core/getScorerById.md +2 -2
- package/.docs/reference/core/getServer.md +1 -1
- package/.docs/reference/core/getStorage.md +1 -1
- package/.docs/reference/core/getStoredAgentById.md +3 -3
- package/.docs/reference/core/getTelemetry.md +1 -1
- package/.docs/reference/core/getWorkflow.md +1 -1
- package/.docs/reference/core/listAgents.md +1 -1
- package/.docs/reference/core/listMCPServers.md +3 -3
- package/.docs/reference/core/listMemory.md +1 -1
- package/.docs/reference/core/listScorers.md +1 -1
- package/.docs/reference/core/listStoredAgents.md +3 -3
- package/.docs/reference/core/listVectors.md +1 -1
- package/.docs/reference/core/mastra-class.md +2 -2
- package/.docs/reference/core/mastra-model-gateway.md +11 -11
- package/.docs/reference/core/setLogger.md +1 -1
- package/.docs/reference/core/setStorage.md +1 -1
- package/.docs/reference/datasets/dataset.md +2 -2
- package/.docs/reference/datasets/datasets-manager.md +1 -1
- package/.docs/reference/datasets/get.md +2 -2
- package/.docs/reference/datasets/getDetails.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/vercel.md +1 -1
- package/.docs/reference/deployer.md +4 -4
- package/.docs/reference/evals/answer-relevancy.md +4 -4
- package/.docs/reference/evals/answer-similarity.md +3 -3
- package/.docs/reference/evals/bias.md +4 -4
- package/.docs/reference/evals/completeness.md +6 -6
- package/.docs/reference/evals/content-similarity.md +3 -3
- package/.docs/reference/evals/context-precision.md +9 -9
- package/.docs/reference/evals/context-relevance.md +7 -7
- package/.docs/reference/evals/create-scorer.md +7 -7
- package/.docs/reference/evals/faithfulness.md +3 -3
- package/.docs/reference/evals/hallucination.md +8 -14
- package/.docs/reference/evals/keyword-coverage.md +4 -4
- package/.docs/reference/evals/mastra-scorer.md +7 -7
- package/.docs/reference/evals/noise-sensitivity.md +11 -11
- package/.docs/reference/evals/prompt-alignment.md +5 -5
- package/.docs/reference/evals/run-evals.md +5 -5
- package/.docs/reference/evals/scorer-utils.md +17 -17
- package/.docs/reference/evals/textual-difference.md +4 -4
- package/.docs/reference/evals/tone-consistency.md +5 -5
- package/.docs/reference/evals/tool-call-accuracy.md +10 -10
- package/.docs/reference/evals/toxicity.md +3 -3
- package/.docs/reference/harness/harness-class.md +5 -3
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/memory/clone-utilities.md +7 -7
- package/.docs/reference/memory/cloneThread.md +5 -5
- package/.docs/reference/memory/createThread.md +1 -1
- package/.docs/reference/memory/deleteMessages.md +1 -1
- package/.docs/reference/memory/getThreadById.md +1 -1
- package/.docs/reference/memory/listThreads.md +3 -3
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/observational-memory.md +8 -6
- package/.docs/reference/memory/recall.md +1 -1
- package/.docs/reference/observability/tracing/bridges/otel.md +6 -6
- package/.docs/reference/observability/tracing/configuration.md +17 -17
- package/.docs/reference/observability/tracing/exporters/arize.md +4 -4
- package/.docs/reference/observability/tracing/exporters/braintrust.md +3 -3
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +6 -6
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +4 -4
- package/.docs/reference/observability/tracing/exporters/datadog.md +4 -4
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +6 -6
- package/.docs/reference/observability/tracing/exporters/laminar.md +2 -2
- package/.docs/reference/observability/tracing/exporters/langfuse.md +4 -4
- package/.docs/reference/observability/tracing/exporters/langsmith.md +6 -6
- package/.docs/reference/observability/tracing/exporters/otel.md +12 -12
- package/.docs/reference/observability/tracing/exporters/posthog.md +3 -3
- package/.docs/reference/observability/tracing/exporters/sentry.md +5 -5
- package/.docs/reference/observability/tracing/instances.md +9 -9
- package/.docs/reference/observability/tracing/interfaces.md +39 -39
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +6 -6
- package/.docs/reference/observability/tracing/spans.md +15 -13
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/processor-interface.md +21 -17
- package/.docs/reference/processors/token-limiter-processor.md +2 -2
- package/.docs/reference/rag/chunk.md +2 -2
- package/.docs/reference/rag/database-config.md +8 -8
- package/.docs/reference/rag/document.md +11 -11
- package/.docs/reference/rag/embeddings.md +5 -5
- package/.docs/reference/rag/extract-params.md +8 -8
- package/.docs/reference/rag/graph-rag.md +4 -4
- package/.docs/reference/rag/metadata-filters.md +15 -15
- package/.docs/reference/rag/rerank.md +2 -2
- package/.docs/reference/rag/rerankWithScorer.md +2 -2
- package/.docs/reference/server/create-route.md +2 -0
- package/.docs/reference/server/express-adapter.md +1 -1
- package/.docs/reference/server/fastify-adapter.md +1 -1
- package/.docs/reference/server/hono-adapter.md +1 -1
- package/.docs/reference/server/koa-adapter.md +2 -2
- package/.docs/reference/server/mastra-server.md +16 -16
- package/.docs/reference/server/register-api-route.md +7 -7
- package/.docs/reference/server/routes.md +1 -1
- package/.docs/reference/storage/cloudflare-d1.md +5 -5
- package/.docs/reference/storage/cloudflare.md +3 -3
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/convex.md +6 -6
- package/.docs/reference/storage/dynamodb.md +7 -7
- package/.docs/reference/storage/lance.md +5 -5
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/mongodb.md +6 -6
- package/.docs/reference/storage/mssql.md +4 -4
- package/.docs/reference/storage/overview.md +2 -2
- package/.docs/reference/storage/postgresql.md +7 -7
- package/.docs/reference/storage/upstash.md +4 -4
- package/.docs/reference/streaming/ChunkType.md +13 -13
- package/.docs/reference/streaming/agents/MastraModelOutput.md +6 -6
- package/.docs/reference/streaming/agents/stream.md +2 -2
- package/.docs/reference/streaming/agents/streamLegacy.md +1 -1
- package/.docs/reference/streaming/workflows/observeStream.md +2 -2
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/templates/overview.md +4 -4
- package/.docs/reference/tools/create-tool.md +10 -10
- package/.docs/reference/tools/document-chunker-tool.md +4 -4
- package/.docs/reference/tools/graph-rag-tool.md +7 -7
- package/.docs/reference/tools/mcp-client.md +13 -13
- package/.docs/reference/tools/mcp-server.md +27 -27
- package/.docs/reference/tools/vector-query-tool.md +12 -12
- package/.docs/reference/vectors/astra.md +13 -13
- package/.docs/reference/vectors/chroma.md +18 -18
- package/.docs/reference/vectors/convex.md +15 -15
- package/.docs/reference/vectors/couchbase.md +21 -21
- package/.docs/reference/vectors/duckdb.md +17 -17
- package/.docs/reference/vectors/elasticsearch.md +14 -14
- package/.docs/reference/vectors/lance.md +22 -22
- package/.docs/reference/vectors/libsql.md +15 -15
- package/.docs/reference/vectors/mongodb.md +18 -18
- package/.docs/reference/vectors/opensearch.md +11 -11
- package/.docs/reference/vectors/pg.md +23 -21
- package/.docs/reference/vectors/pinecone.md +15 -15
- package/.docs/reference/vectors/qdrant.md +15 -15
- package/.docs/reference/vectors/s3vectors.md +22 -22
- package/.docs/reference/vectors/turbopuffer.md +14 -14
- package/.docs/reference/vectors/upstash.md +15 -15
- package/.docs/reference/vectors/vectorize.md +16 -16
- package/.docs/reference/voice/azure.md +12 -10
- package/.docs/reference/voice/cloudflare.md +9 -7
- package/.docs/reference/voice/composite-voice.md +5 -5
- package/.docs/reference/voice/deepgram.md +5 -5
- package/.docs/reference/voice/elevenlabs.md +7 -7
- package/.docs/reference/voice/google-gemini-live.md +22 -22
- package/.docs/reference/voice/google.md +12 -12
- package/.docs/reference/voice/mastra-voice.md +18 -18
- package/.docs/reference/voice/murf.md +8 -8
- package/.docs/reference/voice/openai-realtime.md +19 -17
- package/.docs/reference/voice/openai.md +12 -8
- package/.docs/reference/voice/playai.md +9 -7
- package/.docs/reference/voice/sarvam.md +8 -6
- package/.docs/reference/voice/speechify.md +11 -9
- package/.docs/reference/voice/voice.addInstructions.md +4 -4
- package/.docs/reference/voice/voice.addTools.md +3 -3
- package/.docs/reference/voice/voice.answer.md +2 -2
- package/.docs/reference/voice/voice.close.md +4 -4
- package/.docs/reference/voice/voice.connect.md +9 -7
- package/.docs/reference/voice/voice.events.md +4 -4
- package/.docs/reference/voice/voice.getSpeakers.md +4 -4
- package/.docs/reference/voice/voice.listen.md +17 -11
- package/.docs/reference/voice/voice.off.md +4 -4
- package/.docs/reference/voice/voice.on.md +5 -5
- package/.docs/reference/voice/voice.send.md +2 -2
- package/.docs/reference/voice/voice.speak.md +19 -9
- package/.docs/reference/voice/voice.updateConfig.md +4 -4
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/run.md +3 -3
- package/.docs/reference/workflows/step.md +2 -2
- package/.docs/reference/workflows/workflow-methods/create-run.md +1 -1
- package/.docs/reference/workflows/workflow.md +1 -1
- package/.docs/reference/workspace/blaxel-sandbox.md +164 -0
- package/.docs/reference/workspace/daytona-sandbox.md +50 -141
- package/.docs/reference/workspace/e2b-sandbox.md +41 -77
- package/.docs/reference/workspace/filesystem.md +25 -11
- package/.docs/reference/workspace/gcs-filesystem.md +21 -1
- package/.docs/reference/workspace/local-filesystem.md +24 -10
- package/.docs/reference/workspace/local-sandbox.md +27 -102
- package/.docs/reference/workspace/process-manager.md +296 -0
- package/.docs/reference/workspace/s3-filesystem.md +21 -1
- package/.docs/reference/workspace/sandbox.md +9 -1
- package/.docs/reference/workspace/workspace-class.md +95 -27
- package/CHANGELOG.md +15 -0
- package/dist/tools/course.d.ts +7 -27
- package/dist/tools/course.d.ts.map +1 -1
- package/dist/tools/docs.d.ts +6 -18
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/embedded-docs.d.ts +12 -112
- package/dist/tools/embedded-docs.d.ts.map +1 -1
- package/dist/tools/migration.d.ts +6 -26
- package/dist/tools/migration.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MSSQL
|
|
1
|
+
# MSSQL storage
|
|
2
2
|
|
|
3
3
|
The MSSQL storage implementation provides a production-ready storage solution using Microsoft SQL Server databases.
|
|
4
4
|
|
|
@@ -45,7 +45,7 @@ const storage = new MSSQLStore({
|
|
|
45
45
|
|
|
46
46
|
**schemaName** (`string`): The name of the schema you want the storage to use. Will use the default schema if not provided.
|
|
47
47
|
|
|
48
|
-
## Constructor
|
|
48
|
+
## Constructor examples
|
|
49
49
|
|
|
50
50
|
You can instantiate `MSSQLStore` in the following ways:
|
|
51
51
|
|
|
@@ -89,7 +89,7 @@ const store5 = new MSSQLStore({
|
|
|
89
89
|
})
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
## Additional
|
|
92
|
+
## Additional notes
|
|
93
93
|
|
|
94
94
|
### Schema Management
|
|
95
95
|
|
|
@@ -138,7 +138,7 @@ const memoryStore = await storage.getStore('memory')
|
|
|
138
138
|
const thread = await memoryStore?.getThreadById({ threadId: '...' })
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
> **Warning:** If `init()`
|
|
141
|
+
> **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
|
|
142
142
|
|
|
143
143
|
### Direct Database and Pool Access
|
|
144
144
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# PostgreSQL
|
|
1
|
+
# PostgreSQL storage
|
|
2
2
|
|
|
3
3
|
The PostgreSQL storage implementation provides a production-ready storage solution using PostgreSQL databases.
|
|
4
4
|
|
|
@@ -71,7 +71,7 @@ const storage = new PostgresStore({
|
|
|
71
71
|
|
|
72
72
|
**indexes** (`CreateIndexOptions[]`): Custom indexes to create during initialization.
|
|
73
73
|
|
|
74
|
-
## Constructor
|
|
74
|
+
## Constructor examples
|
|
75
75
|
|
|
76
76
|
You can instantiate `PostgresStore` in the following ways:
|
|
77
77
|
|
|
@@ -119,7 +119,7 @@ const store4 = new PostgresStore({
|
|
|
119
119
|
})
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
## Additional
|
|
122
|
+
## Additional notes
|
|
123
123
|
|
|
124
124
|
### Schema Management
|
|
125
125
|
|
|
@@ -177,7 +177,7 @@ const memoryStore = await storage.getStore('memory')
|
|
|
177
177
|
const thread = await memoryStore?.getThreadById({ threadId: '...' })
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
> **Warning:** If `init()`
|
|
180
|
+
> **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
|
|
181
181
|
|
|
182
182
|
### Using an Existing Pool
|
|
183
183
|
|
|
@@ -201,7 +201,7 @@ const storage = new PostgresStore({
|
|
|
201
201
|
|
|
202
202
|
**Pool lifecycle behavior:**
|
|
203
203
|
|
|
204
|
-
- When you **provide a pool**: Mastra uses your pool but
|
|
204
|
+
- When you **provide a pool**: Mastra uses your pool but **doesn't** close it when `store.close()` is called. You manage the pool lifecycle.
|
|
205
205
|
- When Mastra **creates a pool**: Mastra owns the pool and will close it when `store.close()` is called.
|
|
206
206
|
|
|
207
207
|
### Direct Database and Pool Access
|
|
@@ -316,7 +316,7 @@ This pattern ensures only one `PostgresStore` instance is created regardless of
|
|
|
316
316
|
|
|
317
317
|
> **Tip:** This singleton pattern is only necessary during local development with HMR. In production builds, modules are only loaded once.
|
|
318
318
|
|
|
319
|
-
## Usage
|
|
319
|
+
## Usage example
|
|
320
320
|
|
|
321
321
|
### Adding memory to an agent
|
|
322
322
|
|
|
@@ -387,7 +387,7 @@ for await (const chunk of stream.textStream) {
|
|
|
387
387
|
}
|
|
388
388
|
```
|
|
389
389
|
|
|
390
|
-
## Index
|
|
390
|
+
## Index management
|
|
391
391
|
|
|
392
392
|
PostgreSQL storage provides index management to optimize query performance.
|
|
393
393
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Upstash
|
|
1
|
+
# Upstash storage
|
|
2
2
|
|
|
3
3
|
The Upstash storage implementation provides a serverless-friendly storage solution using Upstash's Redis-compatible key-value store.
|
|
4
4
|
|
|
5
5
|
> **Pricing:** When using Mastra with Upstash, the pay-as-you-go model can result in unexpectedly high costs due to the high volume of Redis commands generated during agent conversations. We strongly recommend using a **fixed pricing plan** for predictable costs. See [Upstash pricing](https://upstash.com/pricing/redis) for details and [GitHub issue #5850](https://github.com/mastra-ai/mastra/issues/5850) for context.
|
|
6
6
|
|
|
7
|
-
> **Observability Not Supported:** Upstash storage **
|
|
7
|
+
> **Observability Not Supported:** Upstash storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Upstash, and Mastra Studio's observability features won't work with Upstash as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -52,7 +52,7 @@ const storage = new UpstashStore({
|
|
|
52
52
|
|
|
53
53
|
**prefix** (`string`): Key prefix for all stored items (Default: `mastra:`)
|
|
54
54
|
|
|
55
|
-
## Additional
|
|
55
|
+
## Additional notes
|
|
56
56
|
|
|
57
57
|
### Key Structure
|
|
58
58
|
|
|
@@ -87,7 +87,7 @@ For optimal performance:
|
|
|
87
87
|
- Monitor Redis memory usage
|
|
88
88
|
- Consider data expiration policies if needed
|
|
89
89
|
|
|
90
|
-
## Usage
|
|
90
|
+
## Usage example
|
|
91
91
|
|
|
92
92
|
### Adding memory to an agent
|
|
93
93
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `ChunkType` type defines the mastra format of stream chunks that can be emitted during streaming responses from agents.
|
|
4
4
|
|
|
5
|
-
## Base
|
|
5
|
+
## Base properties
|
|
6
6
|
|
|
7
7
|
All chunks include these base properties:
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ All chunks include these base properties:
|
|
|
20
20
|
|
|
21
21
|
**from.WORKFLOW** (`'WORKFLOW'`): Chunk from workflow execution
|
|
22
22
|
|
|
23
|
-
## Text
|
|
23
|
+
## Text chunks
|
|
24
24
|
|
|
25
25
|
### text-start
|
|
26
26
|
|
|
@@ -60,7 +60,7 @@ Signals the end of text generation.
|
|
|
60
60
|
|
|
61
61
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
62
62
|
|
|
63
|
-
## Reasoning
|
|
63
|
+
## Reasoning chunks
|
|
64
64
|
|
|
65
65
|
### reasoning-start
|
|
66
66
|
|
|
@@ -118,7 +118,7 @@ Contains the reasoning signature from models that support advanced reasoning (li
|
|
|
118
118
|
|
|
119
119
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
120
120
|
|
|
121
|
-
## Tool
|
|
121
|
+
## Tool chunks
|
|
122
122
|
|
|
123
123
|
### tool-call
|
|
124
124
|
|
|
@@ -162,7 +162,7 @@ Result from a tool execution.
|
|
|
162
162
|
|
|
163
163
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
164
164
|
|
|
165
|
-
### tool-call-input-streaming-start
|
|
165
|
+
### `tool-call-input-streaming-start`
|
|
166
166
|
|
|
167
167
|
Signals the start of streaming tool call arguments.
|
|
168
168
|
|
|
@@ -180,7 +180,7 @@ Signals the start of streaming tool call arguments.
|
|
|
180
180
|
|
|
181
181
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
182
182
|
|
|
183
|
-
### tool-call-delta
|
|
183
|
+
### `tool-call-delta`
|
|
184
184
|
|
|
185
185
|
Incremental tool call arguments during streaming.
|
|
186
186
|
|
|
@@ -196,7 +196,7 @@ Incremental tool call arguments during streaming.
|
|
|
196
196
|
|
|
197
197
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
198
198
|
|
|
199
|
-
### tool-call-input-streaming-end
|
|
199
|
+
### `tool-call-input-streaming-end`
|
|
200
200
|
|
|
201
201
|
Signals the end of streaming tool call arguments.
|
|
202
202
|
|
|
@@ -230,7 +230,7 @@ An error occurred during tool execution.
|
|
|
230
230
|
|
|
231
231
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
232
232
|
|
|
233
|
-
## Source and
|
|
233
|
+
## Source and file chunks
|
|
234
234
|
|
|
235
235
|
### source
|
|
236
236
|
|
|
@@ -270,7 +270,7 @@ Contains file data.
|
|
|
270
270
|
|
|
271
271
|
**payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
|
|
272
272
|
|
|
273
|
-
## Control
|
|
273
|
+
## Control chunks
|
|
274
274
|
|
|
275
275
|
### start
|
|
276
276
|
|
|
@@ -368,7 +368,7 @@ Stream was aborted.
|
|
|
368
368
|
|
|
369
369
|
**payload.\[key: string]** (`any`): Additional abort data
|
|
370
370
|
|
|
371
|
-
## Object and
|
|
371
|
+
## Object and output chunks
|
|
372
372
|
|
|
373
373
|
### object
|
|
374
374
|
|
|
@@ -398,7 +398,7 @@ Contains output from workflow step execution, used primarily for usage tracking
|
|
|
398
398
|
|
|
399
399
|
**payload.output** (`ChunkType`): Nested chunk data from step execution, typically containing finish events or other step results
|
|
400
400
|
|
|
401
|
-
## Metadata and
|
|
401
|
+
## Metadata and special chunks
|
|
402
402
|
|
|
403
403
|
### response-metadata
|
|
404
404
|
|
|
@@ -442,7 +442,7 @@ Emitted when the stream is forcibly terminated due to content being blocked by a
|
|
|
442
442
|
|
|
443
443
|
**payload.processorId** (`string`): ID of the processor that triggered the tripwire
|
|
444
444
|
|
|
445
|
-
## Usage
|
|
445
|
+
## Usage example
|
|
446
446
|
|
|
447
447
|
```typescript
|
|
448
448
|
const stream = await agent.stream('Hello')
|
|
@@ -477,7 +477,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
477
477
|
}
|
|
478
478
|
```
|
|
479
479
|
|
|
480
|
-
## Related
|
|
480
|
+
## Related types
|
|
481
481
|
|
|
482
482
|
- [.stream()](https://mastra.ai/reference/streaming/agents/stream) - Method that returns streams emitting these chunks
|
|
483
483
|
- [MastraModelOutput](https://mastra.ai/reference/streaming/agents/MastraModelOutput) - The stream object that emits these chunks
|
|
@@ -9,7 +9,7 @@ const stream = await agent.stream('Hello world')
|
|
|
9
9
|
|
|
10
10
|
For setup and basic usage, see the [.stream()](https://mastra.ai/reference/streaming/agents/stream) method documentation.
|
|
11
11
|
|
|
12
|
-
## Streaming
|
|
12
|
+
## Streaming properties
|
|
13
13
|
|
|
14
14
|
These properties provide real-time access to model outputs as they're generated:
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ These properties provide real-time access to model outputs as they're generated:
|
|
|
25
25
|
|
|
26
26
|
**elementStream** (`ReadableStream<OUTPUT extends (infer T)[] ? T : never>`): Stream of individual array elements when the output schema defines an array type. Each element is emitted as it's completed rather than waiting for the entire array.
|
|
27
27
|
|
|
28
|
-
## Promise-based
|
|
28
|
+
## Promise-based properties
|
|
29
29
|
|
|
30
30
|
These properties resolve to final values after the stream completes:
|
|
31
31
|
|
|
@@ -95,7 +95,7 @@ These properties resolve to final values after the stream completes:
|
|
|
95
95
|
|
|
96
96
|
**response.uiMessages** (`UIMessage[]`): Response messages in UI format, includes any metadata added by output processors
|
|
97
97
|
|
|
98
|
-
## Error
|
|
98
|
+
## Error properties
|
|
99
99
|
|
|
100
100
|
**error** (`string | Error | { message: string; stack: string; } | undefined`): Error information if the stream encountered an error. Undefined if no errors occurred. Can be a string message, Error object, or serialized error with stack trace.
|
|
101
101
|
|
|
@@ -123,7 +123,7 @@ These properties resolve to final values after the stream completes:
|
|
|
123
123
|
|
|
124
124
|
**consumeStream.onError** (`(error: Error) => void`): Callback for handling stream errors
|
|
125
125
|
|
|
126
|
-
## Usage
|
|
126
|
+
## Usage examples
|
|
127
127
|
|
|
128
128
|
### Basic Text Streaming
|
|
129
129
|
|
|
@@ -221,7 +221,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
221
221
|
}
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
### Error
|
|
224
|
+
### Error handling
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
227
|
const stream = await agent.stream('Analyze this data')
|
|
@@ -246,7 +246,7 @@ if (stream.error) {
|
|
|
246
246
|
}
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
## Related
|
|
249
|
+
## Related types
|
|
250
250
|
|
|
251
251
|
- [.stream()](https://mastra.ai/reference/streaming/agents/stream) - Method that returns MastraModelOutput
|
|
252
252
|
- [ChunkType](https://mastra.ai/reference/streaming/ChunkType) - All possible chunk types in the full stream
|
|
@@ -290,7 +290,7 @@ for await (const chunk of stream.textStream) {
|
|
|
290
290
|
}
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
### Advanced
|
|
293
|
+
### Advanced example with Options
|
|
294
294
|
|
|
295
295
|
```ts
|
|
296
296
|
import { z } from 'zod'
|
|
@@ -323,7 +323,7 @@ await agent.stream('message for agent', {
|
|
|
323
323
|
})
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
## OpenAI WebSocket
|
|
326
|
+
## OpenAI WebSocket transport
|
|
327
327
|
|
|
328
328
|
Opt into OpenAI Responses WebSocket streaming via `providerOptions.openai.transport`. This only applies to streaming calls and is currently supported for direct OpenAI models (for example, `openai/gpt-4o`). If WebSocket streaming is unavailable, Mastra falls back to HTTP streaming. By default, Mastra closes the WebSocket when the stream finishes.
|
|
329
329
|
|
|
@@ -146,7 +146,7 @@ await agent.streamLegacy('message for agent', {
|
|
|
146
146
|
})
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
## Migration to
|
|
149
|
+
## Migration to new API
|
|
150
150
|
|
|
151
151
|
> **Info:** The new `.stream()` method offers enhanced capabilities including AI SDK v5+ compatibility, better structured output handling, and improved callback system. See the [migration guide](https://mastra.ai/guides/migrations/vnext-to-standard-apis) for detailed migration instructions.
|
|
152
152
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Run.observeStream()
|
|
2
2
|
|
|
3
|
-
The `.observeStream()` method opens a new `ReadableStream` to a workflow run that
|
|
3
|
+
The `.observeStream()` method opens a new `ReadableStream` to a workflow run that's currently running, allowing you to observe the stream of events if the original stream is no longer available.
|
|
4
4
|
|
|
5
5
|
## Usage example
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ for await (const chunk of stream) {
|
|
|
24
24
|
|
|
25
25
|
`ReadableStream<ChunkType>`
|
|
26
26
|
|
|
27
|
-
## Stream
|
|
27
|
+
## Stream events
|
|
28
28
|
|
|
29
29
|
The stream emits various event types during workflow execution. Each event has a `type` field and a `payload` containing relevant data:
|
|
30
30
|
|
|
@@ -54,7 +54,7 @@ if (result!.status === 'suspended') {
|
|
|
54
54
|
|
|
55
55
|
**stream.usage** (`Promise<{ inputTokens: number; outputTokens: number; totalTokens: number, reasoningTokens?: number, cacheInputTokens?: number }>`): A promise that resolves to token usage statistics
|
|
56
56
|
|
|
57
|
-
## Stream
|
|
57
|
+
## Stream events
|
|
58
58
|
|
|
59
59
|
The stream emits various event types during workflow execution. Each event has a `type` field and a `payload` containing relevant data:
|
|
60
60
|
|
|
@@ -82,7 +82,7 @@ console.log('Token usage:', usage)
|
|
|
82
82
|
console.log('Status:', stream.status)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
## Stream
|
|
85
|
+
## Stream events
|
|
86
86
|
|
|
87
87
|
The stream emits various event types during workflow execution. Each event has a `type` field and a `payload` containing relevant data:
|
|
88
88
|
|
|
@@ -9,7 +9,7 @@ Mastra templates are pre-built project structures that demonstrate specific use
|
|
|
9
9
|
- **Educational resources** - Learn Mastra patterns through real implementations
|
|
10
10
|
- **Quick starts** - Bootstrap projects faster than building from scratch
|
|
11
11
|
|
|
12
|
-
## Using
|
|
12
|
+
## Using templates
|
|
13
13
|
|
|
14
14
|
### Installation
|
|
15
15
|
|
|
@@ -55,7 +55,7 @@ After installation:
|
|
|
55
55
|
|
|
56
56
|
All templates follow this standardized structure:
|
|
57
57
|
|
|
58
|
-
## Creating
|
|
58
|
+
## Creating templates
|
|
59
59
|
|
|
60
60
|
### Requirements
|
|
61
61
|
|
|
@@ -130,7 +130,7 @@ Templates must be:
|
|
|
130
130
|
- **Single projects** - Not monorepos with multiple applications
|
|
131
131
|
- **Framework-free** - No Next.js, Express, or other web framework boilerplate
|
|
132
132
|
- **Mastra-focused** - Demonstrate Mastra functionality without additional layers
|
|
133
|
-
- **Mergeable** - Structure code for
|
|
133
|
+
- **Mergeable** - Structure code for seamless integration into existing projects
|
|
134
134
|
- **Node.js compatible** - Support Node.js v22.13.0 and later
|
|
135
135
|
- **ESM modules** - Use ES modules (`"type": "module"` in package.json)
|
|
136
136
|
|
|
@@ -155,7 +155,7 @@ Detailed explanation of the template's functionality and use case.
|
|
|
155
155
|
2. Install dependencies: `npm install`
|
|
156
156
|
3. Run the project: `npm run dev`
|
|
157
157
|
|
|
158
|
-
## Environment
|
|
158
|
+
## Environment variables
|
|
159
159
|
|
|
160
160
|
- `OPENAI_API_KEY`: Your OpenAI API key. Get one at [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
161
161
|
- `ANTHROPIC_API_KEY`: Your Anthropic API key. Get one at [Anthropic Console](https://console.anthropic.com/settings/keys)
|
|
@@ -73,7 +73,7 @@ The tool still returns the full `execute` result to your application, while the
|
|
|
73
73
|
- `type: 'json'`
|
|
74
74
|
- `type: 'content'` with parts like `text`, `image-url`, `image-data`, `file-url`, `file-data`, `file-id`, `image-file-id`, or `custom`
|
|
75
75
|
|
|
76
|
-
## Example with MCP
|
|
76
|
+
## Example with MCP annotations
|
|
77
77
|
|
|
78
78
|
When exposing tools via MCP (Model Context Protocol), you can add annotations to describe tool behavior and customize how clients display the tool. These MCP-specific properties are grouped under the `mcp` property:
|
|
79
79
|
|
|
@@ -152,13 +152,13 @@ The `createTool()` function returns a `Tool` object.
|
|
|
152
152
|
|
|
153
153
|
**Tool** (`object`): An object representing the defined tool, ready to be added to an agent.
|
|
154
154
|
|
|
155
|
-
## Tool
|
|
155
|
+
## Tool lifecycle hooks
|
|
156
156
|
|
|
157
157
|
Tools support lifecycle hooks that allow you to monitor and react to different stages of tool execution. These hooks are particularly useful for logging, analytics, validation, and real-time updates during streaming.
|
|
158
158
|
|
|
159
159
|
### Available Hooks
|
|
160
160
|
|
|
161
|
-
#### onInputStart
|
|
161
|
+
#### `onInputStart`
|
|
162
162
|
|
|
163
163
|
Called when tool call input streaming begins, before any input data is received.
|
|
164
164
|
|
|
@@ -172,7 +172,7 @@ export const tool = createTool({
|
|
|
172
172
|
})
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
#### onInputDelta
|
|
175
|
+
#### `onInputDelta`
|
|
176
176
|
|
|
177
177
|
Called for each incremental chunk of input text as it streams in. Useful for showing real-time progress or parsing partial JSON.
|
|
178
178
|
|
|
@@ -186,7 +186,7 @@ export const tool = createTool({
|
|
|
186
186
|
})
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
#### onInputAvailable
|
|
189
|
+
#### `onInputAvailable`
|
|
190
190
|
|
|
191
191
|
Called when the complete tool input is available and has been parsed and validated against the `inputSchema`.
|
|
192
192
|
|
|
@@ -204,7 +204,7 @@ export const tool = createTool({
|
|
|
204
204
|
})
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
#### onOutput
|
|
207
|
+
#### `onOutput`
|
|
208
208
|
|
|
209
209
|
Called after the tool has successfully executed and returned output. Useful for logging results, triggering follow-up actions, or analytics.
|
|
210
210
|
|
|
@@ -249,11 +249,11 @@ Additionally:
|
|
|
249
249
|
- `onInputAvailable` receives `input`: The validated input data (typed according to `inputSchema`)
|
|
250
250
|
- `onOutput` receives `output`: The tool's return value (typed according to `outputSchema`) and `toolName` (string): The name of the tool
|
|
251
251
|
|
|
252
|
-
### Error
|
|
252
|
+
### Error handling
|
|
253
253
|
|
|
254
|
-
Hook errors are caught and logged automatically, but
|
|
254
|
+
Hook errors are caught and logged automatically, but don't prevent tool execution from continuing. If a hook throws an error, it will be logged to the console but won't fail the tool call.
|
|
255
255
|
|
|
256
|
-
## MCP
|
|
256
|
+
## MCP tool annotations
|
|
257
257
|
|
|
258
258
|
When exposing tools via the Model Context Protocol (MCP), you can provide annotations that describe tool behavior. These annotations help MCP clients like OpenAI Apps SDK understand how to present and handle your tools.
|
|
259
259
|
|
|
@@ -266,7 +266,7 @@ mcp: {
|
|
|
266
266
|
}
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
### ToolAnnotations Properties
|
|
269
|
+
### `ToolAnnotations` Properties
|
|
270
270
|
|
|
271
271
|
**title** (`string`): A human-readable title for the tool. Used for display purposes in UI components.
|
|
272
272
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `createDocumentChunkerTool()` function creates a tool for splitting documents into smaller chunks for efficient processing and retrieval. It supports different chunking strategies and configurable parameters.
|
|
4
4
|
|
|
5
|
-
## Basic
|
|
5
|
+
## Basic usage
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
import { createDocumentChunkerTool, MDocument } from '@mastra/rag'
|
|
@@ -31,7 +31,7 @@ const { chunks } = await chunker.execute()
|
|
|
31
31
|
|
|
32
32
|
**params** (`ChunkParams`): Configuration parameters for chunking (Default: `Default chunking parameters`)
|
|
33
33
|
|
|
34
|
-
### ChunkParams
|
|
34
|
+
### `ChunkParams`
|
|
35
35
|
|
|
36
36
|
**strategy** (`'recursive'`): The chunking strategy to use (Default: `'recursive'`)
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ const { chunks } = await chunker.execute()
|
|
|
45
45
|
|
|
46
46
|
**chunks** (`DocumentChunk[]`): Array of document chunks with their content and metadata
|
|
47
47
|
|
|
48
|
-
## Example with
|
|
48
|
+
## Example with custom parameters
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
51
|
const technicalDoc = new MDocument({
|
|
@@ -74,7 +74,7 @@ chunks.forEach((chunk, index) => {
|
|
|
74
74
|
})
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
## Tool
|
|
77
|
+
## Tool details
|
|
78
78
|
|
|
79
79
|
The chunker is created as a Mastra tool with the following properties:
|
|
80
80
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `createGraphRAGTool()` creates a tool that enhances RAG by building a graph of semantic relationships between documents. It uses the `GraphRAG` system under the hood to provide graph-based retrieval, finding relevant content through both direct similarity and connected relationships.
|
|
4
4
|
|
|
5
|
-
## Usage
|
|
5
|
+
## Usage example
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
import { createGraphRAGTool } from '@mastra/rag'
|
|
@@ -61,7 +61,7 @@ The tool returns an object with:
|
|
|
61
61
|
|
|
62
62
|
**sources** (`QueryResult[]`): Array of full retrieval result objects. Each object contains all information needed to reference the original document, chunk, and similarity score.
|
|
63
63
|
|
|
64
|
-
### QueryResult object structure
|
|
64
|
+
### `QueryResult` object structure
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
67
|
{
|
|
@@ -73,7 +73,7 @@ The tool returns an object with:
|
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
## Default
|
|
76
|
+
## Default tool description
|
|
77
77
|
|
|
78
78
|
The default description focuses on:
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ The default description focuses on:
|
|
|
81
81
|
- Finding patterns and connections
|
|
82
82
|
- Answering complex queries
|
|
83
83
|
|
|
84
|
-
## Advanced
|
|
84
|
+
## Advanced example
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
87
|
const graphTool = createGraphRAGTool({
|
|
@@ -97,7 +97,7 @@ const graphTool = createGraphRAGTool({
|
|
|
97
97
|
})
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
## Example with
|
|
100
|
+
## Example with custom description
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
103
|
const graphTool = createGraphRAGTool({
|
|
@@ -111,7 +111,7 @@ const graphTool = createGraphRAGTool({
|
|
|
111
111
|
|
|
112
112
|
This example shows how to customize the tool description for a specific use case while maintaining its core purpose of relationship analysis.
|
|
113
113
|
|
|
114
|
-
## Example: Using
|
|
114
|
+
## Example: Using request context
|
|
115
115
|
|
|
116
116
|
```typescript
|
|
117
117
|
const graphTool = createGraphRAGTool({
|
|
@@ -147,7 +147,7 @@ For more information on request context, please see:
|
|
|
147
147
|
- [Agent Request Context](https://mastra.ai/docs/server/request-context)
|
|
148
148
|
- [Request Context](https://mastra.ai/docs/server/request-context)
|
|
149
149
|
|
|
150
|
-
## Dynamic
|
|
150
|
+
## Dynamic vector store for multi-tenant applications
|
|
151
151
|
|
|
152
152
|
For multi-tenant applications where each tenant has isolated data, you can pass a resolver function instead of a static vector store:
|
|
153
153
|
|