@mastra/mcp-docs-server 1.0.0-beta.1 → 1.0.0-beta.3
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/%40mastra%2Fagent-builder.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +14 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +172 -172
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +48 -48
- package/.docs/organized/changelogs/%40mastra%2Frag.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Freact.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +15 -15
- package/.docs/organized/changelogs/mastra.md +37 -37
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-v5.md +1 -1
- package/.docs/organized/code-examples/assistant-ui.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +1 -1
- package/.docs/organized/code-examples/heads-up-game.md +1 -1
- package/.docs/organized/code-examples/mcp-configuration.md +0 -3
- package/.docs/organized/code-examples/memory-per-resource-example.md +1 -1
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/stock-price-tool.md +1 -21
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +1 -1
- package/.docs/raw/agents/agent-memory.mdx +1 -1
- package/.docs/raw/agents/guardrails.mdx +1 -1
- package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +90 -0
- package/.docs/raw/agents/networks.mdx +1 -1
- package/.docs/raw/agents/overview.mdx +8 -13
- package/.docs/raw/agents/using-tools.mdx +10 -9
- package/.docs/raw/auth/auth0.mdx +1 -1
- package/.docs/raw/auth/clerk.mdx +1 -1
- package/.docs/raw/auth/firebase.mdx +1 -1
- package/.docs/raw/auth/index.mdx +1 -1
- package/.docs/raw/auth/jwt.mdx +1 -1
- package/.docs/raw/auth/supabase.mdx +1 -1
- package/.docs/raw/auth/workos.mdx +1 -1
- 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/deployment/{server-deployment.mdx → building-mastra.mdx} +4 -4
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +3 -3
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +2 -2
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/cloudflare-deployer.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/index.mdx +8 -4
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/netlify-deployer.mdx +1 -1
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/vercel-deployer.mdx +1 -1
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/dashboard.mdx +3 -3
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/observability.mdx +2 -2
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/overview.mdx +3 -3
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/setting-up.mdx +4 -4
- package/.docs/raw/deployment/monorepo.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +5 -5
- package/.docs/raw/deployment/web-framework.mdx +1 -1
- package/.docs/raw/evals/{off-the-shelf-scorers.mdx → built-in-scorers.mdx} +17 -15
- package/.docs/raw/evals/custom-scorers.mdx +1 -1
- package/.docs/raw/evals/overview.mdx +3 -3
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +15 -128
- package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +71 -19
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +8 -29
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +91 -267
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +3 -3
- package/.docs/raw/frameworks/servers/express.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +1 -1
- package/.docs/raw/getting-started/mcp-docs-server.mdx +6 -6
- package/.docs/raw/getting-started/project-structure.mdx +1 -1
- package/.docs/raw/getting-started/quickstart.mdx +27 -0
- package/.docs/raw/getting-started/studio.mdx +3 -3
- package/.docs/raw/getting-started/templates.mdx +1 -1
- package/.docs/raw/guides/guide/ai-recruiter.mdx +1 -1
- package/.docs/raw/guides/guide/chef-michel.mdx +1 -1
- package/.docs/raw/{getting-started/installation.mdx → guides/guide/manual-install.mdx} +6 -80
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
- package/.docs/raw/guides/guide/research-assistant.mdx +2 -2
- package/.docs/raw/guides/guide/stock-agent.mdx +1 -1
- package/.docs/raw/guides/guide/web-search.mdx +1 -1
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +11 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +42 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +31 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +27 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +28 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +25 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +80 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +60 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +25 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +43 -1
- package/.docs/raw/guides/quickstarts/nextjs.mdx +18 -17
- package/.docs/raw/guides/quickstarts/standalone-server.mdx +86 -0
- package/.docs/raw/index.mdx +3 -3
- package/.docs/raw/logging.mdx +7 -7
- package/.docs/raw/mcp/overview.mdx +360 -0
- package/.docs/raw/mcp/publishing-mcp-server.mdx +139 -0
- package/.docs/raw/memory/conversation-history.mdx +1 -1
- package/.docs/raw/memory/memory-processors.mdx +1 -1
- package/.docs/raw/memory/overview.mdx +2 -2
- package/.docs/raw/memory/semantic-recall.mdx +2 -2
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +1 -4
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +152 -0
- package/.docs/raw/memory/storage/memory-with-pg.mdx +1 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +1 -4
- package/.docs/raw/memory/threads-and-resources.mdx +1 -1
- package/.docs/raw/memory/working-memory.mdx +1 -1
- package/.docs/raw/observability/overview.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/arize.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/cloud.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/otel.mdx +1 -1
- package/.docs/raw/observability/tracing/overview.mdx +2 -2
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +2 -2
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +1 -1
- package/.docs/raw/rag/vector-databases.mdx +1 -1
- package/.docs/raw/reference/agents/agent.mdx +1 -2
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +1 -1
- package/.docs/raw/reference/agents/getLLM.mdx +1 -1
- package/.docs/raw/reference/agents/getMemory.mdx +1 -1
- package/.docs/raw/reference/agents/getModel.mdx +1 -1
- package/.docs/raw/reference/agents/getTools.mdx +69 -0
- package/.docs/raw/reference/agents/getVoice.mdx +1 -1
- package/.docs/raw/reference/agents/listAgents.mdx +1 -1
- package/.docs/raw/reference/agents/listScorers.mdx +1 -1
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/auth/auth0.mdx +1 -1
- package/.docs/raw/reference/auth/clerk.mdx +1 -1
- package/.docs/raw/reference/auth/firebase.mdx +1 -1
- package/.docs/raw/reference/auth/jwt.mdx +1 -1
- package/.docs/raw/reference/auth/supabase.mdx +1 -1
- package/.docs/raw/reference/auth/workos.mdx +1 -1
- package/.docs/raw/reference/cli/create-mastra.mdx +1 -1
- package/.docs/raw/reference/cli/mastra.mdx +4 -4
- package/.docs/raw/reference/client-js/agents.mdx +1 -1
- package/.docs/raw/reference/client-js/error-handling.mdx +1 -1
- package/.docs/raw/reference/client-js/logs.mdx +1 -1
- package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
- package/.docs/raw/reference/client-js/memory.mdx +1 -1
- package/.docs/raw/reference/client-js/observability.mdx +1 -1
- package/.docs/raw/reference/client-js/telemetry.mdx +1 -1
- package/.docs/raw/reference/client-js/tools.mdx +1 -1
- package/.docs/raw/reference/client-js/vectors.mdx +1 -1
- package/.docs/raw/reference/client-js/workflows.mdx +1 -1
- package/.docs/raw/reference/core/addGateway.mdx +59 -0
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getGateway.mdx +59 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +62 -0
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServerById.mdx +2 -2
- package/.docs/raw/reference/core/getScorer.mdx +1 -1
- package/.docs/raw/reference/core/getScorerById.mdx +1 -1
- package/.docs/raw/reference/core/getServer.mdx +2 -2
- package/.docs/raw/reference/core/getStorage.mdx +1 -1
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listGateways.mdx +53 -0
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +2 -2
- package/.docs/raw/reference/core/listScorers.mdx +1 -1
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/mastra-class.mdx +9 -1
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +241 -0
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +1 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -1
- package/.docs/raw/reference/deployer/deployer.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +1 -1
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/context-relevance.mdx +1 -1
- package/.docs/raw/reference/evals/create-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/mastra-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +1 -1
- package/.docs/raw/reference/evals/run-evals.mdx +1 -1
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +1 -1
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +2 -2
- package/.docs/raw/reference/memory/createThread.mdx +1 -1
- package/.docs/raw/reference/memory/deleteMessages.mdx +1 -1
- package/.docs/raw/reference/memory/getThreadById.mdx +1 -1
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +1 -1
- package/.docs/raw/reference/memory/memory-class.mdx +1 -1
- package/.docs/raw/reference/memory/query.mdx +1 -1
- package/.docs/raw/reference/memory/recall.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/configuration.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/instances.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/spans.mdx +2 -2
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
- package/.docs/raw/reference/processors/language-detector.mdx +1 -1
- package/.docs/raw/reference/processors/moderation-processor.mdx +1 -1
- package/.docs/raw/reference/processors/pii-detector.mdx +1 -1
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +1 -1
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +1 -1
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +1 -1
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/database-config.mdx +1 -1
- package/.docs/raw/reference/rag/document.mdx +1 -1
- package/.docs/raw/reference/rag/embeddings.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +1 -1
- package/.docs/raw/reference/rag/graph-rag.mdx +1 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +1 -1
- package/.docs/raw/reference/rag/rerank.mdx +1 -1
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +1 -1
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +1 -1
- package/.docs/raw/reference/storage/cloudflare.mdx +1 -1
- package/.docs/raw/reference/storage/dynamodb.mdx +1 -1
- package/.docs/raw/reference/storage/lance.mdx +1 -1
- package/.docs/raw/reference/storage/libsql.mdx +1 -1
- package/.docs/raw/reference/storage/mongodb.mdx +1 -1
- package/.docs/raw/reference/storage/mssql.mdx +1 -1
- package/.docs/raw/reference/storage/postgresql.mdx +1 -1
- package/.docs/raw/reference/storage/upstash.mdx +1 -1
- package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +1 -1
- package/.docs/raw/reference/templates/overview.mdx +1 -1
- package/.docs/raw/reference/tools/client.mdx +1 -1
- package/.docs/raw/reference/tools/create-tool.mdx +3 -4
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +1 -1
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
- package/.docs/raw/reference/tools/mcp-client.mdx +1 -1
- package/.docs/raw/reference/tools/mcp-server.mdx +55 -6
- package/.docs/raw/reference/tools/vector-query-tool.mdx +2 -2
- package/.docs/raw/reference/vectors/astra.mdx +1 -1
- package/.docs/raw/reference/vectors/chroma.mdx +1 -1
- package/.docs/raw/reference/vectors/couchbase.mdx +1 -1
- package/.docs/raw/reference/vectors/lance.mdx +1 -1
- package/.docs/raw/reference/vectors/libsql.mdx +1 -1
- package/.docs/raw/reference/vectors/mongodb.mdx +1 -1
- package/.docs/raw/reference/vectors/opensearch.mdx +1 -1
- package/.docs/raw/reference/vectors/pg.mdx +1 -1
- package/.docs/raw/reference/vectors/pinecone.mdx +22 -2
- package/.docs/raw/reference/vectors/qdrant.mdx +1 -1
- package/.docs/raw/reference/vectors/s3vectors.mdx +1 -1
- package/.docs/raw/reference/vectors/turbopuffer.mdx +1 -1
- package/.docs/raw/reference/vectors/upstash.mdx +1 -1
- package/.docs/raw/reference/vectors/vectorize.mdx +1 -1
- package/.docs/raw/reference/voice/azure.mdx +96 -81
- package/.docs/raw/reference/voice/cloudflare.mdx +1 -1
- package/.docs/raw/reference/voice/composite-voice.mdx +1 -1
- package/.docs/raw/reference/voice/deepgram.mdx +1 -1
- package/.docs/raw/reference/voice/elevenlabs.mdx +1 -1
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/voice/google.mdx +1 -1
- package/.docs/raw/reference/voice/mastra-voice.mdx +1 -1
- package/.docs/raw/reference/voice/murf.mdx +1 -1
- package/.docs/raw/reference/voice/openai-realtime.mdx +1 -1
- package/.docs/raw/reference/voice/openai.mdx +1 -1
- package/.docs/raw/reference/voice/playai.mdx +1 -1
- package/.docs/raw/reference/voice/sarvam.mdx +1 -1
- package/.docs/raw/reference/voice/speechify.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addTools.mdx +1 -1
- package/.docs/raw/reference/voice/voice.answer.mdx +1 -1
- package/.docs/raw/reference/voice/voice.close.mdx +1 -1
- package/.docs/raw/reference/voice/voice.connect.mdx +1 -1
- package/.docs/raw/reference/voice/voice.events.mdx +1 -1
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +1 -1
- package/.docs/raw/reference/voice/voice.listen.mdx +1 -1
- package/.docs/raw/reference/voice/voice.off.mdx +1 -1
- package/.docs/raw/reference/voice/voice.on.mdx +1 -1
- package/.docs/raw/reference/voice/voice.send.mdx +1 -1
- package/.docs/raw/reference/voice/voice.speak.mdx +1 -1
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/start.mdx +1 -1
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow.mdx +2 -2
- package/.docs/raw/server-db/custom-api-routes.mdx +1 -1
- package/.docs/raw/server-db/mastra-client.mdx +2 -2
- package/.docs/raw/server-db/{production-server.mdx → mastra-server.mdx} +2 -2
- package/.docs/raw/server-db/middleware.mdx +31 -31
- package/.docs/raw/server-db/request-context.mdx +3 -3
- package/.docs/raw/server-db/storage.mdx +1 -1
- package/.docs/raw/streaming/events.mdx +1 -1
- package/.docs/raw/streaming/overview.mdx +1 -1
- package/.docs/raw/streaming/tool-streaming.mdx +1 -1
- package/.docs/raw/streaming/workflow-streaming.mdx +1 -1
- package/.docs/raw/tools-mcp/advanced-usage.mdx +1 -1
- package/.docs/raw/tools-mcp/mcp-overview.mdx +1 -1
- package/.docs/raw/tools-mcp/overview.mdx +1 -1
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/voice/speech-to-speech.mdx +1 -1
- package/.docs/raw/voice/speech-to-text.mdx +1 -1
- package/.docs/raw/voice/text-to-speech.mdx +1 -1
- package/.docs/raw/workflows/agents-and-tools.mdx +2 -4
- package/.docs/raw/workflows/control-flow.mdx +6 -1
- package/.docs/raw/workflows/error-handling.mdx +4 -4
- package/.docs/raw/workflows/human-in-the-loop.mdx +160 -213
- package/.docs/raw/workflows/inngest-workflow.mdx +1 -1
- package/.docs/raw/workflows/input-data-mapping.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +10 -2
- package/.docs/raw/workflows/snapshots.mdx +4 -3
- package/.docs/raw/workflows/suspend-and-resume.mdx +72 -224
- package/CHANGELOG.md +26 -0
- package/dist/stdio.js +16 -18
- package/package.json +10 -14
- package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -58
|
@@ -9,6 +9,26 @@ Storage APIs have been standardized with consistent pagination and naming patter
|
|
|
9
9
|
|
|
10
10
|
## Changed
|
|
11
11
|
|
|
12
|
+
### Required `id` property for storage instances
|
|
13
|
+
|
|
14
|
+
Storage instances now require an `id` property. This unique identifier is used for tracking and managing storage instances within Mastra. The `id` should be a descriptive, unique string for each storage instance in your application.
|
|
15
|
+
|
|
16
|
+
To migrate, add an `id` field to your storage constructor.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
const storage = new PostgresStore({
|
|
20
|
+
+ id: 'main-postgres-store',
|
|
21
|
+
connectionString: process.env.POSTGRES_CONNECTION_STRING,
|
|
22
|
+
schemaName: 'public',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const upstashStore = new UpstashStore({
|
|
26
|
+
+ id: 'upstash-cache-store',
|
|
27
|
+
url: process.env.UPSTASH_REDIS_REST_URL,
|
|
28
|
+
token: process.env.UPSTASH_REDIS_REST_TOKEN,
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
12
32
|
### Pagination from `offset/limit` to `page/perPage`
|
|
13
33
|
|
|
14
34
|
All pagination APIs now use `page` and `perPage` instead of `offset` and `limit`. This change provides a more intuitive pagination model that aligns with common web pagination patterns.
|
|
@@ -50,6 +70,16 @@ To migrate, rename the method and update pagination parameters. You can now use
|
|
|
50
70
|
+ });
|
|
51
71
|
```
|
|
52
72
|
|
|
73
|
+
:::tip[Codemod]
|
|
74
|
+
|
|
75
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
npx @mastra/codemod@beta v1/storage-get-messages-paginated .
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
:::
|
|
82
|
+
|
|
53
83
|
### `getThreadsByResourceId` to `listThreadsByResourceId`
|
|
54
84
|
|
|
55
85
|
The `getThreadsByResourceId()` method has been renamed to `listThreadsByResourceId()`. This change aligns with the convention that `list*` methods return collections.
|
|
@@ -65,6 +95,16 @@ To migrate, rename the method call and update pagination parameters.
|
|
|
65
95
|
});
|
|
66
96
|
```
|
|
67
97
|
|
|
98
|
+
:::tip[Codemod]
|
|
99
|
+
|
|
100
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
101
|
+
|
|
102
|
+
```shell
|
|
103
|
+
npx @mastra/codemod@beta v1/storage-get-threads-by-resource .
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
:::
|
|
107
|
+
|
|
68
108
|
### `getWorkflowRuns` to `listWorkflowRuns`
|
|
69
109
|
|
|
70
110
|
The `getWorkflowRuns()` method has been renamed to `listWorkflowRuns()`. This change aligns with the convention that `list*` methods return collections.
|
|
@@ -81,6 +121,16 @@ To migrate, rename the method call and update pagination parameters.
|
|
|
81
121
|
});
|
|
82
122
|
```
|
|
83
123
|
|
|
124
|
+
:::tip[Codemod]
|
|
125
|
+
|
|
126
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
127
|
+
|
|
128
|
+
```shell
|
|
129
|
+
npx @mastra/codemod@beta v1/storage-list-workflow-runs .
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
:::
|
|
133
|
+
|
|
84
134
|
### `getMessagesById` to `listMessagesById`
|
|
85
135
|
|
|
86
136
|
The `getMessagesById()` method has been renamed to `listMessagesById()`. This change aligns with the convention that `list*` methods return collections.
|
|
@@ -94,6 +144,16 @@ To migrate, rename the method call.
|
|
|
94
144
|
});
|
|
95
145
|
```
|
|
96
146
|
|
|
147
|
+
:::tip[Codemod]
|
|
148
|
+
|
|
149
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
150
|
+
|
|
151
|
+
```shell
|
|
152
|
+
npx @mastra/codemod@beta v1/storage-list-messages-by-id .
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
:::
|
|
156
|
+
|
|
97
157
|
### Storage `getMessages` and `saveMessages` signatures
|
|
98
158
|
|
|
99
159
|
The `getMessages()` and `saveMessages()` methods have changed signatures and return types. Format overloads have been removed, and the methods now always work with `MastraDBMessage`. This change simplifies the API by removing format variations.
|
|
@@ -169,6 +229,16 @@ To migrate, pass the connection string as an object property.
|
|
|
169
229
|
+ });
|
|
170
230
|
```
|
|
171
231
|
|
|
232
|
+
:::tip[Codemod]
|
|
233
|
+
|
|
234
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
235
|
+
|
|
236
|
+
```shell
|
|
237
|
+
npx @mastra/codemod@beta v1/vector-pg-constructor .
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
:::
|
|
241
|
+
|
|
172
242
|
### PGVector `defineIndex` to `buildIndex`
|
|
173
243
|
|
|
174
244
|
The `defineIndex()` method has been removed in favor of `buildIndex()`. This change provides clearer naming for the index building operation.
|
|
@@ -198,6 +268,16 @@ To migrate, rename the parameter.
|
|
|
198
268
|
});
|
|
199
269
|
```
|
|
200
270
|
|
|
271
|
+
:::tip[Codemod]
|
|
272
|
+
|
|
273
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
274
|
+
|
|
275
|
+
```shell
|
|
276
|
+
npx @mastra/codemod@beta v1/storage-postgres-schema-name .
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
:::
|
|
280
|
+
|
|
201
281
|
### Score storage methods to `listScoresBy*` pattern
|
|
202
282
|
|
|
203
283
|
Score storage APIs have been renamed to follow the `listScoresBy*` pattern. This change provides consistency with the broader API naming conventions.
|
|
@@ -113,3 +113,63 @@ npx @mastra/codemod@beta v1/runtime-context .
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
:::
|
|
116
|
+
|
|
117
|
+
This applies to all tool executions, whether called directly or through agents and workflows. The type narrowing ensures you handle validation errors appropriately and prevents runtime errors when accessing output properties.
|
|
118
|
+
|
|
119
|
+
### Tool output validation with `outputSchema`
|
|
120
|
+
|
|
121
|
+
Tools with an `outputSchema` now validate their return values at runtime. Previously, `outputSchema` was only used for type inference - the output was never validated.
|
|
122
|
+
|
|
123
|
+
If your tool returns data that doesn't match its `outputSchema`, it will now return a `ValidationError` instead of the invalid data.
|
|
124
|
+
|
|
125
|
+
To fix validation errors, ensure the tool's output matches the schema definition:
|
|
126
|
+
|
|
127
|
+
```diff
|
|
128
|
+
const getUserTool = createTool({
|
|
129
|
+
id: "get-user",
|
|
130
|
+
outputSchema: z.object({
|
|
131
|
+
id: z.string(),
|
|
132
|
+
name: z.string(),
|
|
133
|
+
email: z.string().email(),
|
|
134
|
+
}),
|
|
135
|
+
execute: async (inputData) => {
|
|
136
|
+
- return { id: "123", name: "John" }; // Missing email
|
|
137
|
+
+ return { id: "123", name: "John", email: "john@example.com" };
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
When validation fails, the tool returns a `ValidationError`:
|
|
143
|
+
|
|
144
|
+
```diff
|
|
145
|
+
+ // Before v1 - invalid output would silently pass through
|
|
146
|
+
await getUserTool.execute({});
|
|
147
|
+
- // { id: "123", name: "John" } - missing email
|
|
148
|
+
+ // {
|
|
149
|
+
+ // error: true,
|
|
150
|
+
+ // message: "Tool output validation failed for get-user. The tool returned invalid output:\n- email: Required\n\nReturned output: {...}",
|
|
151
|
+
+ // validationErrors: { ... }
|
|
152
|
+
+ // }
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `tool.execute` return type includes `ValidationError`
|
|
156
|
+
|
|
157
|
+
The return type of `tool.execute` now includes `ValidationError` to handle validation failures. You must narrow the result type before accessing output schema properties to satisfy TypeScript's type checking.
|
|
158
|
+
|
|
159
|
+
When calling `tool.execute`, check if the result contains an error before accessing output properties:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
const result = await getUserTool.execute({});
|
|
163
|
+
|
|
164
|
+
// Type-safe check for validation errors
|
|
165
|
+
if ('error' in result && result.error) {
|
|
166
|
+
console.error('Validation failed:', result.message);
|
|
167
|
+
console.error('Details:', result.validationErrors);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// TypeScript knows result is valid here
|
|
172
|
+
console.log(result.id, result.name, result.email);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Alternatively, update the `outputSchema` to match your actual output, or remove `outputSchema` entirely if you don't need validation.
|
|
@@ -5,10 +5,34 @@ description: "Learn how to migrate vector-related changes when upgrading to v1."
|
|
|
5
5
|
|
|
6
6
|
# Vectors
|
|
7
7
|
|
|
8
|
-
Vector store methods have been renamed to follow consistent naming conventions.
|
|
8
|
+
Vector store constructors now require an `id` property, and vector store methods have been renamed to follow consistent naming conventions.
|
|
9
9
|
|
|
10
10
|
## Changed
|
|
11
11
|
|
|
12
|
+
### Required `id` property for vector store instances
|
|
13
|
+
|
|
14
|
+
Vector store instances now require an `id` property. This unique identifier is used for tracking and managing vector store instances within Mastra. The `id` should be a descriptive, unique string for each vector store in your application.
|
|
15
|
+
|
|
16
|
+
To migrate, add an `id` field to your vector store constructor.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
const vectorStore = new PgVector({
|
|
20
|
+
+ id: 'main-vector-store',
|
|
21
|
+
connectionString: process.env.POSTGRES_CONNECTION_STRING,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const chromaStore = new ChromaVector({
|
|
25
|
+
+ id: 'chroma-embeddings',
|
|
26
|
+
url: process.env.CHROMA_URL,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const pineconeStore = new PineconeVector({
|
|
30
|
+
+ id: 'pinecone-production',
|
|
31
|
+
apiKey: process.env.PINECONE_API_KEY,
|
|
32
|
+
environment: process.env.PINECONE_ENVIRONMENT,
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
12
36
|
### `getVectors` to `listVectors`
|
|
13
37
|
|
|
14
38
|
The `getVectors()` method has been renamed to `listVectors()`. This change aligns with the naming convention used across the API where plural getter methods use the `list` prefix.
|
|
@@ -25,7 +25,7 @@ To migrate, replace all calls to `mastra.getWorkflows()` with `mastra.listWorkfl
|
|
|
25
25
|
You can use Mastra's codemod CLI to update your imports automatically:
|
|
26
26
|
|
|
27
27
|
```shell
|
|
28
|
-
npx @mastra/codemod@beta v1/
|
|
28
|
+
npx @mastra/codemod@beta v1/mastra-plural-apis .
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
:::
|
|
@@ -68,6 +68,16 @@ To migrate, rename method calls from `createRunAsync` to `createRun`.
|
|
|
68
68
|
+ await workflow.createRun({ input: { ... } });
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
:::tip[Codemod]
|
|
72
|
+
|
|
73
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
npx @mastra/codemod@beta v1/workflow-create-run-async .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
:::
|
|
80
|
+
|
|
71
81
|
### `runCount` to `retryCount` (deprecated)
|
|
72
82
|
|
|
73
83
|
The `runCount` parameter has been deprecated in favor of `retryCount` in workflow step execution. This change provides clearer naming that better describes retry behavior. The old `runCount` still works but shows deprecation warnings.
|
|
@@ -83,6 +93,16 @@ To migrate, rename `runCount` to `retryCount` in step execution functions.
|
|
|
83
93
|
});
|
|
84
94
|
```
|
|
85
95
|
|
|
96
|
+
:::tip[Codemod]
|
|
97
|
+
|
|
98
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
99
|
+
|
|
100
|
+
```shell
|
|
101
|
+
npx @mastra/codemod@beta v1/workflow-run-count .
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
:::
|
|
105
|
+
|
|
86
106
|
### `getWorkflowRuns` to `listWorkflowRuns`
|
|
87
107
|
|
|
88
108
|
The `getWorkflowRuns()` method has been renamed to `listWorkflowRuns()`. This change aligns with the convention that `list*` methods return collections.
|
|
@@ -94,6 +114,28 @@ To migrate, rename method calls from `getWorkflowRuns` to `listWorkflowRuns`.
|
|
|
94
114
|
+ const runs = await workflow.listWorkflowRuns({ fromDate, toDate });
|
|
95
115
|
```
|
|
96
116
|
|
|
117
|
+
:::tip[Codemod]
|
|
118
|
+
|
|
119
|
+
You can use Mastra's codemod CLI to update your code automatically:
|
|
120
|
+
|
|
121
|
+
```shell
|
|
122
|
+
npx @mastra/codemod@beta v1/workflow-list-runs .
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
:::
|
|
126
|
+
|
|
127
|
+
### Inputs are validated by default
|
|
128
|
+
|
|
129
|
+
Previously, inputs weren't validated by default. The [`validateInputs`](/reference/v1/workflows/workflow#workflowoptions) flag determines whether to validate the workflow inputs or not. This boolean has been flipped to `true`. If you want the old behavior or have workflows whose schemas don't need to be validated, set `validateInputs: false`.
|
|
130
|
+
|
|
131
|
+
```diff
|
|
132
|
+
createWorkflow({
|
|
133
|
+
+ options: {
|
|
134
|
+
+ validateInputs: false
|
|
135
|
+
+ }
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
97
139
|
## Removed
|
|
98
140
|
|
|
99
141
|
### Legacy workflows export
|
|
@@ -5,11 +5,11 @@ description: "Get started with Mastra, Next.js, and AS SDK UI. Quickly."
|
|
|
5
5
|
|
|
6
6
|
# Next.js Quickstart
|
|
7
7
|
|
|
8
|
-
In this quickstart, you'll build
|
|
8
|
+
In this quickstart, you'll build a tool-calling AI agent using Mastra, then connect it to Next.js by importing and calling the agent directly from your routes.
|
|
9
9
|
|
|
10
|
-
You'll use [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) and [AI Elements](https://ai-sdk.dev/elements) to create a beautiful, interactive chat experience.
|
|
10
|
+
You'll use [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) and [AI Elements](https://ai-sdk.dev/elements) to create a beautiful, interactive chat experience.
|
|
11
11
|
|
|
12
|
-
In
|
|
12
|
+
In about 5 minutes, you'll have a functional AI-powered app ready to extend with your own tools and logic.
|
|
13
13
|
|
|
14
14
|
<figure>
|
|
15
15
|

|
|
@@ -18,7 +18,7 @@ In ~5 minutes, you'll have a functional AI-powered app ready to extend with your
|
|
|
18
18
|
|
|
19
19
|
## Before you begin
|
|
20
20
|
|
|
21
|
-
* You'll need an API key from a supported [model provider](/models/v1). If you don't have a preference, use [OpenAI](
|
|
21
|
+
* You'll need an API key from a supported [model provider](/models/v1). If you don't have a preference, use [OpenAI](/models/v1/providers/openai).
|
|
22
22
|
|
|
23
23
|
## Create a new Next.js app
|
|
24
24
|
|
|
@@ -41,7 +41,7 @@ npx create-next-app \
|
|
|
41
41
|
This creates a project called `my-nextjs-agent`, but you can replace it with any name you want.
|
|
42
42
|
|
|
43
43
|
## Initialize Mastra
|
|
44
|
-
`cd` and run [`mastra init`](/reference/v1/cli/create-mastra).
|
|
44
|
+
`cd` and run [`mastra init`](/reference/v1/cli/create-mastra).
|
|
45
45
|
|
|
46
46
|
When prompted, choose a provider (e.g. OpenAI) and enter your key:
|
|
47
47
|
|
|
@@ -58,14 +58,15 @@ This creates a `src/mastra` folder with an example weather agent and the followi
|
|
|
58
58
|
You'll call `weather-agent.ts` from your Next.js routes in the next steps.
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
## Install AI SDK
|
|
61
|
+
## Install AI SDK and AI Elements
|
|
62
62
|
|
|
63
|
-
Install AI SDK
|
|
63
|
+
Install AI SDK along with the Mastra adapter:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
66
|
npm install \
|
|
67
67
|
@mastra/ai-sdk \
|
|
68
|
-
@ai-sdk/react
|
|
68
|
+
@ai-sdk/react \
|
|
69
|
+
ai
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
Next, initialize AI Elements. When prompted, choose the default options:
|
|
@@ -112,7 +113,7 @@ export async function GET() {
|
|
|
112
113
|
resourceId: "weather-chat",
|
|
113
114
|
});
|
|
114
115
|
|
|
115
|
-
const uiMessages =
|
|
116
|
+
const uiMessages =
|
|
116
117
|
convertMessages(response?.uiMessages ?? []).to("AIV5.UI");
|
|
117
118
|
return NextResponse.json(uiMessages);
|
|
118
119
|
}
|
|
@@ -190,8 +191,8 @@ function Chat() {
|
|
|
190
191
|
{message.parts?.map((part: any, i: number) => {
|
|
191
192
|
if (part.type === 'text') {
|
|
192
193
|
return (
|
|
193
|
-
<Message
|
|
194
|
-
key={`${message.id}-${i}`}
|
|
194
|
+
<Message
|
|
195
|
+
key={`${message.id}-${i}`}
|
|
195
196
|
from={message.role}>
|
|
196
197
|
<MessageContent>
|
|
197
198
|
<MessageResponse>{part.text}</MessageResponse>
|
|
@@ -251,16 +252,16 @@ This component connects [`useChat()`](https://ai-sdk.dev/docs/reference/ai-sdk-u
|
|
|
251
252
|
It renders the response text using the [`<MessageResponse>`](https://ai-sdk.dev/elements/components/message#messageresponse-) component, and shows any tool invocations with the [`<Tool>`](https://ai-sdk.dev/elements/components/tool) component.
|
|
252
253
|
|
|
253
254
|
|
|
254
|
-
## Test your agent
|
|
255
|
+
## Test your agent
|
|
255
256
|
1. Run your Next.js app with `npm run dev`
|
|
256
257
|
|
|
257
258
|
2. Open the chat at http://localhost:3000/chat
|
|
258
259
|
|
|
259
|
-
3. Try asking about the weather. If your API key is set up correctly, you'll get a response
|
|
260
|
+
3. Try asking about the weather. If your API key is set up correctly, you'll get a response
|
|
260
261
|
|
|
261
262
|
## Next steps
|
|
262
263
|
|
|
263
|
-
Congratulations on building your Mastra agent with Next.js! 🎉
|
|
264
|
+
Congratulations on building your Mastra agent with Next.js! 🎉
|
|
264
265
|
|
|
265
266
|
From here, you can extend the project with your own tools and logic:
|
|
266
267
|
|
|
@@ -268,8 +269,8 @@ From here, you can extend the project with your own tools and logic:
|
|
|
268
269
|
- Give your agent its own [tools](/docs/v1/agents/using-tools)
|
|
269
270
|
- Add human-like [memory](/docs/v1/agents/agent-memory) to your agent
|
|
270
271
|
|
|
271
|
-
When you're ready, read more about how Mastra integrates with AI SDK and Next.js, and how to deploy
|
|
272
|
+
When you're ready, read more about how Mastra integrates with AI SDK and Next.js, and how to deploy your agent anywhere, including Vercel:
|
|
272
273
|
|
|
273
274
|
- Integrate Mastra with [AI SDK](/docs/v1/frameworks/agentic-uis/ai-sdk)
|
|
274
|
-
-
|
|
275
|
-
- Deploy your agent
|
|
275
|
+
- Deploy your agent to [Vercel](/docs/v1/deployment/cloud-providers/vercel-deployer)
|
|
276
|
+
- Deploy your agent [anywhere](/docs/v1/deployment/overview)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Standalone Server Quickstart"
|
|
3
|
+
description: Get started with Mastra using the create mastra CLI to build a standalone server with agents, workflows, and tools.
|
|
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
|
+
import { VideoPlayer } from "@site/src/components/video-player";
|
|
11
|
+
|
|
12
|
+
# Standalone Server Quickstart
|
|
13
|
+
|
|
14
|
+
The `create mastra` CLI command is the quickest way to spin up a standalone Mastra server. It walks you through setup and creates example agents, workflows, and tools for you to run locally or adapt
|
|
15
|
+
|
|
16
|
+
If you need more control over the setup, see the [manual installation guide](/guides/v1/guide/manual-install). You can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init) for existing projects.
|
|
17
|
+
|
|
18
|
+
## Before you begin
|
|
19
|
+
|
|
20
|
+
* You'll need an API key from a supported [model provider](/models/v1). If you don't have a preference, use [OpenAI](/models/v1/providers/openai).
|
|
21
|
+
|
|
22
|
+
## Initialize Mastra
|
|
23
|
+
|
|
24
|
+
You can run `create mastra` anywhere on your machine.
|
|
25
|
+
|
|
26
|
+
When prompted, choose a provider (e.g. OpenAI) and enter your key:
|
|
27
|
+
|
|
28
|
+
<Tabs>
|
|
29
|
+
<TabItem value="npm" label="npm">
|
|
30
|
+
|
|
31
|
+
```bash copy
|
|
32
|
+
npm create mastra@beta
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
</TabItem>
|
|
36
|
+
<TabItem value="pnpm" label="pnpm">
|
|
37
|
+
|
|
38
|
+
```bash copy
|
|
39
|
+
pnpm create mastra@beta
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
</TabItem>
|
|
43
|
+
<TabItem value="yarn" label="yarn">
|
|
44
|
+
|
|
45
|
+
```bash copy
|
|
46
|
+
yarn create mastra@beta
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</TabItem>
|
|
50
|
+
<TabItem value="bun" label="bun">
|
|
51
|
+
|
|
52
|
+
```bash copy
|
|
53
|
+
bun create mastra@beta
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
</TabItem>
|
|
57
|
+
</Tabs>
|
|
58
|
+
|
|
59
|
+
This creates a new directory for your project with a `src/mastra` folder containing an example weather agent and the following files:
|
|
60
|
+
|
|
61
|
+
- `index.ts` - Mastra config, including memory
|
|
62
|
+
- `tools/weather-tool.ts` - a tool to fetch weather for a given location
|
|
63
|
+
- `agents/weather-agent.ts` - a weather agent with a prompt that uses the tool
|
|
64
|
+
|
|
65
|
+
:::tip
|
|
66
|
+
|
|
67
|
+
You can use [flags](/reference/v1/cli/create-mastra#cli-flags) with `create mastra` like `--no-example` to skip the example weather agent or `--template` to start from a specific [template](/docs/v1/getting-started/templates)
|
|
68
|
+
|
|
69
|
+
:::
|
|
70
|
+
|
|
71
|
+
## Test your agent
|
|
72
|
+
|
|
73
|
+
Once setup is complete, follow the instructions in your terminal to start the Mastra dev server, then open Studio at [localhost:4111](http://localhost:4111).
|
|
74
|
+
|
|
75
|
+
Try asking about the weather. If your API key is set up correctly, you'll get a response:
|
|
76
|
+
|
|
77
|
+
<VideoPlayer src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406022/local-dev-agents-playground_100_m3begx.mp4" />
|
|
78
|
+
|
|
79
|
+
[Studio](/docs/v1/getting-started/studio) lets you rapidly build and prototype agents without needing to build a UI. Once you're ready, you can integrate your Mastra agent into your app using the guides below.
|
|
80
|
+
|
|
81
|
+
## Next steps
|
|
82
|
+
|
|
83
|
+
- Integrate Mastra with your frontend framework: [Next.js](/docs/v1/frameworks/web-frameworks/next-js), [React](/docs/v1/frameworks/web-frameworks/vite-react), or [Astro](/docs/v1/frameworks/web-frameworks/astro)
|
|
84
|
+
- Read more about [Mastra's features](/docs/v1#why-mastra)
|
|
85
|
+
- Build an agent from scratch following one of our [guides](/guides/v1)
|
|
86
|
+
- Watch conceptual guides on our [YouTube channel](https://www.youtube.com/@mastra-ai) and [subscribe](https://www.youtube.com/@mastra-ai?sub_confirmation=1)
|
package/.docs/raw/index.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "About Mastra
|
|
2
|
+
title: "About Mastra"
|
|
3
3
|
sidebar_position: 2
|
|
4
4
|
sidebar_label: "Introduction"
|
|
5
5
|
description: "Mastra is an all-in-one framework for building AI-powered applications and agents with a modern TypeScript stack."
|
|
@@ -51,8 +51,8 @@ Explore real-world examples in our [community showcase](/showcase).
|
|
|
51
51
|
|
|
52
52
|
## Get started
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Choose a [quickstart](/docs/v1/getting-started/quickstart) to get started, or see the [manual installation guide](/guides/v1/guide/manual-install) if you need more control over your setup.
|
|
55
55
|
|
|
56
|
-
If you're new to AI agents, check out our [templates](/docs/v1/getting-started/templates), [course](https://mastra.ai/
|
|
56
|
+
If you're new to AI agents, check out our [templates](/docs/v1/getting-started/templates), [course](https://mastra.ai/course), and [YouTube videos](https://youtube.com/@mastra-ai). You can also join our [Discord](https://discord.gg/BTYqqHKUrf) community to get help and share your projects.
|
|
57
57
|
|
|
58
58
|
We can't wait to see what you build ✌️
|
package/.docs/raw/logging.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Logging | Observability
|
|
2
|
+
title: "Logging | Observability"
|
|
3
3
|
description: Learn how to use logging in Mastra to monitor execution, capture application behavior, and improve the accuracy of AI applications.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ description: Learn how to use logging in Mastra to monitor execution, capture ap
|
|
|
7
7
|
|
|
8
8
|
Mastra's logging system captures function execution, input data, and output responses in a structured format.
|
|
9
9
|
|
|
10
|
-
When deploying to Mastra Cloud, logs are shown on the [Logs](/docs/v1/mastra-cloud/observability) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
10
|
+
When deploying to Mastra Cloud, logs are shown on the [Logs](/docs/v1/deployment/mastra-cloud/observability) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
11
11
|
|
|
12
|
-
## PinoLogger
|
|
12
|
+
## Configuring logs with PinoLogger
|
|
13
13
|
|
|
14
|
-
When [initializing a new Mastra project](/
|
|
14
|
+
When [initializing a new Mastra project](/guides/v1/quickstarts/standalone-server) using the CLI, `PinoLogger` is included by default.
|
|
15
15
|
|
|
16
16
|
```typescript title="src/mastra/index.ts" showLineNumbers copy
|
|
17
|
-
import { Mastra } from "@mastra/core";
|
|
17
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
18
18
|
import { PinoLogger } from "@mastra/loggers";
|
|
19
19
|
|
|
20
20
|
export const mastra = new Mastra({
|
|
@@ -28,7 +28,7 @@ export const mastra = new Mastra({
|
|
|
28
28
|
|
|
29
29
|
> See the [PinoLogger](/reference/v1/logging/pino-logger) API reference for all available configuration options.
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Customizing logs
|
|
32
32
|
|
|
33
33
|
Mastra provides access to a logger instance via the `mastra.getLogger()` method, available inside both workflow steps and tools. The logger supports standard severity levels: `debug`, `info`, `warn`, and `error`.
|
|
34
34
|
|
|
@@ -79,7 +79,7 @@ export const testTool = createTool({
|
|
|
79
79
|
});
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
### Logging with additional data
|
|
83
83
|
|
|
84
84
|
Logger methods accept an optional second argument for additional data. This can be any value, such as an object, string, or number.
|
|
85
85
|
|