@mastra/core 1.13.3-alpha.1 → 1.14.0-alpha.2

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 (264) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/_types/@internal_core/dist/index.d.ts +1333 -0
  3. package/dist/agent/index.cjs +13 -13
  4. package/dist/agent/index.js +2 -2
  5. package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
  6. package/dist/agent/message-list/index.cjs +18 -18
  7. package/dist/agent/message-list/index.js +1 -1
  8. package/dist/agent/message-list/message-list.d.ts +12 -1
  9. package/dist/agent/message-list/message-list.d.ts.map +1 -1
  10. package/dist/agent/message-list/types.d.ts +3 -3
  11. package/dist/agent/types.d.ts +1 -1
  12. package/dist/{chunk-3B6BQEKK.cjs → chunk-2FDGDAJQ.cjs} +3 -3
  13. package/dist/{chunk-3B6BQEKK.cjs.map → chunk-2FDGDAJQ.cjs.map} +1 -1
  14. package/dist/{chunk-GYSKVDYD.js → chunk-3TECGW34.js} +5 -5
  15. package/dist/{chunk-GYSKVDYD.js.map → chunk-3TECGW34.js.map} +1 -1
  16. package/dist/{chunk-Q4W5XQK2.cjs → chunk-445B4SO3.cjs} +292 -403
  17. package/dist/chunk-445B4SO3.cjs.map +1 -0
  18. package/dist/{chunk-WO2CP4Z2.cjs → chunk-4X35LO4W.cjs} +32 -156
  19. package/dist/chunk-4X35LO4W.cjs.map +1 -0
  20. package/dist/{chunk-GC7AHOXK.js → chunk-5LHPEIQQ.js} +12 -12
  21. package/dist/chunk-5LHPEIQQ.js.map +1 -0
  22. package/dist/{chunk-CMTNYR6E.js → chunk-5UAF67E3.js} +9 -9
  23. package/dist/{chunk-CMTNYR6E.js.map → chunk-5UAF67E3.js.map} +1 -1
  24. package/dist/{chunk-SBHYPYXD.js → chunk-5WKCTOYN.js} +13 -13
  25. package/dist/chunk-5WKCTOYN.js.map +1 -0
  26. package/dist/{chunk-WKZEZJKQ.js → chunk-7V4HN5NK.js} +5 -5
  27. package/dist/{chunk-WKZEZJKQ.js.map → chunk-7V4HN5NK.js.map} +1 -1
  28. package/dist/{chunk-F3SHGIQA.cjs → chunk-B3KIJAOJ.cjs} +185 -185
  29. package/dist/{chunk-F3SHGIQA.cjs.map → chunk-B3KIJAOJ.cjs.map} +1 -1
  30. package/dist/{chunk-TAXQJ5ZP.js → chunk-BOUXMXZQ.js} +4 -94
  31. package/dist/chunk-BOUXMXZQ.js.map +1 -0
  32. package/dist/{chunk-MIILNUS4.cjs → chunk-DDIY3CRP.cjs} +10 -10
  33. package/dist/chunk-DDIY3CRP.cjs.map +1 -0
  34. package/dist/{chunk-4RWTWZET.cjs → chunk-EAKNCJKL.cjs} +31 -433
  35. package/dist/chunk-EAKNCJKL.cjs.map +1 -0
  36. package/dist/{chunk-RE3YFYVQ.cjs → chunk-EH5D56XV.cjs} +7 -7
  37. package/dist/{chunk-RE3YFYVQ.cjs.map → chunk-EH5D56XV.cjs.map} +1 -1
  38. package/dist/{chunk-A2B3L753.js → chunk-FZNKE4DK.js} +4 -4
  39. package/dist/{chunk-A2B3L753.js.map → chunk-FZNKE4DK.js.map} +1 -1
  40. package/dist/chunk-GVQJCS5O.js +812 -0
  41. package/dist/chunk-GVQJCS5O.js.map +1 -0
  42. package/dist/{chunk-NUZYNU4M.cjs → chunk-J7Q3CZI5.cjs} +14 -14
  43. package/dist/{chunk-NUZYNU4M.cjs.map → chunk-J7Q3CZI5.cjs.map} +1 -1
  44. package/dist/{chunk-CJYTDH5Q.js → chunk-KJUHI5QK.js} +5 -5
  45. package/dist/chunk-KJUHI5QK.js.map +1 -0
  46. package/dist/{chunk-B44JEQHW.js → chunk-KKNT7W4Q.js} +4 -4
  47. package/dist/{chunk-B44JEQHW.js.map → chunk-KKNT7W4Q.js.map} +1 -1
  48. package/dist/{chunk-FDC6E3MJ.cjs → chunk-LAFTYVLN.cjs} +72 -72
  49. package/dist/chunk-LAFTYVLN.cjs.map +1 -0
  50. package/dist/chunk-LIRWMGGI.cjs +931 -0
  51. package/dist/chunk-LIRWMGGI.cjs.map +1 -0
  52. package/dist/{chunk-6JM4RID6.js → chunk-MCAE3D3S.js} +41 -7
  53. package/dist/chunk-MCAE3D3S.js.map +1 -0
  54. package/dist/{chunk-T5M2TGCD.js → chunk-OGR427FH.js} +14 -350
  55. package/dist/chunk-OGR427FH.js.map +1 -0
  56. package/dist/{chunk-AZZGCVBY.js → chunk-PV2DBPYF.js} +3 -3
  57. package/dist/{chunk-AZZGCVBY.js.map → chunk-PV2DBPYF.js.map} +1 -1
  58. package/dist/{chunk-Z7JQTINS.js → chunk-QROAUTDP.js} +3 -3
  59. package/dist/{chunk-Z7JQTINS.js.map → chunk-QROAUTDP.js.map} +1 -1
  60. package/dist/{chunk-DRZWU4MQ.cjs → chunk-RQFAL5VW.cjs} +13 -13
  61. package/dist/chunk-RQFAL5VW.cjs.map +1 -0
  62. package/dist/{chunk-YTSTLTQ5.cjs → chunk-SRNRUDZ2.cjs} +21 -21
  63. package/dist/{chunk-YTSTLTQ5.cjs.map → chunk-SRNRUDZ2.cjs.map} +1 -1
  64. package/dist/{chunk-L2YA2HHZ.js → chunk-SRVR5Z2F.js} +5 -5
  65. package/dist/{chunk-L2YA2HHZ.js.map → chunk-SRVR5Z2F.js.map} +1 -1
  66. package/dist/{chunk-KMG525KB.js → chunk-TFV75T4H.js} +10 -10
  67. package/dist/{chunk-KMG525KB.js.map → chunk-TFV75T4H.js.map} +1 -1
  68. package/dist/{chunk-26JVEE76.cjs → chunk-UHO57W6H.cjs} +7 -7
  69. package/dist/{chunk-26JVEE76.cjs.map → chunk-UHO57W6H.cjs.map} +1 -1
  70. package/dist/{chunk-QXNHZJRV.js → chunk-UWTB4U2X.js} +127 -238
  71. package/dist/chunk-UWTB4U2X.js.map +1 -0
  72. package/dist/{chunk-E2Y2HLCU.cjs → chunk-W2LUCUUP.cjs} +41 -7
  73. package/dist/chunk-W2LUCUUP.cjs.map +1 -0
  74. package/dist/{chunk-X7IX2H7I.cjs → chunk-XVH7SCZN.cjs} +13 -13
  75. package/dist/{chunk-X7IX2H7I.cjs.map → chunk-XVH7SCZN.cjs.map} +1 -1
  76. package/dist/{chunk-CXYQJVHK.cjs → chunk-YSQC2LEG.cjs} +10 -10
  77. package/dist/{chunk-CXYQJVHK.cjs.map → chunk-YSQC2LEG.cjs.map} +1 -1
  78. package/dist/{chunk-XNHOUTCP.cjs → chunk-ZSFSSMFT.cjs} +84 -84
  79. package/dist/{chunk-XNHOUTCP.cjs.map → chunk-ZSFSSMFT.cjs.map} +1 -1
  80. package/dist/datasets/index.cjs +17 -17
  81. package/dist/datasets/index.js +2 -2
  82. package/dist/docs/SKILL.md +1 -1
  83. package/dist/docs/assets/SOURCE_MAP.json +721 -708
  84. package/dist/docs/references/docs-agents-adding-voice.md +6 -6
  85. package/dist/docs/references/docs-agents-agent-approval.md +4 -4
  86. package/dist/docs/references/docs-agents-guardrails.md +1 -1
  87. package/dist/docs/references/docs-agents-network-approval.md +1 -1
  88. package/dist/docs/references/docs-agents-networks.md +1 -1
  89. package/dist/docs/references/docs-agents-overview.md +2 -2
  90. package/dist/docs/references/docs-agents-processors.md +11 -11
  91. package/dist/docs/references/docs-agents-structured-output.md +4 -4
  92. package/dist/docs/references/docs-agents-supervisor-agents.md +3 -3
  93. package/dist/docs/references/docs-agents-using-tools.md +4 -4
  94. package/dist/docs/references/docs-evals-custom-scorers.md +4 -4
  95. package/dist/docs/references/docs-evals-overview.md +2 -2
  96. package/dist/docs/references/docs-memory-memory-processors.md +6 -6
  97. package/dist/docs/references/docs-memory-semantic-recall.md +1 -1
  98. package/dist/docs/references/docs-memory-storage.md +1 -1
  99. package/dist/docs/references/docs-memory-working-memory.md +1 -1
  100. package/dist/docs/references/docs-observability-datasets-running-experiments.md +1 -1
  101. package/dist/docs/references/docs-observability-tracing-exporters-langfuse.md +1 -1
  102. package/dist/docs/references/docs-observability-tracing-exporters-langsmith.md +2 -2
  103. package/dist/docs/references/docs-rag-graph-rag.md +2 -2
  104. package/dist/docs/references/docs-rag-retrieval.md +12 -12
  105. package/dist/docs/references/docs-server-mastra-client.md +1 -1
  106. package/dist/docs/references/docs-server-request-context.md +3 -3
  107. package/dist/docs/references/docs-streaming-tool-streaming.md +1 -1
  108. package/dist/docs/references/docs-voice-overview.md +21 -21
  109. package/dist/docs/references/docs-voice-speech-to-speech.md +2 -2
  110. package/dist/docs/references/docs-voice-speech-to-text.md +1 -1
  111. package/dist/docs/references/docs-voice-text-to-speech.md +1 -1
  112. package/dist/docs/references/docs-workspace-filesystem.md +1 -1
  113. package/dist/docs/references/docs-workspace-overview.md +1 -1
  114. package/dist/docs/references/docs-workspace-sandbox.md +1 -1
  115. package/dist/docs/references/reference-agents-agent.md +5 -5
  116. package/dist/docs/references/reference-agents-generateLegacy.md +2 -2
  117. package/dist/docs/references/reference-agents-getLLM.md +1 -1
  118. package/dist/docs/references/reference-agents-network.md +1 -1
  119. package/dist/docs/references/reference-configuration.md +3 -3
  120. package/dist/docs/references/reference-evals-answer-relevancy.md +1 -1
  121. package/dist/docs/references/reference-evals-answer-similarity.md +1 -1
  122. package/dist/docs/references/reference-evals-bias.md +1 -1
  123. package/dist/docs/references/reference-evals-context-precision.md +3 -3
  124. package/dist/docs/references/reference-evals-faithfulness.md +1 -1
  125. package/dist/docs/references/reference-evals-hallucination.md +5 -5
  126. package/dist/docs/references/reference-evals-toxicity.md +1 -1
  127. package/dist/docs/references/reference-harness-harness-class.md +4 -4
  128. package/dist/docs/references/reference-memory-memory-class.md +3 -3
  129. package/dist/docs/references/reference-memory-observational-memory.md +5 -5
  130. package/dist/docs/references/reference-processors-batch-parts-processor.md +1 -1
  131. package/dist/docs/references/reference-processors-language-detector.md +1 -1
  132. package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
  133. package/dist/docs/references/reference-processors-pii-detector.md +2 -2
  134. package/dist/docs/references/reference-processors-processor-interface.md +3 -3
  135. package/dist/docs/references/reference-processors-prompt-injection-detector.md +1 -1
  136. package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
  137. package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -3
  138. package/dist/docs/references/reference-processors-tool-search-processor.md +2 -2
  139. package/dist/docs/references/reference-processors-unicode-normalizer.md +1 -1
  140. package/dist/docs/references/reference-storage-mongodb.md +1 -1
  141. package/dist/docs/references/reference-storage-postgresql.md +1 -1
  142. package/dist/docs/references/reference-storage-upstash.md +1 -1
  143. package/dist/docs/references/reference-templates-overview.md +1 -1
  144. package/dist/docs/references/reference-tools-mcp-client.md +2 -2
  145. package/dist/docs/references/reference-tools-mcp-server.md +1 -1
  146. package/dist/docs/references/reference-tools-vector-query-tool.md +1 -1
  147. package/dist/docs/references/reference-vectors-libsql.md +1 -1
  148. package/dist/docs/references/reference-vectors-mongodb.md +1 -1
  149. package/dist/docs/references/reference-vectors-pg.md +1 -1
  150. package/dist/docs/references/reference-vectors-upstash.md +1 -1
  151. package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
  152. package/dist/docs/references/reference-workspace-local-filesystem.md +1 -1
  153. package/dist/docs/references/reference-workspace-local-sandbox.md +1 -1
  154. package/dist/evals/index.cjs +20 -20
  155. package/dist/evals/index.js +3 -3
  156. package/dist/evals/scoreTraces/index.cjs +7 -7
  157. package/dist/evals/scoreTraces/index.js +3 -3
  158. package/dist/features/index.cjs +2 -1
  159. package/dist/features/index.cjs.map +1 -1
  160. package/dist/features/index.d.ts.map +1 -1
  161. package/dist/features/index.js +2 -1
  162. package/dist/features/index.js.map +1 -1
  163. package/dist/harness/index.cjs +7 -7
  164. package/dist/harness/index.js +5 -5
  165. package/dist/index.cjs +2 -2
  166. package/dist/index.js +1 -1
  167. package/dist/llm/index.cjs +16 -16
  168. package/dist/llm/index.js +5 -5
  169. package/dist/llm/model/base.types.d.ts +1 -1
  170. package/dist/llm/model/provider-types.generated.d.ts +4 -4
  171. package/dist/loop/index.cjs +14 -14
  172. package/dist/loop/index.js +1 -1
  173. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  174. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
  175. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  176. package/dist/mastra/index.cjs +2 -2
  177. package/dist/mastra/index.js +1 -1
  178. package/dist/memory/index.cjs +14 -14
  179. package/dist/memory/index.js +1 -1
  180. package/dist/memory/types.d.ts +1 -1
  181. package/dist/models-dev-E24MAXL2.cjs +12 -0
  182. package/dist/{models-dev-SOEEI4UR.cjs.map → models-dev-E24MAXL2.cjs.map} +1 -1
  183. package/dist/models-dev-F65PLXGJ.js +3 -0
  184. package/dist/{models-dev-EKZCLX7Y.js.map → models-dev-F65PLXGJ.js.map} +1 -1
  185. package/dist/netlify-FT3VYX27.cjs +12 -0
  186. package/dist/{netlify-SSPGBXOO.cjs.map → netlify-FT3VYX27.cjs.map} +1 -1
  187. package/dist/netlify-NYUZ5ZTO.js +3 -0
  188. package/dist/{netlify-ALYV7577.js.map → netlify-NYUZ5ZTO.js.map} +1 -1
  189. package/dist/observability/index.cjs +17 -17
  190. package/dist/observability/index.js +1 -1
  191. package/dist/observability/types/tracing.d.ts +2 -22
  192. package/dist/observability/types/tracing.d.ts.map +1 -1
  193. package/dist/processor-provider/index.cjs +10 -10
  194. package/dist/processor-provider/index.js +1 -1
  195. package/dist/processors/index.cjs +42 -42
  196. package/dist/processors/index.js +1 -1
  197. package/dist/provider-registry-5R2TUINW.js +3 -0
  198. package/dist/{provider-registry-AZ4SPASK.js.map → provider-registry-5R2TUINW.js.map} +1 -1
  199. package/dist/provider-registry-TVYED7F2.cjs +40 -0
  200. package/dist/{provider-registry-35V252GM.cjs.map → provider-registry-TVYED7F2.cjs.map} +1 -1
  201. package/dist/provider-registry.json +8 -8
  202. package/dist/relevance/index.cjs +3 -3
  203. package/dist/relevance/index.js +1 -1
  204. package/dist/storage/constants.cjs +56 -56
  205. package/dist/storage/constants.d.ts +1 -1
  206. package/dist/storage/constants.js +1 -1
  207. package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
  208. package/dist/storage/domains/observability/discovery.d.ts +1 -63
  209. package/dist/storage/domains/observability/discovery.d.ts.map +1 -1
  210. package/dist/storage/domains/observability/feedback.d.ts +1 -185
  211. package/dist/storage/domains/observability/feedback.d.ts.map +1 -1
  212. package/dist/storage/domains/observability/logs.d.ts +1 -321
  213. package/dist/storage/domains/observability/logs.d.ts.map +1 -1
  214. package/dist/storage/domains/observability/metrics.d.ts +1 -394
  215. package/dist/storage/domains/observability/metrics.d.ts.map +1 -1
  216. package/dist/storage/domains/observability/scores.d.ts +1 -192
  217. package/dist/storage/domains/observability/scores.d.ts.map +1 -1
  218. package/dist/storage/domains/observability/tracing.d.ts +50 -52
  219. package/dist/storage/domains/observability/tracing.d.ts.map +1 -1
  220. package/dist/storage/domains/shared.d.ts +1 -118
  221. package/dist/storage/domains/shared.d.ts.map +1 -1
  222. package/dist/storage/index.cjs +479 -466
  223. package/dist/storage/index.js +3 -2
  224. package/dist/stream/index.cjs +11 -11
  225. package/dist/stream/index.js +2 -2
  226. package/dist/test-utils/llm-mock.cjs +4 -4
  227. package/dist/test-utils/llm-mock.js +1 -1
  228. package/dist/tool-loop-agent/index.cjs +4 -4
  229. package/dist/tool-loop-agent/index.js +1 -1
  230. package/dist/utils.cjs +23 -23
  231. package/dist/utils.js +1 -1
  232. package/dist/vector/embed.d.ts +2 -2
  233. package/dist/vector/index.cjs +7 -7
  234. package/dist/vector/index.js +1 -1
  235. package/dist/workflows/evented/index.cjs +10 -10
  236. package/dist/workflows/evented/index.js +1 -1
  237. package/dist/workflows/index.cjs +24 -24
  238. package/dist/workflows/index.js +1 -1
  239. package/package.json +6 -5
  240. package/src/llm/model/provider-types.generated.d.ts +4 -4
  241. package/dist/chunk-4RWTWZET.cjs.map +0 -1
  242. package/dist/chunk-6JM4RID6.js.map +0 -1
  243. package/dist/chunk-CJYTDH5Q.js.map +0 -1
  244. package/dist/chunk-DJCCDPZQ.js +0 -376
  245. package/dist/chunk-DJCCDPZQ.js.map +0 -1
  246. package/dist/chunk-DRZWU4MQ.cjs.map +0 -1
  247. package/dist/chunk-E2Y2HLCU.cjs.map +0 -1
  248. package/dist/chunk-FDC6E3MJ.cjs.map +0 -1
  249. package/dist/chunk-GC7AHOXK.js.map +0 -1
  250. package/dist/chunk-MIILNUS4.cjs.map +0 -1
  251. package/dist/chunk-PBDJR7QN.cjs +0 -393
  252. package/dist/chunk-PBDJR7QN.cjs.map +0 -1
  253. package/dist/chunk-Q4W5XQK2.cjs.map +0 -1
  254. package/dist/chunk-QXNHZJRV.js.map +0 -1
  255. package/dist/chunk-SBHYPYXD.js.map +0 -1
  256. package/dist/chunk-T5M2TGCD.js.map +0 -1
  257. package/dist/chunk-TAXQJ5ZP.js.map +0 -1
  258. package/dist/chunk-WO2CP4Z2.cjs.map +0 -1
  259. package/dist/models-dev-EKZCLX7Y.js +0 -3
  260. package/dist/models-dev-SOEEI4UR.cjs +0 -12
  261. package/dist/netlify-ALYV7577.js +0 -3
  262. package/dist/netlify-SSPGBXOO.cjs +0 -12
  263. package/dist/provider-registry-35V252GM.cjs +0 -40
  264. package/dist/provider-registry-AZ4SPASK.js +0 -3
@@ -20,7 +20,7 @@ export const agent = new Agent({
20
20
  id: 'voice-agent',
21
21
  name: 'Voice Agent',
22
22
  instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
23
- model: 'openai/gpt-5.1',
23
+ model: 'openai/gpt-5.4',
24
24
  voice,
25
25
  })
26
26
 
@@ -109,7 +109,7 @@ export const agent = new Agent({
109
109
  id: 'speech-to-speech-agent',
110
110
  name: 'Speech-to-Speech Agent',
111
111
  instructions: `You are a helpful assistant with speech-to-speech capabilities.`,
112
- model: 'openai/gpt-5.1',
112
+ model: 'openai/gpt-5.4',
113
113
  tools: {
114
114
  // Tools configured on Agent are passed to voice provider
115
115
  search,
@@ -209,7 +209,7 @@ export const convertToText = async (input: string | NodeJS.ReadableStream): Prom
209
209
  export const hybridVoiceAgent = new Agent({
210
210
  id: 'hybrid-voice-agent',
211
211
  name: 'Hybrid Voice Agent',
212
- model: 'openai/gpt-5.1',
212
+ model: 'openai/gpt-5.4',
213
213
  instructions: 'You can speak and listen using different providers.',
214
214
  voice: new CompositeVoice({
215
215
  input: new OpenAIVoice(),
@@ -221,7 +221,7 @@ export const unifiedVoiceAgent = new Agent({
221
221
  id: 'unified-voice-agent',
222
222
  name: 'Unified Voice Agent',
223
223
  instructions: 'You are an agent with both STT and TTS capabilities.',
224
- model: 'openai/gpt-5.1',
224
+ model: 'openai/gpt-5.4',
225
225
  voice: new OpenAIVoice(),
226
226
  })
227
227
 
@@ -263,7 +263,7 @@ export const agent = new Agent({
263
263
  id: 'voice-agent',
264
264
  name: 'Voice Agent',
265
265
  instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
266
- model: 'openai/gpt-5.1',
266
+ model: 'openai/gpt-5.4',
267
267
 
268
268
  // Create a composite voice using OpenAI for listening and PlayAI for speaking
269
269
  voice: new CompositeVoice({
@@ -288,7 +288,7 @@ export const agent = new Agent({
288
288
  id: 'aisdk-voice-agent',
289
289
  name: 'AI SDK Voice Agent',
290
290
  instructions: `You are a helpful assistant with voice capabilities.`,
291
- model: 'openai/gpt-5.1',
291
+ model: 'openai/gpt-5.4',
292
292
 
293
293
  // Pass AI SDK models directly to CompositeVoice
294
294
  voice: new CompositeVoice({
@@ -278,7 +278,7 @@ const agent = new Agent({
278
278
  id: 'my-agent',
279
279
  name: 'My Agent',
280
280
  instructions: 'You are a helpful assistant',
281
- model: 'openai/gpt-4o-mini',
281
+ model: 'openai/gpt-5-mini',
282
282
  tools: { weatherTool },
283
283
  memory: new Memory(),
284
284
  defaultOptions: {
@@ -343,7 +343,7 @@ const agent = new Agent({
343
343
  id: 'my-agent',
344
344
  name: 'My Agent',
345
345
  instructions: 'You are a helpful assistant',
346
- model: 'openai/gpt-4o-mini',
346
+ model: 'openai/gpt-5-mini',
347
347
  tools: { weatherTool },
348
348
  memory: new Memory(),
349
349
  defaultOptions: {
@@ -445,7 +445,7 @@ const dataAgent = new Agent({
445
445
  id: 'data-agent',
446
446
  name: 'Data Agent',
447
447
  description: 'Handles database queries and user data retrieval',
448
- model: 'openai/gpt-4o-mini',
448
+ model: 'openai/gpt-5-mini',
449
449
  tools: { findUserTool },
450
450
  })
451
451
 
@@ -454,7 +454,7 @@ const supervisorAgent = new Agent({
454
454
  name: 'Supervisor Agent',
455
455
  instructions: `You coordinate data retrieval tasks.
456
456
  Delegate to data-agent for user lookups.`,
457
- model: 'openai/gpt-5.1',
457
+ model: 'openai/gpt-5.4',
458
458
  agents: { dataAgent },
459
459
  memory: new Memory(),
460
460
  })
@@ -25,7 +25,7 @@ export const moderatedAgent = new Agent({
25
25
  id: 'moderated-agent',
26
26
  name: 'Moderated Agent',
27
27
  instructions: 'You are a helpful assistant',
28
- model: 'openai/gpt-5.1',
28
+ model: 'openai/gpt-5.4',
29
29
  inputProcessors: [
30
30
  new ModerationProcessor({
31
31
  model: 'openrouter/openai/gpt-oss-safeguard-20b',
@@ -176,7 +176,7 @@ const routingAgent = new Agent({
176
176
  id: 'routing-agent',
177
177
  name: 'Routing Agent',
178
178
  instructions: 'You coordinate tasks across multiple agents',
179
- model: 'openai/gpt-4o-mini',
179
+ model: 'openai/gpt-5-mini',
180
180
  tools: { confirmationTool },
181
181
  memory: new Memory(),
182
182
  defaultNetworkOptions: {
@@ -48,7 +48,7 @@ export const routingAgent = new Agent({
48
48
  Always respond with a complete report—no bullet points.
49
49
  Write in full paragraphs, like a blog post.
50
50
  Do not answer with incomplete or uncertain information.`,
51
- model: 'openai/gpt-5.1',
51
+ model: 'openai/gpt-5.4',
52
52
  agents: {
53
53
  researchAgent,
54
54
  writingAgent,
@@ -53,7 +53,7 @@ Agents use LLMs and tools to solve open-ended tasks. They reason about goals, de
53
53
  id: 'test-agent',
54
54
  name: 'Test Agent',
55
55
  instructions: 'You are a helpful assistant.',
56
- model: 'openai/gpt-5.1',
56
+ model: 'openai/gpt-5.4',
57
57
  })
58
58
  ```
59
59
 
@@ -283,7 +283,7 @@ export const testAgent = new Agent({
283
283
  model: ({ requestContext }) => {
284
284
  const userTier = requestContext.get('user-tier') as UserTier['user-tier']
285
285
 
286
- return userTier === 'enterprise' ? 'openai/gpt-5' : 'openai/gpt-4.1-nano'
286
+ return userTier === 'enterprise' ? 'openai/gpt-5.4' : 'openai/gpt-5-mini'
287
287
  },
288
288
  })
289
289
  ```
@@ -37,10 +37,10 @@ import { ModerationProcessor } from '@mastra/core/processors'
37
37
  export const moderatedAgent = new Agent({
38
38
  name: 'moderated-agent',
39
39
  instructions: 'You are a helpful assistant',
40
- model: 'openai/gpt-4o-mini',
40
+ model: 'openai/gpt-5-mini',
41
41
  inputProcessors: [
42
42
  new ModerationProcessor({
43
- model: 'openai/gpt-4.1-nano',
43
+ model: 'openai/gpt-5-mini',
44
44
  categories: ['hate', 'harassment', 'violence'],
45
45
  threshold: 0.7,
46
46
  strategy: 'block',
@@ -178,7 +178,7 @@ export class DynamicModelProcessor implements Processor {
178
178
  }: ProcessInputStepArgs): Promise<ProcessInputStepResult> {
179
179
  // Use a fast model for initial response
180
180
  if (stepNumber === 0) {
181
- return { model: 'openai/gpt-4o-mini' }
181
+ return { model: 'openai/gpt-5-mini' }
182
182
  }
183
183
 
184
184
  // Disable tools after 5 steps to force completion
@@ -270,7 +270,7 @@ const MAX_STEPS = 5
270
270
  const agent = new Agent({
271
271
  id: 'bounded-agent',
272
272
  name: 'Bounded Agent',
273
- model: 'openai/gpt-4o-mini',
273
+ model: 'openai/gpt-5-mini',
274
274
  tools: {
275
275
  /* your tools */
276
276
  },
@@ -291,7 +291,7 @@ For simpler per-step logic, you can use the `prepareStep` callback on `generate(
291
291
  await agent.generate('Complex task', {
292
292
  prepareStep: async ({ stepNumber, model }) => {
293
293
  if (stepNumber === 0) {
294
- return { model: 'openai/gpt-4o-mini' }
294
+ return { model: 'openai/gpt-5-mini' }
295
295
  }
296
296
  if (stepNumber > 5) {
297
297
  return { toolChoice: 'none' }
@@ -482,7 +482,7 @@ import { TokenLimiter } from '@mastra/core/processors'
482
482
 
483
483
  const agent = new Agent({
484
484
  name: 'my-agent',
485
- model: 'openai/gpt-4o',
485
+ model: 'openai/gpt-5.4',
486
486
  inputProcessors: [
487
487
  // Ensure the total tokens don't exceed ~127k
488
488
  new TokenLimiter(127000),
@@ -490,7 +490,7 @@ const agent = new Agent({
490
490
  })
491
491
  ```
492
492
 
493
- The `TokenLimiter` uses the `o200k_base` encoding by default (suitable for GPT-4o). You can specify other encodings for different models:
493
+ The `TokenLimiter` uses the `o200k_base` encoding by default. You can specify other encodings for different models:
494
494
 
495
495
  ```typescript
496
496
  import cl100k_base from 'js-tiktoken/ranks/cl100k_base'
@@ -516,7 +516,7 @@ import { ToolCallFilter, TokenLimiter } from '@mastra/core/processors'
516
516
 
517
517
  const agent = new Agent({
518
518
  name: 'my-agent',
519
- model: 'openai/gpt-4o',
519
+ model: 'openai/gpt-5.4',
520
520
  inputProcessors: [
521
521
  // Example 1: Remove all tool calls/results
522
522
  new ToolCallFilter(),
@@ -542,7 +542,7 @@ import { ToolSearchProcessor } from '@mastra/core/processors'
542
542
 
543
543
  const agent = new Agent({
544
544
  name: 'my-agent',
545
- model: 'openai/gpt-4o',
545
+ model: 'openai/gpt-5.4',
546
546
  inputProcessors: [
547
547
  new ToolSearchProcessor({
548
548
  tools: {
@@ -584,7 +584,7 @@ const moderationWorkflow = createWorkflow({
584
584
  const agent = new Agent({
585
585
  id: 'moderated-agent',
586
586
  name: 'Moderated Agent',
587
- model: 'openai/gpt-4o',
587
+ model: 'openai/gpt-5.4',
588
588
  inputProcessors: [moderationWorkflow],
589
589
  })
590
590
  ```
@@ -619,7 +619,7 @@ export class QualityChecker implements Processor {
619
619
  const agent = new Agent({
620
620
  id: 'quality-agent',
621
621
  name: 'Quality Agent',
622
- model: 'openai/gpt-4o',
622
+ model: 'openai/gpt-5.4',
623
623
  outputProcessors: [new QualityChecker()],
624
624
  maxProcessorRetries: 3, // Maximum retry attempts (default: 3)
625
625
  })
@@ -137,7 +137,7 @@ const response = await testAgent.generate('Analyze the TypeScript programming la
137
137
  differentiators: z.array(z.string()),
138
138
  }),
139
139
  }),
140
- model: 'openai/gpt-4o',
140
+ model: 'openai/gpt-5.4',
141
141
  },
142
142
  })
143
143
 
@@ -207,7 +207,7 @@ When `model` is provided to the `structuredOutput` property, Mastra uses a separ
207
207
  const response = await testAgent.generate("Tell me about TypeScript.", {
208
208
  structuredOutput: {
209
209
  schema: yourSchema
210
- model: 'openai/gpt-4o'
210
+ model: 'openai/gpt-5.4'
211
211
  }
212
212
  });
213
213
  ```
@@ -221,7 +221,7 @@ const result = await agent.stream('weather in vancouver?', {
221
221
  prepareStep: async ({ stepNumber }) => {
222
222
  if (stepNumber === 0) {
223
223
  return {
224
- model: 'anthropic/claude-sonnet-4-20250514',
224
+ model: 'openai/gpt-5.4',
225
225
  tools: {
226
226
  weatherTool,
227
227
  },
@@ -229,7 +229,7 @@ const result = await agent.stream('weather in vancouver?', {
229
229
  }
230
230
  }
231
231
  return {
232
- model: 'anthropic/claude-sonnet-4-20250514',
232
+ model: 'openai/gpt-5.4',
233
233
  tools: undefined,
234
234
  structuredOutput: {
235
235
  schema: z.object({
@@ -24,20 +24,20 @@ import { LibSQLStore } from '@mastra/libsql'
24
24
  const researchAgent = new Agent({
25
25
  id: 'research-agent',
26
26
  description: 'Gathers factual information and returns bullet-point summaries.',
27
- model: 'openai/gpt-4o-mini',
27
+ model: 'openai/gpt-5-mini',
28
28
  })
29
29
 
30
30
  const writingAgent = new Agent({
31
31
  id: 'writing-agent',
32
32
  description: 'Transforms research into well-structured articles.',
33
- model: 'openai/gpt-4o-mini',
33
+ model: 'openai/gpt-5-mini',
34
34
  })
35
35
 
36
36
  const supervisor = new Agent({
37
37
  id: 'supervisor',
38
38
  instructions: `You coordinate research and writing using specialized agents.
39
39
  Delegate to research-agent for facts, then writing-agent for content.`,
40
- model: 'openai/gpt-5.1',
40
+ model: 'openai/gpt-5.4',
41
41
  agents: { researchAgent, writingAgent },
42
42
  memory: new Memory({
43
43
  storage: new LibSQLStore({ id: 'storage', url: 'file:mastra.db' }),
@@ -86,7 +86,7 @@ export const weatherAgent = new Agent({
86
86
  instructions: `
87
87
  You are a helpful weather assistant.
88
88
  Use the weatherTool to fetch current weather data.`,
89
- model: 'openai/gpt-5.1',
89
+ model: 'openai/gpt-5.4',
90
90
  tools: { weatherTool },
91
91
  })
92
92
  ```
@@ -118,7 +118,7 @@ export const parentAgent = new Agent({
118
118
  name: 'Parent Agent',
119
119
  description: 'Take care in writing a good description here',
120
120
  instructions: `Instructions`,
121
- model: 'openai/gpt-5.1',
121
+ model: 'openai/gpt-5.4',
122
122
  agents: {
123
123
  subAgent,
124
124
  },
@@ -129,7 +129,7 @@ const subAgent = new Agent({
129
129
  name: 'Sub Agent',
130
130
  description: 'Take care in writing a good description here',
131
131
  instructions: `Instructions`,
132
- model: 'openai/gpt-5.1',
132
+ model: 'openai/gpt-5.4',
133
133
  })
134
134
  ```
135
135
 
@@ -149,7 +149,7 @@ export const researchAgent = new Agent({
149
149
  instructions: `
150
150
  You are a research assistant.
151
151
  Use the research workflow to gather and compile information on topics.`,
152
- model: 'openai/gpt-5.1',
152
+ model: 'openai/gpt-5.4',
153
153
  tools: {
154
154
  weatherTool,
155
155
  },
@@ -44,7 +44,7 @@ const glutenCheckerScorer = createScorer({
44
44
  id: 'gluten-checker',
45
45
  description: 'Check if recipes contain gluten ingredients',
46
46
  judge: { // Optional: for prompt object steps
47
- model: 'openai/gpt-5.1',
47
+ model: 'openai/gpt-5.4',
48
48
  instructions: 'You are a Chef that identifies if recipes contain gluten.'
49
49
  }
50
50
  })
@@ -71,7 +71,7 @@ const quoteSourcesScorer = createScorer({
71
71
  id: 'quote-sources',
72
72
  description: 'Check if the response includes sources',
73
73
  judge: {
74
- model: 'openai/gpt-4.1-nano',
74
+ model: 'openai/gpt-5-mini',
75
75
  instructions: 'You are a strict evaluator.',
76
76
  },
77
77
  })
@@ -341,7 +341,7 @@ export const glutenCheckerScorer = createScorer({
341
341
  id: 'gluten-checker',
342
342
  description: 'Check if the output contains any gluten',
343
343
  judge: {
344
- model: 'openai/gpt-4.1-nano',
344
+ model: 'openai/gpt-5-mini',
345
345
  instructions: GLUTEN_INSTRUCTIONS,
346
346
  },
347
347
  })
@@ -376,7 +376,7 @@ Sets up the LLM model and defines its role as a domain expert.
376
376
 
377
377
  ```typescript
378
378
  judge: {
379
- model: 'openai/gpt-4.1-nano',
379
+ model: 'openai/gpt-5-mini',
380
380
  instructions: GLUTEN_INSTRUCTIONS,
381
381
  }
382
382
  ```
@@ -57,11 +57,11 @@ import { createAnswerRelevancyScorer, createToxicityScorer } from '@mastra/evals
57
57
  export const evaluatedAgent = new Agent({
58
58
  scorers: {
59
59
  relevancy: {
60
- scorer: createAnswerRelevancyScorer({ model: 'openai/gpt-4.1-nano' }),
60
+ scorer: createAnswerRelevancyScorer({ model: 'openai/gpt-5-mini' }),
61
61
  sampling: { type: 'ratio', rate: 0.5 },
62
62
  },
63
63
  safety: {
64
- scorer: createToxicityScorer({ model: 'openai/gpt-4.1-nano' }),
64
+ scorer: createToxicityScorer({ model: 'openai/gpt-5-mini' }),
65
65
  sampling: { type: 'ratio', rate: 1 },
66
66
  },
67
67
  },
@@ -45,7 +45,7 @@ const agent = new Agent({
45
45
  id: 'test-agent',
46
46
  name: 'Test Agent',
47
47
  instructions: 'You are a helpful assistant',
48
- model: 'openai/gpt-4o',
48
+ model: 'openai/gpt-5.4',
49
49
  memory: new Memory({
50
50
  storage: new LibSQLStore({
51
51
  id: 'memory-store',
@@ -95,7 +95,7 @@ import { openai } from '@ai-sdk/openai'
95
95
  const agent = new Agent({
96
96
  name: 'semantic-agent',
97
97
  instructions: 'You are a helpful assistant with semantic memory',
98
- model: 'openai/gpt-4o',
98
+ model: 'openai/gpt-5.4',
99
99
  memory: new Memory({
100
100
  storage: new LibSQLStore({
101
101
  id: 'memory-store',
@@ -148,7 +148,7 @@ import { openai } from '@ai-sdk/openai'
148
148
  const agent = new Agent({
149
149
  name: 'working-memory-agent',
150
150
  instructions: 'You are an assistant with working memory',
151
- model: 'openai/gpt-4o',
151
+ model: 'openai/gpt-5.4',
152
152
  memory: new Memory({
153
153
  storage: new LibSQLStore({
154
154
  id: 'memory-store',
@@ -180,7 +180,7 @@ const customMessageHistory = new MessageHistory({
180
180
  const agent = new Agent({
181
181
  name: 'custom-memory-agent',
182
182
  instructions: 'You are a helpful assistant',
183
- model: 'openai/gpt-4o',
183
+ model: 'openai/gpt-5.4',
184
184
  memory: new Memory({
185
185
  storage: new LibSQLStore({ id: 'memory-store', url: 'file:memory.db' }),
186
186
  lastMessages: 10, // This would normally add MessageHistory(10)
@@ -250,7 +250,7 @@ const contentBlocker = {
250
250
  const agent = new Agent({
251
251
  name: 'safe-agent',
252
252
  instructions: 'You are a helpful assistant',
253
- model: 'openai/gpt-4o',
253
+ model: 'openai/gpt-5.4',
254
254
  memory: new Memory({ lastMessages: 10 }),
255
255
  // Your guardrail runs BEFORE memory saves
256
256
  outputProcessors: [contentBlocker],
@@ -289,7 +289,7 @@ const inputValidator = {
289
289
  const agent = new Agent({
290
290
  name: 'validated-agent',
291
291
  instructions: 'You are a helpful assistant',
292
- model: 'openai/gpt-4o',
292
+ model: 'openai/gpt-5.4',
293
293
  memory: new Memory({ lastMessages: 10 }),
294
294
  // Your guardrail runs AFTER memory loads history
295
295
  inputProcessors: [inputValidator],
@@ -28,7 +28,7 @@ const agent = new Agent({
28
28
  id: 'support-agent',
29
29
  name: 'SupportAgent',
30
30
  instructions: 'You are a helpful support agent.',
31
- model: 'openai/gpt-5.1',
31
+ model: 'openai/gpt-5.4',
32
32
  memory: new Memory(),
33
33
  })
34
34
  ```
@@ -180,7 +180,7 @@ export const agent = new Agent({
180
180
  memory: new Memory({
181
181
  options: {
182
182
  generateTitle: {
183
- model: 'openai/gpt-4o-mini',
183
+ model: 'openai/gpt-5-mini',
184
184
  instructions: 'Generate a 1 word title',
185
185
  },
186
186
  },
@@ -26,7 +26,7 @@ const agent = new Agent({
26
26
  id: 'personal-assistant',
27
27
  name: 'PersonalAssistant',
28
28
  instructions: 'You are a helpful personal assistant.',
29
- model: 'openai/gpt-5.1',
29
+ model: 'openai/gpt-5.4',
30
30
  memory: new Memory({
31
31
  options: {
32
32
  workingMemory: {
@@ -96,7 +96,7 @@ const summary = await dataset.startExperiment({
96
96
  ```typescript
97
97
  import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt'
98
98
 
99
- const relevancy = createAnswerRelevancyScorer({ model: 'openai/gpt-4.1-nano' })
99
+ const relevancy = createAnswerRelevancyScorer({ model: 'openai/gpt-5-mini' })
100
100
 
101
101
  const summary = await dataset.startExperiment({
102
102
  name: 'with-scorer-instances',
@@ -168,7 +168,7 @@ const prompt = await langfuse.getPrompt('customer-support')
168
168
  export const supportAgent = new Agent({
169
169
  name: 'support-agent',
170
170
  instructions: prompt.prompt, // Use the prompt text from Langfuse
171
- model: 'openai/gpt-4o',
171
+ model: 'openai/gpt-5.4',
172
172
  defaultGenerateOptions: {
173
173
  tracingOptions: buildTracingOptions(withLangfusePrompt(prompt)),
174
174
  },
@@ -143,7 +143,7 @@ export const supportAgent = new Agent({
143
143
  id: 'support-agent',
144
144
  name: 'support-agent',
145
145
  instructions: 'You are a helpful support agent.',
146
- model: 'openai/gpt-4o',
146
+ model: 'openai/gpt-5.4',
147
147
  defaultOptions: {
148
148
  tracingOptions: buildTracingOptions(withLangsmithMetadata({ projectName: 'customer-support' })),
149
149
  },
@@ -163,7 +163,7 @@ export const supportAgent = new Agent({
163
163
  id: 'support-agent',
164
164
  name: 'support-agent',
165
165
  instructions: 'You are a helpful support agent.',
166
- model: 'openai/gpt-4o',
166
+ model: 'openai/gpt-5.4',
167
167
  defaultOptions: ({ requestContext }) => {
168
168
  const userTier = requestContext?.get('user-tier') as string
169
169
  const userId = requestContext?.get('user-id') as string
@@ -75,7 +75,7 @@ const ragAgent = new Agent({
75
75
  instructions: `You are a helpful assistant that answers questions based on the provided context.
76
76
  When answering questions, use the graph query tool to find relevant information and relationships.
77
77
  Base your answers on the context provided by the tool, and clearly state if the context doesn't contain enough information.`,
78
- model: 'openai/gpt-5.1',
78
+ model: 'openai/gpt-5.4',
79
79
  tools: {
80
80
  graphQueryTool,
81
81
  },
@@ -197,7 +197,7 @@ const agent = new Agent({
197
197
  name: 'RAG Agent',
198
198
  instructions: `Use vector search for simple fact-finding queries.
199
199
  Use graph search when you need to understand relationships or find connected information.`,
200
- model: 'openai/gpt-5.1',
200
+ model: 'openai/gpt-5.4',
201
201
  tools: {
202
202
  vectorQueryTool,
203
203
  graphQueryTool,
@@ -272,7 +272,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
272
272
  export const ragAgent = new Agent({
273
273
  id: 'rag-agent',
274
274
  name: 'RAG Agent',
275
- model: 'openai/gpt-5.1',
275
+ model: 'openai/gpt-5.4',
276
276
  instructions: `
277
277
  Process queries using the provided context. Structure responses to be concise and relevant.
278
278
  ${PGVECTOR_PROMPT}
@@ -289,7 +289,7 @@ import { PINECONE_PROMPT } from '@mastra/pinecone'
289
289
  export const ragAgent = new Agent({
290
290
  id: 'rag-agent',
291
291
  name: 'RAG Agent',
292
- model: 'openai/gpt-5.1',
292
+ model: 'openai/gpt-5.4',
293
293
  instructions: `
294
294
  Process queries using the provided context. Structure responses to be concise and relevant.
295
295
  ${PINECONE_PROMPT}
@@ -306,7 +306,7 @@ import { QDRANT_PROMPT } from '@mastra/qdrant'
306
306
  export const ragAgent = new Agent({
307
307
  id: 'rag-agent',
308
308
  name: 'RAG Agent',
309
- model: 'openai/gpt-5.1',
309
+ model: 'openai/gpt-5.4',
310
310
  instructions: `
311
311
  Process queries using the provided context. Structure responses to be concise and relevant.
312
312
  ${QDRANT_PROMPT}
@@ -323,7 +323,7 @@ import { CHROMA_PROMPT } from '@mastra/chroma'
323
323
  export const ragAgent = new Agent({
324
324
  id: 'rag-agent',
325
325
  name: 'RAG Agent',
326
- model: 'openai/gpt-5.1',
326
+ model: 'openai/gpt-5.4',
327
327
  instructions: `
328
328
  Process queries using the provided context. Structure responses to be concise and relevant.
329
329
  ${CHROMA_PROMPT}
@@ -340,7 +340,7 @@ import { ASTRA_PROMPT } from '@mastra/astra'
340
340
  export const ragAgent = new Agent({
341
341
  id: 'rag-agent',
342
342
  name: 'RAG Agent',
343
- model: 'openai/gpt-5.1',
343
+ model: 'openai/gpt-5.4',
344
344
  instructions: `
345
345
  Process queries using the provided context. Structure responses to be concise and relevant.
346
346
  ${ASTRA_PROMPT}
@@ -357,7 +357,7 @@ import { LIBSQL_PROMPT } from '@mastra/libsql'
357
357
  export const ragAgent = new Agent({
358
358
  id: 'rag-agent',
359
359
  name: 'RAG Agent',
360
- model: 'openai/gpt-5.1',
360
+ model: 'openai/gpt-5.4',
361
361
  instructions: `
362
362
  Process queries using the provided context. Structure responses to be concise and relevant.
363
363
  ${LIBSQL_PROMPT}
@@ -374,7 +374,7 @@ import { UPSTASH_PROMPT } from '@mastra/upstash'
374
374
  export const ragAgent = new Agent({
375
375
  id: 'rag-agent',
376
376
  name: 'RAG Agent',
377
- model: 'openai/gpt-5.1',
377
+ model: 'openai/gpt-5.4',
378
378
  instructions: `
379
379
  Process queries using the provided context. Structure responses to be concise and relevant.
380
380
  ${UPSTASH_PROMPT}
@@ -391,7 +391,7 @@ import { VECTORIZE_PROMPT } from '@mastra/vectorize'
391
391
  export const ragAgent = new Agent({
392
392
  id: 'rag-agent',
393
393
  name: 'RAG Agent',
394
- model: 'openai/gpt-5.1',
394
+ model: 'openai/gpt-5.4',
395
395
  instructions: `
396
396
  Process queries using the provided context. Structure responses to be concise and relevant.
397
397
  ${VECTORIZE_PROMPT}
@@ -408,7 +408,7 @@ import { MONGODB_PROMPT } from '@mastra/mongodb'
408
408
  export const ragAgent = new Agent({
409
409
  id: 'rag-agent',
410
410
  name: 'RAG Agent',
411
- model: 'openai/gpt-5.1',
411
+ model: 'openai/gpt-5.4',
412
412
  instructions: `
413
413
  Process queries using the provided context. Structure responses to be concise and relevant.
414
414
  ${MONGODB_PROMPT}
@@ -425,7 +425,7 @@ import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
425
425
  export const ragAgent = new Agent({
426
426
  id: 'rag-agent',
427
427
  name: 'RAG Agent',
428
- model: 'openai/gpt-5.1',
428
+ model: 'openai/gpt-5.4',
429
429
  instructions: `
430
430
  Process queries using the provided context. Structure responses to be concise and relevant.
431
431
  ${OPENSEARCH_PROMPT}
@@ -442,7 +442,7 @@ import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
442
442
  export const ragAgent = new Agent({
443
443
  id: 'rag-agent',
444
444
  name: 'RAG Agent',
445
- model: 'openai/gpt-5.1',
445
+ model: 'openai/gpt-5.4',
446
446
  instructions: `
447
447
  Process queries using the provided context. Structure responses to be concise and relevant.
448
448
  ${S3VECTORS_PROMPT}
@@ -472,7 +472,7 @@ const initialResults = await pgVector.query({
472
472
  })
473
473
 
474
474
  // Create a relevance scorer
475
- const relevanceProvider = new MastraAgentRelevanceScorer('relevance-scorer', 'openai/gpt-5.1')
475
+ const relevanceProvider = new MastraAgentRelevanceScorer('relevance-scorer', 'openai/gpt-5.4')
476
476
 
477
477
  // Re-rank the results
478
478
  const rerankedResults = await rerank({
@@ -217,7 +217,7 @@ export const colorAgent = new Agent({
217
217
  instructions: `You are a helpful CSS assistant.
218
218
  You can change the background color of web pages.
219
219
  Respond with a hex reference for the color requested by the user`,
220
- model: 'openai/gpt-5.1',
220
+ model: 'openai/gpt-5.4',
221
221
  })
222
222
  ```
223
223
 
@@ -138,7 +138,7 @@ export const dynamicAgent = new Agent({
138
138
 
139
139
  return `${basePrompt} ${localeInstructions}`.trim()
140
140
  },
141
- model: 'openai/gpt-5.1',
141
+ model: 'openai/gpt-5.4',
142
142
  })
143
143
  ```
144
144
 
@@ -165,7 +165,7 @@ export const registryAgent = new Agent({
165
165
 
166
166
  return prompt.content
167
167
  },
168
- model: 'openai/gpt-5.1',
168
+ model: 'openai/gpt-5.4',
169
169
  })
170
170
  ```
171
171
 
@@ -308,7 +308,7 @@ export const validatedAgent = new Agent({
308
308
 
309
309
  return `You are helping user ${userId}`
310
310
  },
311
- model: 'openai/gpt-4o',
311
+ model: 'openai/gpt-5.4',
312
312
  })
313
313
  ```
314
314