@mastra/mcp-docs-server 1.3.6 → 1.3.7-alpha.3

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 (127) hide show
  1. package/.docs/docs/agents/guardrails.md +2 -2
  2. package/.docs/docs/auth/fga.md +0 -1
  3. package/.docs/docs/deployment/workers.md +1 -1
  4. package/.docs/docs/evals/datasets.md +5 -6
  5. package/.docs/docs/evals/gates-and-verdicts.md +3 -3
  6. package/.docs/docs/mastra-platform/deploy.md +8 -1
  7. package/.docs/docs/mastra-platform/system-environment-variables.md +1 -1
  8. package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
  9. package/.docs/docs/mastra-platform/workspaces.md +2 -2
  10. package/.docs/docs/memory/multi-user-threads.md +1 -1
  11. package/.docs/docs/memory/observational-memory.md +17 -15
  12. package/.docs/docs/observability/metrics/overview.md +1 -1
  13. package/.docs/docs/observability/tracing/overview.md +6 -0
  14. package/.docs/docs/sandbox/computer.md +13 -13
  15. package/.docs/docs/sandbox/overview.md +5 -5
  16. package/.docs/docs/server/custom-adapters.md +1 -1
  17. package/.docs/docs/server/server-adapters.md +1 -1
  18. package/.docs/docs/studio/auth.md +1 -1
  19. package/.docs/docs/workflows/control-flow.md +28 -0
  20. package/.docs/docs/workflows/time-travel.md +1 -1
  21. package/.docs/integrations/databases/clickhouse.md +13 -0
  22. package/.docs/integrations/observability/langfuse.md +8 -0
  23. package/.docs/integrations/observability/opentelemetry.md +2 -0
  24. package/.docs/models/gateways/vercel.md +1 -8
  25. package/.docs/models/index.md +1 -1
  26. package/.docs/models/providers/edenai.md +4 -3
  27. package/.docs/models/providers/kilo.md +6 -6
  28. package/.docs/models/providers/llmgateway-providers.md +1 -2
  29. package/.docs/models/providers/nano-gpt.md +24 -24
  30. package/.docs/models/providers/nearai.md +6 -1
  31. package/.docs/reference/auth/better-auth.md +1 -1
  32. package/.docs/reference/auth/clerk.md +1 -1
  33. package/.docs/reference/auth/neon.md +2 -2
  34. package/.docs/reference/datasets/compareExperiments.md +18 -9
  35. package/.docs/reference/datasets/dataset.md +3 -1
  36. package/.docs/reference/datasets/finalizeExperiment.md +2 -2
  37. package/.docs/reference/datasets/listExperiments.md +2 -2
  38. package/.docs/reference/datasets/submitExperimentResult.md +1 -1
  39. package/.docs/reference/editor/tools.md +11 -3
  40. package/.docs/reference/evals/completeness.md +3 -3
  41. package/.docs/reference/evals/context-precision.md +1 -1
  42. package/.docs/reference/evals/create-scorer.md +3 -7
  43. package/.docs/reference/evals/faithfulness.md +6 -4
  44. package/.docs/reference/evals/filter-run.md +2 -2
  45. package/.docs/reference/evals/trajectory-accuracy.md +3 -2
  46. package/.docs/reference/index.md +0 -1
  47. package/.docs/reference/memory/listThreads.md +1 -1
  48. package/.docs/reference/memory/observational-memory.md +3 -3
  49. package/.docs/reference/migrations/mcp-v2.md +2 -2
  50. package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
  51. package/.docs/reference/migrations/vnext-to-standard-apis.md +1 -1
  52. package/.docs/reference/observability/feedback.md +1 -1
  53. package/.docs/reference/observability/metrics/automatic-metrics.md +11 -1
  54. package/.docs/reference/observability/tracing/interfaces.md +26 -0
  55. package/.docs/reference/observability/tracing/spans.md +2 -0
  56. package/.docs/reference/processors/moderation-processor.md +1 -1
  57. package/.docs/reference/processors/prompt-injection-detector.md +2 -2
  58. package/.docs/reference/processors/provider-history-compat.md +12 -8
  59. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  60. package/.docs/reference/processors/system-prompt-scrubber.md +3 -3
  61. package/.docs/reference/processors/token-limiter-processor.md +2 -2
  62. package/.docs/reference/rag/graph-rag.md +1 -1
  63. package/.docs/reference/server/create-route.md +1 -1
  64. package/.docs/reference/server/elysia-adapter.md +1 -1
  65. package/.docs/reference/server/express-adapter.md +1 -1
  66. package/.docs/reference/server/fastify-adapter.md +1 -1
  67. package/.docs/reference/server/hono-adapter.md +2 -2
  68. package/.docs/reference/server/koa-adapter.md +1 -1
  69. package/.docs/reference/server/nestjs-adapter.md +1 -1
  70. package/.docs/reference/server/routes.md +1 -1
  71. package/.docs/reference/storage/composite.md +34 -0
  72. package/.docs/reference/storage/overview.md +3 -3
  73. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  74. package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
  75. package/.docs/reference/streaming/workflows/timeTravelStream.md +6 -4
  76. package/.docs/reference/tools/document-chunker-tool.md +8 -8
  77. package/.docs/reference/tools/mcp-client.md +1 -1
  78. package/.docs/reference/tools/mcp-server.md +17 -0
  79. package/.docs/reference/tools/submit-plan-tool.md +2 -0
  80. package/.docs/reference/tools/vector-query-tool.md +4 -4
  81. package/.docs/reference/vectors/astra.md +1 -1
  82. package/.docs/reference/vectors/azure-ai-search.md +1 -0
  83. package/.docs/reference/vectors/chroma.md +9 -5
  84. package/.docs/reference/vectors/convex.md +1 -3
  85. package/.docs/reference/vectors/couchbase.md +4 -9
  86. package/.docs/reference/vectors/duckdb.md +1 -1
  87. package/.docs/reference/vectors/libsql.md +1 -1
  88. package/.docs/reference/vectors/mongodb.md +2 -1
  89. package/.docs/reference/vectors/pg.md +16 -11
  90. package/.docs/reference/vectors/pinecone.md +8 -4
  91. package/.docs/reference/vectors/qdrant.md +8 -4
  92. package/.docs/reference/vectors/s3vectors.md +8 -4
  93. package/.docs/reference/vectors/turbopuffer.md +12 -6
  94. package/.docs/reference/vectors/upstash.md +10 -4
  95. package/.docs/reference/vectors/vectorize.md +7 -3
  96. package/.docs/reference/vectors/weaviate.md +1 -1
  97. package/.docs/reference/voice/composite-voice.md +15 -15
  98. package/.docs/reference/voice/mastra-voice.md +15 -11
  99. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  100. package/.docs/reference/voice/voice.addTools.md +1 -1
  101. package/.docs/reference/voice/voice.answer.md +1 -1
  102. package/.docs/reference/voice/voice.close.md +1 -1
  103. package/.docs/reference/voice/voice.events.md +2 -2
  104. package/.docs/reference/voice/voice.listen.md +1 -1
  105. package/.docs/reference/voice/voice.off.md +1 -1
  106. package/.docs/reference/voice/voice.on.md +1 -1
  107. package/.docs/reference/voice/voice.send.md +2 -2
  108. package/.docs/reference/voice/voice.updateConfig.md +1 -1
  109. package/.docs/reference/workflows/dynamic-workflow-definition.md +3 -2
  110. package/.docs/reference/workflows/run-methods/cancel.md +1 -2
  111. package/.docs/reference/workflows/run-methods/resume.md +2 -0
  112. package/.docs/reference/workflows/run-methods/timeTravel.md +27 -0
  113. package/.docs/reference/workflows/run.md +14 -0
  114. package/.docs/reference/workflows/workflow-methods/agent.md +1 -1
  115. package/.docs/reference/workflows/workflow-methods/branch.md +4 -4
  116. package/.docs/reference/workflows/workflow-methods/classifier.md +1 -1
  117. package/.docs/reference/workflows/workflow-methods/create-run.md +2 -2
  118. package/.docs/reference/workflows/workflow-methods/dountil.md +1 -1
  119. package/.docs/reference/workflows/workflow-methods/dowhile.md +1 -1
  120. package/.docs/reference/workflows/workflow-methods/sleepUntil.md +1 -1
  121. package/.docs/reference/workspace/filesystem.md +10 -13
  122. package/.docs/reference/workspace/local-filesystem.md +5 -5
  123. package/.docs/reference/workspace/local-sandbox.md +1 -1
  124. package/.docs/reference/workspace/process-manager.md +2 -2
  125. package/.docs/reference/workspace/workspace-class.md +4 -4
  126. package/package.json +4 -4
  127. package/.docs/reference/agents/getTools.md +0 -31
@@ -387,7 +387,6 @@ const results = await vectorStore.query({
387
387
 
388
388
  | Operator | Description |
389
389
  | -------- | --------------------- |
390
- | `$eq` | Equal to |
391
390
  | `$ne` | Not equal to |
392
391
  | `$gt` | Greater than |
393
392
  | `$gte` | Greater than or equal |
@@ -400,10 +399,9 @@ const results = await vectorStore.query({
400
399
 
401
400
  ## Architecture
402
401
 
403
- `ConvexVector` stores vectors in the `mastra_vectors` table with the following structure:
402
+ `ConvexVector` stores each index in its own table named `mastra_vector_{indexName}`. Each record has the following structure:
404
403
 
405
404
  - `id`: Unique vector identifier
406
- - `indexName`: Name of the index
407
405
  - `embedding`: The vector data (array of floats)
408
406
  - `metadata`: Optional JSON metadata
409
407
 
@@ -69,8 +69,6 @@ const store = new CouchbaseVector({
69
69
 
70
70
  **collectionName** (`string`): Name of the Couchbase collection to use
71
71
 
72
- **options** (`CouchbaseClientOptions`): Optional Couchbase client options
73
-
74
72
  ## Methods
75
73
 
76
74
  ### `createIndex()`
@@ -83,7 +81,7 @@ Creates a new vector index in Couchbase.
83
81
 
84
82
  **dimension** (`number`): Vector dimension (must match your embedding model)
85
83
 
86
- **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `cosine`)
84
+ **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `dotproduct`)
87
85
 
88
86
  ### `upsert()`
89
87
 
@@ -111,11 +109,9 @@ Searches for similar vectors.
111
109
 
112
110
  **topK** (`number`): Number of results to return (Default: `10`)
113
111
 
114
- **filter** (`Record<string, any>`): Metadata filters
115
-
116
- **includeVector** (`boolean`): Whether to include vector data in results (Default: `false`)
112
+ **filter** (`Record<string, any>`): Not supported. Filters passed here are ignored.
117
113
 
118
- **minScore** (`number`): Minimum similarity score threshold (Default: `0`)
114
+ **includeVector** (`boolean`): Not supported. Setting this to true throws an error. (Default: `false`)
119
115
 
120
116
  ### `describeIndex()`
121
117
 
@@ -135,7 +131,7 @@ interface IndexStats {
135
131
 
136
132
  ### `deleteIndex()`
137
133
 
138
- Deletes an index and all its data.
134
+ Deletes the Search index. Documents stored in the collection aren't deleted.
139
135
 
140
136
  **indexName** (`string`): Name of the index to delete
141
137
 
@@ -184,7 +180,6 @@ interface QueryResult {
184
180
  id: string
185
181
  score: number
186
182
  metadata: Record<string, any>
187
- vector?: number[] // Only included if includeVector is true
188
183
  }
189
184
  ```
190
185
 
@@ -216,7 +216,7 @@ DuckDB vector store supports MongoDB-like filter operators:
216
216
  | ---------- | ------------------------------------------ |
217
217
  | Comparison | `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte` |
218
218
  | Logical | `$and`, `$or`, `$not`, `$nor` |
219
- | Array | `$in`, `$nin` |
219
+ | Array | `$in`, `$nin`, `$all` |
220
220
  | Element | `$exists` |
221
221
  | Text | `$contains` |
222
222
 
@@ -121,7 +121,7 @@ Searches for similar vectors with optional metadata filtering.
121
121
 
122
122
  **includeVector** (`boolean`): Whether to include vector data in results (Default: `false`)
123
123
 
124
- **minScore** (`number`): Minimum similarity score threshold (Default: `0`)
124
+ **minScore** (`number`): Minimum similarity score threshold (cosine similarity ranges from -1 to 1) (Default: `-1`)
125
125
 
126
126
  ### `describeIndex()`
127
127
 
@@ -352,6 +352,7 @@ interface QueryResult {
352
352
  score: number
353
353
  metadata: Record<string, any>
354
354
  vector?: number[] // Only included if includeVector is true
355
+ document?: string // Source text stored with the vector, when available
355
356
  }
356
357
  ```
357
358
 
@@ -429,7 +430,7 @@ const results = await store.query({
429
430
 
430
431
  **similarity** (`'cosine' | 'dotProduct' | 'euclidean'`): Vector similarity function. Defaults to MongoDB's own default when omitted.
431
432
 
432
- **numDimensions** (`256 | 512 | 1024 | 2048`): Length of the generated embeddings. (Default: `1024`)
433
+ **numDimensions** (`number`): Length of the generated embeddings. Common values are 256, 512, 1024, and 2048. (Default: `1024`)
433
434
 
434
435
  **quantization** (`'float' | 'scalar' | 'binary' | 'binaryNoRescore'`): Storage format for the generated vectors. (Default: `scalar`)
435
436
 
@@ -82,7 +82,9 @@ const vectorStore = new PgVector({
82
82
 
83
83
  **dimension** (`number`): Vector dimension (must match your embedding model)
84
84
 
85
- **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `cosine`)
85
+ **metric** (`'cosine' | 'euclidean' | 'dotproduct' | 'hamming' | 'jaccard'`): Distance metric for similarity search. 'hamming' and 'jaccard' are only valid with vectorType 'bit', and 'jaccard' requires an HNSW index. (Default: `'cosine' ('hamming' when vectorType is 'bit')`)
86
+
87
+ **vectorType** (`'vector' | 'halfvec' | 'bit' | 'sparsevec'`): pgvector storage type for the embeddings (Default: `vector`)
86
88
 
87
89
  **indexConfig** (`IndexConfig`): Index configuration (Default: `{ type: 'ivfflat' }`)
88
90
 
@@ -142,13 +144,11 @@ Higher M values or efConstruction values will increase memory requirements subst
142
144
 
143
145
  **includeVector** (`boolean`): Whether to include the vector in the result (Default: `false`)
144
146
 
145
- **minScore** (`number`): Minimum similarity score threshold (Default: `0`)
146
-
147
- **options** (`{ ef?: number; probes?: number }`): Additional options for HNSW and IVF indexes
147
+ **minScore** (`number`): Minimum similarity score threshold (Default: `-1`)
148
148
 
149
- **options.ef** (`number`): HNSW search parameter
149
+ **ef** (`number`): HNSW search parameter. Higher values improve accuracy at the cost of speed.
150
150
 
151
- **options.probes** (`number`): IVF search parameter
151
+ **probes** (`number`): IVFFlat search parameter. Number of lists to visit during search.
152
152
 
153
153
  ### `listIndexes()`
154
154
 
@@ -164,8 +164,9 @@ Returns:
164
164
  interface PGIndexStats {
165
165
  dimension: number
166
166
  count: number
167
- metric: 'cosine' | 'euclidean' | 'dotproduct'
167
+ metric: 'cosine' | 'euclidean' | 'dotproduct' | 'hamming' | 'jaccard'
168
168
  type: 'flat' | 'hnsw' | 'ivfflat'
169
+ vectorType: 'vector' | 'halfvec' | 'bit' | 'sparsevec'
169
170
  config: {
170
171
  m?: number
171
172
  efConstruction?: number
@@ -246,7 +247,7 @@ Closes the database connection pool. Should be called when done using the store.
246
247
 
247
248
  **indexName** (`string`): Name of the index to define
248
249
 
249
- **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `cosine`)
250
+ **metric** (`'cosine' | 'euclidean' | 'dotproduct' | 'hamming' | 'jaccard'`): Distance metric for similarity search (Default: `cosine`)
250
251
 
251
252
  **indexConfig** (`IndexConfig`): Configuration for the index type and parameters
252
253
 
@@ -291,17 +292,21 @@ interface QueryResult {
291
292
 
292
293
  ## Error handling
293
294
 
294
- The store throws typed errors that can be caught:
295
+ The store throws `MastraError` instances from `@mastra/core/error`:
295
296
 
296
297
  ```typescript
298
+ import { MastraError } from '@mastra/core/error'
299
+
297
300
  try {
298
301
  await store.query({
299
302
  indexName: 'index_name',
300
303
  queryVector: queryVector,
301
304
  })
302
305
  } catch (error) {
303
- if (error instanceof VectorStoreError) {
304
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
306
+ if (error instanceof MastraError) {
307
+ console.log(error.id) // 'MASTRA_VECTOR_PG_QUERY_FAILED'
308
+ console.log(error.domain) // 'MASTRA_VECTOR'
309
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
305
310
  console.log(error.details) // Additional error context
306
311
  }
307
312
  }
@@ -130,24 +130,28 @@ Query results are returned in this format:
130
130
  interface QueryResult {
131
131
  id: string
132
132
  score: number
133
- metadata: Record<string, any>
133
+ metadata?: Record<string, any>
134
134
  vector?: number[] // Only included if includeVector is true
135
135
  }
136
136
  ```
137
137
 
138
138
  ## Error handling
139
139
 
140
- The store throws typed errors that can be caught:
140
+ The store throws `MastraError` instances from `@mastra/core/error`:
141
141
 
142
142
  ```typescript
143
+ import { MastraError } from '@mastra/core/error'
144
+
143
145
  try {
144
146
  await store.query({
145
147
  indexName: 'index_name',
146
148
  queryVector: queryVector,
147
149
  })
148
150
  } catch (error) {
149
- if (error instanceof VectorStoreError) {
150
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
151
+ if (error instanceof MastraError) {
152
+ console.log(error.id) // 'MASTRA_VECTOR_PINECONE_QUERY_FAILED'
153
+ console.log(error.domain) // 'STORAGE'
154
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
151
155
  console.log(error.details) // Additional error context
152
156
  }
153
157
  }
@@ -198,24 +198,28 @@ Query results are returned in this format:
198
198
  interface QueryResult {
199
199
  id: string
200
200
  score: number
201
- metadata: Record<string, any>
201
+ metadata?: Record<string, any>
202
202
  vector?: number[] // Only included if includeVector is true
203
203
  }
204
204
  ```
205
205
 
206
206
  ## Error handling
207
207
 
208
- The store throws typed errors that can be caught:
208
+ The store throws `MastraError` instances from `@mastra/core/error`:
209
209
 
210
210
  ```typescript
211
+ import { MastraError } from '@mastra/core/error'
212
+
211
213
  try {
212
214
  await store.query({
213
215
  indexName: 'index_name',
214
216
  queryVector: queryVector,
215
217
  })
216
218
  } catch (error) {
217
- if (error instanceof VectorStoreError) {
218
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
219
+ if (error instanceof MastraError) {
220
+ console.log(error.id) // 'MASTRA_VECTOR_QDRANT_QUERY_FAILED'
221
+ console.log(error.domain) // 'STORAGE'
222
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
219
223
  console.log(error.details) // Additional error context
220
224
  }
221
225
  }
@@ -196,7 +196,7 @@ Query results are returned in this format:
196
196
  interface QueryResult {
197
197
  id: string
198
198
  score: number // 1/(1 + distance)
199
- metadata: Record<string, any>
199
+ metadata?: Record<string, any>
200
200
  vector?: number[] // Only included if includeVector is true
201
201
  }
202
202
  ```
@@ -244,17 +244,21 @@ S3 Vectors supports a strict subset of operators and value types. The Mastra fil
244
244
 
245
245
  ## Error handling
246
246
 
247
- The store throws typed errors that can be caught:
247
+ The store throws `MastraError` instances from `@mastra/core/error`:
248
248
 
249
249
  ```typescript
250
+ import { MastraError } from '@mastra/core/error'
251
+
250
252
  try {
251
253
  await store.query({
252
254
  indexName: 'index-name',
253
255
  queryVector: queryVector,
254
256
  })
255
257
  } catch (error) {
256
- if (error instanceof VectorStoreError) {
257
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
258
+ if (error instanceof MastraError) {
259
+ console.log(error.id) // 'MASTRA_VECTOR_S3VECTORS_QUERY_FAILED'
260
+ console.log(error.domain) // 'STORAGE'
261
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
258
262
  console.log(error.details) // Additional error context
259
263
  }
260
264
  }
@@ -28,11 +28,13 @@ The TurbopufferVector class provides vector search using [Turbopuffer](https://t
28
28
 
29
29
  ### `createIndex()`
30
30
 
31
+ Turbopuffer has no explicit create-index operation. `createIndex()` validates the arguments and records the dimension and metric locally; the namespace is created in Turbopuffer on the first `upsert()`.
32
+
31
33
  **indexName** (`string`): Name of the index to create
32
34
 
33
35
  **dimension** (`number`): Vector dimension (must match your embedding model)
34
36
 
35
- **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search (Default: `cosine`)
37
+ **metric** (`'cosine' | 'euclidean'`): Distance metric for similarity search. 'dotproduct' isn't supported and throws an error. (Default: `cosine`)
36
38
 
37
39
  ### `upsert()`
38
40
 
@@ -80,7 +82,7 @@ interface IndexStats {
80
82
 
81
83
  ### `updateVector()`
82
84
 
83
- Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
85
+ Update a single vector by ID, or every vector that matches a metadata filter. Either `id` or `filter` must be provided, but not both.
84
86
 
85
87
  **indexName** (`string`): Name of the index containing the vector
86
88
 
@@ -114,7 +116,7 @@ Query results are returned in this format:
114
116
  interface QueryResult {
115
117
  id: string
116
118
  score: number
117
- metadata: Record<string, any>
119
+ metadata?: Record<string, any>
118
120
  vector?: number[] // Only included if includeVector is true
119
121
  }
120
122
  ```
@@ -144,17 +146,21 @@ schemaConfigForIndex: (indexName: string) => {
144
146
 
145
147
  ## Error handling
146
148
 
147
- The store throws typed errors that can be caught:
149
+ The store throws `MastraError` instances from `@mastra/core/error`:
148
150
 
149
151
  ```typescript
152
+ import { MastraError } from '@mastra/core/error'
153
+
150
154
  try {
151
155
  await store.query({
152
156
  indexName: 'index_name',
153
157
  queryVector: queryVector,
154
158
  })
155
159
  } catch (error) {
156
- if (error instanceof VectorStoreError) {
157
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
160
+ if (error instanceof MastraError) {
161
+ console.log(error.id) // 'MASTRA_VECTOR_TURBOPUFFER_QUERY_FAILED'
162
+ console.log(error.domain) // 'STORAGE'
163
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
158
164
  console.log(error.details) // Additional error context
159
165
  }
160
166
  }
@@ -8,6 +8,8 @@ The UpstashVector class provides vector search using [Upstash Vector](https://up
8
8
 
9
9
  ## Constructor options
10
10
 
11
+ **id** (`string`): Unique identifier for this vector store instance
12
+
11
13
  **url** (`string`): Upstash Vector database URL
12
14
 
13
15
  **token** (`string`): Upstash Vector API token
@@ -194,24 +196,28 @@ Query results are returned in this format:
194
196
  interface QueryResult {
195
197
  id: string
196
198
  score: number
197
- metadata: Record<string, any>
199
+ metadata?: Record<string, any>
198
200
  vector?: number[] // Only included if includeVector is true
199
201
  }
200
202
  ```
201
203
 
202
204
  ## Error handling
203
205
 
204
- The store throws typed errors that can be caught:
206
+ The store throws `MastraError` instances from `@mastra/core/error`:
205
207
 
206
208
  ```typescript
209
+ import { MastraError } from '@mastra/core/error'
210
+
207
211
  try {
208
212
  await store.query({
209
213
  indexName: 'index_name',
210
214
  queryVector: queryVector,
211
215
  })
212
216
  } catch (error) {
213
- if (error instanceof VectorStoreError) {
214
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
217
+ if (error instanceof MastraError) {
218
+ console.log(error.id) // 'MASTRA_VECTOR_UPSTASH_QUERY_FAILED'
219
+ console.log(error.domain) // 'STORAGE'
220
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
215
221
  console.log(error.details) // Additional error context
216
222
  }
217
223
  }
@@ -133,17 +133,21 @@ interface QueryResult {
133
133
 
134
134
  ## Error handling
135
135
 
136
- The store throws typed errors that can be caught:
136
+ The store throws `MastraError` instances from `@mastra/core/error`:
137
137
 
138
138
  ```typescript
139
+ import { MastraError } from '@mastra/core/error'
140
+
139
141
  try {
140
142
  await store.query({
141
143
  indexName: 'index_name',
142
144
  queryVector: queryVector,
143
145
  })
144
146
  } catch (error) {
145
- if (error instanceof VectorStoreError) {
146
- console.log(error.code) // 'connection_failed' | 'invalid_dimension' | etc
147
+ if (error instanceof MastraError) {
148
+ console.log(error.id) // 'MASTRA_VECTOR_VECTORIZE_QUERY_FAILED'
149
+ console.log(error.domain) // 'STORAGE'
150
+ console.log(error.category) // 'USER' | 'THIRD_PARTY'
147
151
  console.log(error.details) // Additional error context
148
152
  }
149
153
  }
@@ -50,7 +50,7 @@ The `WeaviateVector` class provides vector search using [Weaviate](https://weavi
50
50
 
51
51
  **indexName** (`string`): Name of the index to query.
52
52
 
53
- **queryVector** (`number[]`): Query vector to find similar vectors for.
53
+ **queryVector** (`number[]`): Query vector to find similar vectors for. At least one of queryVector or filter must be provided.
54
54
 
55
55
  **topK** (`number`): Number of results to return. (Default: `10`)
56
56
 
@@ -10,13 +10,11 @@ CompositeVoice supports both Mastra voice providers and AI SDK model providers
10
10
 
11
11
  ## Constructor parameters
12
12
 
13
- **config** (`object`): Configuration object for the composite voice service
13
+ **input** (`MastraVoice | TranscriptionModel`): Voice provider or AI SDK transcription model to use for speech-to-text operations. AI SDK models are automatically wrapped.
14
14
 
15
- **config.input** (`MastraVoice | TranscriptionModel`): Voice provider or AI SDK transcription model to use for speech-to-text operations. AI SDK models are automatically wrapped.
15
+ **output** (`MastraVoice | SpeechModel`): Voice provider or AI SDK speech model to use for text-to-speech operations. AI SDK models are automatically wrapped.
16
16
 
17
- **config.output** (`MastraVoice | SpeechModel`): Voice provider or AI SDK speech model to use for text-to-speech operations. AI SDK models are automatically wrapped.
18
-
19
- **config.realtime** (`MastraVoice`): Voice provider to use for real-time speech-to-speech operations
17
+ **realtime** (`MastraVoice`): Voice provider to use for real-time speech-to-speech operations
20
18
 
21
19
  ## Methods
22
20
 
@@ -30,9 +28,10 @@ Converts text to speech using the configured speaking provider.
30
28
 
31
29
  Notes:
32
30
 
33
- - If no speaking provider is configured, this method will throw an error
34
- - Options are passed through to the configured speaking provider
35
- - Returns a stream of audio data
31
+ - If a realtime provider is configured, it handles the call; otherwise the speaking provider is used
32
+ - Throws a `MastraError` only when neither a realtime nor a speaking provider is configured
33
+ - Options are passed through to the provider that handles the call
34
+ - Returns a stream of audio data, or `void` when a realtime provider handles the call
36
35
 
37
36
  ### `listen()`
38
37
 
@@ -44,13 +43,14 @@ Converts speech to text using the configured listening provider.
44
43
 
45
44
  Notes:
46
45
 
47
- - If no listening provider is configured, this method will throw an error
48
- - Options are passed through to the configured listening provider
49
- - Returns either a string or a stream of transcribed text, depending on the provider
46
+ - If a realtime provider is configured, it handles the call; otherwise the listening provider is used
47
+ - Throws a `MastraError` only when neither a realtime nor a listening provider is configured
48
+ - Options are passed through to the provider that handles the call
49
+ - Returns a string or a stream of transcribed text, depending on the provider, or `void` when a realtime provider emits results through events
50
50
 
51
51
  ### `getSpeakers()`
52
52
 
53
- Returns a list of available voices from the speaking provider, where each node contains:
53
+ Returns a list of available voices from the realtime provider, or from the speaking provider when no realtime provider is configured, where each node contains:
54
54
 
55
55
  **voiceId** (`string`): Unique identifier for the voice
56
56
 
@@ -58,10 +58,10 @@ Returns a list of available voices from the speaking provider, where each node c
58
58
 
59
59
  Notes:
60
60
 
61
- - Returns voices from the speaking provider only
62
- - If no speaking provider is configured, returns an empty array
61
+ - Returns voices from the realtime provider when one is configured, otherwise from the speaking provider
62
+ - Throws a `MastraError` when neither a realtime nor a speaking provider is configured
63
63
  - Each voice object will have at least a voiceId property
64
- - Additional voice properties depend on the speaking provider
64
+ - Additional voice properties depend on the provider
65
65
 
66
66
  ## Usage examples
67
67
 
@@ -141,7 +141,7 @@ Converts speech to text using the configured listening model.
141
141
 
142
142
  ```typescript
143
143
  abstract listen(
144
- audioStream: NodeJS.ReadableStream,
144
+ audioStream: NodeJS.ReadableStream | unknown,
145
145
  options?: {
146
146
  [key: string]: unknown;
147
147
  }
@@ -150,31 +150,32 @@ abstract listen(
150
150
 
151
151
  Purpose:
152
152
 
153
- - Takes an audio stream and converts it to text using the provider's speech-to-text service
153
+ - Takes an audio stream (or another provider-specific audio input) and converts it to text using the provider's speech-to-text service
154
154
  - Supports provider-specific options for transcription configuration
155
155
  - Can return either a complete text transcription or a stream of transcribed text
156
156
  - Not all providers support this functionality (e.g., PlayAI, Speechify)
157
157
  - May return void if the transcription is handled by emitting 'writing' event
158
158
 
159
+ ## Optional methods
160
+
161
+ These methods have default implementations but can be overridden by voice providers that support speech-to-speech capabilities.
162
+
159
163
  ### `getSpeakers()`
160
164
 
161
165
  Returns a list of available voices supported by the provider.
162
166
 
163
167
  ```typescript
164
- abstract getSpeakers(): Promise<Array<{ voiceId: string; [key: string]: unknown }>>
168
+ getSpeakers(): Promise<Array<{ voiceId: string; [key: string]: unknown }>>
165
169
  ```
166
170
 
167
171
  Purpose:
168
172
 
169
173
  - Retrieves the list of available voices/speakers from the provider
174
+ - The default implementation returns an empty array; providers override it to list their voices
170
175
  - Each voice must have at least a voiceId property
171
176
  - Providers can include additional metadata about each voice
172
177
  - Used to discover available voices for text-to-speech conversion
173
178
 
174
- ## Optional methods
175
-
176
- These methods have default implementations but can be overridden by voice providers that support speech-to-speech capabilities.
177
-
178
179
  ### `connect()`
179
180
 
180
181
  Establishes a WebSocket or WebRTC connection for communication.
@@ -210,12 +211,13 @@ Purpose:
210
211
  Triggers the voice provider to generate a response.
211
212
 
212
213
  ```typescript
213
- answer(): Promise<void>
214
+ answer(options?: Record<string, unknown>): Promise<void>
214
215
  ```
215
216
 
216
217
  Purpose:
217
218
 
218
219
  - Sends a signal to the voice provider to generate a response
220
+ - Accepts optional provider-specific options
219
221
  - Used in real-time conversations to prompt the AI to respond
220
222
  - Response will be emitted through the event system (e.g., 'speaking' event)
221
223
 
@@ -285,9 +287,11 @@ Purpose:
285
287
 
286
288
  The MastraVoice class includes an event system for real-time communication. Standard event types include:
287
289
 
288
- **speaking** (`{ text: string; audioStream?: NodeJS.ReadableStream; audio?: Int16Array }`): Emitted when the voice provider is speaking, contains audio data
290
+ **speaker** (`NodeJS.ReadableStream`): Emitted with an audio stream for each new response the voice provider speaks
291
+
292
+ **speaking** (`{ audio?: string }`): Emitted when the voice provider is speaking, contains audio data
289
293
 
290
- **writing** (`{ text: string, role: string }`): Emitted when text is transcribed from speech
294
+ **writing** (`{ text: string; role: 'assistant' | 'user' }`): Emitted when text is transcribed from speech
291
295
 
292
296
  **error** (`{ message: string; code?: string; details?: unknown }`): Emitted when an error occurs
293
297
 
@@ -308,7 +312,7 @@ MastraVoice includes built-in telemetry support through the `traced` method, whi
308
312
  ## Notes
309
313
 
310
314
  - MastraVoice is an abstract class and can't be instantiated directly
311
- - Implementations must provide concrete implementations for all abstract methods
315
+ - Implementations must provide concrete implementations of the abstract `speak()` and `listen()` methods
312
316
  - The class provides a consistent interface across different voice service providers
313
317
  - Speech-to-speech capabilities are optional and provider-specific
314
318
  - The event system enables asynchronous communication for real-time interactions
@@ -54,7 +54,7 @@ This method doesn't return a value.
54
54
 
55
55
  - Instructions are most effective when they're clear, specific, and relevant to the voice interaction
56
56
  - This method is primarily used with real-time voice providers that maintain conversation context
57
- - If called on a voice provider that doesn't support instructions, it will log a warning and do nothing
57
+ - If called on a voice provider that doesn't support instructions, it will do nothing
58
58
  - Instructions added with this method are typically combined with any instructions provided by an associated Agent
59
59
  - For best results, add instructions before starting a conversation (before calling `connect()`)
60
60
  - Multiple calls to `addInstructions()` may either replace or append to existing instructions, depending on the provider implementation
@@ -64,7 +64,7 @@ This method doesn't return a value.
64
64
 
65
65
  - Tools must follow the Mastra tool format with name, description, input schema, and execute function
66
66
  - This method is primarily used with real-time voice providers that support function calling
67
- - If called on a voice provider that doesn't support tools, it will log a warning and do nothing
67
+ - If called on a voice provider that doesn't support tools, it will do nothing
68
68
  - Tools added with this method are typically combined with any tools provided by an associated Agent
69
69
  - For best results, add tools before starting a conversation (before calling `connect()`)
70
70
  - The voice provider will automatically handle the invocation of tool handlers when the model decides to use them
@@ -52,7 +52,7 @@ Returns a `Promise<void>` that resolves when the response has been triggered.
52
52
  ## Notes
53
53
 
54
54
  - This method is only implemented by real-time voice providers that support speech-to-speech capabilities
55
- - If called on a voice provider that doesn't support this functionality, it will log a warning and resolve immediately
55
+ - If called on a voice provider that doesn't support this functionality, it will log a debug message and resolve immediately
56
56
  - The response audio will typically be emitted through the 'speaking' event rather than returned directly
57
57
  - For providers that support it, you can use this method to send a specific response instead of having the AI generate one
58
58
  - This method is commonly used in conjunction with `send()` to create a conversational flow
@@ -51,5 +51,5 @@ This method doesn't return a value.
51
51
  - Always call `close()` when you're done with a real-time voice session to free up resources
52
52
  - After calling `close()`, you'll need to call `connect()` again if you want to start a new session
53
53
  - This method is primarily used with real-time voice providers that maintain persistent connections
54
- - If called on a voice provider that doesn't support real-time connections, it will log a warning and do nothing
54
+ - If called on a voice provider that doesn't support real-time connections, it will log a debug message and do nothing
55
55
  - Failing to close connections can lead to resource leaks and potential billing issues with voice service providers
@@ -10,7 +10,7 @@ Voice providers emit events during real-time voice interactions. These events ca
10
10
 
11
11
  These events are commonly implemented across real-time voice providers:
12
12
 
13
- **error** (`Error`): Emitted when an error occurs during voice processing or when audio data format is unsupported
13
+ **error** (`{ message: string; code?: string; details?: unknown }`): Emitted when an error occurs during voice processing or when audio data format is unsupported
14
14
 
15
15
  **session.created** (`object`): Emitted when a new session is created with the OpenAI service
16
16
 
@@ -20,7 +20,7 @@ These events are commonly implemented across real-time voice providers:
20
20
 
21
21
  **response.done** (`object`): Emitted when the AI assistant has completed its response
22
22
 
23
- **speaker** (`StreamWithId`): Emitted with a new audio stream that can be piped to an audio output
23
+ **speaker** (`NodeJS.ReadableStream`): Emitted with a new audio stream that can be piped to an audio output. Some realtime providers attach an id property to the stream
24
24
 
25
25
  **writing** (`object`): Emitted when text is being transcribed (user) or generated (assistant)
26
26
 
@@ -8,7 +8,7 @@ The `listen()` method is a core function available in all Mastra voice providers
8
8
 
9
9
  ## Parameters
10
10
 
11
- **audioStream** (`NodeJS.ReadableStream`): Audio stream to transcribe. This can be a file stream or a microphone stream.
11
+ **audioStream** (`NodeJS.ReadableStream | unknown`): Audio to transcribe. This is usually a file stream or a microphone stream; some realtime providers accept other audio input types.
12
12
 
13
13
  **options** (`object`): Provider-specific options for speech recognition
14
14
 
@@ -54,5 +54,5 @@ This method doesn't return a value.
54
54
  - The callback passed to `off()` must be the same function reference that was passed to `on()`
55
55
  - If the callback isn't found, the method will have no effect
56
56
  - This method is primarily used with real-time voice providers that support event-based communication
57
- - If called on a voice provider that doesn't support events, it will log a warning and do nothing
57
+ - If called on a voice provider that doesn't support events, it will log a debug message and do nothing
58
58
  - Removing event listeners is important for preventing memory leaks in long-running applications