GPT-5 models call updateWorkingMemory overly aggressively
I doubt this has anything to do with Mastra, just looking for guidance / best practice.
I'm testing out gpt 5 and gpt 5.1 (previously 4.1) and I'm noticing the model invokes the
On 4.1, it rarely invoked it, basically only when the user asked to save a memory (expected behavior imo).
As an example of what I mean, I upload a file and ask it to explain it, and it randomly writes that to working memory before explaining it.
Has anyone else encountered this? Is there a way to avoid this? I've added the following to my system prompt, but it doesn't seem to make much of a difference:
I'm testing out gpt 5 and gpt 5.1 (previously 4.1) and I'm noticing the model invokes the
updateWorkingMemory tool on nearly every single message, in contexts that don't really make any sense.On 4.1, it rarely invoked it, basically only when the user asked to save a memory (expected behavior imo).
As an example of what I mean, I upload a file and ask it to explain it, and it randomly writes that to working memory before explaining it.
Notes: User uploaded a dummy PDF named "contract-dummy.pdf" that contains only the text "Dummy PDF file.""
Has anyone else encountered this? Is there a way to avoid this? I've added the following to my system prompt, but it doesn't seem to make much of a difference:
TOOLS
- DO NOT update working memory needlessly, only when user shares new information about themself.
