@mastra/mcp-docs-server 1.0.0-beta.4 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +29 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +411 -211
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +52 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flance.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Frag.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Freact.md +89 -1
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +92 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +67 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +201 -1
- package/.docs/organized/changelogs/create-mastra.md +201 -1
- package/.docs/organized/changelogs/mastra.md +201 -1
- package/.docs/organized/code-examples/agui.md +1 -0
- package/.docs/organized/code-examples/ai-sdk-v5.md +1 -0
- package/.docs/organized/code-examples/mcp-server-adapters.md +721 -0
- package/.docs/organized/code-examples/memory-with-processors.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/server-app-access.md +342 -0
- package/.docs/raw/agents/adding-voice.mdx +7 -10
- package/.docs/raw/agents/agent-approval.mdx +189 -0
- package/.docs/raw/agents/guardrails.mdx +26 -23
- package/.docs/raw/agents/networks.mdx +2 -2
- package/.docs/raw/agents/overview.mdx +27 -62
- package/.docs/raw/agents/processors.mdx +279 -0
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/course/01-first-agent/05-running-playground.md +5 -5
- package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +3 -3
- package/.docs/raw/course/01-first-agent/17-testing-memory.md +2 -2
- package/.docs/raw/course/04-workflows/07-using-playground.md +1 -1
- package/.docs/raw/deployment/building-mastra.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/index.mdx +20 -27
- package/.docs/raw/deployment/cloud-providers/netlify-deployer.mdx +44 -13
- package/.docs/raw/deployment/mastra-cloud/observability.mdx +19 -17
- package/.docs/raw/deployment/mastra-cloud/setting-up.mdx +1 -1
- package/.docs/raw/deployment/overview.mdx +2 -2
- package/.docs/raw/deployment/web-framework.mdx +5 -5
- package/.docs/raw/evals/custom-scorers.mdx +3 -5
- package/.docs/raw/evals/overview.mdx +2 -3
- package/.docs/raw/evals/running-in-ci.mdx +0 -2
- package/.docs/raw/{guides/guide → getting-started}/manual-install.mdx +2 -2
- package/.docs/raw/getting-started/project-structure.mdx +1 -1
- package/.docs/raw/getting-started/start.mdx +72 -0
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/{frameworks/agentic-uis/ai-sdk.mdx → guides/build-your-ui/ai-sdk-ui.mdx} +113 -11
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/astro.mdx +23 -25
- package/.docs/raw/{frameworks/servers → guides/getting-started}/express.mdx +3 -4
- package/.docs/raw/guides/{quickstarts/nextjs.mdx → getting-started/next-js.mdx} +11 -11
- package/.docs/raw/guides/{quickstarts/standalone-server.mdx → getting-started/quickstart.mdx} +7 -7
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/sveltekit.mdx +23 -25
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/vite-react.mdx +7 -7
- package/.docs/raw/guides/guide/ai-recruiter.mdx +2 -3
- package/.docs/raw/guides/guide/chef-michel.mdx +2 -3
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
- package/.docs/raw/guides/guide/research-assistant.mdx +7 -8
- package/.docs/raw/guides/guide/stock-agent.mdx +4 -6
- package/.docs/raw/guides/guide/web-search.mdx +12 -10
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
- package/.docs/raw/guides/index.mdx +3 -35
- package/.docs/raw/guides/migrations/agentnetwork.mdx +4 -4
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +40 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +5 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +51 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +2 -2
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mcp/overview.mdx +3 -5
- package/.docs/raw/memory/memory-processors.mdx +264 -79
- package/.docs/raw/memory/semantic-recall.mdx +7 -7
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-pg.mdx +2 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +2 -4
- package/.docs/raw/memory/threads-and-resources.mdx +3 -3
- package/.docs/raw/memory/working-memory.mdx +14 -7
- package/.docs/raw/{logging.mdx → observability/logging.mdx} +1 -1
- package/.docs/raw/observability/overview.mdx +2 -3
- package/.docs/raw/observability/tracing/bridges/otel.mdx +176 -0
- package/.docs/raw/observability/tracing/exporters/arize.mdx +17 -0
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +19 -0
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +20 -0
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +12 -0
- package/.docs/raw/observability/tracing/exporters/otel.mdx +25 -5
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +107 -0
- package/.docs/raw/observability/tracing/overview.mdx +74 -8
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +0 -1
- package/.docs/raw/rag/chunking-and-embedding.mdx +16 -17
- package/.docs/raw/rag/overview.mdx +3 -2
- package/.docs/raw/rag/retrieval.mdx +43 -38
- package/.docs/raw/rag/vector-databases.mdx +93 -2
- package/.docs/raw/reference/agents/agent.mdx +7 -10
- package/.docs/raw/reference/agents/generate.mdx +55 -6
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +1 -1
- package/.docs/raw/reference/agents/network.mdx +46 -3
- package/.docs/raw/reference/cli/mastra.mdx +2 -1
- package/.docs/raw/reference/client-js/agents.mdx +3 -3
- package/.docs/raw/reference/client-js/memory.mdx +43 -0
- package/.docs/raw/reference/client-js/workflows.mdx +92 -63
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +5 -19
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -2
- package/.docs/raw/reference/evals/answer-relevancy.mdx +28 -98
- package/.docs/raw/reference/evals/answer-similarity.mdx +12 -258
- package/.docs/raw/reference/evals/bias.mdx +29 -87
- package/.docs/raw/reference/evals/completeness.mdx +31 -90
- package/.docs/raw/reference/evals/content-similarity.mdx +28 -88
- package/.docs/raw/reference/evals/context-precision.mdx +28 -130
- package/.docs/raw/reference/evals/context-relevance.mdx +11 -11
- package/.docs/raw/reference/evals/faithfulness.mdx +28 -101
- package/.docs/raw/reference/evals/hallucination.mdx +28 -103
- package/.docs/raw/reference/evals/keyword-coverage.mdx +28 -107
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +11 -11
- package/.docs/raw/reference/evals/prompt-alignment.mdx +15 -15
- package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +27 -100
- package/.docs/raw/reference/evals/tone-consistency.mdx +25 -98
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +7 -7
- package/.docs/raw/reference/evals/toxicity.mdx +29 -92
- package/.docs/raw/reference/index.mdx +1 -0
- package/.docs/raw/reference/memory/memory-class.mdx +5 -7
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +150 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +0 -4
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +4 -0
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +17 -1
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +6 -0
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +132 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +0 -4
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +29 -4
- package/.docs/raw/reference/observability/tracing/spans.mdx +0 -4
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
- package/.docs/raw/reference/processors/language-detector.mdx +10 -3
- package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +12 -5
- package/.docs/raw/reference/processors/pii-detector.mdx +12 -5
- package/.docs/raw/reference/processors/processor-interface.mdx +502 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +10 -3
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +3 -4
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +2 -2
- package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
- package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
- package/.docs/raw/reference/rag/embeddings.mdx +5 -5
- package/.docs/raw/reference/rag/rerank.mdx +1 -2
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +0 -1
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +37 -0
- package/.docs/raw/reference/storage/convex.mdx +164 -0
- package/.docs/raw/reference/storage/lance.mdx +33 -0
- package/.docs/raw/reference/storage/libsql.mdx +37 -0
- package/.docs/raw/reference/storage/mongodb.mdx +39 -0
- package/.docs/raw/reference/storage/mssql.mdx +37 -0
- package/.docs/raw/reference/storage/postgresql.mdx +37 -0
- package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +64 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +7 -9
- package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
- package/.docs/raw/reference/streaming/workflows/stream.mdx +83 -24
- package/.docs/raw/reference/templates/overview.mdx +1 -4
- package/.docs/raw/reference/tools/client.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +132 -0
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +5 -5
- package/.docs/raw/reference/tools/mcp-client.mdx +76 -21
- package/.docs/raw/reference/tools/mcp-server.mdx +1 -2
- package/.docs/raw/reference/tools/vector-query-tool.mdx +14 -15
- package/.docs/raw/reference/vectors/chroma.mdx +81 -1
- package/.docs/raw/reference/vectors/convex.mdx +429 -0
- package/.docs/raw/reference/vectors/couchbase.mdx +24 -17
- package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
- package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
- package/.docs/raw/reference/vectors/lance.mdx +38 -22
- package/.docs/raw/reference/vectors/libsql.mdx +35 -2
- package/.docs/raw/reference/vectors/mongodb.mdx +35 -2
- package/.docs/raw/reference/vectors/opensearch.mdx +37 -16
- package/.docs/raw/reference/vectors/pg.mdx +43 -36
- package/.docs/raw/reference/vectors/pinecone.mdx +48 -1
- package/.docs/raw/reference/vectors/qdrant.mdx +36 -1
- package/.docs/raw/reference/vectors/turbopuffer.mdx +74 -0
- package/.docs/raw/reference/voice/google.mdx +159 -20
- package/.docs/raw/reference/voice/openai-realtime.mdx +2 -2
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +2 -3
- 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.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.updateConfig.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +44 -0
- package/.docs/raw/reference/workflows/run-methods/start.mdx +44 -0
- package/.docs/raw/reference/workflows/run.mdx +13 -5
- package/.docs/raw/reference/workflows/step.mdx +13 -0
- package/.docs/raw/reference/workflows/workflow.mdx +19 -0
- package/.docs/raw/server-db/mastra-client.mdx +1 -2
- package/.docs/raw/server-db/mastra-server.mdx +30 -1
- package/.docs/raw/server-db/request-context.mdx +0 -1
- package/.docs/raw/server-db/storage.mdx +11 -0
- package/.docs/raw/streaming/overview.mdx +26 -15
- package/.docs/raw/streaming/tool-streaming.mdx +48 -5
- package/.docs/raw/streaming/workflow-streaming.mdx +5 -11
- package/.docs/raw/tools-mcp/advanced-usage.mdx +1 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +3 -5
- package/.docs/raw/voice/overview.mdx +21 -41
- package/.docs/raw/voice/speech-to-speech.mdx +4 -4
- package/.docs/raw/voice/speech-to-text.mdx +1 -2
- package/.docs/raw/voice/text-to-speech.mdx +1 -2
- package/.docs/raw/workflows/control-flow.mdx +180 -0
- package/.docs/raw/workflows/error-handling.mdx +1 -0
- package/.docs/raw/workflows/human-in-the-loop.mdx +4 -4
- package/.docs/raw/workflows/overview.mdx +56 -44
- package/.docs/raw/workflows/snapshots.mdx +1 -0
- package/.docs/raw/workflows/suspend-and-resume.mdx +85 -16
- package/.docs/raw/workflows/time-travel.mdx +313 -0
- package/.docs/raw/workflows/workflow-state.mdx +191 -0
- package/CHANGELOG.md +18 -0
- package/dist/{chunk-5NJC7NRO.js → chunk-4CM2BQNP.js} +24 -4
- package/dist/prepare-docs/package-changes.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +7 -7
- package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +0 -90
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -102
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -179
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -379
- package/.docs/raw/getting-started/quickstart.mdx +0 -27
- package/.docs/raw/getting-started/templates.mdx +0 -73
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
- /package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/assistant-ui.mdx +0 -0
- /package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/copilotkit.mdx +0 -0
|
@@ -124,12 +124,6 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
|
|
|
124
124
|
},
|
|
125
125
|
],
|
|
126
126
|
},
|
|
127
|
-
{
|
|
128
|
-
name: "tracingContext",
|
|
129
|
-
type: "TracingContext",
|
|
130
|
-
isOptional: true,
|
|
131
|
-
description: "Tracing context for span hierarchy and metadata.",
|
|
132
|
-
},
|
|
133
127
|
{
|
|
134
128
|
name: "returnScorerData",
|
|
135
129
|
type: "boolean",
|
|
@@ -253,6 +247,17 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
|
|
|
253
247
|
},
|
|
254
248
|
],
|
|
255
249
|
},
|
|
250
|
+
{
|
|
251
|
+
parameters: [
|
|
252
|
+
{
|
|
253
|
+
name: "providerOptions",
|
|
254
|
+
type: "ProviderOptions",
|
|
255
|
+
isOptional: true,
|
|
256
|
+
description:
|
|
257
|
+
"Provider-specific options passed to the internal structuring agent. Use this to control model behavior like reasoning effort for thinking models (e.g., `{ openai: { reasoningEffort: 'low' } }`).",
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
256
261
|
],
|
|
257
262
|
},
|
|
258
263
|
{
|
|
@@ -576,6 +581,50 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
|
|
|
576
581
|
},
|
|
577
582
|
],
|
|
578
583
|
},
|
|
584
|
+
{
|
|
585
|
+
parameters: [
|
|
586
|
+
{
|
|
587
|
+
name: "requestContextKeys",
|
|
588
|
+
type: "string[]",
|
|
589
|
+
isOptional: true,
|
|
590
|
+
description:
|
|
591
|
+
"Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
|
|
592
|
+
},
|
|
593
|
+
],
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
parameters: [
|
|
597
|
+
{
|
|
598
|
+
name: "traceId",
|
|
599
|
+
type: "string",
|
|
600
|
+
isOptional: true,
|
|
601
|
+
description:
|
|
602
|
+
"Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
parameters: [
|
|
608
|
+
{
|
|
609
|
+
name: "parentSpanId",
|
|
610
|
+
type: "string",
|
|
611
|
+
isOptional: true,
|
|
612
|
+
description:
|
|
613
|
+
"Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
|
|
614
|
+
},
|
|
615
|
+
],
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
parameters: [
|
|
619
|
+
{
|
|
620
|
+
name: "tags",
|
|
621
|
+
type: "string[]",
|
|
622
|
+
isOptional: true,
|
|
623
|
+
description:
|
|
624
|
+
"Tags to apply to this trace. String labels for categorizing and filtering traces.",
|
|
625
|
+
},
|
|
626
|
+
],
|
|
627
|
+
},
|
|
579
628
|
],
|
|
580
629
|
},
|
|
581
630
|
]}
|
|
@@ -590,12 +590,12 @@ await agent.generateLegacy(
|
|
|
590
590
|
sentiment: z.enum(["positive", "negative", "neutral"]),
|
|
591
591
|
confidence: z.number(),
|
|
592
592
|
}),
|
|
593
|
-
model: openai
|
|
593
|
+
model: "openai/gpt-5.1",
|
|
594
594
|
errorStrategy: "warn",
|
|
595
595
|
},
|
|
596
596
|
// Output processors for response validation
|
|
597
597
|
outputProcessors: [
|
|
598
|
-
new ModerationProcessor({ model: openai
|
|
598
|
+
new ModerationProcessor({ model: "openai/gpt-4.1-nano" }),
|
|
599
599
|
new TokenLimiterProcessor({ maxTokens: 1000 }),
|
|
600
600
|
],
|
|
601
601
|
},
|
|
@@ -17,7 +17,6 @@ The `.network()` method enables multi-agent collaboration and routing. This meth
|
|
|
17
17
|
|
|
18
18
|
```typescript copy
|
|
19
19
|
import { Agent } from "@mastra/core/agent";
|
|
20
|
-
import { openai } from "@ai-sdk/openai";
|
|
21
20
|
import { agent1, agent2 } from "./agents";
|
|
22
21
|
import { workflow1 } from "./workflows";
|
|
23
22
|
import { tool1, tool2 } from "./tools";
|
|
@@ -27,7 +26,7 @@ const agent = new Agent({
|
|
|
27
26
|
name: "Network Agent",
|
|
28
27
|
instructions:
|
|
29
28
|
"You are a network agent that can help users with a variety of tasks.",
|
|
30
|
-
model: openai
|
|
29
|
+
model: "openai/gpt-5.1",
|
|
31
30
|
agents: {
|
|
32
31
|
agent1,
|
|
33
32
|
agent2,
|
|
@@ -42,7 +41,7 @@ const agent = new Agent({
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
await agent.network(`
|
|
45
|
-
Find me the weather in Tokyo.
|
|
44
|
+
Find me the weather in Tokyo.
|
|
46
45
|
Based on the weather, plan an activity for me.
|
|
47
46
|
`);
|
|
48
47
|
```
|
|
@@ -155,6 +154,50 @@ await agent.network(`
|
|
|
155
154
|
},
|
|
156
155
|
],
|
|
157
156
|
},
|
|
157
|
+
{
|
|
158
|
+
parameters: [
|
|
159
|
+
{
|
|
160
|
+
name: "requestContextKeys",
|
|
161
|
+
type: "string[]",
|
|
162
|
+
isOptional: true,
|
|
163
|
+
description:
|
|
164
|
+
"Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
parameters: [
|
|
170
|
+
{
|
|
171
|
+
name: "traceId",
|
|
172
|
+
type: "string",
|
|
173
|
+
isOptional: true,
|
|
174
|
+
description:
|
|
175
|
+
"Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
parameters: [
|
|
181
|
+
{
|
|
182
|
+
name: "parentSpanId",
|
|
183
|
+
type: "string",
|
|
184
|
+
isOptional: true,
|
|
185
|
+
description:
|
|
186
|
+
"Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
parameters: [
|
|
192
|
+
{
|
|
193
|
+
name: "tags",
|
|
194
|
+
type: "string[]",
|
|
195
|
+
isOptional: true,
|
|
196
|
+
description:
|
|
197
|
+
"Tags to apply to this trace. String labels for categorizing and filtering traces.",
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
158
201
|
],
|
|
159
202
|
},
|
|
160
203
|
{
|
|
@@ -75,7 +75,8 @@ ANTHROPIC_BASE_URL=https://anthropic.internal \
|
|
|
75
75
|
mastra dev
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
These are forwarded
|
|
78
|
+
These are forwarded to the Mastra model router and will work with any `"openai/..."`
|
|
79
|
+
or `"anthropic/..."` model selections.
|
|
79
80
|
|
|
80
81
|
## `mastra build`
|
|
81
82
|
|
|
@@ -174,11 +174,11 @@ response.processDataStream({
|
|
|
174
174
|
|
|
175
175
|
#### AI SDK compatible format
|
|
176
176
|
|
|
177
|
-
To stream AI SDK-formatted parts on the client from an `agent.stream(...)` response, wrap `response.processDataStream` into a `ReadableStream<ChunkType>` and use `
|
|
177
|
+
To stream AI SDK-formatted parts on the client from an `agent.stream(...)` response, wrap `response.processDataStream` into a `ReadableStream<ChunkType>` and use `toAISdkStream`:
|
|
178
178
|
|
|
179
179
|
```typescript title="client-ai-sdk-transform.ts" copy
|
|
180
180
|
import { createUIMessageStream } from "ai";
|
|
181
|
-
import {
|
|
181
|
+
import { toAISdkStream } from "@mastra/ai-sdk";
|
|
182
182
|
import type { ChunkType, MastraModelOutput } from "@mastra/core/stream";
|
|
183
183
|
|
|
184
184
|
const response = await agent.stream({ messages: "Tell me a story" });
|
|
@@ -195,7 +195,7 @@ const chunkStream: ReadableStream<ChunkType> = new ReadableStream<ChunkType>({
|
|
|
195
195
|
|
|
196
196
|
const uiMessageStream = createUIMessageStream({
|
|
197
197
|
execute: async ({ writer }) => {
|
|
198
|
-
for await (const part of
|
|
198
|
+
for await (const part of toAISdkStream(
|
|
199
199
|
chunkStream as unknown as MastraModelOutput,
|
|
200
200
|
{ from: "agent" },
|
|
201
201
|
)) {
|
|
@@ -133,6 +133,49 @@ const result = await thread.deleteMessages([
|
|
|
133
133
|
// Returns: { success: true, message: "Message deleted successfully" }
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
## Working Memory
|
|
137
|
+
|
|
138
|
+
Working memory allows agents to maintain persistent information about users across interactions. It can be scoped to either a specific thread or across all threads for a resource (user).
|
|
139
|
+
|
|
140
|
+
### Get Working Memory
|
|
141
|
+
|
|
142
|
+
Retrieve the current working memory for a thread:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
const workingMemory = await mastraClient.getWorkingMemory({
|
|
146
|
+
agentId: "agent-1",
|
|
147
|
+
threadId: "thread-1",
|
|
148
|
+
resourceId: "user-123", // Optional, required for resource-scoped memory
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The response includes:
|
|
153
|
+
- `workingMemory`: The current working memory content (string or null)
|
|
154
|
+
- `source`: Whether the memory is from `"thread"` or `"resource"` scope
|
|
155
|
+
- `workingMemoryTemplate`: The template used for working memory (if configured)
|
|
156
|
+
- `threadExists`: Whether the thread exists
|
|
157
|
+
|
|
158
|
+
### Update Working Memory
|
|
159
|
+
|
|
160
|
+
Update the working memory content for a thread:
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
await mastraClient.updateWorkingMemory({
|
|
164
|
+
agentId: "agent-1",
|
|
165
|
+
threadId: "thread-1",
|
|
166
|
+
workingMemory: `# User Profile
|
|
167
|
+
- Name: John Doe
|
|
168
|
+
- Location: New York
|
|
169
|
+
- Preferences: Prefers formal communication
|
|
170
|
+
`,
|
|
171
|
+
resourceId: "user-123", // Optional, required for resource-scoped memory
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Returns: { success: true }
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Note:** For resource-scoped working memory, you must provide the `resourceId` parameter. This allows the memory to persist across all conversation threads for that user.
|
|
178
|
+
|
|
136
179
|
### Get Memory Status
|
|
137
180
|
|
|
138
181
|
Check the status of the memory system:
|
|
@@ -17,7 +17,7 @@ const workflows = await mastraClient.listWorkflows();
|
|
|
17
17
|
|
|
18
18
|
## Working with a Specific Workflow
|
|
19
19
|
|
|
20
|
-
Get an instance of a specific workflow
|
|
20
|
+
Get an instance of a specific workflow by its ID:
|
|
21
21
|
|
|
22
22
|
```typescript title="src/mastra/workflows/test-workflow.ts"
|
|
23
23
|
export const testWorkflow = createWorkflow({
|
|
@@ -26,12 +26,12 @@ export const testWorkflow = createWorkflow({
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
const workflow = mastraClient.getWorkflow("
|
|
29
|
+
const workflow = mastraClient.getWorkflow("city-workflow");
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Workflow Methods
|
|
33
33
|
|
|
34
|
-
###
|
|
34
|
+
### details()
|
|
35
35
|
|
|
36
36
|
Retrieve detailed information about a workflow:
|
|
37
37
|
|
|
@@ -39,109 +39,138 @@ Retrieve detailed information about a workflow:
|
|
|
39
39
|
const details = await workflow.details();
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
###
|
|
42
|
+
### createRun()
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Create a new workflow run instance:
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
47
|
const run = await workflow.createRun();
|
|
48
48
|
|
|
49
|
+
// Or with an existing runId
|
|
50
|
+
const run = await workflow.createRun({ runId: "existing-run-id" });
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### startAsync()
|
|
54
|
+
|
|
55
|
+
Start a workflow run and await the full result:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
const run = await workflow.createRun();
|
|
59
|
+
|
|
60
|
+
const result = await run.startAsync({
|
|
61
|
+
inputData: {
|
|
62
|
+
city: "New York",
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
You can also pass `initialState` to set the starting values for the workflow's state:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
49
70
|
const result = await run.startAsync({
|
|
50
71
|
inputData: {
|
|
51
72
|
city: "New York",
|
|
52
73
|
},
|
|
74
|
+
initialState: {
|
|
75
|
+
count: 0,
|
|
76
|
+
items: [],
|
|
77
|
+
},
|
|
53
78
|
});
|
|
54
79
|
```
|
|
55
80
|
|
|
56
|
-
|
|
81
|
+
The `initialState` object should match the structure defined in the workflow's `stateSchema`. See [Workflow State](/docs/v1/workflows/workflow-state) for more details.
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
### start()
|
|
84
|
+
|
|
85
|
+
Start a workflow run without waiting for completion:
|
|
59
86
|
|
|
60
87
|
```typescript
|
|
61
88
|
const run = await workflow.createRun();
|
|
62
89
|
|
|
90
|
+
await run.start({
|
|
91
|
+
inputData: {
|
|
92
|
+
city: "New York",
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Poll for results later
|
|
97
|
+
const result = await workflow.runExecutionResult(run.runId);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This is useful for long-running workflows where you want to start execution and check results later.
|
|
101
|
+
|
|
102
|
+
### resumeAsync()
|
|
103
|
+
|
|
104
|
+
Resume a suspended workflow step and await the full result:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
const run = await workflow.createRun({ runId: prevRunId });
|
|
108
|
+
|
|
63
109
|
const result = await run.resumeAsync({
|
|
64
110
|
step: "step-id",
|
|
65
111
|
resumeData: { key: "value" },
|
|
66
112
|
});
|
|
67
113
|
```
|
|
68
114
|
|
|
69
|
-
###
|
|
115
|
+
### resume()
|
|
70
116
|
|
|
71
|
-
Resume workflow
|
|
117
|
+
Resume a suspended workflow step without waiting for completion:
|
|
72
118
|
|
|
73
119
|
```typescript
|
|
74
|
-
|
|
75
|
-
const workflow = mastraClient.getWorkflow("testWorkflow");
|
|
120
|
+
const run = await workflow.createRun({ runId: prevRunId });
|
|
76
121
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
resumeData: { key: "value" },
|
|
82
|
-
});
|
|
83
|
-
} catch (e) {
|
|
84
|
-
console.error(e);
|
|
85
|
-
}
|
|
122
|
+
await run.resume({
|
|
123
|
+
step: "step-id",
|
|
124
|
+
resumeData: { key: "value" },
|
|
125
|
+
});
|
|
86
126
|
```
|
|
87
127
|
|
|
88
|
-
###
|
|
128
|
+
### stream()
|
|
89
129
|
|
|
90
130
|
Stream workflow execution for real-time updates:
|
|
91
131
|
|
|
92
132
|
```typescript
|
|
93
|
-
|
|
94
|
-
const workflow = mastraClient.getWorkflow("testWorkflow");
|
|
95
|
-
|
|
96
|
-
const run = await workflow.createRun();
|
|
133
|
+
const run = await workflow.createRun();
|
|
97
134
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
135
|
+
const stream = await run.stream({
|
|
136
|
+
inputData: {
|
|
137
|
+
city: "New York",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
103
140
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
} catch (e) {
|
|
108
|
-
console.error("Workflow error:", e);
|
|
141
|
+
for await (const chunk of stream) {
|
|
142
|
+
console.log(JSON.stringify(chunk, null, 2));
|
|
109
143
|
}
|
|
110
144
|
```
|
|
111
145
|
|
|
112
|
-
###
|
|
146
|
+
### runExecutionResult()
|
|
113
147
|
|
|
114
|
-
Get the result
|
|
148
|
+
Get the execution result for a workflow run:
|
|
115
149
|
|
|
116
150
|
```typescript
|
|
117
|
-
|
|
118
|
-
const workflow = mastraClient.getWorkflow("testWorkflow");
|
|
119
|
-
|
|
120
|
-
const run = await workflow.createRun();
|
|
121
|
-
|
|
122
|
-
// start the workflow run
|
|
123
|
-
const startResult = await run.start({
|
|
124
|
-
inputData: {
|
|
125
|
-
city: "New York",
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const result = await workflow.runExecutionResult(run.runId);
|
|
130
|
-
|
|
131
|
-
console.log(result);
|
|
132
|
-
} catch (e) {
|
|
133
|
-
console.error(e);
|
|
134
|
-
}
|
|
151
|
+
const result = await workflow.runExecutionResult(runId);
|
|
135
152
|
```
|
|
136
153
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
### Workflow run result
|
|
154
|
+
<h3>Run result format</h3>
|
|
140
155
|
|
|
141
156
|
A workflow run result yields the following:
|
|
142
157
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
<PropertiesTable
|
|
159
|
+
content={[
|
|
160
|
+
{
|
|
161
|
+
name: "runId",
|
|
162
|
+
type: "string",
|
|
163
|
+
description: "Unique identifier for this workflow run instance",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "eventTimestamp",
|
|
167
|
+
type: "Date",
|
|
168
|
+
description: "The timestamp of the event",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "payload",
|
|
172
|
+
type: "object",
|
|
173
|
+
description: "Contains currentStep (id, status, output, payload) and workflowState (status, steps record)",
|
|
174
|
+
},
|
|
175
|
+
]}
|
|
176
|
+
/>
|
|
@@ -15,9 +15,8 @@ import { createOpenAICompatible } from '@ai-sdk/openai-compatible-v5';
|
|
|
15
15
|
import type { LanguageModelV2 } from '@ai-sdk/provider-v5';
|
|
16
16
|
|
|
17
17
|
class MyCustomGateway extends MastraModelGateway {
|
|
18
|
-
readonly id = '
|
|
18
|
+
readonly id = 'custom';
|
|
19
19
|
readonly name = 'My Custom Gateway';
|
|
20
|
-
readonly prefix = 'custom';
|
|
21
20
|
|
|
22
21
|
async fetchProviders(): Promise<Record<string, ProviderConfig>> {
|
|
23
22
|
return {
|
|
@@ -66,7 +65,7 @@ class MyCustomGateway extends MastraModelGateway {
|
|
|
66
65
|
{
|
|
67
66
|
name: 'id',
|
|
68
67
|
type: 'string',
|
|
69
|
-
description: 'Unique identifier for the gateway.
|
|
68
|
+
description: 'Unique identifier for the gateway. This ID is used as the prefix for all providers from this gateway (e.g., "netlify/anthropic"). Exception: models.dev is a provider registry and doesn\'t use a prefix.',
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
71
|
name: 'name',
|
|
@@ -76,18 +75,6 @@ class MyCustomGateway extends MastraModelGateway {
|
|
|
76
75
|
]}
|
|
77
76
|
/>
|
|
78
77
|
|
|
79
|
-
## Optional Properties
|
|
80
|
-
|
|
81
|
-
<PropertiesTable
|
|
82
|
-
content={[
|
|
83
|
-
{
|
|
84
|
-
name: 'prefix',
|
|
85
|
-
type: 'string | undefined',
|
|
86
|
-
description: 'Optional prefix for provider IDs. If set, all providers from this gateway will be prefixed (e.g., "netlify/openai"). Registry gateways typically don\'t have a prefix.',
|
|
87
|
-
},
|
|
88
|
-
]}
|
|
89
|
-
/>
|
|
90
|
-
|
|
91
78
|
## Required Methods
|
|
92
79
|
|
|
93
80
|
### fetchProviders()
|
|
@@ -217,15 +204,14 @@ Returns the gateway's unique identifier.
|
|
|
217
204
|
|
|
218
205
|
## Model ID Format
|
|
219
206
|
|
|
220
|
-
|
|
207
|
+
For true gateways, the gateway ID is used as a prefix and models are accessed using this format:
|
|
221
208
|
|
|
222
209
|
```
|
|
223
|
-
[
|
|
210
|
+
[gateway-id]/[provider]/[model]
|
|
224
211
|
```
|
|
225
212
|
|
|
226
213
|
Examples:
|
|
227
|
-
-
|
|
228
|
-
- Without prefix: `'my-provider/model-1'`
|
|
214
|
+
- Gateway with `id = 'custom'`: `'custom/my-provider/model-1'`
|
|
229
215
|
|
|
230
216
|
## Built-in Implementations
|
|
231
217
|
|
|
@@ -9,12 +9,11 @@ The `NetlifyDeployer` class handles deployment of standalone Mastra applications
|
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript title="src/mastra/index.ts"
|
|
12
|
+
```typescript title="src/mastra/index.ts" copy
|
|
13
13
|
import { Mastra } from "@mastra/core";
|
|
14
14
|
import { NetlifyDeployer } from "@mastra/deployer-netlify";
|
|
15
15
|
|
|
16
16
|
export const mastra = new Mastra({
|
|
17
|
-
// ...
|
|
18
17
|
deployer: new NetlifyDeployer(),
|
|
19
18
|
});
|
|
20
19
|
```
|