@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Setting Up and Deploying | Mastra Cloud
|
|
2
|
+
title: "Setting Up and Deploying | Mastra Cloud"
|
|
3
3
|
description: Configuration steps for Mastra Cloud projects
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ This page explains how to set up a project on [Mastra Cloud](https://mastra.ai/c
|
|
|
18
18
|
- A [Mastra Cloud](https://mastra.ai/cloud) account
|
|
19
19
|
- A GitHub account / repository containing a Mastra application
|
|
20
20
|
|
|
21
|
-
> See our [Getting started](/
|
|
21
|
+
> See our [Getting started](/guides/v1/quickstarts/standalone-server) guide to scaffold out a new Mastra project with sensible defaults.
|
|
22
22
|
|
|
23
23
|
## Setup and Deploy process
|
|
24
24
|
|
|
@@ -98,8 +98,8 @@ Your project is now configured with automatic deployments which occur whenever y
|
|
|
98
98
|
|
|
99
99
|
## Testing your application
|
|
100
100
|
|
|
101
|
-
After a successful deployment you can test your agents and workflows [Studio](/docs/v1/mastra-cloud/dashboard#studio) in Mastra Cloud, or interact with them using our [Client SDK](/docs/v1/server-db/mastra-client).
|
|
101
|
+
After a successful deployment you can test your agents and workflows [Studio](/docs/v1/deployment/mastra-cloud/dashboard#studio) in Mastra Cloud, or interact with them using our [Client SDK](/docs/v1/server-db/mastra-client).
|
|
102
102
|
|
|
103
103
|
## Next steps
|
|
104
104
|
|
|
105
|
-
- [Navigating the Dashboard](/docs/v1/mastra-cloud/dashboard)
|
|
105
|
+
- [Navigating the Dashboard](/docs/v1/deployment/mastra-cloud/dashboard)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Monorepo Deployment | Deployment
|
|
2
|
+
title: "Monorepo Deployment | Deployment"
|
|
3
3
|
description: Learn how to deploy Mastra applications that are part of a monorepo setup
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Monorepo Deployment
|
|
7
7
|
|
|
8
|
-
Deploying Mastra in a monorepo follows the same approach as deploying a standalone application. While some [Cloud](./cloud-providers/) or [Serverless Platform](./
|
|
8
|
+
Deploying Mastra in a monorepo follows the same approach as deploying a standalone application. While some [Cloud](./cloud-providers/) or [Serverless Platform](./cloud-providers/) providers may introduce extra requirements, the core setup is the same.
|
|
9
9
|
|
|
10
10
|
## Example monorepo
|
|
11
11
|
|
|
@@ -44,7 +44,7 @@ api/
|
|
|
44
44
|
|
|
45
45
|
## Deployment configuration
|
|
46
46
|
|
|
47
|
-
The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](
|
|
47
|
+
The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](./mastra-cloud/overview). While the interface may differ between providers, the configuration remains the same.
|
|
48
48
|
|
|
49
49
|

|
|
50
50
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Deployment Overview | Deployment
|
|
2
|
+
title: "Deployment Overview | Deployment"
|
|
3
3
|
description: Learn about different deployment options for your Mastra applications
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ Mastra offers multiple deployment options to suit your application's needs, from
|
|
|
23
23
|
- Node.js `v22.13.0` or later
|
|
24
24
|
- Bun
|
|
25
25
|
- Deno
|
|
26
|
-
- [Cloudflare](../deployment/
|
|
26
|
+
- [Cloudflare](../deployment/cloud-providers/cloudflare-deployer)
|
|
27
27
|
|
|
28
28
|
### Mastra Cloud
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ Mastra Cloud is a deployment platform that connects to your GitHub repository, a
|
|
|
35
35
|
- Comprehensive logs and traces
|
|
36
36
|
- Custom domains for each project
|
|
37
37
|
|
|
38
|
-
[View Mastra Cloud documentation →](
|
|
38
|
+
[View Mastra Cloud documentation →](./mastra-cloud/overview)
|
|
39
39
|
|
|
40
40
|
### With a Web Framework
|
|
41
41
|
|
|
@@ -57,7 +57,7 @@ You can deploy Mastra as a standard Node.js HTTP server, which gives you full co
|
|
|
57
57
|
- Deploy to VMs, containers, or PaaS platforms
|
|
58
58
|
- Ideal for integrating with existing Node.js applications
|
|
59
59
|
|
|
60
|
-
[
|
|
60
|
+
[Building Mastra →](./building-mastra)
|
|
61
61
|
|
|
62
62
|
### Serverless Platforms
|
|
63
63
|
|
|
@@ -68,7 +68,7 @@ Mastra provides platform-specific deployers for popular serverless platforms, en
|
|
|
68
68
|
- Simplified deployment process
|
|
69
69
|
- Automatic scaling through the platform
|
|
70
70
|
|
|
71
|
-
[
|
|
71
|
+
[Building Mastra →](./building-mastra)
|
|
72
72
|
|
|
73
73
|
## Client Configuration
|
|
74
74
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Built-in Scorers | Evals
|
|
2
|
+
title: "Built-in Scorers | Evals"
|
|
3
3
|
description: "Overview of Mastra's ready-to-use scorers for evaluating AI outputs across quality, safety, and performance dimensions."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -7,14 +7,16 @@ description: "Overview of Mastra's ready-to-use scorers for evaluating AI output
|
|
|
7
7
|
|
|
8
8
|
Mastra provides a comprehensive set of built-in scorers for evaluating AI outputs. These scorers are optimized for common evaluation scenarios and are ready to use in your agents and workflows.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
To create your own scorers, see the [Custom Scorers](/docs/v1/evals/custom-scorers) guide.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Available scorers
|
|
13
|
+
|
|
14
|
+
### Accuracy and reliability
|
|
13
15
|
|
|
14
16
|
These scorers evaluate how correct, truthful, and complete your agent's answers are:
|
|
15
17
|
|
|
16
18
|
- [`answer-relevancy`](/reference/v1/evals/answer-relevancy): Evaluates how well responses address the input query (`0-1`, higher is better)
|
|
17
|
-
- [`answer-similarity`](/reference/v1/evals/answer-similarity): Compares agent outputs against ground
|
|
19
|
+
- [`answer-similarity`](/reference/v1/evals/answer-similarity): Compares agent outputs against ground-truth answers for CI/CD testing using semantic analysis (`0-1`, higher is better)
|
|
18
20
|
- [`faithfulness`](/reference/v1/evals/faithfulness): Measures how accurately responses represent provided context (`0-1`, higher is better)
|
|
19
21
|
- [`hallucination`](/reference/v1/evals/hallucination): Detects factual contradictions and unsupported claims (`0-1`, lower is better)
|
|
20
22
|
- [`completeness`](/reference/v1/evals/completeness): Checks if responses include all necessary information (`0-1`, higher is better)
|
|
@@ -23,7 +25,7 @@ These scorers evaluate how correct, truthful, and complete your agent's answers
|
|
|
23
25
|
- [`tool-call-accuracy`](/reference/v1/evals/tool-call-accuracy): Evaluates whether the LLM selects the correct tool from available options (`0-1`, higher is better)
|
|
24
26
|
- [`prompt-alignment`](/reference/v1/evals/prompt-alignment): Measures how well agent responses align with user prompt intent, requirements, completeness, and format (`0-1`, higher is better)
|
|
25
27
|
|
|
26
|
-
### Context
|
|
28
|
+
### Context quality
|
|
27
29
|
|
|
28
30
|
These scorers evaluate the quality and relevance of context used in generating responses:
|
|
29
31
|
|
|
@@ -31,16 +33,16 @@ These scorers evaluate the quality and relevance of context used in generating r
|
|
|
31
33
|
- [`context-relevance`](/reference/v1/evals/context-relevance): Measures context utility with nuanced relevance levels, usage tracking, and missing context detection (`0-1`, higher is better)
|
|
32
34
|
|
|
33
35
|
> tip Context Scorer Selection
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Both context scorers support:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Output
|
|
36
|
+
>
|
|
37
|
+
>- Use **Context Precision** when context ordering matters and you need standard IR metrics (ideal for RAG ranking evaluation)
|
|
38
|
+
>- Use **Context Relevance** when you need detailed relevance assessment and want to track context usage and identify gaps
|
|
39
|
+
>
|
|
40
|
+
>Both context scorers support:
|
|
41
|
+
>
|
|
42
|
+
>- **Static context**: Pre-defined context arrays
|
|
43
|
+
>- **Dynamic context extraction**: Extract context from runs using custom functions (ideal for RAG systems, vector databases, etc.)
|
|
44
|
+
|
|
45
|
+
### Output quality
|
|
44
46
|
|
|
45
47
|
These scorers evaluate adherence to format, style, and safety requirements:
|
|
46
48
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Scorers overview | Evals
|
|
2
|
+
title: "Scorers overview | Evals"
|
|
3
3
|
description: Overview of scorers in Mastra, detailing their capabilities for evaluating AI outputs and measuring performance.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -33,7 +33,7 @@ npm install @mastra/evals@beta
|
|
|
33
33
|
|
|
34
34
|
### Adding scorers to agents
|
|
35
35
|
|
|
36
|
-
You can add built-in scorers to your agents to automatically evaluate their outputs. See the [full list of built-in scorers](/docs/v1/evals/
|
|
36
|
+
You can add built-in scorers to your agents to automatically evaluate their outputs. See the [full list of built-in scorers](/docs/v1/evals/built-in-scorers) for all available options.
|
|
37
37
|
|
|
38
38
|
```typescript title="src/mastra/agents/evaluated-agent.ts" showLineNumbers copy
|
|
39
39
|
import { Agent } from "@mastra/core/agent";
|
|
@@ -135,5 +135,5 @@ For more details, see [Studio](/docs/v1/getting-started/studio) docs.
|
|
|
135
135
|
## Next steps
|
|
136
136
|
|
|
137
137
|
- Learn how to create your own scorers in the [Creating Custom Scorers](/docs/v1/evals/custom-scorers) guide
|
|
138
|
-
- Explore built-in scorers in the [
|
|
138
|
+
- Explore built-in scorers in the [Built-in Scorers](/docs/v1/evals/built-in-scorers) section
|
|
139
139
|
- Test scorers with [Studio](/docs/v1/getting-started/studio)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Running Scorers in CI | Evals
|
|
2
|
+
title: "Running Scorers in CI | Evals"
|
|
3
3
|
description: "Learn how to run scorer experiments in your CI/CD pipeline using the runEvals function."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -109,5 +109,5 @@ describe('Weather Agent Tests', () => {
|
|
|
109
109
|
## Next Steps
|
|
110
110
|
|
|
111
111
|
- Learn about [creating custom scorers](/docs/v1/evals/custom-scorers)
|
|
112
|
-
- Explore [
|
|
112
|
+
- Explore [built-in scorers](/docs/v1/evals/built-in-scorers)
|
|
113
113
|
- Read the [runEvals API reference](/reference/v1/evals/run-evals)
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Using
|
|
3
|
-
description: "Learn how Mastra leverages the
|
|
2
|
+
title: "Using AI SDK | Frameworks"
|
|
3
|
+
description: "Learn how Mastra leverages the AI SDK library and how you can leverage it further with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Tabs from "@theme/Tabs";
|
|
7
7
|
import TabItem from "@theme/TabItem";
|
|
8
8
|
|
|
9
|
-
# Using
|
|
9
|
+
# Using AI SDK
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
[AI SDK](https://sdk.vercel.ai) is a free open-source library that gives you the tools you need to build AI-powered products. Mastra has great integration with AI SDK, including model routing, streaming support, custom React hooks, custom tool/UI, and more.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
:::note
|
|
14
|
+
Migrating from AI SDK v4 to v5? See the [migration guide](/guides/v1/migrations/ai-sdk-v4-to-v5).
|
|
15
|
+
:::
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
:::tip
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
import { Agent } from "@mastra/core/agent";
|
|
19
|
+
Visit Mastra's [**UI Dojo**](https://ui-dojo.mastra.ai/) to see real-world examples of AI SDK integrated with Mastra.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
id: "weather-agent",
|
|
22
|
-
name: "Weather Agent",
|
|
23
|
-
instructions: "Instructions for the agent...",
|
|
24
|
-
model: "openai/gpt-4-turbo",
|
|
25
|
-
});
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
> See [Using AI SDK with Mastra](/models/v1#use-ai-sdk-with-mastra) for more information.
|
|
21
|
+
:::
|
|
29
22
|
|
|
30
23
|
## Streaming
|
|
31
24
|
|
|
@@ -138,6 +131,10 @@ const { error, status, sendMessage, messages, regenerate, stop } = useChat({
|
|
|
138
131
|
inputData: {
|
|
139
132
|
city: messages[messages.length - 1].parts[0].text,
|
|
140
133
|
},
|
|
134
|
+
//Or resumeData for resuming a suspended workflow
|
|
135
|
+
resumeData: {
|
|
136
|
+
confirmation: messages[messages.length - 1].parts[0].text
|
|
137
|
+
}
|
|
141
138
|
},
|
|
142
139
|
};
|
|
143
140
|
},
|
|
@@ -575,114 +572,4 @@ export const mastra = new Mastra({
|
|
|
575
572
|
```
|
|
576
573
|
|
|
577
574
|
> You can then access this data in your tools via the `requestContext` parameter. See the [Request Context documentation](/docs/v1/server-db/request-context) for more details.
|
|
578
|
-
|
|
579
|
-
## Migrating from AI SDK v4 to v5
|
|
580
|
-
|
|
581
|
-
Follow the official [AI SDK v5 Migration Guide](https://v5.ai-sdk.dev/docs/migration-guides/migration-guide-5-0) for all AI SDK core breaking changes, package updates, and API changes.
|
|
582
|
-
|
|
583
|
-
This guide covers only the Mastra-specific aspects of the migration.
|
|
584
|
-
|
|
585
|
-
- **Data compatibility**: New data stored in v5 format will no longer work if you downgrade from v5 to v4
|
|
586
|
-
- **Backup recommendation**: Keep DB backups from before you upgrade to v5
|
|
587
|
-
|
|
588
|
-
### Memory and Storage
|
|
589
|
-
|
|
590
|
-
Mastra automatically handles AI SDK v4 data using its internal `MessageList` class, which manages format conversion—including v4 to v5. No database migrations are required; your existing messages are translated on the fly and continue working after you upgrade.
|
|
591
|
-
|
|
592
|
-
### Message Format Conversion
|
|
593
|
-
|
|
594
|
-
For cases where you need to manually convert messages between AI SDK and Mastra formats, use the `convertMessages()` utility:
|
|
595
|
-
|
|
596
|
-
```typescript
|
|
597
|
-
import { convertMessages } from "@mastra/core/agent";
|
|
598
|
-
|
|
599
|
-
// Convert AI SDK v4 messages to v5
|
|
600
|
-
const aiv5Messages = convertMessages(aiv4Messages).to("AIV5.UI");
|
|
601
|
-
|
|
602
|
-
// Convert Mastra messages to AI SDK v5
|
|
603
|
-
const aiv5Messages = convertMessages(mastraMessages).to("AIV5.Core");
|
|
604
|
-
|
|
605
|
-
// Supported output formats:
|
|
606
|
-
// 'Mastra.V2', 'AIV4.UI', 'AIV5.UI', 'AIV5.Core', 'AIV5.Model'
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
This utility is helpful when you want to fetch messages directly from your storage DB and convert them for use in AI SDK.
|
|
610
|
-
|
|
611
|
-
### Type Inference for Tools
|
|
612
|
-
|
|
613
|
-
When using tools with TypeScript in AI SDK v5, Mastra provides type inference helpers to ensure type safety for your tool inputs and outputs.
|
|
614
|
-
|
|
615
|
-
#### `InferUITool`
|
|
616
|
-
|
|
617
|
-
The `InferUITool` type helper infers the input and output types of a single Mastra tool:
|
|
618
|
-
|
|
619
|
-
```typescript title="app/types.ts" copy
|
|
620
|
-
import { InferUITool, createTool } from "@mastra/core/tools";
|
|
621
|
-
import { z } from "zod";
|
|
622
|
-
|
|
623
|
-
const weatherTool = createTool({
|
|
624
|
-
id: "get-weather",
|
|
625
|
-
description: "Get the current weather",
|
|
626
|
-
inputSchema: z.object({
|
|
627
|
-
location: z.string().describe("The city and state"),
|
|
628
|
-
}),
|
|
629
|
-
outputSchema: z.object({
|
|
630
|
-
temperature: z.number(),
|
|
631
|
-
conditions: z.string(),
|
|
632
|
-
}),
|
|
633
|
-
execute: async (inputData) => {
|
|
634
|
-
return {
|
|
635
|
-
temperature: 72,
|
|
636
|
-
conditions: "sunny",
|
|
637
|
-
};
|
|
638
|
-
},
|
|
639
|
-
});
|
|
640
|
-
|
|
641
|
-
// Infer the types from the tool
|
|
642
|
-
type WeatherUITool = InferUITool<typeof weatherTool>;
|
|
643
|
-
// This creates:
|
|
644
|
-
// {
|
|
645
|
-
// input: { location: string };
|
|
646
|
-
// output: { temperature: number; conditions: string };
|
|
647
|
-
// }
|
|
648
|
-
```
|
|
649
|
-
|
|
650
|
-
#### `InferUITools`
|
|
651
|
-
|
|
652
|
-
The `InferUITools` type helper infers the input and output types of multiple tools:
|
|
653
|
-
|
|
654
|
-
```typescript title="app/mastra/tools.ts" copy
|
|
655
|
-
import { InferUITools, createTool } from "@mastra/core/tools";
|
|
656
|
-
import { z } from "zod";
|
|
657
|
-
|
|
658
|
-
// Using weatherTool from the previous example
|
|
659
|
-
const tools = {
|
|
660
|
-
weather: weatherTool,
|
|
661
|
-
calculator: createTool({
|
|
662
|
-
id: "calculator",
|
|
663
|
-
description: "Perform basic arithmetic",
|
|
664
|
-
inputSchema: z.object({
|
|
665
|
-
operation: z.enum(["add", "subtract", "multiply", "divide"]),
|
|
666
|
-
a: z.number(),
|
|
667
|
-
b: z.number(),
|
|
668
|
-
}),
|
|
669
|
-
outputSchema: z.object({
|
|
670
|
-
result: z.number(),
|
|
671
|
-
}),
|
|
672
|
-
execute: async (inputData) => {
|
|
673
|
-
// implementation...
|
|
674
|
-
return { result: 0 };
|
|
675
|
-
},
|
|
676
|
-
}),
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
// Infer types from the tool set
|
|
680
|
-
export type MyUITools = InferUITools<typeof tools>;
|
|
681
|
-
// This creates:
|
|
682
|
-
// {
|
|
683
|
-
// weather: { input: { location: string }; output: { temperature: number; conditions: string } };
|
|
684
|
-
// calculator: { input: { operation: "add" | "subtract" | "multiply" | "divide"; a: number; b: number }; output: { result: number } };
|
|
685
|
-
// }
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
These type helpers provide full TypeScript support when using Mastra tools with AI SDK v5 UI components, ensuring type safety across your application.
|
|
575
|
+
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Using
|
|
2
|
+
title: "Using Assistant UI | Frameworks"
|
|
3
3
|
description: "Learn how to integrate Assistant UI with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Steps from "@site/src/components/Steps";
|
|
7
7
|
import StepItem from "@site/src/components/StepItem";
|
|
8
8
|
|
|
9
|
-
# Using
|
|
9
|
+
# Using Assistant UI
|
|
10
10
|
|
|
11
|
-
[Assistant UI](https://assistant-ui.com) is the TypeScript/React library for AI Chat.
|
|
12
|
-
Built on shadcn/ui and Tailwind CSS, it enables developers to create beautiful, enterprise-grade chat experiences in minutes.
|
|
11
|
+
[Assistant UI](https://assistant-ui.com) is the TypeScript/React library for AI Chat. Built on shadcn/ui and Tailwind CSS, it enables developers to create beautiful, enterprise-grade chat experiences in minutes.
|
|
13
12
|
|
|
14
13
|
:::info
|
|
15
14
|
|
|
@@ -17,6 +16,12 @@ For a full-stack integration approach where Mastra runs directly in your Next.js
|
|
|
17
16
|
|
|
18
17
|
:::
|
|
19
18
|
|
|
19
|
+
:::tip
|
|
20
|
+
|
|
21
|
+
Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of Assistant UI integrated with Mastra.
|
|
22
|
+
|
|
23
|
+
:::
|
|
24
|
+
|
|
20
25
|
## Integration Guide
|
|
21
26
|
|
|
22
27
|
Run Mastra as a standalone server and connect your Next.js frontend (with Assistant UI) to its API endpoints.
|
|
@@ -33,7 +38,7 @@ project-root
|
|
|
33
38
|
│ ├── src
|
|
34
39
|
│ │ └── mastra
|
|
35
40
|
│ └── package.json
|
|
36
|
-
└──
|
|
41
|
+
└── my-app
|
|
37
42
|
└── package.json
|
|
38
43
|
```
|
|
39
44
|
|
|
@@ -43,8 +48,13 @@ Bootstrap your Mastra server:
|
|
|
43
48
|
npx create-mastra@beta
|
|
44
49
|
```
|
|
45
50
|
|
|
46
|
-
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations.
|
|
47
|
-
|
|
51
|
+
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations. Follow the prompts to create your server project.
|
|
52
|
+
|
|
53
|
+
Navigate to your newly created Mastra server directory:
|
|
54
|
+
|
|
55
|
+
```bash copy
|
|
56
|
+
cd mastra-server # Replace with the actual directory name you provided
|
|
57
|
+
```
|
|
48
58
|
|
|
49
59
|
You now have a basic Mastra server project ready. You should have the following files and folders:
|
|
50
60
|
|
|
@@ -53,6 +63,8 @@ src
|
|
|
53
63
|
└── mastra
|
|
54
64
|
├── agents
|
|
55
65
|
│ └── weather-agent.ts
|
|
66
|
+
├── scorers
|
|
67
|
+
│ └── weather-scorer.ts
|
|
56
68
|
├── tools
|
|
57
69
|
│ └── weather-tool.ts
|
|
58
70
|
├── workflows
|
|
@@ -70,18 +82,55 @@ Ensure that you have set the appropriate environment variables for your LLM prov
|
|
|
70
82
|
|
|
71
83
|
<StepItem>
|
|
72
84
|
|
|
85
|
+
Create a chat route for the Assistant UI frontend by using the `chatRoute()` helper from `@mastra/ai-sdk`. Add it to your Mastra project:
|
|
86
|
+
|
|
87
|
+
```bash copy
|
|
88
|
+
npm install @mastra/ai-sdk@beta
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
In your `src/mastra/index.ts` file, register the chat route:
|
|
92
|
+
|
|
93
|
+
```typescript copy title="src/mastra/index.ts" {2,7-13}
|
|
94
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
95
|
+
import { chatRoute } from '@mastra/ai-sdk';
|
|
96
|
+
// Rest of the imports...
|
|
97
|
+
|
|
98
|
+
export const mastra = new Mastra({
|
|
99
|
+
// Rest of the configuration...
|
|
100
|
+
server: {
|
|
101
|
+
apiRoutes: [
|
|
102
|
+
chatRoute({
|
|
103
|
+
path: '/chat/:agentId'
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This will make all agents available in AI SDK-compatible formats, including the `weatherAgent` at the endpoint `/chat/weatherAgent`.
|
|
111
|
+
|
|
112
|
+
</StepItem>
|
|
113
|
+
|
|
114
|
+
<StepItem>
|
|
115
|
+
|
|
73
116
|
Run the Mastra server using the following command:
|
|
74
117
|
|
|
75
118
|
```bash copy
|
|
76
119
|
npm run dev
|
|
77
120
|
```
|
|
78
121
|
|
|
79
|
-
By default, the Mastra server will run on `http://localhost:4111`.
|
|
122
|
+
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps where we'll set up the Assistant UI frontend to connect to it.
|
|
80
123
|
|
|
81
124
|
</StepItem>
|
|
82
125
|
|
|
83
126
|
<StepItem>
|
|
84
127
|
|
|
128
|
+
Go up one directory to your project root.
|
|
129
|
+
|
|
130
|
+
```bash copy
|
|
131
|
+
cd ..
|
|
132
|
+
```
|
|
133
|
+
|
|
85
134
|
Create a new `assistant-ui` project with the following command.
|
|
86
135
|
|
|
87
136
|
```bash copy
|
|
@@ -100,19 +149,22 @@ For detailed setup instructions, including adding API keys, basic configuration,
|
|
|
100
149
|
|
|
101
150
|
The default Assistant UI setup configures the chat runtime to use a local API route (`/api/chat`) within the Next.js project. Since our Mastra agent is running on a separate server, we need to update the frontend to point to that server's endpoint.
|
|
102
151
|
|
|
103
|
-
|
|
152
|
+
Open the file in your assistant-ui frontend project that contains the `useChatRuntime` hook (usually `app/assistant.tsx` or `src/app/assistant.tsx`). Find the `useChatRuntime` hook and change the `api` property to the full URL of your Mastra agent's stream endpoint:
|
|
104
153
|
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
useChatRuntime,
|
|
108
|
-
AssistantChatTransport,
|
|
109
|
-
} from "@assistant-ui/react-ai-sdk";
|
|
154
|
+
```tsx {8} title="app/assistant.tsx"
|
|
155
|
+
"use client";
|
|
110
156
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
157
|
+
// Rest of the imports...
|
|
158
|
+
|
|
159
|
+
export const Assistant = () => {
|
|
160
|
+
const runtime = useChatRuntime({
|
|
161
|
+
transport: new AssistantChatTransport({
|
|
162
|
+
api: "http://localhost:4111/chat/weatherAgent",
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Rest of the component...
|
|
167
|
+
};
|
|
116
168
|
```
|
|
117
169
|
|
|
118
170
|
Now, the Assistant UI frontend will send chat requests directly to your running Mastra server.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
description: "
|
|
2
|
+
title: "Using Cedar-OS | Frameworks"
|
|
3
|
+
description: "Learn how to integrate Cedar-OS with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Tabs from "@theme/Tabs";
|
|
@@ -8,29 +8,17 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
import Steps from "@site/src/components/Steps";
|
|
9
9
|
import StepItem from "@site/src/components/StepItem";
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Using Cedar-OS
|
|
12
12
|
|
|
13
|
-
Cedar-OS is an open-source agentic UI framework designed specifically for building the most ambitious AI-native applications. Cedar was built with Mastra in mind.
|
|
13
|
+
[Cedar-OS](https://docs.cedarcopilot.com/introduction/overview) is an open-source agentic UI framework designed specifically for building the most ambitious AI-native applications. Cedar was built with Mastra in mind.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
:::info
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Also see the [Extending Mastra](https://docs.cedarcopilot.com/agent-backend-connection/mastra) and [Custom Backend Implementation](https://docs.cedarcopilot.com/agent-backend-connection/custom) guides on Cedar's documentation site for more advanced integration patterns.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
:::
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
- **Works out of the box** – Just drop in the chat component, and it'll work
|
|
23
|
-
- **Fully extensible** - Built on a [Zustand store architecture](https://docs.cedarcopilot.com/introduction/architecture) that you can customize completely. Every single internal function can be overridden in one line.
|
|
24
|
-
|
|
25
|
-
#### 2. Enabling truly AI-native applications
|
|
26
|
-
|
|
27
|
-
For the first time in history, products can come to life. Cedar is aimed at helping you build something with life.
|
|
28
|
-
|
|
29
|
-
- **[Spells](https://docs.cedarcopilot.com/spells/spells#what-are-spells)** - Users can trigger AI from keyboard shortcuts, mouse events, text selection, and other components
|
|
30
|
-
- **[State Diff Management](https://docs.cedarcopilot.com/state-diff/using-state-diff)** - Give users control over accepting/rejecting agent outputs
|
|
31
|
-
- **[Voice Integration](https://docs.cedarcopilot.com/voice/voice-integration)** - Let users control your app with their voice
|
|
32
|
-
|
|
33
|
-
## Quick Start
|
|
21
|
+
## Integration Guide
|
|
34
22
|
|
|
35
23
|
<Steps>
|
|
36
24
|
|
|
@@ -112,12 +100,3 @@ Your backend and frontend are now linked! You're ready to start building AI-nati
|
|
|
112
100
|
</StepItem>
|
|
113
101
|
|
|
114
102
|
</Steps>
|
|
115
|
-
|
|
116
|
-
## More information
|
|
117
|
-
|
|
118
|
-
- Check out the [detailed Mastra integration guide](https://docs.cedarcopilot.com/agent-backend-connection/mastra#extending-mastra) for more configuration options (or for manual installation instructions if something goes wrong)
|
|
119
|
-
- Explore Mastra-specific optimizations and features Cedar has built
|
|
120
|
-
- **Seamless event streaming** - Automatic rendering of [Mastra streamed events](https://docs.cedarcopilot.com/chat/custom-message-rendering#mastra-event-renderer)
|
|
121
|
-
- **Voice endpoint support** - Built-in [voice backend integration](https://docs.cedarcopilot.com/voice/agentic-backend#endpoint-configuration)
|
|
122
|
-
- **End-to-End type safety** - [Types](https://docs.cedarcopilot.com/type-safety/typing-agent-requests) for communicating between your app and Mastra backend
|
|
123
|
-
- [Join the Discord!](https://discord.gg/4AWawRjNdZ) The Cedar team is excited to have you :)
|