Mastra

M

Mastra

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

Join

Dynamically Reload Prompt/Agents

Hi team, is there a way to dynamically reload the agent instructions (or the agent itself)? We're using Langfuse for prompt management and would love to automate the propagation of prompt changes from Langfuse to Mastra. Our current workaround is to simply trigger an infra-level restart of the pod (we don't have much volume yet so it's fine). I'm wondering if there was a way to do this without manual intervention? I'm picturing a simple custom route implementation: ``` apiRoutes: [...

chatRoute + useChat stream unstable

I am using ai-sdk's useChat and mastra's chatRoute together, and sometimes the SSE stream closes without an error, but also without sending the [DONE] event. Could this be an ai-sdk issue or a mastra issue? I will work on a repro repository, as the problem seems to happen under specific circumstances (never happens on my first message + agent's tool call, but happens always on the second) Short summary of my setup: - Frontend uses useChat....

Langfuse integration via mastra/langfuse - tags and cached token count

Current versions: "@mastra/core": "0.24.1", "@mastra/langfuse": "0.2.3", "@mastra/memory": "0.15.11",...

chatRoute + useChat not working for tool suspension in @mastra/ai-sdk@beta

When using chatRoute with @ai-sdk useChat hook, tool suspension events (tool-call-suspended) are not emitted, causing the frontend to never receive them. This makes HITL (Human-in-the-Loop) flows impossible with the...

Tracing prompts with Langfuse

I am using Langfuse for prompt management, and I can consume the prompts just fine. However, I cannot have the tracing link to the prompts to the ones created in langfuse, and versions. Here is an example of how I set it up ```typescript const headerAuditing = createStep({ id: "header-auditing", description: "Diagnose the header",...

Mastra node-audio

Error when trying to use mastra node-audio :




...

GeminiLiveVoice: Tool calls work but args always empty - Expected behavior?

Hi Mastra team! šŸ‘‹ I'm having trouble getting tool arguments to populate in GeminiLiveVoice. Tools are called but args are always empty. Am I missing some configuration? Current Setup:...

Cannot send base64 images to Gemini in Mastra v1.0 Beta [Solved]

I scaffolded a new project with pnpm create mastra@beta. ``` "dependencies": { "@mastra/core": "1.0.0-beta.2", "@mastra/evals": "1.0.0-beta.0",...

Nested Branching

Does anyone have a good example of how to do nested branching? I am seeing (probably old) info out there that says to create nested workflows, but its not working at all and I spent a good deal of my afternoon on this. My flow is simple and I would think this would be simple too. Agent calls tool that wraps a workflow. First step as an A or B path. If A it needs to run another tool and then it has another A B branch. .branch([ [async ({ inputData }: { inputData: { intent: string } }) => inputData.intent === 'create', fullStep], [async ({ inputData }: { inputData: { intent: string } }) => inputData.intent === 'refine', individualStep],...

Parallel Steps `writer.custom` throwing writer is locked

Works for sequencial steps, but getting error for parallel

PineconeVector not assignable to MastraVector<VectorFilter> in Mastra configuration

Hi, I’m not sure if this is intended or a bug, but passing a PineconeVector instance into the main Mastra instance under vectors throws this TypeScript error:
Type 'PineconeVector' is not assignable to type 'MastraVector<VectorFilter>'.
Type 'PineconeVector' is not assignable to type 'MastraVector<VectorFilter>'.
Original Code:...

Firebase Auth - Dev Bypass

https://mastra.ai/docs/auth/firebase Need A way to keep Auth in Development ( user auth data to keep getting added to context ) but still disable auth in a sense that it doesnt block access ... This is in order to let things through like local scripts that dont use auth... while still keeping the auth working for things that do...

Struggling to deploy to Mastra Cloud

I've been trying to decouple my Mastra instance from my main Nextjs app, to deploy it to Mastra Cloud. It's been very difficult. I have a number of hacks that I'm not happy with, but right now the one I'm stuck on is this: INFO [2025-11-14 19:14:36.790 +0000] (Mastra CLI): Analyzing dependencies... INFO [2025-11-14 19:14:42.327 +0000] (Mastra CLI): Optimizing dependencies... INFO [2025-11-14 19:15:17.755 +0000] (Mastra CLI): Bundling Mastra application...

Build Error When Upgrading Beyond Mastra v0.12.3

Hello, I'm experiencing a build failure when attempting to upgrade Mastra beyond version 0.12.3. The last version that builds successfully is "mastra": "^0.12.3", but any version after that results in the following error: Error:...

How to debug runtime server issues

Hi we are incorporating mastra into our codebase, but for certain tools calling our other existing functions we get errors like (From Typeorm and decimal.js imported in other files): ColumnTypeUndefinedError: Column type for AppProfile#appName is not defined and cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true option in tsconfig.json. Also make sure you have imported "reflect-metadata" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type. at ColumnTypeUndefinedError.TypeORMError [as constructor] (/Users/ericyu/Documents/GitHub/rutter-backend/node_modules/typeorm/error/TypeORMError.js:9:28) at new ColumnTypeUndefinedError (/Users/ericyu/Documents/GitHub/rutter-backend/node_modules/typeorm/error/ColumnTypeUndefinedError.js:13:23)...

Azure Voice setup + outdated doc

Hello, i am not able to use azure voice models : Error: HTTP error! status: 500 - {"error":"Speech recognition failed: NoMatch - ","stack":"Error: Speech recognition failed: NoMatch - \n here is my code: ...

How to stop agent midway during stream while preserving the output streamed till that point

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:...

Streaming Workflow Using Copilot Kit

Is there a working example of using Copilot Kit with an agent that has a workflow attached to it, and having that workflow steps being streamed to Copilot Kit and being displayed in the chat. I can get it working for tools, but for workflows, it is not working.

Why the step Call execution tells me the tool not found?

hi @Romain , if you have time to check on this. Issue: "Error executing step toolCallStep: Error: Tool serpApi_googleFlightsTool not found" check the actual error in the attachments ...
No description

Circular dependency issue

We're unable to build our mastra node/typescript service with a mastra build command.