MastraAI

M

MastraAI

The TypeScript Agent FrameworkFrom the team that brought you Gatsby: prototype and productionize AI features with a modern JavaScript stack.

Join

Mastra Cloud deployment failing with `ERR_MODULE_NOT_FOUND` for `instrumentation.mjs`

BLUF:
Mastra Cloud deployment failing with ERR_MODULE_NOT_FOUND for instrumentation.mjs — file not being generated during cloud build despite working locally. --- ...

updateWorkingMemory tool parameter mismatch

Tool Parameter Mismatch
LLM sends: { personalInfo: {...}, jobPreferences: {...} }
Validation expects: { memory: { personalInfo: {...}, jobPreferences: {...} } }
Tool Parameter Mismatch
LLM sends: { personalInfo: {...}, jobPreferences: {...} }
Validation expects: { memory: { personalInfo: {...}, jobPreferences: {...} } }
...

How to customize tracing metadata for Agents invoked with ChatRoute?

Is it possible to add metadata to the tracingContext when a agent is invoked using the ChatRoute supplied by @mastra/ai-sdk? Docs here mention how to update the span metadata but I don't see how I could do this for an agent invoked this way....

Mastra build fails after latest updates

ERROR [2025-10-15 19:12:34.700 +0100] (Mastra CLI): Failed to analyze Mastra application: ../../node_modules/undici/lib/core/util.js (2:7): "default" is not exported by "node:assert?commonjs-external", imported by "../../node_modules/undici/lib/core/util.js". domain: "DEPLOYER" category: "SYSTEM" details: {}...

Accessing messages inside a tool callback

Hey everyone, I’m new to Mastra and have a quick question. From what I understand, Mastra automatically passes messages to the agent (like in the config below). What I’m trying to figure out is: can I access those messages from within a tool callback?...

External package imports throwing error when using mastra dev command

I am importing a local package into other local package where mastra resides. Monorepo setup. Using Logger from that package to be added to mastra flow. While running mastra dev, getting the below error ERROR [2025-10-15 16:23:50.254 +0100] (Mastra CLI): virtual:#virtual-@local/gate (1:9): "Logger" is not exported by "../gate/dist/index.js", imported by "virtual:#virtual-@local/gate" Now Logger is being exported from the index.js file, have checked it but still throwing an error. All mastra packages are on latest version....

Structured output sometimes not getting followed in agent generate()

I have an agent taht uses generate() to output a structured response and I notice that this sometimes results in an erro that gets logged as this in my generate() function onError handler: ``` { category: SYSTEM domain: AGENT...

useChat with workflow human in the loop

The latest streaming workflow stuff, with the adaptors for AI SDK is great. Is there a recommended way to make all this work with suspend and resume?

Express.js stream

Hello! How can i pipe with response object from Express.js when using .stream() function?

Mastra cloud build fail

Build failed on mastra cloud : ``` Optimizing dependencies... [ERROR]...

Can't get structured output after update to latest version

I'm using @mastra/client-js from an app to call my agent. client side: ` const outputSchema = z.object({ code: z.string().describe('code'),...

Langfuse integration

Since upgrading to mastra 0.19.1 the langfuse integration has stopped showing data properly (no input, cost, tracing)

Dealing with file path to load csv file

Hi guys, i need help for a simple question I have a tree project like this: ```....

mastra build not working

mastra build command is failing with error, attached screenshot below is my package.json { "name": "mastra", "version": "1.0.0",...
No description

Coming from 0.10.X to 0.20.X -Agent Networks and Memory

We are doing an upgrade and having a ton of pain around this. After moving to the new privative and cutting over to passing a group of agents into another, we noticed we need to instantiate memory. We are having issues with working memory and Mastra is complaining and had to disable it. Are there any other steps we need to look out for jumping this many versions forward?
No description

READINESS_PROBE_ATTEMPTED

I'm seeing the same error as https://discord.com/channels/1309558646228779139/1426406572447502346 on Mastra cloud. Seemed to occur after I added basic MastraJwtAuth from @mastra/auth to my project, but since there isn't really a helpful error message I don't know if that actually was the cause. ...

how to config AUTH in mastra cloud?

Hi, whats the right way to protect a deployment on mastra cloud? i'm using the middleware to add a custom API endpoint, I can access it on the dashboard but i cannot see the "agents" and "workflows" i understand this is due to the middleware, but whats the right way to do this?...

🚨 Build failing on Mastra Cloud (was working fine this morning)

Hey team — looks like something changed on the deployer side of MASTRA CLOUD. My app was deploying fine earlier today, but as of now it fails during the analyze step with the following error: Failed to analyze Mastra application: node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/streams.cjs (4:7): "default" is not exported by "node:process?commonjs-external" ...

Vercel Deployer always leads to Empty Builds

/swagger-ui always shows a 404 error, as if no agents / workflows exist when it deploys to Vercel. However, normal .mastra/output builds wthout using new VercelDeployer() shows the playground and swagger-ui correctly as it should. EDIT: Now for some reason, even non-vercel-deployer builds come empty with no api routes and agents and workflows....
No description

Title generation model switching not working

I am using runtimeContext/dynamic stuff to set the title generation model in threads/memory on an agent and looking at my logs it is ALWAYS using the same model as the agent itself and never even calling my function that sets the model. Example code: ``` memory: ({ runtimeContext }) => new Memory({...