delete_memory
Remove outdated or incorrect information from Serena's memory files when users request deletion to maintain accurate project data.
Instructions
Delete a memory file. Should only happen if a user asks for it explicitly, for example by saying that the information retrieved from a memory file is no longer correct or no longer relevant for the project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_file_name | Yes |
Implementation Reference
- src/serena/tools/memory_tools.py:55-67 (handler)The DeleteMemoryTool class provides the handler for the 'delete_memory' tool. Its apply method executes the tool logic by delegating to the project's memories_manager.delete_memory method.class DeleteMemoryTool(Tool, ToolMarkerCanEdit): """ Deletes a memory from Serena's project-specific memory store. """ def apply(self, memory_file_name: str) -> str: """ Delete a memory file. Should only happen if a user asks for it explicitly, for example by saying that the information retrieved from a memory file is no longer correct or no longer relevant for the project. """ return self.memories_manager.delete_memory(memory_file_name)
- src/serena/project.py:51-54 (helper)The delete_memory method in MemoriesManager performs the actual file deletion for memories and returns a confirmation message. This is called by the DeleteMemoryTool handler.def delete_memory(self, name: str) -> str: memory_file_path = self.get_memory_file_path(name) memory_file_path.unlink() return f"Memory {name} deleted."