feat: expose infer param in MCP add_memories tool#4517
Merged
whysosaket merged 1 commit intomainfrom Mar 25, 2026
Merged
Conversation
Allow MCP clients to control LLM fact extraction by passing infer=False to store memories verbatim. Defaults to True for backward compatibility. Brings MCP API to parity with the REST API. Closes #3322 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kartik-mem0
approved these changes
Mar 25, 2026
whysosaket
approved these changes
Mar 25, 2026
whysosaket
approved these changes
Mar 25, 2026
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.
Linked Issue
Closes #3322
Description
The MCP server's
add_memoriestool always usedinfer=Truewhen callingmemory_client.add(), with no way for MCP clients to control LLM fact extraction. This caused memories about third parties to lose their subject (e.g., "Bob has a PhD" → "has a PhD"), making them unusable.This adds an
inferparameter (defaultTrue) to the MCPadd_memoriestool and passes it through tomemory_client.add(). This brings the MCP API to parity with the REST API (which already supportsinfersince #3607). The tool description is also updated to document the parameter for MCP clients.Type of Change
Breaking Changes
N/A
Test Coverage
Verified that the
inferparameter is accepted in the function signature and correctly forwarded tomemory_client.add(). The change is minimal (3 lines) and mirrors the existing REST API behavior.Checklist