Feat/bulk delete and search drawer#310
Conversation
Add 'id' field to search results containing the drawer ID. This enables the delete/update workflow after finding content via search. - Extract drawer IDs from results["ids"][0] (index-aligned with documents) - Include 'id' field in each hit dictionary - Add test to verify drawer_id is present in search results Fixes milla-jovovich#224
Implement bulk deletion capabilities via MCP tools: - mempdelete_wing: Delete all drawers in a wing using where filter - mempdelete_room: Delete specific room in a wing using \ filter Both tools: - Check existence before deletion - Return deleted_count in response - Log deletion for audit trail - Include comprehensive tests Fixes MemPalace#237 Fixes MemPalace#209
Add CLI commands for bulk deletion: - mempalace delete-wing <wing>: Delete entire wing with confirmation - mempalace delete-room <wing> <room>: Delete specific room Features: - Shows drawer count before deletion - Interactive confirmation prompt - --force flag to skip confirmation - Proper error handling for non-existent wings/rooms Fixes MemPalace#237
Update documentation to reflect new features: - Update tool count from 19 to 21 - Add mempdelete_wing and mempdelete_room to MCP tools table - Add delete-wing and delete-room CLI commands - Note that search results now include 'id' field - Update plugin READMEs with new tool count
PR Review: Feat/bulk delete and search drawerExecutive Summary
Affected Areas: Business Impact: Enables users and AI agents to bulk-delete entire wings or rooms, and allows search→delete workflows by exposing drawer IDs in search results. Flow Changes: Search results now include an Ratings
PR Health
High Priority Issues🏗️ #1:
|
web3guru888
left a comment
There was a problem hiding this comment.
LGTM! The code properly implements the requested bulk deletion features (wings and rooms) with proper confirmation prompts when not forced. Returning the DB IDs for search results is useful too. I verified the test coverage ensures wing/room filters and ID return work as expected.
Minor heads up for the future since stability is a focus rn: it might be valuable to extract ChromaDB specific interaction out of cli.py into a separate DB layer at some point so cli.py handles exclusively the commands/formatting part.
Otherwise looks clean and ready!
|
Closing — this is superseded by recently merged PRs to develop. Thank you for the contribution! |
What does this PR do?
This PR implements bulk deletion capabilities and adds
drawer_idto search results, fixing three open issues:Search Results (Fixes Stale drawer retrieval can inject contradictory memory into live agent context; no official sync/update workflow exists #224)
idfield containing thedrawer_idMCP Bulk Delete Tools (Fixes Feature Request / Bug: No Storage Limit Handling or Disk-Full Graceful Degradation #237, Index does not respect the config. Room removal does not remove already indexed files, and mining should respect project
.gitignore#209)mempdelete_wing: Delete all drawers in a wingmempdelete_room: Delete all drawers in a specific roomwherefilters (wing, room fields) for efficient bulk operationsCLI Commands (Fixes Feature Request / Bug: No Storage Limit Handling or Disk-Full Graceful Degradation #237)
mempalace delete-wing <wing>– Delete entire wingmempalace delete-room <wing> <room>– Delete specific room--forceflag to skip confirmationDocumentation
mempdelete_wing,mempdelete_room)drawer_idin search resultsHow to test