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 Due to @mastra/cloud Version Incompatibility

I can't deploy my project to Mastra Cloud because of a version conflict that might be caused by your deployment system. The Problem: Your packages have incompatible version requirements: - @mastra/cloud requires @mastra/core versions 0.10.7-0.14.0 ...

AI Tracing Storage Issues

In the documentation, it says that you should use PostgresSQL in production. When using AI tracing, you get the following error: "AI tracing is not supported by this storage adapter (PostgresStore)" when trying to set your storage to a PostgresSQL solution. Is it ok to use LibSQL in production for AI tracing?...

AI tracing issue with Langfuse- prompt tracing not working

Running into an issue where the tracing is not properly correlating with the prompts, so I can't follow the linked generations in langfuse. Here is the relative documentation for Langfuse for using the Vercel AI SDK, which does work. I have recreated the issue here: https://github.com/tommyOtsai/test-ai-tracing...

Put Agent Memory on a Different Model than Response?

Is there a way to put agent memory on a different model than the response? For example, I may want my agent to respond to a customer using a high quality / expensive / longer running model but I'd ideally like it to write to memory with a fast cheap model.

streamVNext converting image URLs to embedded content - need URLs as strings for tools

Problem: When I pass image URLs as file parts, the agent receives only the embedded image content for visual analysis (it treats it as “embedded directly” ?) instead of also retaining the original URL string. While embedding the content is fine for visual analysis, losing the URL is problematic. The agent should still have access to the original URL so it can pass it to other tools, rather than only seeing the embedded content and losing the source URL. What I need: ...

Mastra client js SDK types export missing

i am using this code: const myWorkflow: Workflow = await mastraClient.getWorkflow(workflowId); But Workflow type is not exported by mastra client js...

Mastra React SDK

It is complicated to connect to mastra instance only via client js SDK, i need to write my own react hooks and manage that, it should be simple for mastra to create a react SDK as well above the existing client js sdk. this would REALLY help, please...

List of generateVNext compatible models

Is there a list of models compatible with the generateVNext API? I am seeing a v1 compatibility error with 4o-mini and couldn't confirm which model I should move to instead to be compatible with the new API

Possible memory leak or expected behavior?

Hey Mastra! I have this strange behavior that keeps eating RAM until it hits the limit and, by using AWS ECS, it just restarts and we're good to go. I'm using ECS with 1 vcpu and 2GB RAM, which I know is not much, but due to my use case it is better to have 2~3 small instances because our workload goes down a lot after evening....
No description

Do you plan to implement indexing support for other storage systems as well?

https://github.com/mastra-ai/mastra/issues/5876 Regarding PostgreSQL, this has been addressed in this PR, but will support for other storage systems be added in the future?...

initial message generation

I'm wondering if someone has setup a chat system where the chat agent welcomes the user with the initial message. I have this working with a special endpoint but my problem is this 1. if I use memory on the generateVNext call it saves the user prompt also 2. if I don't use memory I can't find a way to store the agent (assistant) message so it's lost on reload. Does anyone have any ideas on how I can store the assistant response without the user prompt?...

How do I make RuntimeContext Typesafe?

if seems that the RuntimeContext becomes type unknown when used in a workflow or step. for example here I need to re-define finished every time I want to use it which feels very counter intuitive. ```typescript .dountil(mainLoopWorkflow, async ({ inputData, runtimeContext }) => {...

Monetize mastra agents

I built a mastra instance with a lot of relevant ai workflows and ai agents for my customers, How is it best to monetize it? Is there some middleware? If i just put some auth middleware it's ok from SECURITY standpoint or will it be hackable?...

Standalone Agent Scorers storage

i am using standalone mastra agents without a mastra instance, where do i put a storage object so i could save these evals and scorers results such as when having a mstra instance + server? This is my code: `...
No description

The latest version cannot install private packages.

When running mastra build, the following error occurs: ```sh ackend:build: INFO [2025-09-18 10:46:23.071 +0900] (Mastra CLI): ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@my-org%2Fprivate-package: Not Found - 404 backend:build: ...

generateVNext with structured output results in undefined object

```ts const result = await agent.generateVNext(inputData.prompt, { structuredOutput: { schema: z .object({...

HTML Chunking via Mastra rag Mdocument

I want a simple example of it, in the current example it is really basic and not real world. I did this code and it does not work, chunks are too big. Bottom line i just want a real world working example of html chunking for websites (otherwise im thinking about using firecrawl -> markdown -> chunk via markdown) ...

Mastra masks useful errors

Mastra tends to give "Unknown error" for valid errors such as when the prompt is too big: https://discord.com/channels/1309558646228779139/1309558648476930100/1417631233072173168

WritableStream is locked after updating from 0.15.2 to 0.16.3

Hey, I started getting following when updating Mastra. Anyone seen similar, and how to overcome it? Unfortuantely I don't exactly know what causes it so providing a targeted repro is pretty hard. ``` TypeError: Invalid state: WritableStream is locked at setupWritableStreamDefaultWriter (node:internal/webstreams/writablestream:612:11)...