MastraAI

M

MastraAI

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

Join

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

Straight usage of @mastra/server

Is it ok to use @mastra/server to serve my agents on the web to mastra client? Instead of the whole mastra CLI? I guess it can also support mastra client in frontend. Am i missing something?...

RAG pipeline example - workflow

Is it just me or all of the rag pipelines are better to be represented as mastra workflows? That way you can run it from wherever with strong typings. Is it ok or is it anti pattern?...

Anthropic System Prompt Caching Regression

It seems that Anthropic Prompt caching is being regressed from the AI-SDK implementation. I read the source code for the Agent class in mastra and it seems like in multiple places the providerOptions are not being passed for system role messages. The work around would of been to pass the system role messages as part of the message list when .streamVNext is called, as below: ```typescript...

How to address several running instances of a workflow

Suppose, I have a workflow with waitForEvent step: ``` import { createWorkflow, createStep } from "@mastra/core/workflows"; import { z } from "zod";...

Mastra RAG with sources advice needed:

I have a bunch of Q&A questions which i want to do a simple RAG agent on them, I am using Postgresql + PGVector + Mastra. Bottom line i want to get the sources as well, meaning i want to show in my UI (assistant-ui) the citations or the original Q&A question. It is super important and with mastra i dont see how it is possible right now, is it true? ...

Mastra products

is there going to be some extra mastra products such as agent builder (i saw in github) or workflow builder no-code or something extra? Or something i can embed in my website like a no-code builder? or maybe some thing extra just any extra product which is not mastra library and not mastra cloud...

Mastra serverless concurrency

Is mastra serverless? Meaning I can deploy my own mastra server docker container with 100 instances that all connected to same DB and it's ok? (Postgresql)

Working Memory Updates Not Always Additive

Hi there, while testing a fairly simple use case of building a profile like schema in the agent working memory, I noticed most the time when the memory update is invoked (in the playground) I am seeing information being lost from previous turns or chat. It seems the agent turn making the update is replacing the working memory that is already there. I was looking for a setting that may be PUT/PATCH style logic (full replace vs upsert) but I could not find any such setting. is this intended behavior? IN. ayoutube video demo from mastra I saw that a template working memory was being addited to in a thread scoped working memory. Wondering if schema bound resource scoped working memory maybe doesn't function the same? ...

Why persisting Message Thread implementation ignored the messages for role - System?

For example, I access the Mastra Agents via POST: /agents/<agentId>/stream { // if these parameters are present - messages for role - system is ignored "threadId": "sample-tread-id123433345435555", "resourceId": "sample-tread-id123433345435555",...
No description

Web Socket Connection Errors in Prod Environment

We are receiving the following error when using Drizzle to connect to Neon via a websocket: Error: All attempts to open a WebSocket to connect to the database failed. We never see this issue locally, so wondering if there is an issue with the environment....

workflow inputs resulting from a zod intersection are not rendered in the playground

`const type1 = z.object({ type: z.string().description("the type") }); const workflowInput = z.intersection(type1, z.object({ prop: z.string().description("the prop")...

Mastra deploy error - cannot find @mastra/cloud

Hello, i'm getting the following error on: https://cloud.mastra.ai/lorenzos-team/dashboard/projects/enough-sparse-engine/runtime/deployment/2f571fbb-1478-44bd-9b59-8d7a57668dff ``` [INFO] [09/09/2025, 06:04:59 PM] - node:internal/modules/package_json_reader:266...

experimental_ouput support for other models

I would love to see this being supported for other models than openai I am not sure but I suspect under the hood it depends on the structured_ouput from openai models option so natuarelly it doesnt work with other models like gemeni . ...