@mastra/mcp-docs-server 1.0.0-beta.5 → 1.0.0-beta.7

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.
Files changed (163) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +67 -67
  3. package/.docs/organized/changelogs/%40mastra%2Fastra.md +10 -10
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +12 -12
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +57 -57
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +110 -110
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +57 -57
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +57 -57
  9. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +60 -0
  11. package/.docs/organized/changelogs/%40mastra%2Fcore.md +358 -358
  12. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +24 -24
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +12 -12
  15. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +79 -79
  16. package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
  17. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +57 -57
  18. package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +61 -0
  19. package/.docs/organized/changelogs/%40mastra%2Fevals.md +12 -12
  20. package/.docs/organized/changelogs/%40mastra%2Flance.md +57 -57
  21. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +55 -55
  22. package/.docs/organized/changelogs/%40mastra%2Floggers.md +12 -12
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
  24. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +125 -125
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +36 -36
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +57 -57
  27. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +57 -57
  28. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
  29. package/.docs/organized/changelogs/%40mastra%2Fpg.md +59 -59
  30. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
  31. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +77 -77
  32. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +10 -10
  33. package/.docs/organized/changelogs/%40mastra%2Frag.md +43 -43
  34. package/.docs/organized/changelogs/%40mastra%2Freact.md +16 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
  36. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  37. package/.docs/organized/changelogs/%40mastra%2Fserver.md +113 -113
  38. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
  39. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +57 -57
  40. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +19 -19
  42. package/.docs/organized/changelogs/create-mastra.md +15 -15
  43. package/.docs/organized/changelogs/mastra.md +30 -30
  44. package/.docs/organized/code-examples/agui.md +1 -0
  45. package/.docs/organized/code-examples/ai-elements.md +1 -1
  46. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  47. package/.docs/organized/code-examples/ai-sdk-v5.md +2 -1
  48. package/.docs/organized/code-examples/assistant-ui.md +1 -1
  49. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
  50. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
  51. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  52. package/.docs/organized/code-examples/mcp-server-adapters.md +721 -0
  53. package/.docs/organized/code-examples/server-app-access.md +342 -0
  54. package/.docs/organized/code-examples/server-express-adapter.md +87 -0
  55. package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
  56. package/.docs/raw/agents/agent-approval.mdx +189 -0
  57. package/.docs/raw/agents/guardrails.mdx +13 -9
  58. package/.docs/raw/agents/networks.mdx +1 -0
  59. package/.docs/raw/agents/overview.mdx +8 -152
  60. package/.docs/raw/agents/processors.mdx +279 -0
  61. package/.docs/raw/agents/structured-output.mdx +224 -0
  62. package/.docs/raw/deployment/cloud-providers/index.mdx +19 -26
  63. package/.docs/raw/deployment/cloud-providers/netlify-deployer.mdx +44 -13
  64. package/.docs/raw/evals/running-in-ci.mdx +0 -2
  65. package/.docs/raw/{guides/getting-started → getting-started}/manual-install.mdx +2 -2
  66. package/.docs/raw/getting-started/start.mdx +1 -1
  67. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +8 -0
  68. package/.docs/raw/guides/getting-started/quickstart.mdx +1 -1
  69. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
  70. package/.docs/raw/guides/index.mdx +3 -35
  71. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +11 -0
  72. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +37 -0
  73. package/.docs/raw/index.mdx +1 -1
  74. package/.docs/raw/memory/memory-processors.mdx +265 -79
  75. package/.docs/raw/memory/working-memory.mdx +11 -2
  76. package/.docs/raw/observability/overview.mdx +0 -1
  77. package/.docs/raw/observability/tracing/bridges/otel.mdx +200 -0
  78. package/.docs/raw/observability/tracing/exporters/arize.mdx +36 -0
  79. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +19 -0
  80. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +83 -0
  81. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +12 -0
  82. package/.docs/raw/observability/tracing/exporters/otel.mdx +34 -22
  83. package/.docs/raw/observability/tracing/exporters/posthog.mdx +20 -0
  84. package/.docs/raw/observability/tracing/overview.mdx +76 -6
  85. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +0 -1
  86. package/.docs/raw/rag/retrieval.mdx +23 -6
  87. package/.docs/raw/rag/vector-databases.mdx +93 -2
  88. package/.docs/raw/reference/agents/generate.mdx +55 -6
  89. package/.docs/raw/reference/agents/network.mdx +44 -0
  90. package/.docs/raw/reference/client-js/memory.mdx +43 -0
  91. package/.docs/raw/reference/client-js/workflows.mdx +92 -63
  92. package/.docs/raw/reference/deployer/netlify.mdx +1 -2
  93. package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
  94. package/.docs/raw/reference/index.mdx +1 -0
  95. package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +177 -0
  96. package/.docs/raw/reference/observability/tracing/configuration.mdx +0 -4
  97. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +29 -0
  98. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +43 -0
  99. package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +17 -1
  100. package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +33 -43
  101. package/.docs/raw/reference/observability/tracing/instances.mdx +0 -4
  102. package/.docs/raw/reference/observability/tracing/interfaces.mdx +29 -4
  103. package/.docs/raw/reference/observability/tracing/spans.mdx +0 -4
  104. package/.docs/raw/reference/processors/language-detector.mdx +9 -2
  105. package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
  106. package/.docs/raw/reference/processors/moderation-processor.mdx +10 -3
  107. package/.docs/raw/reference/processors/pii-detector.mdx +10 -3
  108. package/.docs/raw/reference/processors/processor-interface.mdx +502 -0
  109. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +9 -2
  110. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
  111. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
  112. package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
  113. package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
  114. package/.docs/raw/reference/server/create-route.mdx +314 -0
  115. package/.docs/raw/reference/server/express-adapter.mdx +193 -0
  116. package/.docs/raw/reference/server/hono-adapter.mdx +174 -0
  117. package/.docs/raw/reference/server/mastra-server.mdx +316 -0
  118. package/.docs/raw/reference/server/routes.mdx +250 -0
  119. package/.docs/raw/reference/storage/cloudflare-d1.mdx +37 -0
  120. package/.docs/raw/reference/storage/convex.mdx +164 -0
  121. package/.docs/raw/reference/storage/lance.mdx +33 -0
  122. package/.docs/raw/reference/storage/libsql.mdx +37 -0
  123. package/.docs/raw/reference/storage/mongodb.mdx +39 -0
  124. package/.docs/raw/reference/storage/mssql.mdx +37 -0
  125. package/.docs/raw/reference/storage/postgresql.mdx +37 -0
  126. package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
  127. package/.docs/raw/reference/streaming/agents/stream.mdx +56 -1
  128. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +7 -9
  129. package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
  130. package/.docs/raw/reference/streaming/workflows/stream.mdx +83 -24
  131. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +170 -0
  132. package/.docs/raw/reference/tools/mcp-client.mdx +128 -18
  133. package/.docs/raw/reference/vectors/convex.mdx +429 -0
  134. package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
  135. package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
  136. package/.docs/raw/reference/voice/google.mdx +159 -20
  137. package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
  138. package/.docs/raw/reference/workflows/run-methods/resume.mdx +44 -0
  139. package/.docs/raw/reference/workflows/run-methods/start.mdx +44 -0
  140. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +310 -0
  141. package/.docs/raw/reference/workflows/run.mdx +27 -5
  142. package/.docs/raw/reference/workflows/step.mdx +13 -0
  143. package/.docs/raw/reference/workflows/workflow.mdx +19 -0
  144. package/.docs/raw/server-db/custom-adapters.mdx +380 -0
  145. package/.docs/raw/server-db/mastra-server.mdx +16 -8
  146. package/.docs/raw/server-db/request-context.mdx +0 -1
  147. package/.docs/raw/server-db/server-adapters.mdx +286 -0
  148. package/.docs/raw/server-db/storage.mdx +11 -0
  149. package/.docs/raw/streaming/overview.mdx +6 -6
  150. package/.docs/raw/streaming/tool-streaming.mdx +2 -2
  151. package/.docs/raw/streaming/workflow-streaming.mdx +5 -11
  152. package/.docs/raw/workflows/error-handling.mdx +1 -0
  153. package/.docs/raw/workflows/human-in-the-loop.mdx +4 -4
  154. package/.docs/raw/workflows/overview.mdx +56 -44
  155. package/.docs/raw/workflows/snapshots.mdx +1 -0
  156. package/.docs/raw/workflows/suspend-and-resume.mdx +85 -16
  157. package/.docs/raw/workflows/time-travel.mdx +313 -0
  158. package/.docs/raw/workflows/workflow-state.mdx +191 -0
  159. package/CHANGELOG.md +16 -0
  160. package/package.json +4 -4
  161. package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +0 -91
  162. package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
  163. package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
@@ -0,0 +1,164 @@
1
+ ---
2
+ title: "Reference: Convex Storage | Storage"
3
+ description: Documentation for the Convex storage implementation in Mastra.
4
+ ---
5
+
6
+ # Convex Storage
7
+
8
+ The Convex storage implementation provides a serverless storage solution using [Convex](https://convex.dev), a full-stack TypeScript development platform with real-time sync and automatic caching.
9
+
10
+ ## Installation
11
+
12
+ ```bash copy
13
+ npm install @mastra/convex@beta
14
+ ```
15
+
16
+ ## Convex Setup
17
+
18
+ Before using `ConvexStore`, you need to set up the Convex schema and storage handler in your Convex project.
19
+
20
+ ### 1. Set up Convex Schema
21
+
22
+ In `convex/schema.ts`:
23
+
24
+ ```typescript copy
25
+ import { defineSchema } from 'convex/server';
26
+ import {
27
+ mastraThreadsTable,
28
+ mastraMessagesTable,
29
+ mastraResourcesTable,
30
+ mastraWorkflowSnapshotsTable,
31
+ mastraScoresTable,
32
+ mastraVectorIndexesTable,
33
+ mastraVectorsTable,
34
+ mastraDocumentsTable,
35
+ } from '@mastra/convex/server';
36
+
37
+ export default defineSchema({
38
+ mastra_threads: mastraThreadsTable,
39
+ mastra_messages: mastraMessagesTable,
40
+ mastra_resources: mastraResourcesTable,
41
+ mastra_workflow_snapshots: mastraWorkflowSnapshotsTable,
42
+ mastra_scorers: mastraScoresTable,
43
+ mastra_vector_indexes: mastraVectorIndexesTable,
44
+ mastra_vectors: mastraVectorsTable,
45
+ mastra_documents: mastraDocumentsTable,
46
+ });
47
+ ```
48
+
49
+ ### 2. Create the Storage Handler
50
+
51
+ In `convex/mastra/storage.ts`:
52
+
53
+ ```typescript copy
54
+ import { mastraStorage } from '@mastra/convex/server';
55
+
56
+ export const handle = mastraStorage;
57
+ ```
58
+
59
+ ### 3. Deploy to Convex
60
+
61
+ ```bash copy
62
+ npx convex dev
63
+ # or for production
64
+ npx convex deploy
65
+ ```
66
+
67
+ ## Usage
68
+
69
+ ```typescript copy showLineNumbers
70
+ import { ConvexStore } from "@mastra/convex";
71
+
72
+ const storage = new ConvexStore({
73
+ id: 'convex-storage',
74
+ deploymentUrl: process.env.CONVEX_URL!,
75
+ adminAuthToken: process.env.CONVEX_ADMIN_KEY!,
76
+ });
77
+ ```
78
+
79
+ ## Parameters
80
+
81
+ <PropertiesTable
82
+ content={[
83
+ {
84
+ name: "deploymentUrl",
85
+ type: "string",
86
+ description:
87
+ "Convex deployment URL (e.g., https://your-project.convex.cloud)",
88
+ isOptional: false,
89
+ },
90
+ {
91
+ name: "adminAuthToken",
92
+ type: "string",
93
+ description:
94
+ "Convex admin authentication token for backend access",
95
+ isOptional: false,
96
+ },
97
+ {
98
+ name: "storageFunction",
99
+ type: "string",
100
+ description:
101
+ "Path to the storage mutation function (default: 'mastra/storage:handle')",
102
+ isOptional: true,
103
+ defaultValue: "mastra/storage:handle",
104
+ },
105
+ ]}
106
+ />
107
+
108
+ ## Constructor Examples
109
+
110
+ ```ts
111
+ import { ConvexStore } from "@mastra/convex";
112
+
113
+ // Basic configuration
114
+ const store = new ConvexStore({
115
+ id: 'convex-storage',
116
+ deploymentUrl: "https://your-project.convex.cloud",
117
+ adminAuthToken: "your-admin-token",
118
+ });
119
+
120
+ // With custom storage function path
121
+ const storeCustom = new ConvexStore({
122
+ id: 'convex-storage',
123
+ deploymentUrl: "https://your-project.convex.cloud",
124
+ adminAuthToken: "your-admin-token",
125
+ storageFunction: "custom/path:handler",
126
+ });
127
+ ```
128
+
129
+ ## Additional Notes
130
+
131
+ ### Schema Management
132
+
133
+ The storage implementation uses typed Convex tables for each Mastra domain:
134
+
135
+ | Domain | Convex Table | Purpose |
136
+ | -------------- | --------------------------- | -------------------- |
137
+ | Threads | `mastra_threads` | Conversation threads |
138
+ | Messages | `mastra_messages` | Chat messages |
139
+ | Resources | `mastra_resources` | User working memory |
140
+ | Workflows | `mastra_workflow_snapshots` | Workflow state |
141
+ | Scorers | `mastra_scorers` | Evaluation data |
142
+ | Fallback | `mastra_documents` | Unknown tables |
143
+
144
+ ### Architecture
145
+
146
+ All typed tables include:
147
+
148
+ - An `id` field for Mastra's record ID (distinct from Convex's auto-generated `_id`)
149
+ - A `by_record_id` index for efficient lookups by Mastra ID
150
+
151
+ This design ensures compatibility with Mastra's storage contract while leveraging Convex's automatic indexing and real-time capabilities.
152
+
153
+ ### Environment Variables
154
+
155
+ Set these environment variables for your deployment:
156
+
157
+ - `CONVEX_URL` – Your Convex deployment URL
158
+ - `CONVEX_ADMIN_KEY` – Admin authentication token (get from Convex dashboard)
159
+
160
+ ## Related
161
+
162
+ - [Convex Vector Store](../vectors/convex)
163
+ - [Convex Documentation](https://docs.convex.dev/)
164
+
@@ -73,6 +73,39 @@ The LanceStorage implementation automatically handles schema creation and update
73
73
  - `jsonb`, `json` → Utf8 (serialized)
74
74
  - `binary` → Binary
75
75
 
76
+ ### Initialization
77
+
78
+ When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
79
+
80
+ ```typescript copy
81
+ import { Mastra } from "@mastra/core";
82
+ import { LanceStorage } from "@mastra/lance";
83
+
84
+ const storage = await LanceStorage.create("my-storage", "/path/to/db");
85
+
86
+ const mastra = new Mastra({
87
+ storage, // init() is called automatically
88
+ });
89
+ ```
90
+
91
+ If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
92
+
93
+ ```typescript copy
94
+ import { LanceStorage } from "@mastra/lance";
95
+
96
+ const storage = await LanceStorage.create("my-storage", "/path/to/db");
97
+
98
+ // Required when using storage directly
99
+ await storage.init();
100
+
101
+ // Now you can use the storage
102
+ await storage.getThread({ threadId: "..." });
103
+ ```
104
+
105
+ :::warning
106
+ If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
107
+ :::
108
+
76
109
  ### Deployment Options
77
110
 
78
111
  LanceDB storage can be configured for different deployment scenarios:
@@ -74,3 +74,40 @@ The storage implementation handles schema creation and updates automatically. It
74
74
  - `mastra_traces`: Stores telemetry and tracing data
75
75
  - `mastra_scorers`: Stores scoring and evaluation data
76
76
  - `mastra_resources`: Stores resource working memory data
77
+
78
+ ### Initialization
79
+
80
+ When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
81
+
82
+ ```typescript copy
83
+ import { Mastra } from "@mastra/core";
84
+ import { LibSQLStore } from "@mastra/libsql";
85
+
86
+ const storage = new LibSQLStore({
87
+ url: "file:./storage.db",
88
+ });
89
+
90
+ const mastra = new Mastra({
91
+ storage, // init() is called automatically
92
+ });
93
+ ```
94
+
95
+ If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
96
+
97
+ ```typescript copy
98
+ import { LibSQLStore } from "@mastra/libsql";
99
+
100
+ const storage = new LibSQLStore({
101
+ url: "file:./storage.db",
102
+ });
103
+
104
+ // Required when using storage directly
105
+ await storage.init();
106
+
107
+ // Now you can use the storage
108
+ await storage.getThread({ threadId: "..." });
109
+ ```
110
+
111
+ :::warning
112
+ If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
113
+ :::
@@ -93,6 +93,45 @@ The storage implementation handles collection creation and management automatica
93
93
  - `mastra_scorers`: Stores scoring and evaluation data
94
94
  - `mastra_resources`: Stores resource working memory data
95
95
 
96
+ ### Initialization
97
+
98
+ When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
99
+
100
+ ```typescript copy
101
+ import { Mastra } from "@mastra/core";
102
+ import { MongoDBStore } from "@mastra/mongodb";
103
+
104
+ const storage = new MongoDBStore({
105
+ url: process.env.MONGODB_URL,
106
+ dbName: process.env.MONGODB_DATABASE,
107
+ });
108
+
109
+ const mastra = new Mastra({
110
+ storage, // init() is called automatically
111
+ });
112
+ ```
113
+
114
+ If you're using storage directly without Mastra, you must call `init()` explicitly to create the collections:
115
+
116
+ ```typescript copy
117
+ import { MongoDBStore } from "@mastra/mongodb";
118
+
119
+ const storage = new MongoDBStore({
120
+ url: process.env.MONGODB_URL,
121
+ dbName: process.env.MONGODB_DATABASE,
122
+ });
123
+
124
+ // Required when using storage directly
125
+ await storage.init();
126
+
127
+ // Now you can use the storage
128
+ await storage.getThread({ threadId: "..." });
129
+ ```
130
+
131
+ :::warning
132
+ If `init()` is not called, collections won't be created and storage operations will fail silently or throw errors.
133
+ :::
134
+
96
135
  ## Vector Search Capabilities
97
136
 
98
137
  MongoDB storage includes built-in vector search capabilities for AI applications:
@@ -101,6 +101,43 @@ The storage implementation handles schema creation and updates automatically. It
101
101
  - `mastra_scorers`: Stores scoring and evaluation data
102
102
  - `mastra_resources`: Stores resource working memory data
103
103
 
104
+ ### Initialization
105
+
106
+ When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
107
+
108
+ ```typescript copy
109
+ import { Mastra } from "@mastra/core";
110
+ import { MSSQLStore } from "@mastra/mssql";
111
+
112
+ const storage = new MSSQLStore({
113
+ connectionString: process.env.DATABASE_URL,
114
+ });
115
+
116
+ const mastra = new Mastra({
117
+ storage, // init() is called automatically
118
+ });
119
+ ```
120
+
121
+ If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
122
+
123
+ ```typescript copy
124
+ import { MSSQLStore } from "@mastra/mssql";
125
+
126
+ const storage = new MSSQLStore({
127
+ connectionString: process.env.DATABASE_URL,
128
+ });
129
+
130
+ // Required when using storage directly
131
+ await storage.init();
132
+
133
+ // Now you can use the storage
134
+ await storage.getThread({ threadId: "..." });
135
+ ```
136
+
137
+ :::warning
138
+ If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
139
+ :::
140
+
104
141
  ### Direct Database and Pool Access
105
142
 
106
143
  `MSSQLStore` exposes the mssql connection pool as public fields:
@@ -101,6 +101,43 @@ The storage implementation handles schema creation and updates automatically. It
101
101
  - `mastra_scorers`: Stores scoring and evaluation data
102
102
  - `mastra_resources`: Stores resource working memory data
103
103
 
104
+ ### Initialization
105
+
106
+ When you pass storage to the Mastra class, `init()` is called automatically before any storage operation:
107
+
108
+ ```typescript copy
109
+ import { Mastra } from "@mastra/core";
110
+ import { PostgresStore } from "@mastra/pg";
111
+
112
+ const storage = new PostgresStore({
113
+ connectionString: process.env.DATABASE_URL,
114
+ });
115
+
116
+ const mastra = new Mastra({
117
+ storage, // init() is called automatically
118
+ });
119
+ ```
120
+
121
+ If you're using storage directly without Mastra, you must call `init()` explicitly to create the tables:
122
+
123
+ ```typescript copy
124
+ import { PostgresStore } from "@mastra/pg";
125
+
126
+ const storage = new PostgresStore({
127
+ connectionString: process.env.DATABASE_URL,
128
+ });
129
+
130
+ // Required when using storage directly
131
+ await storage.init();
132
+
133
+ // Now you can use the storage
134
+ await storage.getThread({ threadId: "..." });
135
+ ```
136
+
137
+ :::warning
138
+ If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
139
+ :::
140
+
104
141
  ### Direct Database and Pool Access
105
142
 
106
143
  `PostgresStore` exposes both the underlying database object and the pg-promise instance as public fields:
@@ -1325,4 +1325,4 @@ for await (const chunk of stream.fullStream) {
1325
1325
 
1326
1326
  - [.stream()](./agents/stream) - Method that returns streams emitting these chunks
1327
1327
  - [MastraModelOutput](./agents/MastraModelOutput) - The stream object that emits these chunks
1328
- - [workflow.streamVNext()](./workflows/streamVNext) - Method that returns streams emitting these chunks for workflows
1328
+ - [workflow.stream()](./workflows/stream) - Method that returns streams emitting these chunks for workflows
@@ -245,6 +245,17 @@ const aiSdkStream = await agent.stream("message for agent", {
245
245
  },
246
246
  ],
247
247
  },
248
+ {
249
+ parameters: [
250
+ {
251
+ name: "providerOptions",
252
+ type: "ProviderOptions",
253
+ isOptional: true,
254
+ description:
255
+ "Provider-specific options passed to the internal structuring agent. Use this to control model behavior like reasoning effort for thinking models (e.g., `{ openai: { reasoningEffort: 'low' } }`).",
256
+ },
257
+ ],
258
+ },
248
259
  ],
249
260
  },
250
261
  {
@@ -584,6 +595,50 @@ const aiSdkStream = await agent.stream("message for agent", {
584
595
  },
585
596
  ],
586
597
  },
598
+ {
599
+ parameters: [
600
+ {
601
+ name: "requestContextKeys",
602
+ type: "string[]",
603
+ isOptional: true,
604
+ description:
605
+ "Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
606
+ },
607
+ ],
608
+ },
609
+ {
610
+ parameters: [
611
+ {
612
+ name: "traceId",
613
+ type: "string",
614
+ isOptional: true,
615
+ description:
616
+ "Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
617
+ },
618
+ ],
619
+ },
620
+ {
621
+ parameters: [
622
+ {
623
+ name: "parentSpanId",
624
+ type: "string",
625
+ isOptional: true,
626
+ description:
627
+ "Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
628
+ },
629
+ ],
630
+ },
631
+ {
632
+ parameters: [
633
+ {
634
+ name: "tags",
635
+ type: "string[]",
636
+ isOptional: true,
637
+ description:
638
+ "Tags to apply to this trace. String labels for categorizing and filtering traces.",
639
+ },
640
+ ],
641
+ },
587
642
  ],
588
643
  },
589
644
  ]}
@@ -713,7 +768,7 @@ await agent.stream("message for agent", {
713
768
  },
714
769
  // Output processors for streaming response validation
715
770
  outputProcessors: [
716
- new ModerationProcessor({ model: "openai/gpt-4.1-nano" }),
771
+ new ModerationProcessor({ model: "openrouter/openai/gpt-oss-safeguard-20b" }),
717
772
  new BatchPartsProcessor({ maxBatchSize: 3, maxWaitTime: 100 }),
718
773
  ],
719
774
  });
@@ -18,7 +18,7 @@ run.stream({
18
18
  },
19
19
  });
20
20
 
21
- const { stream } = await run.observeStream();
21
+ const stream = await run.observeStream();
22
22
 
23
23
  for await (const chunk of stream) {
24
24
  console.log(chunk);
@@ -33,17 +33,15 @@ for await (const chunk of stream) {
33
33
 
34
34
  The stream emits various event types during workflow execution. Each event has a `type` field and a `payload` containing relevant data:
35
35
 
36
- - **`start`**: Workflow execution begins
37
- - **`step-start`**: A step begins execution
38
- - **`tool-call`**: A tool call is initiated
39
- - **`tool-call-streaming-start`**: Tool call streaming begins
40
- - **`tool-call-delta`**: Incremental tool output updates
41
- - **`step-result`**: A step completes with results
42
- - **`step-finish`**: A step finishes execution
43
- - **`finish`**: Workflow execution completes
36
+ - **`workflow-start`**: Workflow execution begins
37
+ - **`workflow-step-start`**: A step begins execution
38
+ - **`workflow-step-output`**: Custom output from a step
39
+ - **`workflow-step-result`**: A step completes with results
40
+ - **`workflow-finish`**: Workflow execution completes with usage statistics
44
41
 
45
42
  ## Related
46
43
 
47
44
  - [Workflows overview](/docs/v1/workflows/overview#running-workflows)
48
45
  - [Workflow.createRun()](/reference/v1/workflows/workflow-methods/create-run)
49
46
  - [Run.stream()](./stream)
47
+ - [Run.resumeStream()](./resumeStream)
@@ -1,22 +1,18 @@
1
1
  ---
2
- title: "Reference: Run.resumeStreamVNext() (Experimental) | Streaming"
3
- description: Documentation for the `Run.resumeStreamVNext()` method in workflows, which enables real-time resumption and streaming of suspended workflow runs.
2
+ title: "Reference: Run.resumeStream() | Streaming"
3
+ description: Documentation for the `Run.resumeStream()` method in workflows, which enables real-time resumption and streaming of suspended workflow runs.
4
4
  ---
5
5
 
6
- # Run.resumeStreamVNext() (Experimental)
6
+ # Run.resumeStream()
7
7
 
8
- :::caution Experimental Feature
9
- This is an experimental API that may change in future versions. The `resumeStreamVNext()` method is part of the enhanced streaming system that will eventually replace the current streaming methods. Use with caution in production environments.
10
- :::
11
-
12
- The `.resumeStreamVNext()` method resumes a suspended workflow run with new data, allowing you to continue execution from a specific step and to observe the stream of events.
8
+ The `.resumeStream()` method resumes a suspended workflow run with new data, allowing you to continue execution from a specific step and to observe the stream of events.
13
9
 
14
10
  ## Usage example
15
11
 
16
12
  ```typescript showLineNumbers copy
17
13
  const run = await workflow.createRun();
18
14
 
19
- const stream = run.streamVNext({
15
+ const stream = run.stream({
20
16
  inputData: {
21
17
  value: "initial data",
22
18
  },
@@ -25,7 +21,7 @@ const stream = run.streamVNext({
25
21
  const result = await stream.result;
26
22
 
27
23
  if (result!.status === "suspended") {
28
- const resumedStream = await run.resumeStreamVNext({
24
+ const resumedStream = await run.resumeStream({
29
25
  resumeData: {
30
26
  value: "resume data",
31
27
  },
@@ -72,6 +68,50 @@ if (result!.status === "suspended") {
72
68
  },
73
69
  ],
74
70
  },
71
+ {
72
+ parameters: [
73
+ {
74
+ name: "requestContextKeys",
75
+ type: "string[]",
76
+ isOptional: true,
77
+ description:
78
+ "Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
79
+ },
80
+ ],
81
+ },
82
+ {
83
+ parameters: [
84
+ {
85
+ name: "traceId",
86
+ type: "string",
87
+ isOptional: true,
88
+ description:
89
+ "Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ parameters: [
95
+ {
96
+ name: "parentSpanId",
97
+ type: "string",
98
+ isOptional: true,
99
+ description:
100
+ "Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ parameters: [
106
+ {
107
+ name: "tags",
108
+ type: "string[]",
109
+ isOptional: true,
110
+ description:
111
+ "Tags to apply to this trace. String labels for categorizing and filtering traces.",
112
+ },
113
+ ],
114
+ },
75
115
  ],
76
116
  },
77
117
  ]}
@@ -119,4 +159,4 @@ The stream emits various event types during workflow execution. Each event has a
119
159
 
120
160
  - [Workflows overview](/docs/v1/workflows/overview#running-workflows)
121
161
  - [Workflow.createRun()](/reference/v1/workflows/workflow-methods/create-run)
122
- - [Run.streamVNext()](./streamVNext)
162
+ - [Run.stream()](./stream)