MastraAI

M

MastraAI

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

Join

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

Memory (RAM) issues

I have a workflow where one step is to enrich every page on a website (sometimes 600 or more) with wider business context information, then after that, a forEach step that handles each page of the website and examines the HTML / attributes. With a very large site, I got this error in the Mastra logs (attached). I have a few questions:...

How do the Traces work ? (mastra cloud/local)

I never see traces, is it normal, do i have to do anything ? i only have logs
No description

Mastra vNext Network Stream Format Incompatibility with AI SDK

Problem: When using Mastra's new vNext networks with the AI SDK's useChat hook, the stream parsing fails with the error: Failed to parse stream string. Invalid code {"type". Root Cause:...

Logging in the console

Hey folks, moving the discussion here to avoid spamming general. What's the easiest path logging HTTP requests emitted by Mastra agents? As a default the playground would log traces but the LLM call seems tied to a "getMostRecentUserMessage" event which only shows the model message, not the full HTTP request. A log drain should work but I don't see docs for a console drain, and as a default on a new app I don't see logs in the console. The default recommended logger is Pino which I think will stick to outputting JSON data and not HTTP requests. The lack of HTTP logging is the #1 pain point I feel when using anything that wraps HTTP requests (looking at n8n namely 😬 huge pain to debug) and I'd be eager to get rid of this issue in Mastra's context. Using mastra@latest (11.0.3 alpha) the log drain is not recognized despite Pino being set up. What is the expected behaviour, having logs in the console ?...

Tool calling & Structured output

When calling my agent through the mastra client sdk, it does not use the tools i provided, with the same prompt in the chat in the playground it does call the tool, why ? ```ts...

Support for format: 'aisdk' in streamVNext for mastra/client-js

It appears that { format: 'aisdk' } is not supported in client-js.

Streaming reasoning w/ 0.14.1 and ai v5 SDK

I'm using o3 and added sendReasoning: true to the toUIMessageStreamResponse and do not get any actual reasoning text. See the screenshot for the in-browser console of the part for reasoning. I did see this post, but it makes it seem the issue is resolved....
No description

Mastra as Remote Agent for AG UI using Copilotkit seems not working?

here's my dependencies: "@ag-ui/mastra": "^0.0.8", "@copilotkit/react-core": "1.9.3", "@copilotkit/react-ui": "1.9.3", "@copilotkit/runtime": "1.9.3",...
No description

Turborepo built package wrong type

I have my agents, workflows, tools etc. in a separate package that is built with tsc I then import them like so, for example:
import { myAgent } from "@mypackage/worker-core/agent";
import { myAgent } from "@mypackage/worker-core/agent";
...

[ERROR] Error executing step: Error: Cannot perform I/O on behalf of a different request.

We are getting the following issue on CF Workers. This is currently blocking our production deployment. Someone created an issue for it here with reproduction details: https://github.com/mastra-ai/mastra/issues/6337...

Reasoning part not saved in Mastra Memory message history?

Is reasoning not being saved? I get reasoning streamed in during generation, but when inspecting hte mastra messages table, I only see the text and tool invocation parts. I'd expect any data part to just be saved to the DB, as long as it's not transient: true. EDIT: okay I see the issue. For some reason, it gets saved like this.....

Thread id issue

i'm new to this but have frontend calling mastra server agents and trying to use thread creation feature. using cursor and after quite a few tries (upgrading to newer version of mastra) was prompted to raise a bug. Mastra Memory Thread Creation issue ...

Why did the type of GenerateReturn change?

before ```ts export type GenerateReturn<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = Z extends undefined ? GenerateTextResult<any, Z extends ZodSchema ? z.infer<Z> : unknown> : GenerateObjectResult<Z extends ZodSchema ? z.infer<Z> : unknown>;...

Help needed, registerApiRoute is not working properly.

Hi, how can I register a route properly, it return 404. Is there a working repo out there. Attached the SS. I am accessing the localhost:3000/api/chat Is there something fundamentally wrong here? Cause I see it works....
No description

dynamic agents - throwing in `instructions`

I use dynamic agents and throw inside instructions function if runtimeContext is not valid. Because of it, I can't initialize mastra dev, on some reasons on initializing it tries to call agent.generate() (with empty runtimeContext obviously) and fails.. Is that an issue to post or I'm doing something wrong?