Mastra

M

Mastra

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

Join

Is this not an Abort Signal in Mastra Studio? Stop Execution

I'm trying to understand what messages are emitted when stopping the Agent’s process after submitting a request. When I click the stop button, I get an error (see attachment). Is this correct? but not an Abort signal something? So,...
No description

Can you enable the playground yet with Mastra's Hono server adapter?

I was able to get an example of the Hono adapter working in my code, but even if I set playground to true the playground endpoints do not show up. I am unable to run Mastra Studio with my Bun monorepo and would really like to get this set up to at least locally test.

Runtime error with latest version of Mastra core

I recently updated to a recent version of @mastra/core 0.23.3 and I get the following error at runtime, which never appeared before: ``` /app/nodemodules/.pnpm/@mastra+core@0.23.3@sinclair+typebox@0.34.41_encoding@0.1.13_openapi-types@12.1.3_react@19.2_z2dqksn5fjdorsfe3momgu443q/node_modules/@mastra/core/dist/chunk-5KNLBUBH.cjs:97 - Focus on content that could cause real harm...

Restoring chat history based on workflow with multiple agents

I'm using a workflow where I have multiple steps that call different agents. In the UI this workflow is displayed like a chat. The agents sometimes just emit a text stream and sometimes call tools that I use to display UI components. The workflow uses suspend/resume and I want to be able to let the user reload the page and restore everything in the Chat UI. My current setup is using AI-SDK and workflowRoute to stream the workflow....

maxSteps in agent network

Is there are a way of increasing the number of maxSteps for the subagents of an agent network? I've set maxSteps in defaultGenerateOptions and defaultStreamOptions for all the agents in the network, and also in the request: ``` const body = await req.json(); 13 const { messages, memory, maxSteps = 200 } = body;...

Cannot call mcp tool directly?

Hi! From an endpoint I am trying to directly call an mcp tool: ``` const client = c.get("mastra") const markitdownAgent = client.getAgent('markitdownAgent') const tools = await markitdownAgent.getTools();...

Unable to make requests to mastra API server

Hi! I've made a new MCP server in mastra. Currently able to connect to it and call tools using port 4111 when running bun mastra dev. However, I am unable to connect to it when I run bun start on port 3000. I've attached a photo. Not too sure if the implementation from line 11 onwards is correct. Any help would be appreciated!...
No description

Mastra cloud first message delay

I am using mastra cloud from past few months and i face signle problem with mastra cloud every day- first message response from agent takes more than 30 seconds. once its responds with first message then it works well with good speed. I believe this is a cold start issue. Could you please help me over come this?? becuase of this new users getting bad feel about my product. please help.

@mastra/chroma package showing following warning

Collection schema deserialization was created with the google-generative-ai embedding function. However, the @chroma-core/google-generative-ai package is not installed. 'add' and 'query' will fail unless you provide them embeddings directly, or install the @chroma-core/google-generative-ai package. I could not find any such package on NPM. I'm guessing chroma package itself outdated? Query seems to work though....

Issue run example weather agent and get error

Hi I know it's maybe a really easy one, but I just follow the steps for beginner that set up the Mastra and run it locally I got error in the agent that says something like:
message":"Item with id 'fc_05248b2bff4ea6be016930c92c9b8c81a0928427289630a8c9' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again.","name":"AI_APICallError","stack":"AI_APICallError: Item with id 'fc_05248b2bff4ea6be016930c92c9b8c81a0928427289630a8c9' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again.
message":"Item with id 'fc_05248b2bff4ea6be016930c92c9b8c81a0928427289630a8c9' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again.","name":"AI_APICallError","stack":"AI_APICallError: Item with id 'fc_05248b2bff4ea6be016930c92c9b8c81a0928427289630a8c9' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again.
the work flow calls the api correctly but can not run in the agent, I tested in the work flow, it works fine....
No description

Agent responds to updateWorkingMemory tool calls

Running into an issue with workingMemory enabled where the LLM responds to the updateWorkingMemory tool call, even though it has already provided an appropriate response to the user. This creates an poor experience for the user since the LLM is responding to its own question. I see this thread, but it's relatively old and I'm already on a newer version of mastra than it (v0.23.1).
Do I need to upgrade to v1 beta? Or should I be forcing/preventing the additional LLM call in some other way? Trying to avoid disabling workingMemory since it's otherwise a great feature....

Mistra embeds images when remote URLs are supported

According to Grok's documentation, it supports remote image urls as input. Mastra keeps embedding it as Base64 though. In my opinion this behavior should be changeable as it unnecessarily fills memory with megabytes of data. I use the latest v1.0.0 version. ...

Is `Agent` really deprecated or is this ts being a bit funky?

Been looking at the documentation around Agent and haven't seen anything marked as 'deprecated' yet the typescript language server is having a seizure -- is it really deprecated and if yes -- in favour of what?...
No description

agent.generate() with structuredOutput.model throws "promise 'text' was not resolved or rejected

Description: Seeing an error when using agent.generate() with structured output that includes a model field. The stream finishes before the "finish" chunk resolves the text promise, causing a rejection. Error:
Error: promise 'text' was not resolved or rejected when stream finished
Error: promise 'text' was not resolved or rejected when stream finished
...

CF Workers memory overload

Having massive memory issues due to postgresstore using pg promise under the hood which has its own separate db pool. Even though you guys expose the db instance, it uses pg promise and drizzle doesn't support it. Really desperately need the option of using the neon serverless driver which has compatibility also with planetscale (https://planetscale.com/docs/postgres/connecting/neon-serverless-driver), so that we can do http connections and not just tcp. This makes it feasible to use mastra memory/storage in serverless environments. Otherwise its just too memory intensive and crashes, and becomes very tempting to just get rid of mastra storage/memory instead of having to wrestle with it. This would require little effort for you guys to implement but be a massive help. Even if you don't support neon-serverless-postgres-driver (https://neon.com/docs/serverless/serverless-driver) , at least supporting postgres-js, or letting us put in our own postgres client....

Deploying Mastra with NextJS

Hi there! Loving Mastra so far, but getting to deployment now and I'm a little confused. So I'm deploying this with my next.js app, and I was wondering how workflow streaming would work. In the docs, it says to include workflow streaming with ai sdk as WorkflowRoute in mastra index.ts - does this mean that its a seperate server? If I want to integrate it into my nextjs app with workflow streaming, does that needs to be a route hosted in my nextjs app or does including the mastra package in the external dependencies and the WorkflowRoute in the index.ts cover that?...

Does Mastra + Assitant UI work with HITL tool calls ?? NEED EXAMPLE Desperatly :D

Basically trying to figure out if I can achieve this 1. assitant ui chat 2. make human in the loop tool call 3. calling another tool after since hu...

Can't get mastra + copilotkit memory to work

No matter how I try, I cannot get messages to be saved across sessions. If I refresh the page, it starts a new chat with new memory every single time. I've tried to fix this for hours, reading all docs. Here's some of the code used: ``` apiRoutes: [ registerCopilotKit<RuntimeContext>({...

Example of using agent network in studio

I am trying to use network agent on studio but I can't seem to get it to work. Is there documentation I'm missing or an example code somewhere I could study?
Next