@mastra/mcp-docs-server 0.13.39 → 1.0.0-beta.0
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%2Fai-sdk-v4.md +1 -0
- package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +0 -10
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +0 -10
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +36 -36
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +0 -10
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +40 -40
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +4 -14
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +223 -223
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +190 -190
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +214 -214
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +74 -74
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +209 -209
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +191 -191
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +5 -13
- package/.docs/organized/changelogs/%40mastra%2Flance.md +182 -182
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +58 -58
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +228 -228
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +199 -199
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +206 -206
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +197 -197
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +217 -217
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Frag.md +61 -61
- package/.docs/organized/changelogs/%40mastra%2Freact.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -17
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -30
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +206 -206
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +190 -190
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +20 -20
- package/.docs/organized/changelogs/create-mastra.md +33 -33
- package/.docs/organized/changelogs/mastra.md +86 -86
- package/.docs/organized/code-examples/a2a.md +4 -2
- package/.docs/organized/code-examples/agui.md +12 -9
- package/.docs/organized/code-examples/ai-sdk-useChat.md +12 -18
- package/.docs/organized/code-examples/ai-sdk-v5.md +4 -2
- package/.docs/organized/code-examples/bird-checker-with-express.md +5 -4
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +4 -3
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +4 -3
- package/.docs/organized/code-examples/client-side-tools.md +1 -0
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +8 -177
- package/.docs/organized/code-examples/fireworks-r1.md +2 -2
- package/.docs/organized/code-examples/heads-up-game.md +10 -7
- package/.docs/organized/code-examples/mcp-configuration.md +5 -3
- package/.docs/organized/code-examples/mcp-registry-registry.md +3 -2
- package/.docs/organized/code-examples/memory-per-resource-example.md +4 -2
- package/.docs/organized/code-examples/memory-todo-agent.md +1 -0
- package/.docs/organized/code-examples/memory-with-context.md +2 -1
- package/.docs/organized/code-examples/memory-with-libsql.md +4 -2
- package/.docs/organized/code-examples/memory-with-mongodb.md +4 -2
- package/.docs/organized/code-examples/memory-with-pg.md +4 -2
- package/.docs/organized/code-examples/memory-with-processors.md +13 -8
- package/.docs/organized/code-examples/memory-with-upstash.md +5 -3
- package/.docs/organized/code-examples/openapi-spec-writer.md +32 -41
- package/.docs/organized/code-examples/quick-start.md +5 -32
- package/.docs/organized/code-examples/stock-price-tool.md +6 -5
- package/.docs/organized/code-examples/weather-agent.md +21 -16
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +3 -2
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +9 -12
- package/.docs/organized/code-examples/workflow-with-memory.md +16 -15
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +2 -2
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +3 -2
- package/.docs/raw/agents/adding-voice.mdx +27 -22
- package/.docs/raw/agents/agent-memory.mdx +23 -15
- package/.docs/raw/agents/guardrails.mdx +33 -12
- package/.docs/raw/agents/networks.mdx +8 -4
- package/.docs/raw/agents/overview.mdx +21 -15
- package/.docs/raw/agents/using-tools.mdx +11 -8
- package/.docs/raw/auth/auth0.mdx +8 -8
- package/.docs/raw/auth/clerk.mdx +6 -6
- package/.docs/raw/auth/firebase.mdx +8 -8
- package/.docs/raw/auth/index.mdx +6 -6
- package/.docs/raw/auth/jwt.mdx +6 -6
- package/.docs/raw/auth/supabase.mdx +7 -7
- package/.docs/raw/auth/workos.mdx +8 -8
- package/.docs/raw/community/contributing-templates.mdx +3 -3
- package/.docs/raw/community/discord.mdx +1 -1
- package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +2 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +2 -1
- package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +2 -0
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -0
- package/.docs/raw/course/03-agent-memory/10-storage-configuration.md +2 -3
- package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +2 -0
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +2 -0
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +1 -0
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +2 -0
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +1 -0
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +1 -0
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +1 -0
- package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +2 -2
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +5 -5
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +7 -5
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +3 -3
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +4 -4
- package/.docs/raw/deployment/cloud-providers/index.mdx +11 -8
- package/.docs/raw/deployment/monorepo.mdx +2 -2
- package/.docs/raw/deployment/overview.mdx +2 -2
- package/.docs/raw/deployment/server-deployment.mdx +2 -10
- package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +4 -4
- package/.docs/raw/deployment/serverless-platforms/index.mdx +10 -7
- package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +4 -4
- package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +4 -4
- package/.docs/raw/deployment/web-framework.mdx +8 -8
- package/.docs/raw/{scorers → evals}/custom-scorers.mdx +6 -6
- package/.docs/raw/evals/off-the-shelf-scorers.mdx +50 -0
- package/.docs/raw/{scorers → evals}/overview.mdx +8 -8
- package/.docs/raw/evals/running-in-ci.mdx +113 -0
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +22 -21
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +8 -8
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +3 -0
- package/.docs/raw/frameworks/servers/express.mdx +10 -9
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +6 -6
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +3 -3
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +4 -4
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +2 -2
- package/.docs/raw/getting-started/installation.mdx +13 -12
- package/.docs/raw/getting-started/mcp-docs-server.mdx +1 -1
- package/.docs/raw/getting-started/project-structure.mdx +4 -4
- package/.docs/raw/getting-started/studio.mdx +8 -8
- package/.docs/raw/getting-started/templates.mdx +1 -1
- package/.docs/raw/guides/guide/ai-recruiter.mdx +264 -0
- package/.docs/raw/guides/guide/chef-michel.mdx +271 -0
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +450 -0
- package/.docs/raw/guides/guide/research-assistant.mdx +389 -0
- package/.docs/raw/guides/guide/stock-agent.mdx +185 -0
- package/.docs/raw/guides/guide/web-search.mdx +291 -0
- package/.docs/raw/guides/index.mdx +43 -0
- package/.docs/raw/guides/migrations/agentnetwork.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/_template.mdx +50 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +265 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +48 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +153 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +230 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +171 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +114 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +241 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +83 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +62 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +270 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +115 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +280 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +23 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/voice.mdx +39 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +178 -0
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +367 -0
- package/.docs/raw/index.mdx +9 -9
- package/.docs/raw/{observability/logging.mdx → logging.mdx} +4 -4
- package/.docs/raw/mastra-cloud/dashboard.mdx +2 -2
- package/.docs/raw/mastra-cloud/observability.mdx +6 -6
- package/.docs/raw/mastra-cloud/overview.mdx +2 -2
- package/.docs/raw/mastra-cloud/setting-up.mdx +4 -4
- package/.docs/raw/memory/conversation-history.mdx +1 -0
- package/.docs/raw/memory/memory-processors.mdx +4 -3
- package/.docs/raw/memory/overview.mdx +9 -5
- package/.docs/raw/memory/semantic-recall.mdx +12 -7
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +10 -5
- package/.docs/raw/memory/storage/memory-with-pg.mdx +9 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +9 -4
- package/.docs/raw/memory/threads-and-resources.mdx +11 -13
- package/.docs/raw/memory/working-memory.mdx +30 -14
- package/.docs/raw/observability/overview.mdx +13 -30
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/arize.mdx +10 -18
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/cloud.mdx +11 -17
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/default.mdx +16 -20
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/langfuse.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +7 -16
- package/.docs/raw/observability/{ai-tracing → tracing}/exporters/otel.mdx +9 -18
- package/.docs/raw/observability/{ai-tracing → tracing}/overview.mdx +107 -142
- package/.docs/raw/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +14 -13
- package/.docs/raw/rag/chunking-and-embedding.mdx +5 -5
- package/.docs/raw/rag/overview.mdx +3 -13
- package/.docs/raw/rag/retrieval.mdx +24 -12
- package/.docs/raw/rag/vector-databases.mdx +7 -1
- package/.docs/raw/reference/agents/agent.mdx +33 -28
- package/.docs/raw/reference/agents/generate.mdx +10 -10
- package/.docs/raw/reference/agents/generateLegacy.mdx +8 -8
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +21 -15
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +69 -0
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +22 -16
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +8 -8
- package/.docs/raw/reference/agents/getLLM.mdx +9 -9
- package/.docs/raw/reference/agents/getMemory.mdx +9 -9
- package/.docs/raw/reference/agents/getModel.mdx +10 -10
- package/.docs/raw/reference/agents/getVoice.mdx +8 -8
- package/.docs/raw/reference/agents/listAgents.mdx +9 -9
- package/.docs/raw/reference/agents/listScorers.mdx +7 -7
- package/.docs/raw/reference/agents/listTools.mdx +7 -7
- package/.docs/raw/reference/agents/listWorkflows.mdx +7 -7
- package/.docs/raw/reference/agents/network.mdx +11 -10
- package/.docs/raw/reference/auth/auth0.mdx +4 -4
- package/.docs/raw/reference/auth/clerk.mdx +4 -4
- package/.docs/raw/reference/auth/firebase.mdx +6 -6
- package/.docs/raw/reference/auth/jwt.mdx +4 -4
- package/.docs/raw/reference/auth/supabase.mdx +4 -4
- package/.docs/raw/reference/auth/workos.mdx +4 -4
- package/.docs/raw/reference/cli/mastra.mdx +7 -7
- package/.docs/raw/reference/client-js/agents.mdx +6 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +7 -7
- package/.docs/raw/reference/client-js/memory.mdx +24 -16
- package/.docs/raw/reference/client-js/observability.mdx +11 -11
- package/.docs/raw/reference/client-js/workflows.mdx +6 -34
- 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 +2 -2
- package/.docs/raw/reference/core/getLogger.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServer.mdx +31 -15
- package/.docs/raw/reference/core/getMCPServerById.mdx +81 -0
- package/.docs/raw/reference/core/getScorer.mdx +3 -3
- package/.docs/raw/reference/core/getScorerById.mdx +79 -0
- package/.docs/raw/reference/core/getServer.mdx +2 -2
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getTelemetry.mdx +2 -2
- package/.docs/raw/reference/core/getVector.mdx +2 -2
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +2 -2
- package/.docs/raw/reference/core/listLogsByRunId.mdx +2 -2
- package/.docs/raw/reference/core/listMCPServers.mdx +65 -0
- package/.docs/raw/reference/core/listScorers.mdx +3 -3
- package/.docs/raw/reference/core/listVectors.mdx +36 -0
- package/.docs/raw/reference/core/listWorkflows.mdx +6 -6
- package/.docs/raw/reference/core/mastra-class.mdx +3 -2
- package/.docs/raw/reference/core/setLogger.mdx +2 -2
- package/.docs/raw/reference/core/setStorage.mdx +3 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
- package/.docs/raw/reference/deployer/cloudflare.mdx +2 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -6
- package/.docs/raw/reference/deployer/netlify.mdx +2 -2
- package/.docs/raw/reference/deployer/vercel.mdx +3 -3
- package/.docs/raw/reference/evals/answer-relevancy.mdx +164 -126
- package/.docs/raw/reference/{scorers → evals}/answer-similarity.mdx +27 -27
- package/.docs/raw/reference/evals/bias.mdx +149 -115
- package/.docs/raw/reference/evals/completeness.mdx +148 -117
- package/.docs/raw/reference/evals/content-similarity.mdx +126 -113
- package/.docs/raw/reference/evals/context-precision.mdx +290 -133
- package/.docs/raw/reference/{scorers → evals}/context-relevance.mdx +6 -6
- package/.docs/raw/reference/{scorers → evals}/create-scorer.mdx +11 -11
- package/.docs/raw/reference/evals/faithfulness.mdx +163 -121
- package/.docs/raw/reference/evals/hallucination.mdx +159 -132
- package/.docs/raw/reference/evals/keyword-coverage.mdx +169 -125
- package/.docs/raw/reference/{scorers → evals}/mastra-scorer.mdx +5 -5
- package/.docs/raw/reference/{scorers → evals}/noise-sensitivity.mdx +9 -9
- package/.docs/raw/reference/evals/prompt-alignment.mdx +604 -182
- package/.docs/raw/reference/{scorers/run-experiment.mdx → evals/run-evals.mdx} +17 -18
- package/.docs/raw/reference/evals/textual-difference.mdx +149 -117
- package/.docs/raw/reference/evals/tone-consistency.mdx +149 -125
- package/.docs/raw/reference/{scorers → evals}/tool-call-accuracy.mdx +8 -6
- package/.docs/raw/reference/evals/toxicity.mdx +152 -96
- package/.docs/raw/reference/{observability/logging → logging}/pino-logger.mdx +2 -2
- package/.docs/raw/reference/memory/createThread.mdx +5 -5
- package/.docs/raw/reference/memory/deleteMessages.mdx +7 -7
- package/.docs/raw/reference/memory/getThreadById.mdx +4 -4
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +110 -0
- package/.docs/raw/reference/memory/memory-class.mdx +13 -9
- package/.docs/raw/reference/memory/query.mdx +58 -57
- package/.docs/raw/reference/memory/recall.mdx +185 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +245 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/arize.mdx +13 -13
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/braintrust.mdx +11 -8
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/cloud-exporter.mdx +21 -19
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/console-exporter.mdx +49 -17
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/default-exporter.mdx +42 -41
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langfuse.mdx +10 -7
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/langsmith.mdx +10 -7
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/exporters/otel.mdx +5 -5
- package/.docs/raw/reference/observability/tracing/instances.mdx +168 -0
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/interfaces.mdx +115 -89
- package/.docs/raw/reference/observability/{ai-tracing → tracing}/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/reference/observability/{ai-tracing/span.mdx → tracing/spans.mdx} +59 -41
- 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 -8
- package/.docs/raw/reference/rag/database-config.mdx +7 -7
- package/.docs/raw/reference/rag/metadata-filters.mdx +14 -11
- package/.docs/raw/reference/storage/libsql.mdx +2 -0
- package/.docs/raw/reference/storage/mssql.mdx +5 -0
- package/.docs/raw/reference/storage/postgresql.mdx +6 -0
- package/.docs/raw/reference/storage/upstash.mdx +1 -0
- package/.docs/raw/reference/streaming/agents/stream.mdx +12 -12
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +8 -8
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +3 -3
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +3 -3
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +6 -6
- package/.docs/raw/reference/streaming/workflows/stream.mdx +10 -10
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +11 -11
- package/.docs/raw/reference/templates/overview.mdx +2 -2
- package/.docs/raw/reference/tools/create-tool.mdx +52 -35
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +15 -15
- package/.docs/raw/reference/tools/mcp-client.mdx +1 -1
- package/.docs/raw/reference/tools/mcp-server.mdx +119 -35
- package/.docs/raw/reference/tools/vector-query-tool.mdx +27 -26
- package/.docs/raw/reference/vectors/libsql.mdx +1 -0
- package/.docs/raw/reference/vectors/pg.mdx +3 -0
- package/.docs/raw/reference/vectors/upstash.mdx +1 -0
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addTools.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +4 -4
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +14 -14
- package/.docs/raw/reference/workflows/run-methods/start.mdx +17 -17
- package/.docs/raw/reference/workflows/run.mdx +1 -8
- package/.docs/raw/reference/workflows/step.mdx +5 -5
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +7 -13
- 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 +5 -0
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- 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 +1 -1
- package/.docs/raw/server-db/custom-api-routes.mdx +2 -2
- package/.docs/raw/server-db/mastra-client.mdx +19 -18
- package/.docs/raw/server-db/middleware.mdx +7 -7
- package/.docs/raw/server-db/production-server.mdx +4 -4
- package/.docs/raw/server-db/{runtime-context.mdx → request-context.mdx} +46 -45
- package/.docs/raw/server-db/storage.mdx +29 -21
- package/.docs/raw/streaming/events.mdx +3 -3
- package/.docs/raw/streaming/overview.mdx +5 -5
- package/.docs/raw/streaming/tool-streaming.mdx +18 -17
- package/.docs/raw/streaming/workflow-streaming.mdx +1 -1
- package/.docs/raw/tools-mcp/advanced-usage.mdx +5 -4
- package/.docs/raw/tools-mcp/mcp-overview.mdx +32 -19
- package/.docs/raw/tools-mcp/overview.mdx +11 -11
- package/.docs/raw/voice/overview.mdx +63 -43
- package/.docs/raw/voice/speech-to-speech.mdx +5 -3
- package/.docs/raw/voice/speech-to-text.mdx +9 -8
- package/.docs/raw/voice/text-to-speech.mdx +12 -11
- package/.docs/raw/workflows/agents-and-tools.mdx +9 -5
- package/.docs/raw/workflows/control-flow.mdx +3 -3
- package/.docs/raw/workflows/error-handling.mdx +2 -21
- package/.docs/raw/workflows/human-in-the-loop.mdx +7 -4
- package/.docs/raw/workflows/inngest-workflow.mdx +2 -2
- package/.docs/raw/workflows/input-data-mapping.mdx +107 -0
- package/.docs/raw/workflows/overview.mdx +17 -16
- package/.docs/raw/workflows/snapshots.mdx +13 -11
- package/.docs/raw/workflows/suspend-and-resume.mdx +23 -15
- package/CHANGELOG.md +52 -57
- package/README.md +11 -2
- package/dist/{chunk-TUAHUTTB.js → chunk-5NJC7NRO.js} +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/prompts/migration.d.ts +6 -0
- package/dist/prompts/migration.d.ts.map +1 -0
- package/dist/stdio.js +402 -30
- package/dist/tools/migration.d.ts +40 -0
- package/dist/tools/migration.d.ts.map +1 -0
- package/package.json +8 -12
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +0 -302
- package/.docs/raw/observability/nextjs-tracing.mdx +0 -109
- package/.docs/raw/observability/otel-tracing.mdx +0 -189
- package/.docs/raw/reference/agents/getScorers.mdx +0 -69
- package/.docs/raw/reference/agents/getTools.mdx +0 -69
- package/.docs/raw/reference/agents/getWorkflows.mdx +0 -69
- package/.docs/raw/reference/client-js/workflows-legacy.mdx +0 -143
- package/.docs/raw/reference/core/getAgents.mdx +0 -35
- package/.docs/raw/reference/core/getLogs.mdx +0 -96
- package/.docs/raw/reference/core/getLogsByRunId.mdx +0 -87
- package/.docs/raw/reference/core/getMCPServers.mdx +0 -36
- package/.docs/raw/reference/core/getMemory.mdx +0 -36
- package/.docs/raw/reference/core/getScorerByName.mdx +0 -78
- package/.docs/raw/reference/core/getScorers.mdx +0 -43
- package/.docs/raw/reference/core/getVectors.mdx +0 -36
- package/.docs/raw/reference/core/getWorkflows.mdx +0 -45
- package/.docs/raw/reference/evals/context-position.mdx +0 -197
- package/.docs/raw/reference/evals/context-relevancy.mdx +0 -196
- package/.docs/raw/reference/evals/contextual-recall.mdx +0 -196
- package/.docs/raw/reference/evals/summarization.mdx +0 -212
- package/.docs/raw/reference/legacyWorkflows/after.mdx +0 -89
- package/.docs/raw/reference/legacyWorkflows/afterEvent.mdx +0 -79
- package/.docs/raw/reference/legacyWorkflows/commit.mdx +0 -33
- package/.docs/raw/reference/legacyWorkflows/createRun.mdx +0 -76
- package/.docs/raw/reference/legacyWorkflows/else.mdx +0 -68
- package/.docs/raw/reference/legacyWorkflows/events.mdx +0 -305
- package/.docs/raw/reference/legacyWorkflows/execute.mdx +0 -110
- package/.docs/raw/reference/legacyWorkflows/if.mdx +0 -108
- package/.docs/raw/reference/legacyWorkflows/resume.mdx +0 -158
- package/.docs/raw/reference/legacyWorkflows/resumeWithEvent.mdx +0 -133
- package/.docs/raw/reference/legacyWorkflows/snapshots.mdx +0 -207
- package/.docs/raw/reference/legacyWorkflows/start.mdx +0 -87
- package/.docs/raw/reference/legacyWorkflows/step-class.mdx +0 -100
- package/.docs/raw/reference/legacyWorkflows/step-condition.mdx +0 -137
- package/.docs/raw/reference/legacyWorkflows/step-function.mdx +0 -93
- package/.docs/raw/reference/legacyWorkflows/step-options.mdx +0 -69
- package/.docs/raw/reference/legacyWorkflows/step-retries.mdx +0 -196
- package/.docs/raw/reference/legacyWorkflows/suspend.mdx +0 -70
- package/.docs/raw/reference/legacyWorkflows/then.mdx +0 -72
- package/.docs/raw/reference/legacyWorkflows/until.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/watch.mdx +0 -124
- package/.docs/raw/reference/legacyWorkflows/while.mdx +0 -168
- package/.docs/raw/reference/legacyWorkflows/workflow.mdx +0 -234
- package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +0 -79
- package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +0 -110
- package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +0 -185
- package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +0 -238
- package/.docs/raw/reference/observability/otel-tracing/otel-config.mdx +0 -117
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-ax.mdx +0 -81
- package/.docs/raw/reference/observability/otel-tracing/providers/arize-phoenix.mdx +0 -121
- package/.docs/raw/reference/observability/otel-tracing/providers/braintrust.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/dash0.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/index.mdx +0 -20
- package/.docs/raw/reference/observability/otel-tracing/providers/keywordsai.mdx +0 -73
- package/.docs/raw/reference/observability/otel-tracing/providers/laminar.mdx +0 -41
- package/.docs/raw/reference/observability/otel-tracing/providers/langfuse.mdx +0 -84
- package/.docs/raw/reference/observability/otel-tracing/providers/langsmith.mdx +0 -48
- package/.docs/raw/reference/observability/otel-tracing/providers/langwatch.mdx +0 -43
- package/.docs/raw/reference/observability/otel-tracing/providers/new-relic.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/signoz.mdx +0 -40
- package/.docs/raw/reference/observability/otel-tracing/providers/traceloop.mdx +0 -40
- package/.docs/raw/reference/scorers/answer-relevancy.mdx +0 -227
- package/.docs/raw/reference/scorers/bias.mdx +0 -228
- package/.docs/raw/reference/scorers/completeness.mdx +0 -214
- package/.docs/raw/reference/scorers/content-similarity.mdx +0 -197
- package/.docs/raw/reference/scorers/context-precision.mdx +0 -352
- package/.docs/raw/reference/scorers/faithfulness.mdx +0 -241
- package/.docs/raw/reference/scorers/hallucination.mdx +0 -252
- package/.docs/raw/reference/scorers/keyword-coverage.mdx +0 -229
- package/.docs/raw/reference/scorers/prompt-alignment.mdx +0 -668
- package/.docs/raw/reference/scorers/textual-difference.mdx +0 -203
- package/.docs/raw/reference/scorers/tone-consistency.mdx +0 -211
- package/.docs/raw/reference/scorers/toxicity.mdx +0 -228
- package/.docs/raw/reference/workflows/run-methods/watch.mdx +0 -73
- package/.docs/raw/scorers/evals-old-api/custom-eval.mdx +0 -24
- package/.docs/raw/scorers/evals-old-api/overview.mdx +0 -106
- package/.docs/raw/scorers/evals-old-api/running-in-ci.mdx +0 -85
- package/.docs/raw/scorers/evals-old-api/textual-evals.mdx +0 -58
- package/.docs/raw/scorers/off-the-shelf-scorers.mdx +0 -50
- package/.docs/raw/workflows-legacy/control-flow.mdx +0 -774
- package/.docs/raw/workflows-legacy/dynamic-workflows.mdx +0 -239
- package/.docs/raw/workflows-legacy/error-handling.mdx +0 -187
- package/.docs/raw/workflows-legacy/nested-workflows.mdx +0 -360
- package/.docs/raw/workflows-legacy/overview.mdx +0 -182
- package/.docs/raw/workflows-legacy/runtime-variables.mdx +0 -156
- package/.docs/raw/workflows-legacy/steps.mdx +0 -115
- package/.docs/raw/workflows-legacy/suspend-and-resume.mdx +0 -406
- package/.docs/raw/workflows-legacy/variables.mdx +0 -318
|
@@ -46,7 +46,7 @@ OPENAI_API_KEY=<your-api-key>
|
|
|
46
46
|
|
|
47
47
|
:::note
|
|
48
48
|
|
|
49
|
-
Mastra supports more than 600 models. Choose from the [full list](/models).
|
|
49
|
+
Mastra supports more than 600 models. Choose from the [full list](/models/v1).
|
|
50
50
|
|
|
51
51
|
:::
|
|
52
52
|
|
|
@@ -60,7 +60,8 @@ Create an agent by instantiating the `Agent` class with system `instructions` an
|
|
|
60
60
|
import { Agent } from "@mastra/core/agent";
|
|
61
61
|
|
|
62
62
|
export const testAgent = new Agent({
|
|
63
|
-
|
|
63
|
+
id: "test-agent",
|
|
64
|
+
name: "Test Agent",
|
|
64
65
|
instructions: "You are a helpful assistant.",
|
|
65
66
|
model: "openai/gpt-4o-mini",
|
|
66
67
|
});
|
|
@@ -108,7 +109,8 @@ import { openai } from "@ai-sdk/openai";
|
|
|
108
109
|
import { Agent } from "@mastra/core/agent";
|
|
109
110
|
|
|
110
111
|
export const testAgent = new Agent({
|
|
111
|
-
|
|
112
|
+
id: "test-agent",
|
|
113
|
+
name: "Test Agent",
|
|
112
114
|
instructions: "You are a helpful assistant.",
|
|
113
115
|
model: openai("gpt-4o-mini"),
|
|
114
116
|
});
|
|
@@ -161,14 +163,14 @@ instructions: {
|
|
|
161
163
|
}
|
|
162
164
|
```
|
|
163
165
|
|
|
164
|
-
> See the [Agent reference doc](/reference/agents/agent) for more information.
|
|
166
|
+
> See the [Agent reference doc](/reference/v1/agents/agent) for more information.
|
|
165
167
|
|
|
166
168
|
### Registering an agent
|
|
167
169
|
|
|
168
170
|
Register your agent in the Mastra instance to make it available throughout your application. Once registered, it can be called from workflows, tools, or other agents, and has access to shared resources such as memory, logging, and observability features:
|
|
169
171
|
|
|
170
172
|
```typescript {6} showLineNumbers title="src/mastra/index.ts" copy
|
|
171
|
-
import { Mastra } from "@mastra/core
|
|
173
|
+
import { Mastra } from "@mastra/core";
|
|
172
174
|
import { testAgent } from "./agents/test-agent";
|
|
173
175
|
|
|
174
176
|
export const mastra = new Mastra({
|
|
@@ -189,7 +191,7 @@ const testAgent = mastra.getAgent("testAgent");
|
|
|
189
191
|
|
|
190
192
|
`mastra.getAgent()` is preferred over a direct import, since it provides access to the Mastra instance configuration (logger, telemetry, storage, registered agents, and vector stores).
|
|
191
193
|
|
|
192
|
-
See [Calling agents](/examples/agents/calling-agents) for more information.
|
|
194
|
+
See [Calling agents](/examples/v1/agents/calling-agents) for more information.
|
|
193
195
|
|
|
194
196
|
:::
|
|
195
197
|
|
|
@@ -259,7 +261,7 @@ for await (const chunk of stream.textStream) {
|
|
|
259
261
|
</TabItem>
|
|
260
262
|
</Tabs>
|
|
261
263
|
|
|
262
|
-
> See [.generate()](/reference/agents/generate) or [.stream()](/reference/streaming/agents/stream) for more information.
|
|
264
|
+
> See [.generate()](/reference/v1/agents/generate) or [.stream()](/reference/v1/streaming/agents/stream) for more information.
|
|
263
265
|
|
|
264
266
|
## Structured output
|
|
265
267
|
|
|
@@ -420,6 +422,8 @@ Agents can use tools to go beyond language generation, enabling structured inter
|
|
|
420
422
|
|
|
421
423
|
```typescript title="src/mastra/agents/test-agent.ts" showLineNumbers
|
|
422
424
|
export const testAgent = new Agent({
|
|
425
|
+
id: "test-agent",
|
|
426
|
+
name: "Test Agent",
|
|
423
427
|
// ...
|
|
424
428
|
tools: { testTool },
|
|
425
429
|
});
|
|
@@ -427,9 +431,9 @@ export const testAgent = new Agent({
|
|
|
427
431
|
|
|
428
432
|
> See [Using Tools](./using-tools) for more information.
|
|
429
433
|
|
|
430
|
-
## Using `
|
|
434
|
+
## Using `RequestContext`
|
|
431
435
|
|
|
432
|
-
Use `
|
|
436
|
+
Use `RequestContext` to access request-specific values. This lets you conditionally adjust behavior based on the context of the request.
|
|
433
437
|
|
|
434
438
|
```typescript title="src/mastra/agents/test-agent.ts" showLineNumbers
|
|
435
439
|
export type UserTier = {
|
|
@@ -437,9 +441,11 @@ export type UserTier = {
|
|
|
437
441
|
};
|
|
438
442
|
|
|
439
443
|
export const testAgent = new Agent({
|
|
444
|
+
id: "test-agent",
|
|
445
|
+
name: "Test Agent",
|
|
440
446
|
// ...
|
|
441
|
-
model: ({
|
|
442
|
-
const userTier =
|
|
447
|
+
model: ({ requestContext }) => {
|
|
448
|
+
const userTier = requestContext.get("user-tier") as UserTier["user-tier"];
|
|
443
449
|
|
|
444
450
|
return userTier === "enterprise"
|
|
445
451
|
? openai("gpt-4o-mini")
|
|
@@ -448,15 +454,15 @@ export const testAgent = new Agent({
|
|
|
448
454
|
});
|
|
449
455
|
```
|
|
450
456
|
|
|
451
|
-
> See [
|
|
457
|
+
> See [Request Context](/docs/v1/server-db/request-context) for more information.
|
|
452
458
|
|
|
453
459
|
## Testing with Studio
|
|
454
460
|
|
|
455
|
-
Use [Studio](/docs/getting-started/studio) to test agents with different messages, inspect tool calls and responses, and debug agent behavior.
|
|
461
|
+
Use [Studio](/docs/v1/getting-started/studio) to test agents with different messages, inspect tool calls and responses, and debug agent behavior.
|
|
456
462
|
|
|
457
463
|
## Related
|
|
458
464
|
|
|
459
465
|
- [Using Tools](./using-tools)
|
|
460
466
|
- [Agent Memory](./agent-memory)
|
|
461
|
-
- [
|
|
462
|
-
- [Calling Agents](/examples/agents/calling-agents)
|
|
467
|
+
- [Request Context](/examples/v1/agents/request-context)
|
|
468
|
+
- [Calling Agents](/examples/v1/agents/calling-agents)
|
|
@@ -13,9 +13,9 @@ Use tools when an agent needs additional context or information from remote reso
|
|
|
13
13
|
|
|
14
14
|
## Creating a tool
|
|
15
15
|
|
|
16
|
-
This example shows how to create a tool that fetches weather data from an API. When the agent calls the tool, it provides the required input as defined by the tool
|
|
16
|
+
This example shows how to create a tool that fetches weather data from an API. When the agent calls the tool, it provides the required input as defined by the tool's `inputSchema`. The tool accesses this data through its `inputData` parameter, which in this example includes the `location` used in the weather API query.
|
|
17
17
|
|
|
18
|
-
```typescript {14
|
|
18
|
+
```typescript {14} title="src/mastra/tools/weather-tool.ts" showLineNumbers copy
|
|
19
19
|
import { createTool } from "@mastra/core/tools";
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
|
|
@@ -28,8 +28,8 @@ export const weatherTool = createTool({
|
|
|
28
28
|
outputSchema: z.object({
|
|
29
29
|
weather: z.string(),
|
|
30
30
|
}),
|
|
31
|
-
execute: async (
|
|
32
|
-
const { location } =
|
|
31
|
+
execute: async (inputData) => {
|
|
32
|
+
const { location } = inputData;
|
|
33
33
|
|
|
34
34
|
const response = await fetch(`https://wttr.in/${location}?format=3`);
|
|
35
35
|
const weather = await response.text();
|
|
@@ -49,7 +49,8 @@ import { Agent } from "@mastra/core/agent";
|
|
|
49
49
|
import { weatherTool } from "../tools/weather-tool";
|
|
50
50
|
|
|
51
51
|
export const weatherAgent = new Agent({
|
|
52
|
-
|
|
52
|
+
id: "weather-agent",
|
|
53
|
+
name: "Weather Agent",
|
|
53
54
|
instructions: `
|
|
54
55
|
You are a helpful weather assistant.
|
|
55
56
|
Use the weatherTool to fetch current weather data.`,
|
|
@@ -60,7 +61,7 @@ export const weatherAgent = new Agent({
|
|
|
60
61
|
|
|
61
62
|
## Calling an agent
|
|
62
63
|
|
|
63
|
-
The agent uses the tool
|
|
64
|
+
The agent uses the tool's `inputSchema` to infer what data the tool expects. In this case, it extracts `London` as the `location` from the message and passes it to the tool's inputData parameter.
|
|
64
65
|
|
|
65
66
|
```typescript {5} title="src/test-tool.ts" showLineNumbers copy
|
|
66
67
|
import { mastra } from "./mastra";
|
|
@@ -81,6 +82,8 @@ import { weatherTool } from "../tools/weather-tool";
|
|
|
81
82
|
import { activitiesTool } from "../tools/activities-tool";
|
|
82
83
|
|
|
83
84
|
export const weatherAgent = new Agent({
|
|
85
|
+
id: "weather-agent",
|
|
86
|
+
name: "Weather Agent",
|
|
84
87
|
// ..
|
|
85
88
|
tools: { weatherTool, activitiesTool },
|
|
86
89
|
});
|
|
@@ -90,5 +93,5 @@ export const weatherAgent = new Agent({
|
|
|
90
93
|
|
|
91
94
|
- [Tools Overview](../tools-mcp/overview)
|
|
92
95
|
- [Agent Memory](./agent-memory)
|
|
93
|
-
- [
|
|
94
|
-
- [Calling Agents](/examples/agents/calling-agents)
|
|
96
|
+
- [Request Context](/docs/v1/server-db/request-context)
|
|
97
|
+
- [Calling Agents](/examples/v1/agents/calling-agents)
|
package/.docs/raw/auth/auth0.mdx
CHANGED
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraAuthAuth0 Class
|
|
10
10
|
|
|
11
|
-
The `MastraAuthAuth0` class provides authentication for Mastra using Auth0. It verifies incoming requests using Auth0-issued JWT tokens and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraAuthAuth0` class provides authentication for Mastra using Auth0. It verifies incoming requests using Auth0-issued JWT tokens and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
@@ -41,13 +41,13 @@ npm install @mastra/auth-auth0@latest
|
|
|
41
41
|
### Basic usage with environment variables
|
|
42
42
|
|
|
43
43
|
```typescript {2,7} title="src/mastra/index.ts" showLineNumbers copy
|
|
44
|
-
import { Mastra } from "@mastra/core
|
|
44
|
+
import { Mastra } from "@mastra/core";
|
|
45
45
|
import { MastraAuthAuth0 } from "@mastra/auth-auth0";
|
|
46
46
|
|
|
47
47
|
export const mastra = new Mastra({
|
|
48
48
|
// ..
|
|
49
49
|
server: {
|
|
50
|
-
|
|
50
|
+
auth: new MastraAuthAuth0(),
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
```
|
|
@@ -55,13 +55,13 @@ export const mastra = new Mastra({
|
|
|
55
55
|
### Custom configuration
|
|
56
56
|
|
|
57
57
|
```typescript {2,7-10} title="src/mastra/index.ts" showLineNumbers copy
|
|
58
|
-
import { Mastra } from "@mastra/core
|
|
58
|
+
import { Mastra } from "@mastra/core";
|
|
59
59
|
import { MastraAuthAuth0 } from "@mastra/auth-auth0";
|
|
60
60
|
|
|
61
61
|
export const mastra = new Mastra({
|
|
62
62
|
// ..
|
|
63
63
|
server: {
|
|
64
|
-
|
|
64
|
+
auth: new MastraAuthAuth0({
|
|
65
65
|
domain: process.env.AUTH0_DOMAIN,
|
|
66
66
|
audience: process.env.AUTH0_AUDIENCE,
|
|
67
67
|
}),
|
|
@@ -93,7 +93,7 @@ const auth0Provider = new MastraAuthAuth0({
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
> See the [MastraAuthAuth0](/reference/auth/auth0) API reference for all available configuration options.
|
|
96
|
+
> See the [MastraAuthAuth0](/reference/v1/auth/auth0) API reference for all available configuration options.
|
|
97
97
|
|
|
98
98
|
## Client-side setup
|
|
99
99
|
|
|
@@ -153,7 +153,7 @@ export const useAuth0Token = () => {
|
|
|
153
153
|
|
|
154
154
|
## Configuring `MastraClient`
|
|
155
155
|
|
|
156
|
-
When `
|
|
156
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid Auth0 access token in the `Authorization` header:
|
|
157
157
|
|
|
158
158
|
```typescript title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
159
159
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -170,7 +170,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
170
170
|
|
|
171
171
|
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
172
172
|
|
|
173
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
173
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
174
174
|
|
|
175
175
|
### Making authenticated requests
|
|
176
176
|
|
package/.docs/raw/auth/clerk.mdx
CHANGED
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraAuthClerk Class
|
|
10
10
|
|
|
11
|
-
The `MastraAuthClerk` class provides authentication for Mastra using Clerk. It verifies incoming requests using Clerk's authentication system and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraAuthClerk` class provides authentication for Mastra using Clerk. It verifies incoming requests using Clerk's authentication system and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
@@ -33,13 +33,13 @@ npm install @mastra/auth-clerk@latest
|
|
|
33
33
|
## Usage example
|
|
34
34
|
|
|
35
35
|
```typescript {2,7-11} title="src/mastra/index.ts" showLineNumbers copy
|
|
36
|
-
import { Mastra } from "@mastra/core
|
|
36
|
+
import { Mastra } from "@mastra/core";
|
|
37
37
|
import { MastraAuthClerk } from "@mastra/auth-clerk";
|
|
38
38
|
|
|
39
39
|
export const mastra = new Mastra({
|
|
40
40
|
// ..
|
|
41
41
|
server: {
|
|
42
|
-
|
|
42
|
+
auth: new MastraAuthClerk({
|
|
43
43
|
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
|
|
44
44
|
secretKey: process.env.CLERK_SECRET_KEY,
|
|
45
45
|
jwksUri: process.env.CLERK_JWKS_URI,
|
|
@@ -50,7 +50,7 @@ export const mastra = new Mastra({
|
|
|
50
50
|
|
|
51
51
|
> **Note:** The default `authorizeUser` method allows all authenticated users. To customize user authorization, provide a custom `authorizeUser` function when constructing the provider.
|
|
52
52
|
|
|
53
|
-
> See the [MastraAuthClerk](/reference/auth/clerk) API reference for all available configuration options.
|
|
53
|
+
> See the [MastraAuthClerk](/reference/v1/auth/clerk) API reference for all available configuration options.
|
|
54
54
|
|
|
55
55
|
## Client-side setup
|
|
56
56
|
|
|
@@ -79,7 +79,7 @@ export const useClerkAuth = () => {
|
|
|
79
79
|
|
|
80
80
|
## Configuring `MastraClient`
|
|
81
81
|
|
|
82
|
-
When `
|
|
82
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid Clerk access token in the `Authorization` header:
|
|
83
83
|
|
|
84
84
|
```typescript {6} title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
85
85
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -93,7 +93,7 @@ export const mastraClient = new MastraClient({
|
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
96
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
96
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
97
97
|
|
|
98
98
|
### Making authenticated requests
|
|
99
99
|
|
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraAuthFirebase Class
|
|
10
10
|
|
|
11
|
-
The `MastraAuthFirebase` class provides authentication for Mastra using Firebase Authentication. It verifies incoming requests using Firebase ID tokens and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraAuthFirebase` class provides authentication for Mastra using Firebase Authentication. It verifies incoming requests using Firebase ID tokens and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
@@ -43,14 +43,14 @@ npm install @mastra/auth-firebase@latest
|
|
|
43
43
|
If you set the required environment variables (`FIREBASE_SERVICE_ACCOUNT` and `FIRESTORE_DATABASE_ID`), you can initialize `MastraAuthFirebase` without any constructor arguments. The class will automatically read these environment variables as configuration:
|
|
44
44
|
|
|
45
45
|
```typescript {2,7} title="src/mastra/index.ts" showLineNumbers copy
|
|
46
|
-
import { Mastra } from "@mastra/core
|
|
46
|
+
import { Mastra } from "@mastra/core";
|
|
47
47
|
import { MastraAuthFirebase } from "@mastra/auth-firebase";
|
|
48
48
|
|
|
49
49
|
// Automatically uses FIREBASE_SERVICE_ACCOUNT and FIRESTORE_DATABASE_ID env vars
|
|
50
50
|
export const mastra = new Mastra({
|
|
51
51
|
// ..
|
|
52
52
|
server: {
|
|
53
|
-
|
|
53
|
+
auth: new MastraAuthFirebase(),
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
56
|
```
|
|
@@ -58,13 +58,13 @@ export const mastra = new Mastra({
|
|
|
58
58
|
### Custom configuration
|
|
59
59
|
|
|
60
60
|
```typescript {2,7-10} title="src/mastra/index.ts" showLineNumbers copy
|
|
61
|
-
import { Mastra } from "@mastra/core
|
|
61
|
+
import { Mastra } from "@mastra/core";
|
|
62
62
|
import { MastraAuthFirebase } from "@mastra/auth-firebase";
|
|
63
63
|
|
|
64
64
|
export const mastra = new Mastra({
|
|
65
65
|
// ..
|
|
66
66
|
server: {
|
|
67
|
-
|
|
67
|
+
auth: new MastraAuthFirebase({
|
|
68
68
|
serviceAccount: "/path/to/service-account.json",
|
|
69
69
|
databaseId: "your-database-id",
|
|
70
70
|
}),
|
|
@@ -106,7 +106,7 @@ const firebaseAuth = new MastraAuthFirebase({
|
|
|
106
106
|
});
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
> See the [MastraAuthFirebase](/reference/auth/firebase) API reference for all available configuration options.
|
|
109
|
+
> See the [MastraAuthFirebase](/reference/v1/auth/firebase) API reference for all available configuration options.
|
|
110
110
|
|
|
111
111
|
## Client-side setup
|
|
112
112
|
|
|
@@ -173,7 +173,7 @@ export const signOutUser = async () => {
|
|
|
173
173
|
|
|
174
174
|
## Configuring `MastraClient`
|
|
175
175
|
|
|
176
|
-
When `
|
|
176
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid Firebase ID token in the `Authorization` header:
|
|
177
177
|
|
|
178
178
|
```typescript {6} title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
179
179
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -190,7 +190,7 @@ export const createMastraClient = (idToken: string) => {
|
|
|
190
190
|
|
|
191
191
|
> **Note:** The ID token must be prefixed with `Bearer` in the Authorization header.
|
|
192
192
|
|
|
193
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
193
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
194
194
|
|
|
195
195
|
### Making authenticated requests
|
|
196
196
|
|
package/.docs/raw/auth/index.mdx
CHANGED
|
@@ -11,9 +11,9 @@ You can start with simple shared secret JWT authentication and switch to provide
|
|
|
11
11
|
|
|
12
12
|
## Available providers
|
|
13
13
|
|
|
14
|
-
- [JSON Web Token (JWT)](/docs/auth/jwt)
|
|
15
|
-
- [Clerk](/docs/auth/clerk)
|
|
16
|
-
- [Supabase](/docs/auth/supabase)
|
|
17
|
-
- [Firebase](/docs/auth/firebase)
|
|
18
|
-
- [WorkOS](/docs/auth/workos)
|
|
19
|
-
- [Auth0](/docs/auth/auth0)
|
|
14
|
+
- [JSON Web Token (JWT)](/docs/v1/auth/jwt)
|
|
15
|
+
- [Clerk](/docs/v1/auth/clerk)
|
|
16
|
+
- [Supabase](/docs/v1/auth/supabase)
|
|
17
|
+
- [Firebase](/docs/v1/auth/firebase)
|
|
18
|
+
- [WorkOS](/docs/v1/auth/workos)
|
|
19
|
+
- [Auth0](/docs/v1/auth/auth0)
|
package/.docs/raw/auth/jwt.mdx
CHANGED
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraJwtAuth Class
|
|
10
10
|
|
|
11
|
-
The `MastraJwtAuth` class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs). It verifies incoming requests based on a shared secret and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraJwtAuth` class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs). It verifies incoming requests based on a shared secret and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -21,24 +21,24 @@ npm install @mastra/auth@latest
|
|
|
21
21
|
## Usage example
|
|
22
22
|
|
|
23
23
|
```typescript {2,7-9} title="src/mastra/index.ts" showLineNumbers copy
|
|
24
|
-
import { Mastra } from "@mastra/core
|
|
24
|
+
import { Mastra } from "@mastra/core";
|
|
25
25
|
import { MastraJwtAuth } from "@mastra/auth";
|
|
26
26
|
|
|
27
27
|
export const mastra = new Mastra({
|
|
28
28
|
// ..
|
|
29
29
|
server: {
|
|
30
|
-
|
|
30
|
+
auth: new MastraJwtAuth({
|
|
31
31
|
secret: process.env.MASTRA_JWT_SECRET,
|
|
32
32
|
}),
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
> See the [MastraJwtAuth](/reference/auth/jwt) API reference for all available configuration options.
|
|
37
|
+
> See the [MastraJwtAuth](/reference/v1/auth/jwt) API reference for all available configuration options.
|
|
38
38
|
|
|
39
39
|
## Configuring `MastraClient`
|
|
40
40
|
|
|
41
|
-
When `
|
|
41
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid JWT in the `Authorization` header:
|
|
42
42
|
|
|
43
43
|
```typescript {6} title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
44
44
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -51,7 +51,7 @@ export const mastraClient = new MastraClient({
|
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
54
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
55
55
|
|
|
56
56
|
### Making authenticated requests
|
|
57
57
|
|
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraAuthSupabase Class
|
|
10
10
|
|
|
11
|
-
The `MastraAuthSupabase` class provides authentication for Mastra using Supabase Auth. It verifies incoming requests using Supabase's authentication system and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraAuthSupabase` class provides authentication for Mastra using Supabase Auth. It verifies incoming requests using Supabase's authentication system and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
@@ -32,13 +32,13 @@ npm install @mastra/auth-supabase@latest
|
|
|
32
32
|
## Usage example
|
|
33
33
|
|
|
34
34
|
```typescript {2,7-9} title="src/mastra/index.ts" showLineNumbers copy
|
|
35
|
-
import { Mastra } from "@mastra/core
|
|
35
|
+
import { Mastra } from "@mastra/core";
|
|
36
36
|
import { MastraAuthSupabase } from "@mastra/auth-supabase";
|
|
37
37
|
|
|
38
38
|
export const mastra = new Mastra({
|
|
39
39
|
// ..
|
|
40
40
|
server: {
|
|
41
|
-
|
|
41
|
+
auth: new MastraAuthSupabase({
|
|
42
42
|
url: process.env.SUPABASE_URL,
|
|
43
43
|
anonKey: process.env.SUPABASE_ANON_KEY,
|
|
44
44
|
}),
|
|
@@ -48,7 +48,7 @@ export const mastra = new Mastra({
|
|
|
48
48
|
|
|
49
49
|
> **Note:** The default `authorizeUser` method checks the `isAdmin` column in the `users` table in the `public` schema. To customize user authorization, provide a custom `authorizeUser` function when constructing the provider.
|
|
50
50
|
|
|
51
|
-
> See the [MastraAuthSupabase](/reference/auth/supabase) API reference for all available configuration options.
|
|
51
|
+
> See the [MastraAuthSupabase](/reference/v1/auth/supabase) API reference for all available configuration options.
|
|
52
52
|
|
|
53
53
|
## Client-side setup
|
|
54
54
|
|
|
@@ -75,7 +75,7 @@ const accessToken = authTokenResponse.data?.session?.access_token;
|
|
|
75
75
|
|
|
76
76
|
## Configuring `MastraClient`
|
|
77
77
|
|
|
78
|
-
When `
|
|
78
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid Supabase access token in the `Authorization` header:
|
|
79
79
|
|
|
80
80
|
```typescript {6} title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
81
81
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -90,14 +90,14 @@ export const mastraClient = new MastraClient({
|
|
|
90
90
|
|
|
91
91
|
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
92
92
|
|
|
93
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
93
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
94
94
|
|
|
95
95
|
### Making authenticated requests
|
|
96
96
|
|
|
97
97
|
Once `MastraClient` is configured with the Supabase access token, you can send authenticated requests:
|
|
98
98
|
|
|
99
99
|
<Tabs>
|
|
100
|
-
|
|
100
|
+
<TabItem value="react" label="React">
|
|
101
101
|
```tsx title="src/components/test-agent.tsx" showLineNumbers copy
|
|
102
102
|
import { mastraClient } from "../../lib/mastra-client";
|
|
103
103
|
|
|
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
|
|
9
9
|
# MastraAuthWorkos Class
|
|
10
10
|
|
|
11
|
-
The `MastraAuthWorkos` class provides authentication for Mastra using WorkOS. It verifies incoming requests using WorkOS access tokens and integrates with the Mastra server using the `
|
|
11
|
+
The `MastraAuthWorkos` class provides authentication for Mastra using WorkOS. It verifies incoming requests using WorkOS access tokens and integrates with the Mastra server using the `auth` option.
|
|
12
12
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
@@ -41,13 +41,13 @@ npm install @mastra/auth-workos@latest
|
|
|
41
41
|
### Basic usage with environment variables
|
|
42
42
|
|
|
43
43
|
```typescript {2,7} title="src/mastra/index.ts" showLineNumbers copy
|
|
44
|
-
import { Mastra } from "@mastra/core
|
|
44
|
+
import { Mastra } from "@mastra/core";
|
|
45
45
|
import { MastraAuthWorkos } from "@mastra/auth-workos";
|
|
46
46
|
|
|
47
47
|
export const mastra = new Mastra({
|
|
48
48
|
// ..
|
|
49
49
|
server: {
|
|
50
|
-
|
|
50
|
+
auth: new MastraAuthWorkos(),
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
```
|
|
@@ -55,13 +55,13 @@ export const mastra = new Mastra({
|
|
|
55
55
|
### Custom configuration
|
|
56
56
|
|
|
57
57
|
```typescript {2,7-10} title="src/mastra/index.ts" showLineNumbers copy
|
|
58
|
-
import { Mastra } from "@mastra/core
|
|
58
|
+
import { Mastra } from "@mastra/core";
|
|
59
59
|
import { MastraAuthWorkos } from "@mastra/auth-workos";
|
|
60
60
|
|
|
61
61
|
export const mastra = new Mastra({
|
|
62
62
|
// ..
|
|
63
63
|
server: {
|
|
64
|
-
|
|
64
|
+
auth: new MastraAuthWorkos({
|
|
65
65
|
apiKey: process.env.WORKOS_API_KEY,
|
|
66
66
|
clientId: process.env.WORKOS_CLIENT_ID,
|
|
67
67
|
}),
|
|
@@ -94,7 +94,7 @@ const workosAuth = new MastraAuthWorkos({
|
|
|
94
94
|
});
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
> See the [MastraAuthWorkos](/reference/auth/workos) API reference for all available configuration options.
|
|
97
|
+
> See the [MastraAuthWorkos](/reference/v1/auth/workos) API reference for all available configuration options.
|
|
98
98
|
|
|
99
99
|
## Client-side setup
|
|
100
100
|
|
|
@@ -135,7 +135,7 @@ export const authenticateWithWorkos = async (
|
|
|
135
135
|
|
|
136
136
|
## Configuring `MastraClient`
|
|
137
137
|
|
|
138
|
-
When `
|
|
138
|
+
When `auth` is enabled, all requests made with `MastraClient` must include a valid WorkOS access token in the `Authorization` header:
|
|
139
139
|
|
|
140
140
|
```typescript title="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
141
141
|
import { MastraClient } from "@mastra/client-js";
|
|
@@ -152,7 +152,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
152
152
|
|
|
153
153
|
> **Note:** The access token must be prefixed with `Bearer` in the Authorization header.
|
|
154
154
|
|
|
155
|
-
> See [Mastra Client SDK](/docs/server-db/mastra-client) for more configuration options.
|
|
155
|
+
> See [Mastra Client SDK](/docs/v1/server-db/mastra-client) for more configuration options.
|
|
156
156
|
|
|
157
157
|
### Making authenticated requests
|
|
158
158
|
|
|
@@ -13,8 +13,8 @@ The Mastra community plays a vital role in creating templates that showcase inno
|
|
|
13
13
|
|
|
14
14
|
Before creating a template, ensure you understand:
|
|
15
15
|
|
|
16
|
-
- [Templates Reference](/reference/templates/overview) - Technical requirements and conventions
|
|
17
|
-
- [Project Structure](/docs/getting-started/project-structure) - Standard Mastra project organization
|
|
16
|
+
- [Templates Reference](/reference/v1/templates/overview) - Technical requirements and conventions
|
|
17
|
+
- [Project Structure](/docs/v1/getting-started/project-structure) - Standard Mastra project organization
|
|
18
18
|
- Community guidelines and quality standards
|
|
19
19
|
|
|
20
20
|
### 2. Develop Your Template
|
|
@@ -56,7 +56,7 @@ Templates must meet these quality benchmarks:
|
|
|
56
56
|
|
|
57
57
|
### 1. Prepare Your Template
|
|
58
58
|
|
|
59
|
-
Ensure your template meets all requirements outlined in the [Templates Reference](/reference/templates/overview):
|
|
59
|
+
Ensure your template meets all requirements outlined in the [Templates Reference](/reference/v1/templates/overview):
|
|
60
60
|
|
|
61
61
|
- Proper project structure in `src/mastra/` directory
|
|
62
62
|
- Standard TypeScript configuration
|
|
@@ -9,4 +9,4 @@ The Discord server has over 1000 members and serves as the main discussion forum
|
|
|
9
9
|
|
|
10
10
|
## Discord MCP Bot
|
|
11
11
|
|
|
12
|
-
In addition to community members, we have an (experimental!) Discord bot that can also help answer questions. It uses [Model Context Protocol (MCP)](/docs/tools-mcp/mcp-overview). You can ask it a question with `/ask` (either in public channels or DMs) and clear history (in DMs only) with `/cleardm`.
|
|
12
|
+
In addition to community members, we have an (experimental!) Discord bot that can also help answer questions. It uses [Model Context Protocol (MCP)](/docs/v1/tools-mcp/mcp-overview). You can ask it a question with `/ask` (either in public channels or DMs) and clear history (in DMs only) with `/cleardm`.
|
|
@@ -5,7 +5,7 @@ To make your agent available to the playground, you need to export it through th
|
|
|
5
5
|
First, import the necessary dependencies and your agent:
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
|
-
import { Mastra } from "@mastra/core
|
|
8
|
+
import { Mastra } from "@mastra/core";
|
|
9
9
|
import { PinoLogger } from "@mastra/loggers";
|
|
10
10
|
import { LibSQLStore } from "@mastra/libsql";
|
|
11
11
|
import { financialAgent } from "./agents/financial-agent";
|
|
@@ -15,6 +15,7 @@ export const mastra = new Mastra({
|
|
|
15
15
|
financialAgent,
|
|
16
16
|
},
|
|
17
17
|
storage: new LibSQLStore({
|
|
18
|
+
id: "learning-memory-storage",
|
|
18
19
|
url: ":memory:",
|
|
19
20
|
}),
|
|
20
21
|
logger: new PinoLogger({
|
|
@@ -5,7 +5,7 @@ Now, let's update our agent to include memory. Open your `agents/index.ts` file
|
|
|
5
5
|
1. Import the Memory and LibSQLStore classes:
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
|
-
import { Agent } from "@mastra/core";
|
|
8
|
+
import { Agent } from "@mastra/core/agent";
|
|
9
9
|
import { openai } from "@ai-sdk/openai";
|
|
10
10
|
import { Memory } from "@mastra/memory";
|
|
11
11
|
import { LibSQLStore } from "@mastra/libsql";
|
|
@@ -24,6 +24,7 @@ export const financialAgent = new Agent({
|
|
|
24
24
|
tools: { getTransactionsTool },
|
|
25
25
|
memory: new Memory({
|
|
26
26
|
storage: new LibSQLStore({
|
|
27
|
+
id: "learning-memory-storage",
|
|
27
28
|
url: "file:../../memory.db", // local file-system database. Location is relative to the output directory `.mastra/output`
|
|
28
29
|
}),
|
|
29
30
|
}), // Add memory here
|
|
@@ -7,9 +7,11 @@ import { LibSQLStore, LibSQLVector } from "@mastra/libsql";
|
|
|
7
7
|
|
|
8
8
|
const memory = new Memory({
|
|
9
9
|
storage: new LibSQLStore({
|
|
10
|
+
id: "learning-memory-storage",
|
|
10
11
|
url: "file:../../memory.db",
|
|
11
12
|
}),
|
|
12
13
|
vector: new LibSQLVector({
|
|
14
|
+
id: "learning-memory-vector",
|
|
13
15
|
connectionUrl: "file:../../memory.db",
|
|
14
16
|
}),
|
|
15
17
|
embedder: openai.embedding("text-embedding-3-small"),
|
|
@@ -13,6 +13,7 @@ import { openai } from "@ai-sdk/openai";
|
|
|
13
13
|
// Create a basic memory instance
|
|
14
14
|
const memory = new Memory({
|
|
15
15
|
storage: new LibSQLStore({
|
|
16
|
+
id: "learning-memory-storage",
|
|
16
17
|
url: "file:../../memory.db", // relative path from the `.mastra/output` directory
|
|
17
18
|
}),
|
|
18
19
|
});
|
|
@@ -9,9 +9,8 @@ import { LibSQLStore } from "@mastra/libsql";
|
|
|
9
9
|
const memory = new Memory({
|
|
10
10
|
// Configure storage
|
|
11
11
|
storage: new LibSQLStore({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
12
|
+
id: "learning-memory-storage",
|
|
13
|
+
url: "file:../../memory.db", // Local database. Relative to the output folder
|
|
15
14
|
}),
|
|
16
15
|
options: {
|
|
17
16
|
lastMessages: 20,
|