Mastra

M

Mastra

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

Join

Network Agent subagent stream text

When I call agent.network(...) and one of the sub-agents needs to ask a follow-up question, the message comes through the data-network stream instead of the regular text stream when using the AI SDK. Most of the data-network payload isn’t useful to me, only the actual text content matters. Shouldn’t that text be streamed through the text chunk instead?

How to handle multi-step branches

Hi team! I'm converting an N8N workflow to Mastra and struggling with how to properly implement branching logic where each branch needs to execute multiple steps before merging back to the main workflow. Use Case:...

Mastra Cloud: how can I filter traces per run ID?

On this page, it says I can filter by trace ID (see first image). But I don't see any way to do so in practise? (see second image) Am I missing something?...
No description

Prompt caching with dynamic context

Where is the best place to supply fully dynamic context, while taking full advantage of prompt caching? (particularly with openai) OpenAI recommends placing it "at the end" of your prompt. Heres an approximation of our current setup:...

Converting messages to AI-SDK format (v1 Client)

When using client.listThreadMessages to retrieve message history, the messages are now returned as MastraDBMessage. To use them to populate initial messages in useChat they need to be converted to AISdkV5 format, because it expects the messages to be UI_MESSAGE. It seems the method needed to do that exists, but is currently not exported (only the chunk-based conversion for streaming is). ...

Cannot access Mastra Cloud project UI - React Query error

Expected behavior: - Should be able to access and view my project in Mastra Cloud dashboard - UI should load normally Actual behavior:...
No description

Bug in Dane creates spam

Dane seems to have a bug right now, because he creates multiple copies of issues (though with different labels at times) and multiple @mentions in Discord.
No description

How to persist partial step output to memory for single step agent invocations

Hi Folks, I was wondering if its possible to stop agent stream midway while also preserving the tokens that were streamed till the time user stopped the stream. So essentially:...

I think I borked my mastra cloud project. It won't load. Getting this error.

Connected this project yesterday. It was working fine. Not entirely sure what I changed if anything, but now it just does this full page error on load. The last thing I remember doing is adding an AI token to the env vars, but I managed to go directly to the settings page via the url and remove it and it's still erroring. The error seems to appear about the same time as this console log, but I'm not 100% sure it's related
No description

Workflow Support in @mastra/react

I just noticed there's a special version of useChat in @mastra/react (discovered it through this Github Issue). I'm glad I found that because that's something I was missing and I already started building a similar hook. I've got some questions regarding the package:...

Limits of workflows as serverless functions in NextJS

Hi there, I was curious how you manage long-performing tasks? I came across Qstash workflows, which somehow enables to run long tasks even in serverless functions in nextjs, but ideally would love to stick with Mastra workflows. How do you manage that? Do you slice in smaller pieces and then for example queue via Qstash? Specifically, my current task is:...

Tool output not being passed back to agent

Hey everyone, I’m running into a consistent issue with Mastra (latest stable version 0.24.1) where a tool’s output isn’t being passed back to the agent during execution. What’s Happening:...
No description

Mastra v1 observability

hi, question about HTTP tracing after upgrading to v1 beta. in v0.x, my custom API endpoints (like /api/heartbeat) were automatically traced using the old telemetry config. After upgrading to v1.0.0-beta.2, http traces don't show up in my observability platform (honeycomb) anymore. is http endpoint tracing still supported in v1? If it's supported, what's the right way to set it up?...

Tool Calling using Gemini 3

When Gemini 3 uses tools, it needs to be passed a thought_signature. Here is the associated documentation. I am not sure if Mastra is handling this now or if it still goes through the ai-sdk.

REST call still works even after the deployment is disabled on a Mastra Cloud project

Is this a bug? Can you please have a look because this can be a big security problem. Thanks!

Errors seem to escape to stdout and are not caught by the pino logger

Maybe related to this issue: https://github.com/mastra-ai/mastra/issues/9121 I am experiencing issues where critical errors are being spit to stdout instead of being captured and structured as an error log, this has the result of missing errors in out structure log observability. Here are a couple of examples of errors that spit to stdout: Error executing step generate-draft-response: AI_APICallError: Rate limit reached...

Re-generate a message

Hi, I am trying to implement a regeneration mechanism. The user should be able to re-generate any message from the history. Right now, I am deleting the message to regenerate + all messages after that one but for some reason, this query always returns all messages: ```typescript const messages = await memory.query({ threadId: chat.threadId,...

Mastra Cloud - new account (Google) initializes with "random" repo

Hey Mastra Team, A bit of an odd one -- I just created a Mastra Cloud using my Google Account (I used my github account previously for my personal work and that worked fine). I didn't link to a github repo, it just asked me to provide a name for a new project. Then in Studio Overview it appears to have linked my Cloud project to someone else's (public) repo. There doesn't seem to be a way to change the repo, either. Steps to reproduce: - navigate to https://cloud.mastra.ai...
No description
Mastra Community - Answer Overflow