fix: send messages in chat format in MCP add_memory tool#1275
Merged
CaralHsi merged 2 commits intoMar 26, 2026
Merged
Conversation
The /product/add endpoint expects messages as a list of chat message objects, not a plain string. When passed a string, the SimpleStruct MemReader silently skips it and no memory is stored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
Collaborator
|
Hey @brentkearney! Thanks for the contribution — already merged your PR, thanks for putting this together! 🚀 Btw if you enjoyed contributing and want to stay connected with the project, we run a Discord server for contributors, a chill space to discuss features, ask questions, or pick up new issues 👉🏻 MemOS Discord Server (Contributor Exclusive) Thanks again for shipping this, and happy MemOSing 🧠✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The MCP
add_memorytool inexamples/mem_mcp/simple_fastmcp_serve.pypassesmemory_contentas a plain string to themessagesfield in the/product/addAPI payload. The endpoint expectsmessagesto be a list of chat message objects. When a plain string is passed, theSimpleStructMemReader silently skips it — no error is raised, the API returns success, but no memory is actually stored.The fix wraps the content as
[{"role": "user", "content": memory_content}].Related Issue (Required): Fixes #1274
Type of change
How Has This Been Tested?
Test steps:
simple_fastmcp_serve.pyadd_memorytool with test contentsearch_memories— verify memory is returnedChecklist
🤖 Generated with Claude Code