Agent responds to updateWorkingMemory tool calls
Running into an issue with
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.
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.
GitHub
mastra-ai/mastra
The TypeScript AI agent framework. ā” Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. - mastra-ai/mastra
11 Replies
Hey @joofsh ! What model are you using? You could try adding more guidance in your agent's instructions, telling it how it must handle the
updateWorkingMemory tool call/result. If you happen to have an example that reproduces this behaviour, please share it with us and we'll have a look šHey @Romain thanks for getting back to me. Good idea, I'll specifically add instructions for handling this tool call. I'm using
gemini-2.5-flash, which maybe is the underlying problem? I can switch to gemini-2.5-pro to gain more reasoning?I know
gemini-2.5-flash-lite is sometimes problematic with tool calls, but I thought flash was fine. If the addtional instructions don't work, you can try with pro and see if you see the same behaviour.
Keep us posted šš Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10859
š If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly.
š Thank you for helping us improve Mastra!
Gemini is 2.5 is trash at tool calling!!
First thing to see if the problem occurs with a diff model, something like OpenAI to see the behavior difference
We did have problems with this in the past but it comes down to the model quirks
@Abhi Aiyer Thanks, and I generally agree with you. If I didn't have a ton of GCP credits I would use something else š
hahaha dude i feel you on the credits
What mastra version are you on @joofsh
0.17.5 . In the process of upgrading to 1.0 beta though.
Fwiw, I added additional guidance in my prompt telling it to not respond to
updateWorkingMemory tool calls and that seems to have worked for nowAwesome!
Thanks for upgrading, let us know how it goes š
what can I say, I like to live dangerously š