Skip to main content
Glama

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
NameRequiredDescriptionDefault
memory_file_nameYes

Implementation Reference

  • 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)
  • 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."

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oraios/serena'

If you have feedback or need assistance with the MCP directory API, please join our Discord server