LearnNewsExamplesServices
Frontmatter
id10722
titlePer-session purge MCP tool
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gemini-3-1-pro
createdAtMay 5, 2026, 12:13 AM
updatedAtMay 15, 2026, 2:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/10722
authorneo-gemini-3-1-pro
commentsCount1
parentIssue10721
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 5, 2026, 8:57 AM

Per-session purge MCP tool

Closedenhancementaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 5, 2026, 12:13 AM

Context

As part of the Shared Deployment MVP completeness gaps (post-#10691), operators need fine-grained control over session state. Currently, the delete_all_summaries tool provides a blunt full-clear mechanism, which is inappropriate for a shared environment where multiple teams and sessions coexist.

The Problem

A shared environment requires the ability to purge single sessions without disturbing the global state or other active team sessions. Without this, agents or operators cannot selectively clean up corrupted, orphaned, or stale sessions without causing collateral damage.

The Architectural Reality

The Memory Core currently supports global purges. A new MCP tool must be introduced on the Memory Core server to provide session-scoped cleanup. This interacts directly with the MCP boundary and the database layer without bleeding into core Memory Core operational internals inappropriately.

The Fix

Surface a purge_session({session_id}) tool on Memory Core. This tool should remove raw memories and the summary for the specified session. It must be operator-controlled via tool description/permission gating to prevent accidental invocation.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
purge_session MCP Tool Memory Core MCP Server Delete raw memories and summary for a single session_id. Throw explicit error if session not found or permission denied. Add to learn/agentos/SharedDeployment.md or tools list. L2 (Playwright unit test demonstrating session isolation)

Acceptance Criteria

  • Surface purge_session tool on Memory Core MCP.
  • Implement targeted deletion of raw memories for session_id.
  • Implement targeted deletion of summary for session_id.
  • Restrict access via permission gating / description caveats.
  • Add Playwright unit test demonstrating that purging session A does not affect session B's memories or summary.

Out of Scope

  • Global garbage collection routines.
  • Purging data across multiple environments simultaneously.

Avoided Traps

  • Rejected: Overloading existing delete_all_summaries. Adding a parameter to a destructive global tool creates a dangerous API surface where a missing parameter wipes the database. A dedicated tool ensures safety by design.

Related

Origin Session ID: 79042442-bebc-431d-8968-8a2e7d7a1151 Retrieval Hint: query_raw_memories(query="purge_session MCP tool Memory Core session isolation")

tobiu referenced in commit 570a2b9 - "feat(memory-core): surface purge_session MCP tool (#10722) (#10729) on May 5, 2026, 8:57 AM
tobiu closed this issue on May 5, 2026, 8:57 AM