update_memory
Modify existing stored information by replacing the content of a specific memory with new text, enabling AI applications to maintain accurate and current long-term data.
Instructions
Overwrite an existing memory’s text.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory_id to overwrite. | |
| text | Yes | Replacement text for the memory. |
Implementation Reference
- src/mem0_mcp_server/server.py:390-400 (handler)Handler function for the 'update_memory' tool that executes the logic to update a memory's text using the Mem0 MemoryClient.@server.tool(description="Overwrite an existing memory’s text.") def update_memory( memory_id: Annotated[str, Field(description="Exact memory_id to overwrite.")], text: Annotated[str, Field(description="Replacement text for the memory.")], ctx: Context | None = None, ) -> str: """Overwrite an existing memory’s text after the user confirms the exact memory_id.""" api_key, _, _ = _resolve_settings(ctx) client = _mem0_client(api_key) return _mem0_call(client.update, memory_id=memory_id, text=text)