You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add configurable default_infer and custom update prompt
- Add default_infer setting to control default behavior when infer parameter not specified in API/MCP calls
- Add custom_update_memory_prompt setting for deduplication phase
- Update config schema with detailed parameter descriptions for LLM agents
- Apply config defaults in REST API and MCP endpoints using Optional[bool] pattern
- Add UI controls in Settings page for both configuration options
- Load config values from database and pass to mem0 core
@mcp.tool(description="Add a new memory. This method is called everytime the user informs anything about themselves, their preferences, or anything that has any relevant information which can be useful in the future conversation. This can also be called when the user asks you to remember something.")
61
-
asyncdefadd_memories(text: str) ->str:
61
+
@mcp.tool(description="Add a new memory. This method is called everytime the user informs anything about themselves, their preferences, or anything that has any relevant information which can be useful in the future conversation. This can also be called when the user asks you to remember something. The 'infer' parameter controls processing: True (default) = LLM extracts semantic facts and deduplicates; False = stores exact verbatim text without transformation.")
Copy file name to clipboardExpand all lines: openmemory/api/app/routers/config.py
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,18 @@ class EmbedderProvider(BaseModel):
30
30
config: EmbedderConfig
31
31
32
32
classOpenMemoryConfig(BaseModel):
33
-
custom_instructions: Optional[str] =Field(None, description="Custom instructions for memory management and fact extraction")
33
+
custom_instructions: Optional[str] =Field(None, description="Custom prompt for fact extraction phase. Overrides default prompt used to extract semantic facts from input text.")
34
+
custom_update_memory_prompt: Optional[str] =Field(None, description="Custom prompt for deduplication/update phase. Overrides default prompt used to determine ADD/UPDATE/DELETE/NONE decisions when comparing with existing memories.")
34
35
35
36
classMem0Config(BaseModel):
36
37
llm: Optional[LLMProvider] =None
37
38
embedder: Optional[EmbedderProvider] =None
39
+
default_infer: Optional[bool] =Field(
40
+
None,
41
+
description="Default value for infer parameter when not specified in API/MCP calls. "
42
+
"When True: enables LLM fact extraction and deduplication. "
43
+
"When False: stores verbatim text without transformation."
0 commit comments