@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
|
@@ -13,7 +13,7 @@ Mastra Cloud captures execution data to help you monitor your application's beha
|
|
|
13
13
|
|
|
14
14
|
## Logs
|
|
15
15
|
|
|
16
|
-
You can view detailed logs for debugging and monitoring your application's behavior on the [Logs]
|
|
16
|
+
You can view detailed logs for debugging and monitoring your application's behavior on the [Logs]/docs/v1/mastra-cloud/dashboard#logs) page of the Dashboard.
|
|
17
17
|
|
|
18
18
|

|
|
19
19
|
|
|
@@ -23,11 +23,11 @@ Each log entry includes its severity level and a detailed message showing agent,
|
|
|
23
23
|
|
|
24
24
|
## Traces
|
|
25
25
|
|
|
26
|
-
More detailed traces are available for both agents and workflows by using a [logger]
|
|
26
|
+
More detailed traces are available for both agents and workflows by using a [logger]/docs/v1/logging) or enabling [observability]/docs/v1/observability/tracing/overview) using one of our [supported providers]/docs/v1/observability/tracing/overview#exporters).
|
|
27
27
|
|
|
28
28
|
### Agents
|
|
29
29
|
|
|
30
|
-
With a [logger]
|
|
30
|
+
With a [logger]/docs/v1/logging) enabled, you can view detailed outputs from your agents in the **Traces** section in Studio.
|
|
31
31
|
|
|
32
32
|

|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Tools passed to the agent during generation are standardized using `convertTools
|
|
|
37
37
|
|
|
38
38
|
### Workflows
|
|
39
39
|
|
|
40
|
-
With a [logger]
|
|
40
|
+
With a [logger]/docs/v1/logging) enabled, you can view detailed outputs from your workflows in the **Traces** section in Studio.
|
|
41
41
|
|
|
42
42
|

|
|
43
43
|
|
|
@@ -47,5 +47,5 @@ Workflows are created using `createWorkflow`, which sets up steps, metadata, and
|
|
|
47
47
|
|
|
48
48
|
## Next steps
|
|
49
49
|
|
|
50
|
-
- [Logging]
|
|
51
|
-
- [Tracing]
|
|
50
|
+
- [Logging]/docs/v1/logging)
|
|
51
|
+
- [Tracing]/docs/v1/observability/tracing/overview)
|
|
@@ -7,7 +7,7 @@ import { MastraCloudCallout } from "@site/src/components/MastraCloudCallout";
|
|
|
7
7
|
|
|
8
8
|
# Mastra Cloud
|
|
9
9
|
|
|
10
|
-
[Mastra Cloud](https://mastra.ai/cloud) is a platform for deploying, managing, monitoring, and debugging Mastra applications. When you [deploy](/docs/mastra-cloud/setting-up) your application, Mastra Cloud exposes your agents, tools, and workflows as REST API endpoints.
|
|
10
|
+
[Mastra Cloud](https://mastra.ai/cloud) is a platform for deploying, managing, monitoring, and debugging Mastra applications. When you [deploy](/docs/v1/mastra-cloud/setting-up) your application, Mastra Cloud exposes your agents, tools, and workflows as REST API endpoints.
|
|
11
11
|
|
|
12
12
|
<MastraCloudCallout />
|
|
13
13
|
|
|
@@ -62,4 +62,4 @@ Mastra Cloud is purpose-built for Mastra agents, tools, and workflows. It handle
|
|
|
62
62
|
|
|
63
63
|
## Next steps
|
|
64
64
|
|
|
65
|
-
- [Setting Up and Deploying](/docs/mastra-cloud/setting-up)
|
|
65
|
+
- [Setting Up and Deploying](/docs/v1/mastra-cloud/setting-up)
|
|
@@ -18,7 +18,7 @@ This page explains how to set up a project on [Mastra Cloud](https://mastra.ai/c
|
|
|
18
18
|
- A [Mastra Cloud](https://mastra.ai/cloud) account
|
|
19
19
|
- A GitHub account / repository containing a Mastra application
|
|
20
20
|
|
|
21
|
-
> See our [Getting started](/docs/getting-started/installation) guide to scaffold out a new Mastra project with sensible defaults.
|
|
21
|
+
> See our [Getting started](/docs/v1/getting-started/installation) guide to scaffold out a new Mastra project with sensible defaults.
|
|
22
22
|
|
|
23
23
|
## Setup and Deploy process
|
|
24
24
|
|
|
@@ -73,7 +73,7 @@ Mastra Cloud automatically detects the right build settings, but you can customi
|
|
|
73
73
|
- **Install command**: Runs pre-build to install project dependencies
|
|
74
74
|
- **Project setup command**: Runs pre-build to prepare any external dependencies
|
|
75
75
|
- **Port**: The network port the server will use
|
|
76
|
-
- **Store settings**: Use Mastra Cloud's built-in [LibSQLStore](/docs/server-db/storage) storage
|
|
76
|
+
- **Store settings**: Use Mastra Cloud's built-in [LibSQLStore](/docs/v1/server-db/storage) storage
|
|
77
77
|
- **Deploy Project**: Starts the deployment process
|
|
78
78
|
|
|
79
79
|
</StepItem>
|
|
@@ -98,8 +98,8 @@ Your project is now configured with automatic deployments which occur whenever y
|
|
|
98
98
|
|
|
99
99
|
## Testing your application
|
|
100
100
|
|
|
101
|
-
After a successful deployment you can test your agents and workflows [Studio](/docs/mastra-cloud/dashboard#studio) in Mastra Cloud, or interact with them using our [Client SDK](/docs/server-db/mastra-client).
|
|
101
|
+
After a successful deployment you can test your agents and workflows [Studio](/docs/v1/mastra-cloud/dashboard#studio) in Mastra Cloud, or interact with them using our [Client SDK](/docs/v1/server-db/mastra-client).
|
|
102
102
|
|
|
103
103
|
## Next steps
|
|
104
104
|
|
|
105
|
-
- [Navigating the Dashboard](/docs/mastra-cloud/dashboard)
|
|
105
|
+
- [Navigating the Dashboard](/docs/v1/mastra-cloud/dashboard)
|
|
@@ -24,6 +24,8 @@ import { Agent } from "@mastra/core/agent";
|
|
|
24
24
|
import { openai } from "@ai-sdk/openai";
|
|
25
25
|
|
|
26
26
|
const agent = new Agent({
|
|
27
|
+
id: "test-agent",
|
|
28
|
+
name: "Test Agent",
|
|
27
29
|
model: openai("gpt-4o"),
|
|
28
30
|
memory: new Memory({
|
|
29
31
|
processors: [
|
|
@@ -103,9 +105,8 @@ const memoryWithMultipleProcessors = new Memory({
|
|
|
103
105
|
You can create custom logic by extending the base `MemoryProcessor` class.
|
|
104
106
|
|
|
105
107
|
```typescript copy showLineNumbers {5-20,24-27}
|
|
106
|
-
import { Memory } from "@mastra/memory";
|
|
107
|
-
import { CoreMessage
|
|
108
|
-
import { MemoryProcessor } from "@mastra/core/memory";
|
|
108
|
+
import { Memory, MemoryProcessorOpts, MemoryProcessor } from "@mastra/memory";
|
|
109
|
+
import { CoreMessage } from "@mastra/core/llm";
|
|
109
110
|
|
|
110
111
|
class ConversationOnlyFilter extends MemoryProcessor {
|
|
111
112
|
constructor() {
|
|
@@ -22,12 +22,13 @@ npm install @mastra/core @mastra/memory @mastra/libsql
|
|
|
22
22
|
Then add a storage adapter to the main Mastra instance. Any agent with memory enabled will use this shared storage to store and recall interactions.
|
|
23
23
|
|
|
24
24
|
```typescript {6-8} title="src/mastra/index.ts" showLineNumbers copy
|
|
25
|
-
import { Mastra } from "@mastra/core
|
|
25
|
+
import { Mastra } from "@mastra/core";
|
|
26
26
|
import { LibSQLStore } from "@mastra/libsql";
|
|
27
27
|
|
|
28
28
|
export const mastra = new Mastra({
|
|
29
29
|
// ...
|
|
30
30
|
storage: new LibSQLStore({
|
|
31
|
+
id: 'mastra-storage',
|
|
31
32
|
url: ":memory:",
|
|
32
33
|
}),
|
|
33
34
|
});
|
|
@@ -40,6 +41,7 @@ import { Memory } from "@mastra/memory";
|
|
|
40
41
|
import { Agent } from "@mastra/core/agent";
|
|
41
42
|
|
|
42
43
|
export const testAgent = new Agent({
|
|
44
|
+
id: "test-agent",
|
|
43
45
|
// ...
|
|
44
46
|
memory: new Memory(),
|
|
45
47
|
});
|
|
@@ -61,13 +63,13 @@ Mastra combines all memory types into a single context window. If the total exce
|
|
|
61
63
|
|
|
62
64
|
## Scoping memory with threads and resources
|
|
63
65
|
|
|
64
|
-
All memory types are [
|
|
66
|
+
All memory types are [resource-scoped](./working-memory#resource-scoped-memory-default) by default, meaning they persist across all conversations for the same user or entity. [Thread-scoped](./working-memory#thread-scoped-memory) configuration isolates memory to a single conversation thread.
|
|
65
67
|
|
|
66
68
|
## Memory Storage Adapters
|
|
67
69
|
|
|
68
70
|
To persist and recall information between conversations, memory requires a storage adapter.
|
|
69
71
|
|
|
70
|
-
Supported options include [LibSQL](/docs/memory/storage/memory-with-libsql), [MongoDB](/examples/memory/memory-with-mongodb), [Postgres](/docs/memory/storage/memory-with-pg), and [Upstash](/docs/memory/storage/memory-with-upstash)
|
|
72
|
+
Supported options include [LibSQL](/docs/v1/memory/storage/memory-with-libsql), [MongoDB](/examples/v1/memory/memory-with-mongodb), [Postgres](/docs/v1/memory/storage/memory-with-pg), and [Upstash](/docs/v1/memory/storage/memory-with-upstash)
|
|
71
73
|
|
|
72
74
|
We use LibSQL out of the box because it is file-based or in-memory, so it is easy to install and works well with Studio.
|
|
73
75
|
|
|
@@ -85,10 +87,12 @@ import { Agent } from "@mastra/core/agent";
|
|
|
85
87
|
import { LibSQLStore } from "@mastra/libsql";
|
|
86
88
|
|
|
87
89
|
export const testAgent = new Agent({
|
|
90
|
+
id: "test-agent",
|
|
88
91
|
// ...
|
|
89
92
|
memory: new Memory({
|
|
90
93
|
// ...
|
|
91
94
|
storage: new LibSQLStore({
|
|
95
|
+
id: 'test-agent-storage',
|
|
92
96
|
url: "file:agent-memory.db",
|
|
93
97
|
}),
|
|
94
98
|
// ...
|
|
@@ -102,7 +106,7 @@ If tracing is enabled in your Mastra deployment and memory is configured either
|
|
|
102
106
|
|
|
103
107
|
This is helpful for debugging, understanding agent decisions, and verifying that the agent is retrieving the right information for each request.
|
|
104
108
|
|
|
105
|
-
For more details on enabling and configuring tracing, see [
|
|
109
|
+
For more details on enabling and configuring tracing, see [Tracing](../observability/tracing/overview).
|
|
106
110
|
|
|
107
111
|
## Local development with LibSQL
|
|
108
112
|
|
|
@@ -114,4 +118,4 @@ For local development with `LibSQLStore`, you can inspect stored memory using th
|
|
|
114
118
|
|
|
115
119
|
Now that you understand the core concepts, continue to [semantic recall](./semantic-recall) to learn how to add RAG memory to your Mastra agents.
|
|
116
120
|
|
|
117
|
-
Alternatively you can visit the [configuration reference](/reference/memory/memory-class) for available options.
|
|
121
|
+
Alternatively you can visit the [configuration reference](/reference/v1/memory/memory-class) for available options.
|
|
@@ -36,6 +36,7 @@ import { Memory } from "@mastra/memory";
|
|
|
36
36
|
import { openai } from "@ai-sdk/openai";
|
|
37
37
|
|
|
38
38
|
const agent = new Agent({
|
|
39
|
+
id: "support-agent",
|
|
39
40
|
name: "SupportAgent",
|
|
40
41
|
instructions: "You are a helpful support agent.",
|
|
41
42
|
model: openai("gpt-4o"),
|
|
@@ -67,7 +68,7 @@ const agent = new Agent({
|
|
|
67
68
|
|
|
68
69
|
### Storage configuration
|
|
69
70
|
|
|
70
|
-
Semantic recall relies on a [storage and vector db](/reference/memory/memory-class) to store messages and their embeddings.
|
|
71
|
+
Semantic recall relies on a [storage and vector db](/reference/v1/memory/memory-class) to store messages and their embeddings.
|
|
71
72
|
|
|
72
73
|
```ts {8-17}
|
|
73
74
|
import { Memory } from "@mastra/memory";
|
|
@@ -78,10 +79,12 @@ const agent = new Agent({
|
|
|
78
79
|
memory: new Memory({
|
|
79
80
|
// this is the default storage db if omitted
|
|
80
81
|
storage: new LibSQLStore({
|
|
82
|
+
id: 'agent-storage',
|
|
81
83
|
url: "file:./local.db",
|
|
82
84
|
}),
|
|
83
85
|
// this is the default vector db if omitted
|
|
84
86
|
vector: new LibSQLVector({
|
|
87
|
+
id: 'agent-vector',
|
|
85
88
|
connectionUrl: "file:./local.db",
|
|
86
89
|
}),
|
|
87
90
|
}),
|
|
@@ -90,14 +93,14 @@ const agent = new Agent({
|
|
|
90
93
|
|
|
91
94
|
**Storage/vector code Examples**:
|
|
92
95
|
|
|
93
|
-
- [LibSQL](/docs/memory/storage/memory-with-libsql)
|
|
94
|
-
- [MongoDB](/examples/memory/memory-with-mongodb)
|
|
95
|
-
- [Postgres](/docs/memory/storage/memory-with-pg)
|
|
96
|
-
- [Upstash](/docs/memory/storage/memory-with-upstash)
|
|
96
|
+
- [LibSQL](/docs/v1/memory/storage/memory-with-libsql)
|
|
97
|
+
- [MongoDB](/examples/v1/memory/memory-with-mongodb)
|
|
98
|
+
- [Postgres](/docs/v1/memory/storage/memory-with-pg)
|
|
99
|
+
- [Upstash](/docs/v1/memory/storage/memory-with-upstash)
|
|
97
100
|
|
|
98
101
|
### Embedder configuration
|
|
99
102
|
|
|
100
|
-
Semantic recall relies on an [embedding model](/reference/memory/memory-class) to convert messages into embeddings. Mastra supports embedding models through the model router using `provider/model` strings, or you can use any [embedding model](https://sdk.vercel.ai/docs/ai-sdk-core/embeddings) compatible with the AI SDK.
|
|
103
|
+
Semantic recall relies on an [embedding model](/reference/v1/memory/memory-class) to convert messages into embeddings. Mastra supports embedding models through the model router using `provider/model` strings, or you can use any [embedding model](https://sdk.vercel.ai/docs/ai-sdk-core/embeddings) compatible with the AI SDK.
|
|
101
104
|
|
|
102
105
|
#### Using the Model Router (Recommended)
|
|
103
106
|
|
|
@@ -175,9 +178,11 @@ import { PgStore, PgVector } from "@mastra/pg";
|
|
|
175
178
|
const agent = new Agent({
|
|
176
179
|
memory: new Memory({
|
|
177
180
|
storage: new PgStore({
|
|
181
|
+
id: 'agent-storage',
|
|
178
182
|
connectionString: process.env.DATABASE_URL,
|
|
179
183
|
}),
|
|
180
184
|
vector: new PgVector({
|
|
185
|
+
id: 'agent-vector',
|
|
181
186
|
connectionString: process.env.DATABASE_URL,
|
|
182
187
|
}),
|
|
183
188
|
options: {
|
|
@@ -196,7 +201,7 @@ const agent = new Agent({
|
|
|
196
201
|
});
|
|
197
202
|
```
|
|
198
203
|
|
|
199
|
-
For detailed information about index configuration options and performance tuning, see the [PgVector configuration guide](/reference/vectors/pg#index-configuration-guide).
|
|
204
|
+
For detailed information about index configuration options and performance tuning, see the [PgVector configuration guide](/reference/v1/vectors/pg#index-configuration-guide).
|
|
200
205
|
|
|
201
206
|
### Disabling
|
|
202
207
|
|
|
@@ -32,16 +32,18 @@ import { openai } from "@ai-sdk/openai";
|
|
|
32
32
|
import { LibSQLStore } from "@mastra/libsql";
|
|
33
33
|
|
|
34
34
|
export const libsqlAgent = new Agent({
|
|
35
|
-
|
|
35
|
+
id: "libsql-agent",
|
|
36
|
+
name: "LibSQL Agent",
|
|
36
37
|
instructions:
|
|
37
38
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
38
39
|
model: openai("gpt-4o"),
|
|
39
40
|
memory: new Memory({
|
|
40
41
|
storage: new LibSQLStore({
|
|
42
|
+
id: 'libsql-agent-storage',
|
|
41
43
|
url: "file:libsql-agent.db",
|
|
42
44
|
}),
|
|
43
45
|
options: {
|
|
44
|
-
generateTitle: true,
|
|
46
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
45
47
|
},
|
|
46
48
|
}),
|
|
47
49
|
});
|
|
@@ -67,15 +69,18 @@ import { LibSQLStore, LibSQLVector } from "@mastra/libsql";
|
|
|
67
69
|
import { fastembed } from "@mastra/fastembed";
|
|
68
70
|
|
|
69
71
|
export const libsqlAgent = new Agent({
|
|
70
|
-
|
|
72
|
+
id: "libsql-agent",
|
|
73
|
+
name: "LibSQL Agent",
|
|
71
74
|
instructions:
|
|
72
75
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
73
76
|
model: openai("gpt-4o"),
|
|
74
77
|
memory: new Memory({
|
|
75
78
|
storage: new LibSQLStore({
|
|
79
|
+
id: 'libsql-agent-storage',
|
|
76
80
|
url: "file:libsql-agent.db",
|
|
77
81
|
}),
|
|
78
82
|
vector: new LibSQLVector({
|
|
83
|
+
id: 'libsql-agent-vector',
|
|
79
84
|
connectionUrl: "file:libsql-agent.db",
|
|
80
85
|
}),
|
|
81
86
|
embedder: fastembed,
|
|
@@ -86,7 +91,7 @@ export const libsqlAgent = new Agent({
|
|
|
86
91
|
messageRange: 2,
|
|
87
92
|
},
|
|
88
93
|
threads: {
|
|
89
|
-
generateTitle: true,
|
|
94
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
90
95
|
},
|
|
91
96
|
},
|
|
92
97
|
}),
|
|
@@ -137,4 +142,4 @@ for await (const chunk of stream.textStream) {
|
|
|
137
142
|
|
|
138
143
|
## Related
|
|
139
144
|
|
|
140
|
-
- [Calling Agents](/examples/agents/calling-agents)
|
|
145
|
+
- [Calling Agents](/examples/v1/agents/calling-agents)
|
|
@@ -33,16 +33,18 @@ import { openai } from "@ai-sdk/openai";
|
|
|
33
33
|
import { PostgresStore } from "@mastra/pg";
|
|
34
34
|
|
|
35
35
|
export const pgAgent = new Agent({
|
|
36
|
-
|
|
36
|
+
id: "pg-agent",
|
|
37
|
+
name: "PG Agent",
|
|
37
38
|
instructions:
|
|
38
39
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
39
40
|
model: openai("gpt-4o"),
|
|
40
41
|
memory: new Memory({
|
|
41
42
|
storage: new PostgresStore({
|
|
43
|
+
id: 'pg-agent-storage',
|
|
42
44
|
connectionString: process.env.DATABASE_URL!,
|
|
43
45
|
}),
|
|
44
46
|
options: {
|
|
45
|
-
generateTitle: true,
|
|
47
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
46
48
|
},
|
|
47
49
|
}),
|
|
48
50
|
});
|
|
@@ -68,15 +70,18 @@ import { PostgresStore, PgVector } from "@mastra/pg";
|
|
|
68
70
|
import { fastembed } from "@mastra/fastembed";
|
|
69
71
|
|
|
70
72
|
export const pgAgent = new Agent({
|
|
71
|
-
|
|
73
|
+
id: "pg-agent",
|
|
74
|
+
name: "PG Agent",
|
|
72
75
|
instructions:
|
|
73
76
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
74
77
|
model: openai("gpt-4o"),
|
|
75
78
|
memory: new Memory({
|
|
76
79
|
storage: new PostgresStore({
|
|
80
|
+
id: 'pg-agent-storage',
|
|
77
81
|
connectionString: process.env.DATABASE_URL!,
|
|
78
82
|
}),
|
|
79
83
|
vector: new PgVector({
|
|
84
|
+
id: 'pg-agent-vector',
|
|
80
85
|
connectionString: process.env.DATABASE_URL!,
|
|
81
86
|
}),
|
|
82
87
|
embedder: fastembed,
|
|
@@ -135,4 +140,4 @@ for await (const chunk of stream.textStream) {
|
|
|
135
140
|
|
|
136
141
|
## Related
|
|
137
142
|
|
|
138
|
-
- [Calling Agents](/examples/agents/calling-agents)
|
|
143
|
+
- [Calling Agents](/examples/v1/agents/calling-agents)
|
|
@@ -38,17 +38,19 @@ import { openai } from "@ai-sdk/openai";
|
|
|
38
38
|
import { UpstashStore } from "@mastra/upstash";
|
|
39
39
|
|
|
40
40
|
export const upstashAgent = new Agent({
|
|
41
|
-
|
|
41
|
+
id: "upstash-agent",
|
|
42
|
+
name: "Upstash Agent",
|
|
42
43
|
instructions:
|
|
43
44
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
44
45
|
model: openai("gpt-4o"),
|
|
45
46
|
memory: new Memory({
|
|
46
47
|
storage: new UpstashStore({
|
|
48
|
+
id: 'upstash-agent-storage',
|
|
47
49
|
url: process.env.UPSTASH_REDIS_REST_URL!,
|
|
48
50
|
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
|
|
49
51
|
}),
|
|
50
52
|
options: {
|
|
51
|
-
generateTitle: true,
|
|
53
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
52
54
|
},
|
|
53
55
|
}),
|
|
54
56
|
});
|
|
@@ -74,16 +76,19 @@ import { UpstashStore, UpstashVector } from "@mastra/upstash";
|
|
|
74
76
|
import { fastembed } from "@mastra/fastembed";
|
|
75
77
|
|
|
76
78
|
export const upstashAgent = new Agent({
|
|
77
|
-
|
|
79
|
+
id: "upstash-agent",
|
|
80
|
+
name: "Upstash Agent",
|
|
78
81
|
instructions:
|
|
79
82
|
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
80
83
|
model: openai("gpt-4o"),
|
|
81
84
|
memory: new Memory({
|
|
82
85
|
storage: new UpstashStore({
|
|
86
|
+
id: 'upstash-agent-storage',
|
|
83
87
|
url: process.env.UPSTASH_REDIS_REST_URL!,
|
|
84
88
|
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
|
|
85
89
|
}),
|
|
86
90
|
vector: new UpstashVector({
|
|
91
|
+
id: 'upstash-agent-vector',
|
|
87
92
|
url: process.env.UPSTASH_VECTOR_REST_URL!,
|
|
88
93
|
token: process.env.UPSTASH_VECTOR_REST_TOKEN!,
|
|
89
94
|
}),
|
|
@@ -143,4 +148,4 @@ for await (const chunk of stream.textStream) {
|
|
|
143
148
|
|
|
144
149
|
## Related
|
|
145
150
|
|
|
146
|
-
- [Calling Agents](/examples/agents/calling-agents)
|
|
151
|
+
- [Calling Agents](/examples/v1/agents/calling-agents)
|
|
@@ -10,13 +10,13 @@ Mastra organizes memory into threads, which are records that group related inter
|
|
|
10
10
|
1. **`thread`**: A globally unique ID representing the conversation (e.g., `support_123`). Must be unique across all resources.
|
|
11
11
|
2. **`resource`**: The user or entity that owns the thread (e.g., `user_123`, `org_456`).
|
|
12
12
|
|
|
13
|
-
The `resource` is especially important for [resource-scoped memory](./working-memory#resource-scoped-memory), which allows memory to persist across all threads associated with the same user or entity.
|
|
13
|
+
The `resource` is especially important for [resource-scoped memory](./working-memory#resource-scoped-memory-default), which allows memory to persist across all threads associated with the same user or entity.
|
|
14
14
|
|
|
15
15
|
```typescript {4} showLineNumbers
|
|
16
16
|
const stream = await agent.stream("message for agent", {
|
|
17
17
|
memory: {
|
|
18
|
-
thread: "
|
|
19
|
-
resource: "
|
|
18
|
+
thread: "conversation-123",
|
|
19
|
+
resource: "user-123",
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
```
|
|
@@ -31,21 +31,19 @@ Even with memory configured, agents won’t store or recall information unless b
|
|
|
31
31
|
|
|
32
32
|
### Thread title generation
|
|
33
33
|
|
|
34
|
-
Mastra can automatically generate descriptive thread titles based on the user's first message. Enable it by setting `generateTitle` to `true`. This improves organization and makes it easier to display conversations in your UI.
|
|
34
|
+
Mastra can automatically generate descriptive thread titles based on the user's first message. This feature is disabled by default. Enable it by setting `generateTitle` to `true`. This improves organization and makes it easier to display conversations in your UI.
|
|
35
35
|
|
|
36
36
|
```typescript {3-7} showLineNumbers
|
|
37
37
|
export const testAgent = new Agent({
|
|
38
38
|
memory: new Memory({
|
|
39
39
|
options: {
|
|
40
|
-
|
|
41
|
-
generateTitle: true,
|
|
42
|
-
}
|
|
40
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
43
41
|
},
|
|
44
42
|
}),
|
|
45
43
|
});
|
|
46
44
|
```
|
|
47
45
|
|
|
48
|
-
> Title generation runs asynchronously after the agent responds and does not affect response time. See the [full configuration reference](/reference/memory/memory-class) for details and examples.
|
|
46
|
+
> Title generation runs asynchronously after the agent responds and does not affect response time. See the [full configuration reference](/reference/v1/memory/memory-class) for details and examples.
|
|
49
47
|
|
|
50
48
|
#### Optimizing title generation
|
|
51
49
|
|
|
@@ -70,7 +68,7 @@ export const testAgent = new Agent({
|
|
|
70
68
|
|
|
71
69
|
#### Dynamic model selection and instructions
|
|
72
70
|
|
|
73
|
-
You can configure thread title generation dynamically by passing functions to `model` and `instructions`. These functions receive the `
|
|
71
|
+
You can configure thread title generation dynamically by passing functions to `model` and `instructions`. These functions receive the `requestContext` object, allowing you to adapt title generation based on user-specific values.
|
|
74
72
|
|
|
75
73
|
```typescript {7-16} showLineNumbers
|
|
76
74
|
export const testAgent = new Agent({
|
|
@@ -79,14 +77,14 @@ export const testAgent = new Agent({
|
|
|
79
77
|
options: {
|
|
80
78
|
threads: {
|
|
81
79
|
generateTitle: {
|
|
82
|
-
model: ({
|
|
83
|
-
const userTier =
|
|
80
|
+
model: ({ requestContext }) => {
|
|
81
|
+
const userTier = requestContext.get("userTier");
|
|
84
82
|
return userTier === "premium"
|
|
85
83
|
? openai("gpt-4.1")
|
|
86
84
|
: openai("gpt-4.1-nano");
|
|
87
85
|
},
|
|
88
|
-
instructions: ({
|
|
89
|
-
const language =
|
|
86
|
+
instructions: ({ requestContext }) => {
|
|
87
|
+
const language = requestContext.get("userLanguage") || "English";
|
|
90
88
|
return `Generate a concise, engaging title in ${language} based on the user's first message.`;
|
|
91
89
|
},
|
|
92
90
|
},
|
|
@@ -7,7 +7,7 @@ import YouTube from "@site/src/components/YouTube-player";
|
|
|
7
7
|
|
|
8
8
|
# Working Memory
|
|
9
9
|
|
|
10
|
-
While [conversation history](/docs/memory/conversation-history) and [semantic recall](./semantic-recall) help agents remember conversations, working memory allows them to maintain persistent information about users across interactions.
|
|
10
|
+
While [conversation history](/docs/v1/memory/conversation-history) and [semantic recall](./semantic-recall) help agents remember conversations, working memory allows them to maintain persistent information about users across interactions.
|
|
11
11
|
|
|
12
12
|
Think of it as the agent's active thoughts or scratchpad – the key information they keep available about the user or task. It's similar to how a person would naturally remember someone's name, preferences, or important details during a conversation.
|
|
13
13
|
|
|
@@ -15,8 +15,8 @@ This is useful for maintaining ongoing state that's always relevant and should a
|
|
|
15
15
|
|
|
16
16
|
Working memory can persist at two different scopes:
|
|
17
17
|
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
18
|
+
- **Resource-scoped** (default): Memory persists across all conversation threads for the same user
|
|
19
|
+
- **Thread-scoped**: Memory is isolated per conversation thread
|
|
20
20
|
|
|
21
21
|
**Important:** Switching between scopes means the agent won't see memory from the other scope - thread-scoped memory is completely separate from resource-scoped memory.
|
|
22
22
|
|
|
@@ -31,6 +31,7 @@ import { openai } from "@ai-sdk/openai";
|
|
|
31
31
|
|
|
32
32
|
// Create agent with working memory enabled
|
|
33
33
|
const agent = new Agent({
|
|
34
|
+
id: "personal-assistant",
|
|
34
35
|
name: "PersonalAssistant",
|
|
35
36
|
instructions: "You are a helpful personal assistant.",
|
|
36
37
|
model: openai("gpt-4o"),
|
|
@@ -54,9 +55,9 @@ Working memory is a block of Markdown text that the agent is able to update over
|
|
|
54
55
|
|
|
55
56
|
Working memory can operate in two different scopes, allowing you to choose how memory persists across conversations:
|
|
56
57
|
|
|
57
|
-
###
|
|
58
|
+
### Resource-Scoped Memory (Default)
|
|
58
59
|
|
|
59
|
-
By default, working memory
|
|
60
|
+
By default, working memory persists across all conversation threads for the same user (resourceId), enabling persistent user memory:
|
|
60
61
|
|
|
61
62
|
```typescript
|
|
62
63
|
const memory = new Memory({
|
|
@@ -64,11 +65,13 @@ const memory = new Memory({
|
|
|
64
65
|
options: {
|
|
65
66
|
workingMemory: {
|
|
66
67
|
enabled: true,
|
|
67
|
-
scope:
|
|
68
|
+
scope: "resource", // Memory persists across all user threads
|
|
68
69
|
template: `# User Profile
|
|
69
70
|
- **Name**:
|
|
71
|
+
- **Location**:
|
|
70
72
|
- **Interests**:
|
|
71
|
-
- **
|
|
73
|
+
- **Preferences**:
|
|
74
|
+
- **Long-term Goals**:
|
|
72
75
|
`,
|
|
73
76
|
},
|
|
74
77
|
},
|
|
@@ -76,13 +79,26 @@ const memory = new Memory({
|
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
**Use cases:**
|
|
79
|
-
- Different conversations about separate topics
|
|
80
|
-
- Temporary or session-specific information
|
|
81
|
-
- Workflows where each thread needs working memory but threads are ephemeral and not related to each other
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
- Personal assistants that remember user preferences
|
|
84
|
+
- Customer service bots that maintain customer context
|
|
85
|
+
- Educational applications that track student progress
|
|
86
|
+
|
|
87
|
+
### Usage with Agents
|
|
88
|
+
|
|
89
|
+
When using resource-scoped memory, make sure to pass the `resourceId` parameter:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// Resource-scoped memory requires resourceId
|
|
93
|
+
const response = await agent.generate("Hello!", {
|
|
94
|
+
threadId: "conversation-123",
|
|
95
|
+
resourceId: "user-alice-456", // Same user across different threads
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Thread-Scoped Memory
|
|
84
100
|
|
|
85
|
-
|
|
101
|
+
Thread-scoped memory isolates working memory to individual conversation threads. Each thread maintains its own isolated memory:
|
|
86
102
|
|
|
87
103
|
```typescript
|
|
88
104
|
const memory = new Memory({
|
|
@@ -362,6 +378,6 @@ await memory.updateWorkingMemory({
|
|
|
362
378
|
|
|
363
379
|
## Examples
|
|
364
380
|
|
|
365
|
-
- [Working memory with template](/examples/memory/working-memory-template)
|
|
366
|
-
- [Working memory with schema](/examples/memory/working-memory-schema)
|
|
381
|
+
- [Working memory with template](/examples/v1/memory/working-memory-template)
|
|
382
|
+
- [Working memory with schema](/examples/v1/memory/working-memory-schema)
|
|
367
383
|
- [Per-resource working memory](https://github.com/mastra-ai/mastra/tree/main/examples/memory-per-resource-example) - Complete example showing resource-scoped memory persistence
|
|
@@ -9,62 +9,45 @@ Mastra provides comprehensive observability features designed specifically for A
|
|
|
9
9
|
|
|
10
10
|
## Key Features
|
|
11
11
|
|
|
12
|
-
###
|
|
13
|
-
|
|
14
|
-
Debug applications with contextual logging:
|
|
15
|
-
|
|
16
|
-
- **Context propagation**: Automatic correlation with traces
|
|
17
|
-
- **Configurable levels**: Filter by severity in development and production
|
|
18
|
-
|
|
19
|
-
### AI Tracing
|
|
12
|
+
### Tracing
|
|
20
13
|
|
|
21
14
|
Specialized tracing for AI operations that captures:
|
|
22
15
|
|
|
23
|
-
- **
|
|
16
|
+
- **Model interactions**: Token usage, latency, prompts, and completions
|
|
24
17
|
- **Agent execution**: Decision paths, tool calls, and memory operations
|
|
25
18
|
- **Workflow steps**: Branching logic, parallel execution, and step outputs
|
|
26
19
|
- **Automatic instrumentation**: Zero-configuration tracing with decorators
|
|
27
20
|
|
|
28
|
-
### OTEL Tracing
|
|
29
|
-
|
|
30
|
-
Traditional distributed tracing with OpenTelemetry:
|
|
31
|
-
|
|
32
|
-
- **Standard OTLP protocol**: Compatible with existing observability infrastructure
|
|
33
|
-
- **HTTP and database instrumentation**: Automatic spans for common operations
|
|
34
|
-
- **Provider integrations**: Datadog, New Relic, Jaeger, and other OTLP collectors
|
|
35
|
-
- **Distributed context**: W3C Trace Context propagation
|
|
36
|
-
|
|
37
21
|
## Quick Start
|
|
38
22
|
|
|
39
23
|
Configure Observability in your Mastra instance:
|
|
40
24
|
|
|
41
25
|
```typescript title="src/mastra/index.ts"
|
|
42
26
|
import { Mastra } from "@mastra/core";
|
|
43
|
-
import { PinoLogger } from "@mastra/
|
|
27
|
+
import { PinoLogger } from "@mastra/loggers";
|
|
44
28
|
import { LibSqlStorage } from "@mastra/libsql";
|
|
29
|
+
import { Observability } from "@mastra/observability";
|
|
45
30
|
|
|
46
31
|
export const mastra = new Mastra({
|
|
47
32
|
// ... other config
|
|
48
33
|
logger: new PinoLogger(),
|
|
49
|
-
observability: {
|
|
50
|
-
default: { enabled: true }, // Enables AI Tracing
|
|
51
|
-
},
|
|
52
34
|
storage: new LibSQLStore({
|
|
35
|
+
id: 'mastra-storage',
|
|
53
36
|
url: "file:./mastra.db", // Storage is required for tracing
|
|
54
37
|
}),
|
|
55
|
-
|
|
56
|
-
enabled: true,
|
|
57
|
-
},
|
|
38
|
+
observability: new Observability({ // Enables Tracing
|
|
39
|
+
default: { enabled: true },
|
|
40
|
+
}),
|
|
58
41
|
});
|
|
59
42
|
```
|
|
60
43
|
|
|
61
44
|
With this basic setup, you will see Traces and Logs in both Studio and in Mastra Cloud.
|
|
62
45
|
|
|
63
|
-
We also support various external tracing providers like Langfuse, Braintrust, and any OpenTelemetry-compatible platform (Datadog, New Relic, SigNoz, etc.). See more about this in the [
|
|
46
|
+
We also support various external tracing providers like Langfuse, Braintrust, and any OpenTelemetry-compatible platform (Datadog, New Relic, SigNoz, etc.). See more about this in the [Tracing]/docs/v1/observability/tracing/overview) documentation.
|
|
64
47
|
|
|
65
48
|
## What's Next?
|
|
66
49
|
|
|
67
|
-
- **[Set up
|
|
68
|
-
- **[Configure Logging]
|
|
69
|
-
- **[View Examples]
|
|
70
|
-
- **[API Reference]
|
|
50
|
+
- **[Set up Tracing]/docs/v1/observability/tracing/overview)**: Configure tracing for your application
|
|
51
|
+
- **[Configure Logging]/docs/v1/logging)**: Add structured logging
|
|
52
|
+
- **[View Examples]/examples/v1/observability/basic-tracing)**: See observability in action
|
|
53
|
+
- **[API Reference]/reference/v1/observability/tracing/instances)**: Detailed configuration options
|