Working Memory Updates Not Always Additive
Hi there, while testing a fairly simple use case of building a profile like schema in the agent working memory, I noticed most the time when the memory update is invoked (in the playground) I am seeing information being lost from previous turns or chat.
It seems the agent turn making the update is replacing the working memory that is already there. I was looking for a setting that may be PUT/PATCH style logic (full replace vs upsert) but I could not find any such setting.
is this intended behavior? IN. ayoutube video demo from mastra I saw that a template working memory was being addited to in a thread scoped working memory. Wondering if schema bound resource scoped working memory maybe doesn't function the same?
Happy to provide examples if useful
v0.12.3
2 Replies
Upon inspecting the tool invoking the memory update it looks like it has this instruction
"updateWorkingMemory": {
"type": "function",
"description": "Update the working memory with new information. Any data not included will be overwritten. Always pass data as string to the memory field. Never pass an object.",
......
Maybe this could be optional? Or are their logistical issues of retrieving existing memory data and making the update additive
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/7775