-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add configurable defaults for infer and custom update prompt #3619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add configurable defaults for infer and custom update prompt #3619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please incorporate the changes? Thanks!
Implements a configurable default value for the infer parameter across memory operations, allowing users to control whether LLM processing is enabled by default. Configuration: - Added default_infer field to mem0 MemoryConfig (default: True) - Added default_infer to OpenMemory API configuration schema - Configuration UI toggle in settings page under "Default Memory Processing Settings" - Loaded from database configuration with proper None/False handling API Changes: - MCP add_memories: infer parameter now optional (Optional[bool]) - REST create_memory: infer parameter now optional with Field documentation - When infer=None, applies memory_client.config.default_infer - Updated tool descriptions to document infer parameter behavior Behavior: - infer=True: LLM extracts semantic facts and deduplicates - infer=False: Stores exact verbatim text without transformation - infer=None: Uses configured default_infer value (default: True) This allows users to set their preferred default behavior while still being able to override on a per-call basis. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
5c8134c to
11f3712
Compare
The PUT endpoint was missing the critical database save operations. This bug was introduced in upstream commit 639d26e (PR mem0ai#3583) when adding the PATCH endpoint - the save/reset/return lines were accidentally moved from PUT to PATCH instead of being duplicated in both. Added missing lines to PUT endpoint: - save_config_to_db(db, updated_config) - reset_memory_client() - return updated_config This ensures config changes (like default_infer toggle) persist when Save Configuration is clicked in the UI. Refs: upstream mem0ai/mem0 commit 639d26e
|
However, I realized that there was a bug introduced recently in commit 639d26e from @vedant381 In this screenshot, the lines 175-177 on the right side originally belonged to the PUT function. But there was a copy-paste error which led to moving the lines instead of copying them to
I also fixed it with another commit on this branch since this would otherwise break the whole config 🙂 Took me some time to figure that out - it was a difficult diff to read due to how diff showed only new lines introduced 😄 |



Description
This PR adds configurable default values for the
inferparameter and custom deduplication prompts in OpenMemory, allowing users to control default behavior system-wide through the Settings UI.Features:
default_infersetting: Controls whether LLM processing (fact extraction & deduplication) is enabled by default wheninferparameter is not specified in API/MCP callscustom_update_memory_promptsetting: Allows customizing the deduplication phase prompt (ADD/UPDATE/DELETE/NONE decisions)Implementation:
Optional[bool] = Nonepattern forinferparameterType of change
How Has This Been Tested?
Checklist: