MastraAI

M

MastraAI

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

Join

Adding / Removing agents in live environment

Hi All, Very new to mastra so apologies if this is a dumb question. Im investigating whether it would be possible to add or remove agents from an existing mastra instance? Im looking through the provided type interface of the Mastra class but havent found anything. Looking at the constructor, i found the following ```typescript...

No detail on error message, need more verbosity re: Mastra Cloud

No metadata available Error in streamVNext generate: Unknown error...
No description

Working Memory Schema Changes

I am using working memory with a schema for typesafe memory. I am looking to change the schema. Is there any specific mechanism I should consider for making sure the models are able to migradte data from the previous schema to the new one? Or will I need to take care of this through some other upgrade/migration process?

Any way to visualize Mastra workflows?

It would be great to have a function we can call to export a PNG, or if there's some internal XState state (I could be wrong, but I think Mastra uses XState?) we could export. Would be great to be able to have this as a part of our CI/CD pipeline. I belive the playground supports this.

Production Bug: Cannot read properties of undefined (reading 'typeName')

I'm getting this error in a production deployment (Docker container). This does not happen when I run the app locally with pnpm dev. Error executing step prepare-tools-step: TypeError: Cannot read properties of undefined (reading 'typeName')...

Attachment Support

What are best practices for handling file attachment support and attachment processing? Right now we have a separate component from Mastra to handle file upload to S3. In the input processor we are creating custom code to handle PDF, Word Doc that converts that into markdown and then into Mastra for processing. Is that the best approach if our goal is to be able to incorporate a file into a query with the LLM?...

GraphRAG Metadata Planned Support?

Hi there, is there planned support for metadata filtering in GraphRAG? In the current impleentation we have to split data from different sources into different vector stores to support "filtering". it would be much easier if we can pass the field into the vector store and let it sort what can be used to build the graph. https://github.com/mastra-ai/mastra/blob/main/packages/rag/src/graph-rag/index.ts...

Did you change anything about the bundling from 0.15 to 0.18 cause my build fails

basically my build is failing on a random depency nothing changed expect the mastra version 😄
No description

update working memory tool call errors on searchString

The update working memory tool call regularly errors in the first call w/ this error. ``` "state": "result", "toolCallId": "call_W84bP8Lo2qCwIYe03QDLCgTJ",...

structuredOutput issue with Zod primitives

I have noticed an issue: calling an agent.generate in 0.20.X recently I have noticed that giving a structuredOutput schema option which is a Zod primitive (for example: schema: z.string() instead of schema: z.object({ text: z.string() }). This breaks every time with a validation error for me. String is an example, but it also has issues with number(), etc....

Real-time progress streaming from Mastra tools

Problem: Need real-time progress streaming from Mastra tools (15+ min execution). Currently, agent responses only appear after tool completes. Setup: - Using agent.stream() with format: 'aisdk' - Tool uses writer.write() for progress events...

Error: tool-output-error must be preceded by a tool-input-available

Getting this error after upgrading mastra versions: Before with streamVNext: ```"@mastra/memory": "^0.15.3", "@mastra/loggers": "^0.10.13",...

Top-level error handling

Our mastra server crashes if we ever throw any uncaught error. Is there a top-level error handler we can use similar to Hono's app.onError?

Playground crashes on maxSteps limits reached

Once receiving following error in console playground crashes with white screen: Uncaught Error: Stream finished with reason tool-calls, try increasing maxSteps Note: increasing maxSteps in playground doesn't help. crash still happens after 5th tool call...

Network streaming

https://mastra.ai/en/docs/streaming/overview doesn't mention streaming from Networks -- is this supported?

How to get detailed error with http status code and header?

Currently when I uses aisdkv5 with mastra and do
const result = agent.stream(...)
const result = agent.stream(...)
When a error happens with the provider API, for example 503 or 429, it seems there no way for me to get the response status code or headers to understand what is going on, for example for 429 I would want to read the header to know when I can retry. I have tried to use the onError callback and reading the stream and reading result.error all of them give me a stripped error that doesn't include http status code or response. These detailed field should exist in the underlying aisdk error like AI_APICallError and it is even logged out by mastra, but it seems mastra doesn't return or throw the detailed error for consumer to use it only give consumer a stripped down version of the error? is there a way I can get the full error?...

READINESS_PROBE_ATTEMPTS_EXCEEDED Unknown Error on Mastra Cloud

[ERROR]
[10/10/2025, 07:49:30 PM] - Build process failed for build d8582adc-83d6-468d-907a-c50255bb0bc9 and project 98f828f3-6977-4762-b990-1abf5ab9dab8: {"message":"Unknown error","details":{"message":"Unknown error","domain":"BUILDER","category":"SYSTEM","details":{}},"code":"READINESS_PROBE_ATTEMPTS_EXCEEDED"}
[ERROR]
[10/10/2025, 07:49:30 PM] - Build process failed for build d8582adc-83d6-468d-907a-c50255bb0bc9 and project 98f828f3-6977-4762-b990-1abf5ab9dab8: {"message":"Unknown error","details":{"message":"Unknown error","domain":"BUILDER","category":"SYSTEM","details":{}},"code":"READINESS_PROBE_ATTEMPTS_EXCEEDED"}
...

A subsequent call generates an error about reasoning being omitted from `function_call`

I do a agent.stream, get the results.. all works great, the very next message the user creates, this error is logged. ```Error creating stream [Error [AI_APICallError]: Item 'fc_0a038568becf80fb0068e9630e5fd081978df905e0edaed49a' of type 'function_call' was provided without its required 'reasoning' item: 'rs_0a038568becf80fb0068e9630ad5248197a0938f405d5fad2e'.] { cause: undefined, url: 'https://api.openai.com/v1/responses',...