Skip to content

Missing lesson_delete tool — no way to delete/cleanup lessons via MCP or REST API #945

Description

@AzYuJie

Problem

The agentmemory MCP server (53 tools) has memory_lesson_save and memory_lesson_recall for CRUD operations on lessons, but there is no lesson_delete (or equivalent) tool.

  • memory_governance_delete only operates on mem_* (memories), not lsn_* (lessons)
  • No undocumented REST API endpoints for lesson deletion (DELETE /agentmemory/lesson/:id returns 404)
  • The internal KV store supports soft-delete (lesson.deleted = true) as seen in source code, but it is not exposed via any MCP tool

Impact

Users cannot remove duplicate, outdated, or incorrect lessons. This is especially problematic when:

  • Multiple lessons cover the same topic (needs consolidation/dedup)
  • A lesson was created with incorrect content
  • Cleanup of test/experimental lessons

The only workaround is manual KV store manipulation, which is not user-accessible.

Proposed Solution

Expose a memory_lesson_delete MCP tool with:

  • Parameter: id (single lesson ID) or ids (comma-separated, matching memory_governance_delete pattern)
  • Parameter: reason (audit trail, same as governance_delete)
  • Behavior: soft-delete (set deleted = true), matching the existing internal mechanism

Environment

  • agentmemory version: latest (npm @agentmemory/agentmemory)
  • MCP server ports: 3113/3114
  • Verified via: direct REST API probing + MCP tool list + source code inspection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions