updateWorkingMemory tool parameter mismatch
Hey there I am trying to use working memory schema and although my agent tried to make tool call 4 times each time it gives the same error. Here is my memory config:
and here is agent memory config:
Any help is appreciated 🙏🏻
11 Replies
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8911
GitHub
[DISCORD:1428127724446159000] updateWorkingMemory tool parameter mi...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1428127724446159000 Tool Parameter Mismatch LLM sends: { personalInfo: {...}, jobPreferences: {...} } Vali...
Hi @souvikinator ! Are you using the latest mastra packages?
using:
Thanks! What model/llm are you using?
gpt-5-chat-latest
Also wanted to know what's the recommended and reliable way to keep building working memory..noticed that in structured working memory if I add some information and then later agent tried adding information into working memory it removes the info that I added.
I don't think this happens in templated working memory.
Checked logs again and this validation error is quite frequent:
it did manage to make correct tool call to update the memory on 2nd try
That's interesting, I'm surprised gpt-5 isn't able to handle populating the json properly. I'll check with the team
When you say you add information to the working memory, you mean manually?
Yes
So I want to route to different agents in workflow based on whether user is onboarded or not. The onboarding agent is supposed to mark onboarded in working memory.
yeah, I've seen people running into this issue before, unfortunately we don't support updating the working memory manually very well at the moment, there are sometimes weird race conditions that make it so that the agent doesn't receive the correct version of the current state of the memory. We have plans on improving our memory, it was mainly designed to be used by the llm, but then we saw people want to also be able to manually update it.
When you get this error, usually llms retry the tool call, is it not doing this right now?
It does most of the times, rare ocassions when it doesn't. Hard to recreate that.
Understood. What are the chances of llm replacing existing working memory while updating with new information?
From what I understand using templated working memory seems to be more reliable.
yes, that's because there is no "validation" happening on the template memory, it's just a "string" whereas when you use a schema there is json validation involved
Any idea on this one?
Hey there I am constantly facing this problem where the agent while updating the working memory removed other data in the wokring memory. Not sure how to go about it, any help is appreciated 🙏🏻
One possible solution to this (using structured working memory in my case) and create dedicated tools for updating specific parts of the schema. Each tool would either add or modify existing information never remove it and the prompt would explicitly instruct the agent to use these tools for all memory updates.