@mastra/mcp-docs-server 1.0.0-beta.13 → 1.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +78 -78
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +173 -173
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +248 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +338 -338
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +139 -139
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +102 -102
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Freact.md +77 -70
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +218 -218
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +195 -195
- package/.docs/organized/changelogs/create-mastra.md +13 -13
- package/.docs/organized/changelogs/mastra.md +56 -56
- package/.docs/organized/code-examples/agent-v6.md +210 -0
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +10 -6
- package/.docs/raw/agents/agent-approval.mdx +5 -6
- package/.docs/raw/agents/agent-memory.mdx +22 -30
- package/.docs/raw/agents/guardrails.mdx +60 -50
- package/.docs/raw/agents/networks.mdx +8 -12
- package/.docs/raw/agents/overview.mdx +39 -23
- package/.docs/raw/agents/processors.mdx +20 -19
- package/.docs/raw/agents/structured-output.mdx +11 -7
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/deployment/mastra-server.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -1
- package/.docs/raw/deployment/web-framework.mdx +4 -6
- package/.docs/raw/deployment/workflow-runners.mdx +14 -0
- package/.docs/raw/evals/custom-scorers.mdx +9 -6
- package/.docs/raw/evals/overview.mdx +3 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +30 -30
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
- package/.docs/raw/guides/deployment/amazon-ec2.mdx +9 -9
- package/.docs/raw/guides/deployment/aws-lambda.mdx +11 -11
- package/.docs/raw/guides/deployment/azure-app-services.mdx +2 -2
- package/.docs/raw/guides/deployment/cloudflare-deployer.mdx +5 -6
- package/.docs/raw/guides/deployment/digital-ocean.mdx +10 -10
- package/.docs/raw/guides/deployment/index.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +444 -0
- package/.docs/raw/guides/deployment/netlify-deployer.mdx +4 -4
- package/.docs/raw/guides/deployment/vercel-deployer.mdx +5 -6
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +7 -7
- package/.docs/raw/guides/getting-started/hono.mdx +18 -18
- package/.docs/raw/guides/getting-started/next-js.mdx +19 -20
- package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +21 -21
- package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
- package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
- package/.docs/raw/guides/guide/research-assistant.mdx +13 -13
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +8 -8
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +41 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mastra-cloud/deployment.mdx +39 -0
- package/.docs/raw/mastra-cloud/observability.mdx +9 -15
- package/.docs/raw/mastra-cloud/overview.mdx +14 -44
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +31 -13
- package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
- package/.docs/raw/memory/memory-processors.mdx +9 -9
- package/.docs/raw/memory/message-history.mdx +69 -0
- package/.docs/raw/memory/overview.mdx +34 -76
- package/.docs/raw/memory/semantic-recall.mdx +58 -49
- package/.docs/raw/memory/storage.mdx +188 -0
- package/.docs/raw/memory/working-memory.mdx +7 -7
- package/.docs/raw/observability/logging.mdx +9 -10
- package/.docs/raw/observability/overview.mdx +0 -1
- package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
- package/.docs/raw/observability/tracing/overview.mdx +23 -25
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/rag/chunking-and-embedding.mdx +6 -6
- package/.docs/raw/rag/graph-rag.mdx +7 -7
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +21 -22
- package/.docs/raw/rag/vector-databases.mdx +22 -22
- package/.docs/raw/reference/agents/agent.mdx +3 -3
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +2 -2
- package/.docs/raw/reference/agents/getMemory.mdx +2 -2
- package/.docs/raw/reference/agents/getModel.mdx +2 -2
- package/.docs/raw/reference/agents/getTools.mdx +2 -2
- package/.docs/raw/reference/agents/getVoice.mdx +2 -2
- package/.docs/raw/reference/agents/listAgents.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +2 -2
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/network-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +2 -2
- package/.docs/raw/reference/auth/auth0.mdx +1 -2
- package/.docs/raw/reference/auth/clerk.mdx +1 -2
- package/.docs/raw/reference/auth/firebase.mdx +2 -4
- package/.docs/raw/reference/auth/jwt.mdx +1 -2
- package/.docs/raw/reference/auth/supabase.mdx +1 -2
- package/.docs/raw/reference/auth/workos.mdx +1 -2
- package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
- package/.docs/raw/reference/cli/mastra.mdx +9 -9
- package/.docs/raw/reference/client-js/agents.mdx +1 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +1 -1
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
- package/.docs/raw/reference/core/getMemory.mdx +2 -2
- package/.docs/raw/reference/core/getServer.mdx +1 -1
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
- package/.docs/raw/reference/core/listMemory.mdx +2 -2
- package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +2 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
- package/.docs/raw/reference/memory/createThread.mdx +2 -2
- package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +3 -3
- package/.docs/raw/reference/memory/query.mdx +2 -2
- package/.docs/raw/reference/memory/recall.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +2 -2
- package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
- package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
- package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +40 -19
- package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +2 -2
- package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
- package/.docs/raw/reference/server/create-route.mdx +13 -13
- package/.docs/raw/reference/server/express-adapter.mdx +6 -7
- package/.docs/raw/reference/server/hono-adapter.mdx +6 -7
- package/.docs/raw/reference/server/mastra-server.mdx +20 -20
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +7 -5
- package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
- package/.docs/raw/reference/storage/convex.mdx +6 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
- package/.docs/raw/reference/storage/lance.mdx +6 -5
- package/.docs/raw/reference/storage/libsql.mdx +72 -54
- package/.docs/raw/reference/storage/mongodb.mdx +84 -9
- package/.docs/raw/reference/storage/mssql.mdx +8 -6
- package/.docs/raw/{memory → reference}/storage/overview.mdx +12 -110
- package/.docs/raw/reference/storage/postgresql.mdx +82 -9
- package/.docs/raw/reference/storage/upstash.mdx +74 -2
- package/.docs/raw/reference/streaming/agents/stream.mdx +5 -5
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
- package/.docs/raw/reference/templates/overview.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +1 -4
- package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
- package/.docs/raw/reference/vectors/astra.mdx +3 -3
- package/.docs/raw/reference/vectors/chroma.mdx +3 -3
- package/.docs/raw/reference/vectors/convex.mdx +12 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
- package/.docs/raw/reference/vectors/lance.mdx +4 -4
- package/.docs/raw/reference/vectors/libsql.mdx +61 -11
- package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
- package/.docs/raw/reference/vectors/pg.mdx +53 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
- package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
- package/.docs/raw/reference/vectors/upstash.mdx +55 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
- 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 +6 -6
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
- 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 +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow.mdx +3 -3
- package/.docs/raw/server/auth/auth0.mdx +20 -14
- package/.docs/raw/server/auth/clerk.mdx +16 -9
- package/.docs/raw/server/auth/firebase.mdx +21 -15
- package/.docs/raw/server/auth/jwt.mdx +14 -7
- package/.docs/raw/server/auth/supabase.mdx +16 -9
- package/.docs/raw/server/auth/workos.mdx +19 -13
- package/.docs/raw/server/custom-adapters.mdx +10 -10
- package/.docs/raw/server/custom-api-routes.mdx +2 -4
- package/.docs/raw/server/mastra-client.mdx +24 -13
- package/.docs/raw/server/mastra-server.mdx +3 -3
- package/.docs/raw/server/middleware.mdx +7 -7
- package/.docs/raw/server/request-context.mdx +31 -30
- package/.docs/raw/server/server-adapters.mdx +6 -6
- package/.docs/raw/streaming/events.mdx +14 -7
- package/.docs/raw/streaming/overview.mdx +21 -10
- package/.docs/raw/streaming/tool-streaming.mdx +6 -6
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
- package/.docs/raw/tools-mcp/overview.mdx +9 -10
- package/.docs/raw/voice/overview.mdx +2 -2
- package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
- package/.docs/raw/workflows/control-flow.mdx +27 -40
- package/.docs/raw/workflows/error-handling.mdx +15 -22
- package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
- package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
- package/.docs/raw/workflows/overview.mdx +34 -23
- package/.docs/raw/workflows/snapshots.mdx +16 -45
- package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
- package/.docs/raw/workflows/time-travel.mdx +16 -16
- package/.docs/raw/workflows/workflow-state.mdx +5 -8
- package/CHANGELOG.md +16 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/stdio.js +53 -0
- package/package.json +3 -3
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -102
- package/.docs/raw/memory/conversation-history.mdx +0 -24
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
|
@@ -9,13 +9,13 @@ The MSSQL storage implementation provides a production-ready storage solution us
|
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
|
-
```bash
|
|
12
|
+
```bash
|
|
13
13
|
npm install @mastra/mssql@beta
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
|
-
```typescript
|
|
18
|
+
```typescript
|
|
19
19
|
import { MSSQLStore } from "@mastra/mssql";
|
|
20
20
|
|
|
21
21
|
const storage = new MSSQLStore({
|
|
@@ -105,7 +105,7 @@ The storage implementation handles schema creation and updates automatically. It
|
|
|
105
105
|
|
|
106
106
|
When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
|
|
107
107
|
|
|
108
|
-
```typescript
|
|
108
|
+
```typescript
|
|
109
109
|
import { Mastra } from "@mastra/core";
|
|
110
110
|
import { MSSQLStore } from "@mastra/mssql";
|
|
111
111
|
|
|
@@ -120,18 +120,20 @@ const mastra = new Mastra({
|
|
|
120
120
|
|
|
121
121
|
If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
|
|
122
122
|
|
|
123
|
-
```typescript
|
|
123
|
+
```typescript
|
|
124
124
|
import { MSSQLStore } from "@mastra/mssql";
|
|
125
125
|
|
|
126
126
|
const storage = new MSSQLStore({
|
|
127
|
+
id: 'mssql-storage',
|
|
127
128
|
connectionString: process.env.DATABASE_URL,
|
|
128
129
|
});
|
|
129
130
|
|
|
130
131
|
// Required when using storage directly
|
|
131
132
|
await storage.init();
|
|
132
133
|
|
|
133
|
-
//
|
|
134
|
-
await storage.
|
|
134
|
+
// Access domain-specific stores via getStore()
|
|
135
|
+
const memoryStore = await storage.getStore('memory');
|
|
136
|
+
const thread = await memoryStore?.getThreadById({ threadId: "..." });
|
|
135
137
|
```
|
|
136
138
|
|
|
137
139
|
:::warning
|
|
@@ -1,58 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
description:
|
|
2
|
+
title: "Reference: Storage Overview | Storage"
|
|
3
|
+
description: Core data schema and table structure for Mastra's storage system.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import PropertiesTable from "@site/src/components/PropertiesTable";
|
|
7
6
|
import { SchemaTable } from "@site/src/components/SchemaTable";
|
|
8
|
-
import { StorageOverviewImage } from "@site/src/components/StorageOverviewImage";
|
|
9
7
|
import Tabs from "@theme/Tabs";
|
|
10
8
|
import TabItem from "@theme/TabItem";
|
|
11
9
|
|
|
12
10
|
# Storage Overview
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
Mastra requires the following tables to be present in the database.
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
- **Memory**: threads and messages per `resourceId` in your application
|
|
18
|
-
- **Traces**: OpenTelemetry traces from all components of Mastra
|
|
19
|
-
- **Eval Datasets**: scores and scoring reasons from eval runs
|
|
20
|
-
|
|
21
|
-
<br />
|
|
22
|
-
|
|
23
|
-
<br />
|
|
24
|
-
|
|
25
|
-
<StorageOverviewImage />
|
|
26
|
-
|
|
27
|
-
Mastra provides different storage providers, but you can treat them as interchangeable. Eg, you could use libsql in development but postgres in production, and your code will work the same both ways.
|
|
28
|
-
|
|
29
|
-
## Configuration
|
|
30
|
-
|
|
31
|
-
Mastra can be configured with a default storage option:
|
|
32
|
-
|
|
33
|
-
```typescript copy
|
|
34
|
-
import { Mastra } from "@mastra/core";
|
|
35
|
-
import { LibSQLStore } from "@mastra/libsql";
|
|
36
|
-
|
|
37
|
-
const mastra = new Mastra({
|
|
38
|
-
storage: new LibSQLStore({
|
|
39
|
-
id: 'mastra-storage',
|
|
40
|
-
url: "file:./mastra.db",
|
|
41
|
-
}),
|
|
42
|
-
});
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If you do not specify any `storage` configuration, Mastra will not persist data across application restarts or deployments. For any
|
|
46
|
-
deployment beyond local testing you should provide your own storage
|
|
47
|
-
configuration either on `Mastra` or directly within `new Memory()`.
|
|
48
|
-
|
|
49
|
-
## Data Schema
|
|
14
|
+
## Core Schema
|
|
50
15
|
|
|
51
16
|
<Tabs>
|
|
52
17
|
<TabItem value="messages" label="Messages">
|
|
53
18
|
Stores conversation messages and their metadata. Each message belongs to a thread and contains the actual content along with metadata about the sender role and message type.
|
|
54
19
|
|
|
55
|
-
<br />
|
|
56
20
|
<SchemaTable
|
|
57
21
|
columns={[
|
|
58
22
|
{
|
|
@@ -152,10 +116,9 @@ The message `content` column contains a JSON object conforming to the `MastraMes
|
|
|
152
116
|
|
|
153
117
|
</TabItem>
|
|
154
118
|
|
|
155
|
-
|
|
119
|
+
<TabItem value="threads" label="Threads">
|
|
156
120
|
Groups related messages together and associates them with a resource. Contains metadata about the conversation.
|
|
157
121
|
|
|
158
|
-
<br />
|
|
159
122
|
<SchemaTable
|
|
160
123
|
columns={[
|
|
161
124
|
{
|
|
@@ -202,10 +165,9 @@ Groups related messages together and associates them with a resource. Contains m
|
|
|
202
165
|
/>
|
|
203
166
|
|
|
204
167
|
</TabItem>
|
|
205
|
-
|
|
168
|
+
<TabItem value="resources" label="Resources">
|
|
206
169
|
Stores user-specific data for resource-scoped working memory. Each resource represents a user or entity, allowing working memory to persist across all conversation threads for that user.
|
|
207
170
|
|
|
208
|
-
<br />
|
|
209
171
|
<SchemaTable
|
|
210
172
|
columns={[
|
|
211
173
|
{
|
|
@@ -248,10 +210,9 @@ Stores user-specific data for resource-scoped working memory. Each resource repr
|
|
|
248
210
|
/>
|
|
249
211
|
|
|
250
212
|
</TabItem>
|
|
251
|
-
|
|
213
|
+
<TabItem value="workflows" label="Workflows">
|
|
252
214
|
When `suspend` is called on a workflow, its state is saved in the following format. When `resume` is called, that state is rehydrated.
|
|
253
215
|
|
|
254
|
-
<br />
|
|
255
216
|
<SchemaTable
|
|
256
217
|
columns={[
|
|
257
218
|
{
|
|
@@ -296,11 +257,10 @@ When `suspend` is called on a workflow, its state is saved in the following form
|
|
|
296
257
|
}
|
|
297
258
|
]}
|
|
298
259
|
/>
|
|
299
|
-
|
|
300
|
-
|
|
260
|
+
</TabItem>
|
|
261
|
+
<TabItem value="evals" label="Evals">
|
|
301
262
|
Stores eval results from running metrics against agent outputs.
|
|
302
263
|
|
|
303
|
-
<br />
|
|
304
264
|
<SchemaTable
|
|
305
265
|
columns={[
|
|
306
266
|
{
|
|
@@ -370,11 +330,10 @@ Stores eval results from running metrics against agent outputs.
|
|
|
370
330
|
}
|
|
371
331
|
]}
|
|
372
332
|
/>
|
|
373
|
-
|
|
374
|
-
|
|
333
|
+
</TabItem>
|
|
334
|
+
<TabItem value="traces" label="Traces">
|
|
375
335
|
Captures OpenTelemetry traces for monitoring and debugging.
|
|
376
336
|
|
|
377
|
-
<br />
|
|
378
337
|
<SchemaTable
|
|
379
338
|
columns={[
|
|
380
339
|
{
|
|
@@ -468,62 +427,5 @@ Captures OpenTelemetry traces for monitoring and debugging.
|
|
|
468
427
|
}
|
|
469
428
|
]}
|
|
470
429
|
/>
|
|
471
|
-
|
|
430
|
+
</TabItem>
|
|
472
431
|
</Tabs>
|
|
473
|
-
|
|
474
|
-
### Querying Messages
|
|
475
|
-
|
|
476
|
-
Messages are stored in the `MastraDBMessage` format, which provides a consistent structure across the entire Mastra system:
|
|
477
|
-
|
|
478
|
-
```typescript copy
|
|
479
|
-
// Get messages for a thread with pagination
|
|
480
|
-
const result = await mastra
|
|
481
|
-
.getStorage()
|
|
482
|
-
.listMessages({
|
|
483
|
-
threadId: "your-thread-id",
|
|
484
|
-
page: 0,
|
|
485
|
-
perPage: 50
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
console.log(result.messages); // MastraDBMessage[]
|
|
489
|
-
console.log(result.total); // Total count
|
|
490
|
-
console.log(result.hasMore); // Whether more pages exist
|
|
491
|
-
|
|
492
|
-
// Get messages from multiple threads at once
|
|
493
|
-
const multiThreadResult = await mastra
|
|
494
|
-
.getStorage()
|
|
495
|
-
.listMessages({
|
|
496
|
-
threadId: ["thread-1", "thread-2", "thread-3"],
|
|
497
|
-
page: 0,
|
|
498
|
-
perPage: 100
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
// Get messages by their IDs
|
|
502
|
-
const messages = await mastra
|
|
503
|
-
.getStorage()
|
|
504
|
-
.listMessagesById({ messageIds: messageIdArr });
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
The `threadId` parameter accepts either a single thread ID string or an array of thread IDs to query messages from multiple threads in a single request.
|
|
508
|
-
|
|
509
|
-
All message queries return `MastraDBMessage[]` format. If you need to convert messages to AI SDK formats for UI rendering, use the conversion utilities from `@mastra/ai-sdk/ui`:
|
|
510
|
-
|
|
511
|
-
```typescript copy
|
|
512
|
-
import { toAISdkV5Messages } from '@mastra/ai-sdk/ui';
|
|
513
|
-
|
|
514
|
-
const result = await mastra
|
|
515
|
-
.getStorage()
|
|
516
|
-
.listMessages({ threadId: "your-thread-id" });
|
|
517
|
-
|
|
518
|
-
// Convert to AI SDK v5 UIMessage format for UI rendering
|
|
519
|
-
const uiMessages = toAISdkV5Messages(result.messages);
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
## Storage Providers
|
|
523
|
-
|
|
524
|
-
Mastra supports the following providers:
|
|
525
|
-
|
|
526
|
-
- For local development, check out [LibSQL Storage](/reference/v1/storage/libsql)
|
|
527
|
-
- For production, check out [PostgreSQL Storage](/reference/v1/storage/postgresql)
|
|
528
|
-
- For serverless deployments, check out [Upstash Storage](/reference/v1/storage/upstash)
|
|
529
|
-
- For document-based storage, check out [MongoDB Storage](/reference/v1/storage/mongodb)
|
|
@@ -9,13 +9,13 @@ The PostgreSQL storage implementation provides a production-ready storage soluti
|
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
|
-
```bash
|
|
12
|
+
```bash
|
|
13
13
|
npm install @mastra/pg@beta
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
|
-
```typescript
|
|
18
|
+
```typescript
|
|
19
19
|
import { PostgresStore } from "@mastra/pg";
|
|
20
20
|
|
|
21
21
|
const storage = new PostgresStore({
|
|
@@ -105,7 +105,7 @@ The storage implementation handles schema creation and updates automatically. It
|
|
|
105
105
|
|
|
106
106
|
When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
|
|
107
107
|
|
|
108
|
-
```typescript
|
|
108
|
+
```typescript
|
|
109
109
|
import { Mastra } from "@mastra/core";
|
|
110
110
|
import { PostgresStore } from "@mastra/pg";
|
|
111
111
|
|
|
@@ -120,18 +120,20 @@ const mastra = new Mastra({
|
|
|
120
120
|
|
|
121
121
|
If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
|
|
122
122
|
|
|
123
|
-
```typescript
|
|
123
|
+
```typescript
|
|
124
124
|
import { PostgresStore } from "@mastra/pg";
|
|
125
125
|
|
|
126
126
|
const storage = new PostgresStore({
|
|
127
|
+
id: 'pg-storage',
|
|
127
128
|
connectionString: process.env.DATABASE_URL,
|
|
128
129
|
});
|
|
129
130
|
|
|
130
131
|
// Required when using storage directly
|
|
131
132
|
await storage.init();
|
|
132
133
|
|
|
133
|
-
//
|
|
134
|
-
await storage.
|
|
134
|
+
// Access domain-specific stores via getStore()
|
|
135
|
+
const memoryStore = await storage.getStore('memory');
|
|
136
|
+
const thread = await memoryStore?.getThreadById({ threadId: "..." });
|
|
135
137
|
```
|
|
136
138
|
|
|
137
139
|
:::warning
|
|
@@ -155,6 +157,77 @@ This enables direct queries and custom transaction management. When using these
|
|
|
155
157
|
|
|
156
158
|
This approach is intended for advanced scenarios where low-level access is required.
|
|
157
159
|
|
|
160
|
+
## Usage Example
|
|
161
|
+
|
|
162
|
+
### Adding memory to an agent
|
|
163
|
+
|
|
164
|
+
To add PostgreSQL memory to an agent use the `Memory` class and create a new `storage` key using `PostgresStore`. The `connectionString` can either be a remote location, or a local database connection.
|
|
165
|
+
|
|
166
|
+
```typescript title="src/mastra/agents/example-pg-agent.ts"
|
|
167
|
+
import { Memory } from "@mastra/memory";
|
|
168
|
+
import { Agent } from "@mastra/core/agent";
|
|
169
|
+
import { PostgresStore } from "@mastra/pg";
|
|
170
|
+
|
|
171
|
+
export const pgAgent = new Agent({
|
|
172
|
+
id: "pg-agent",
|
|
173
|
+
name: "PG Agent",
|
|
174
|
+
instructions:
|
|
175
|
+
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
176
|
+
model: "openai/gpt-5.1",
|
|
177
|
+
memory: new Memory({
|
|
178
|
+
storage: new PostgresStore({
|
|
179
|
+
id: 'pg-agent-storage',
|
|
180
|
+
connectionString: process.env.DATABASE_URL!,
|
|
181
|
+
}),
|
|
182
|
+
options: {
|
|
183
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
184
|
+
},
|
|
185
|
+
}),
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Using the agent
|
|
190
|
+
|
|
191
|
+
Use `memoryOptions` to scope recall for this request. Set `lastMessages: 5` to limit recency-based recall, and use `semanticRecall` to fetch the `topK: 3` most relevant messages, including `messageRange: 2` neighboring messages for context around each match.
|
|
192
|
+
|
|
193
|
+
```typescript title="src/test-pg-agent.ts"
|
|
194
|
+
import "dotenv/config";
|
|
195
|
+
|
|
196
|
+
import { mastra } from "./mastra";
|
|
197
|
+
|
|
198
|
+
const threadId = "123";
|
|
199
|
+
const resourceId = "user-456";
|
|
200
|
+
|
|
201
|
+
const agent = mastra.getAgent("pg-agent");
|
|
202
|
+
|
|
203
|
+
const message = await agent.stream("My name is Mastra", {
|
|
204
|
+
memory: {
|
|
205
|
+
thread: threadId,
|
|
206
|
+
resource: resourceId,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
await message.textStream.pipeTo(new WritableStream());
|
|
211
|
+
|
|
212
|
+
const stream = await agent.stream("What's my name?", {
|
|
213
|
+
memory: {
|
|
214
|
+
thread: threadId,
|
|
215
|
+
resource: resourceId,
|
|
216
|
+
},
|
|
217
|
+
memoryOptions: {
|
|
218
|
+
lastMessages: 5,
|
|
219
|
+
semanticRecall: {
|
|
220
|
+
topK: 3,
|
|
221
|
+
messageRange: 2,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
for await (const chunk of stream.textStream) {
|
|
227
|
+
process.stdout.write(chunk);
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
158
231
|
## Index Management
|
|
159
232
|
|
|
160
233
|
PostgreSQL storage provides comprehensive index management capabilities to optimize query performance.
|
|
@@ -174,7 +247,7 @@ These indexes significantly improve performance for filtered queries with sortin
|
|
|
174
247
|
|
|
175
248
|
Create additional indexes to optimize specific query patterns:
|
|
176
249
|
|
|
177
|
-
```typescript
|
|
250
|
+
```typescript
|
|
178
251
|
// Basic index for common queries
|
|
179
252
|
await storage.createIndex({
|
|
180
253
|
name: "idx_threads_resource",
|
|
@@ -278,7 +351,7 @@ For more advanced use cases, you can also use:
|
|
|
278
351
|
|
|
279
352
|
List and monitor existing indexes:
|
|
280
353
|
|
|
281
|
-
```typescript
|
|
354
|
+
```typescript
|
|
282
355
|
// List all indexes
|
|
283
356
|
const allIndexes = await storage.listIndexes();
|
|
284
357
|
console.log(allIndexes);
|
|
@@ -321,7 +394,7 @@ await storage.dropIndex("idx_threads_status");
|
|
|
321
394
|
|
|
322
395
|
When using custom schemas, indexes are created with schema prefixes:
|
|
323
396
|
|
|
324
|
-
```typescript
|
|
397
|
+
```typescript
|
|
325
398
|
const storage = new PostgresStore({
|
|
326
399
|
id: 'pg-storage',
|
|
327
400
|
connectionString: process.env.DATABASE_URL,
|
|
@@ -15,13 +15,13 @@ The Upstash storage implementation provides a serverless-friendly storage soluti
|
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
```bash
|
|
18
|
+
```bash
|
|
19
19
|
npm install @mastra/upstash@beta
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
|
-
```typescript
|
|
24
|
+
```typescript
|
|
25
25
|
import { UpstashStore } from "@mastra/upstash";
|
|
26
26
|
|
|
27
27
|
const storage = new UpstashStore({
|
|
@@ -91,3 +91,75 @@ For optimal performance:
|
|
|
91
91
|
- Use appropriate key prefixes to organize data
|
|
92
92
|
- Monitor Redis memory usage
|
|
93
93
|
- Consider data expiration policies if needed
|
|
94
|
+
|
|
95
|
+
## Usage Example
|
|
96
|
+
|
|
97
|
+
### Adding memory to an agent
|
|
98
|
+
|
|
99
|
+
To add Upstash memory to an agent use the `Memory` class and create a new `storage` key using `UpstashStore` and a new `vector` key using `UpstashVector`. The configuration can point to either a remote service or a local setup.
|
|
100
|
+
|
|
101
|
+
```typescript title="src/mastra/agents/example-upstash-agent.ts"
|
|
102
|
+
import { Memory } from "@mastra/memory";
|
|
103
|
+
import { Agent } from "@mastra/core/agent";
|
|
104
|
+
import { UpstashStore } from "@mastra/upstash";
|
|
105
|
+
|
|
106
|
+
export const upstashAgent = new Agent({
|
|
107
|
+
id: "upstash-agent",
|
|
108
|
+
name: "Upstash Agent",
|
|
109
|
+
instructions:
|
|
110
|
+
"You are an AI agent with the ability to automatically recall memories from previous interactions.",
|
|
111
|
+
model: "openai/gpt-5.1",
|
|
112
|
+
memory: new Memory({
|
|
113
|
+
storage: new UpstashStore({
|
|
114
|
+
id: 'upstash-agent-storage',
|
|
115
|
+
url: process.env.UPSTASH_REDIS_REST_URL!,
|
|
116
|
+
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
|
|
117
|
+
}),
|
|
118
|
+
options: {
|
|
119
|
+
generateTitle: true, // Explicitly enable automatic title generation
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Using the agent
|
|
126
|
+
|
|
127
|
+
Use `memoryOptions` to scope recall for this request. Set `lastMessages: 5` to limit recency-based recall, and use `semanticRecall` to fetch the `topK: 3` most relevant messages, including `messageRange: 2` neighboring messages for context around each match.
|
|
128
|
+
|
|
129
|
+
```typescript title="src/test-upstash-agent.ts"
|
|
130
|
+
import "dotenv/config";
|
|
131
|
+
|
|
132
|
+
import { mastra } from "./mastra";
|
|
133
|
+
|
|
134
|
+
const threadId = "123";
|
|
135
|
+
const resourceId = "user-456";
|
|
136
|
+
|
|
137
|
+
const agent = mastra.getAgent("upstashAgent");
|
|
138
|
+
|
|
139
|
+
const message = await agent.stream("My name is Mastra", {
|
|
140
|
+
memory: {
|
|
141
|
+
thread: threadId,
|
|
142
|
+
resource: resourceId,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
await message.textStream.pipeTo(new WritableStream());
|
|
147
|
+
|
|
148
|
+
const stream = await agent.stream("What's my name?", {
|
|
149
|
+
memory: {
|
|
150
|
+
thread: threadId,
|
|
151
|
+
resource: resourceId,
|
|
152
|
+
},
|
|
153
|
+
memoryOptions: {
|
|
154
|
+
lastMessages: 5,
|
|
155
|
+
semanticRecall: {
|
|
156
|
+
topK: 3,
|
|
157
|
+
messageRange: 2,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
for await (const chunk of stream.textStream) {
|
|
163
|
+
process.stdout.write(chunk);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
@@ -11,7 +11,7 @@ The `.stream()` method enables real-time streaming of responses from an agent wi
|
|
|
11
11
|
|
|
12
12
|
## Usage example
|
|
13
13
|
|
|
14
|
-
```ts title="index.ts"
|
|
14
|
+
```ts title="index.ts"
|
|
15
15
|
const stream = await agent.stream("message for agent");
|
|
16
16
|
```
|
|
17
17
|
|
|
@@ -675,7 +675,7 @@ const stream = await agent.stream("message for agent");
|
|
|
675
675
|
|
|
676
676
|
### Mastra Format (Default)
|
|
677
677
|
|
|
678
|
-
```ts title="index.ts"
|
|
678
|
+
```ts title="index.ts"
|
|
679
679
|
import { stepCountIs } from "ai-v5";
|
|
680
680
|
|
|
681
681
|
const stream = await agent.stream("Tell me a story", {
|
|
@@ -703,7 +703,7 @@ const fullText = await stream.text;
|
|
|
703
703
|
|
|
704
704
|
To use the stream with AI SDK v5, you can convert it using our utility function `toAISdkStream`.
|
|
705
705
|
|
|
706
|
-
```ts title="index.ts"
|
|
706
|
+
```ts title="index.ts"
|
|
707
707
|
import { stepCountIs, createUIMessageStreamResponse } from "ai";
|
|
708
708
|
import { toAISdkStream } from "@mastra/ai-sdk";
|
|
709
709
|
|
|
@@ -724,7 +724,7 @@ return createUIMessageStreamResponse({
|
|
|
724
724
|
|
|
725
725
|
All callback functions are now available as top-level properties for a cleaner API experience.
|
|
726
726
|
|
|
727
|
-
```ts title="index.ts"
|
|
727
|
+
```ts title="index.ts"
|
|
728
728
|
const stream = await agent.stream("Tell me a story", {
|
|
729
729
|
onFinish: (result) => {
|
|
730
730
|
console.log("Streaming finished:", result);
|
|
@@ -751,7 +751,7 @@ for await (const chunk of stream.textStream) {
|
|
|
751
751
|
|
|
752
752
|
### Advanced Example with Options
|
|
753
753
|
|
|
754
|
-
```ts title="index.ts"
|
|
754
|
+
```ts title="index.ts"
|
|
755
755
|
import { z } from "zod";
|
|
756
756
|
import { stepCountIs } from "ai";
|
|
757
757
|
|
|
@@ -15,7 +15,7 @@ The `.streamLegacy()` method is the legacy version of the agent streaming API, u
|
|
|
15
15
|
|
|
16
16
|
## Usage example
|
|
17
17
|
|
|
18
|
-
```typescript
|
|
18
|
+
```typescript
|
|
19
19
|
await agent.streamLegacy("message for agent");
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -534,7 +534,7 @@ await agent.streamLegacy("message for agent");
|
|
|
534
534
|
|
|
535
535
|
## Extended usage example
|
|
536
536
|
|
|
537
|
-
```typescript
|
|
537
|
+
```typescript
|
|
538
538
|
await agent.streamLegacy("message for agent", {
|
|
539
539
|
temperature: 0.7,
|
|
540
540
|
maxSteps: 3,
|
|
@@ -9,7 +9,7 @@ The `.stream()` method enables real-time streaming of responses from a workflow.
|
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
12
|
+
```typescript
|
|
13
13
|
const run = await workflow.createRun();
|
|
14
14
|
|
|
15
15
|
const stream = await run.stream({
|
|
@@ -163,7 +163,7 @@ Returns a `WorkflowRunOutput` object that implements the async iterable interfac
|
|
|
163
163
|
|
|
164
164
|
## Extended usage example
|
|
165
165
|
|
|
166
|
-
```typescript
|
|
166
|
+
```typescript
|
|
167
167
|
const run = await workflow.createRun();
|
|
168
168
|
|
|
169
169
|
const stream = run.stream({
|
|
@@ -9,7 +9,7 @@ The `.timeTravelStream()` method re-executes a workflow starting from any specif
|
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
12
|
+
```typescript
|
|
13
13
|
const run = await workflow.createRun();
|
|
14
14
|
|
|
15
15
|
const output = run.timeTravelStream({
|
|
@@ -76,7 +76,7 @@ The stream emits various workflow events during execution:
|
|
|
76
76
|
|
|
77
77
|
### Processing events during time travel
|
|
78
78
|
|
|
79
|
-
```typescript
|
|
79
|
+
```typescript
|
|
80
80
|
const run = await workflow.createRun();
|
|
81
81
|
|
|
82
82
|
const output = run.timeTravelStream({
|
|
@@ -104,7 +104,7 @@ console.log("Time travel completed:", result);
|
|
|
104
104
|
|
|
105
105
|
### Time travel stream with context
|
|
106
106
|
|
|
107
|
-
```typescript
|
|
107
|
+
```typescript
|
|
108
108
|
const output = run.timeTravelStream({
|
|
109
109
|
step: "step2",
|
|
110
110
|
context: {
|
|
@@ -128,7 +128,7 @@ const result = await output.result;
|
|
|
128
128
|
|
|
129
129
|
### Time travel stream with nested workflows
|
|
130
130
|
|
|
131
|
-
```typescript
|
|
131
|
+
```typescript
|
|
132
132
|
const output = run.timeTravelStream({
|
|
133
133
|
step: ["nestedWorkflow", "step3"],
|
|
134
134
|
inputData: { value: 10 },
|
|
@@ -20,7 +20,7 @@ Mastra templates are pre-built project structures that demonstrate specific use
|
|
|
20
20
|
|
|
21
21
|
Install a template using the `create-mastra` command:
|
|
22
22
|
|
|
23
|
-
```bash
|
|
23
|
+
```bash
|
|
24
24
|
npx create-mastra@beta --template template-name
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -123,7 +123,6 @@ const agent = new Agent({
|
|
|
123
123
|
name: "example-agent",
|
|
124
124
|
model: "openai/gpt-5.1", // or other provider strings
|
|
125
125
|
instructions: "Your agent instructions here",
|
|
126
|
-
// ... other configuration
|
|
127
126
|
});
|
|
128
127
|
```
|
|
129
128
|
|
|
@@ -9,7 +9,7 @@ The `createTool()` function is used to define custom tools that your Mastra agen
|
|
|
9
9
|
|
|
10
10
|
## Usage example
|
|
11
11
|
|
|
12
|
-
```typescript title="src/mastra/tools/reverse-tool.ts"
|
|
12
|
+
```typescript title="src/mastra/tools/reverse-tool.ts"
|
|
13
13
|
import { createTool } from "@mastra/core/tools";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
@@ -215,7 +215,6 @@ export const tool = createTool({
|
|
|
215
215
|
onInputStart: ({ toolCallId, messages, abortSignal }) => {
|
|
216
216
|
console.log(`Tool ${toolCallId} input streaming started`);
|
|
217
217
|
},
|
|
218
|
-
// ... other properties
|
|
219
218
|
});
|
|
220
219
|
```
|
|
221
220
|
|
|
@@ -230,7 +229,6 @@ export const tool = createTool({
|
|
|
230
229
|
onInputDelta: ({ inputTextDelta, toolCallId, messages, abortSignal }) => {
|
|
231
230
|
console.log(`Received input chunk: ${inputTextDelta}`);
|
|
232
231
|
},
|
|
233
|
-
// ... other properties
|
|
234
232
|
});
|
|
235
233
|
```
|
|
236
234
|
|
|
@@ -249,7 +247,6 @@ export const tool = createTool({
|
|
|
249
247
|
console.log(`Tool received complete input:`, input);
|
|
250
248
|
// input is fully typed based on inputSchema
|
|
251
249
|
},
|
|
252
|
-
// ... other properties
|
|
253
250
|
});
|
|
254
251
|
```
|
|
255
252
|
|
|
@@ -574,7 +574,7 @@ For more information on request context, please see:
|
|
|
574
574
|
|
|
575
575
|
The tool can be used by itself to retrieve documents matching a query:
|
|
576
576
|
|
|
577
|
-
```typescript
|
|
577
|
+
```typescript title="src/index.ts"
|
|
578
578
|
import { RequestContext } from "@mastra/core/request-context";
|
|
579
579
|
import { createVectorQueryTool } from "@mastra/rag";
|
|
580
580
|
import { PgVector } from "@mastra/pg";
|