feat: soft-archive wings — exclude from search without deleting data (#332) - #336
Conversation
web3guru888
left a comment
There was a problem hiding this comment.
Approved — Clean, well-structured implementation. Zero data deletion, fully reversible archiving. Tests are solid (11 tests covering idempotency, corrupt JSON recovery, config preservation). This directly addresses a real need from Issue #332.
Two architectural observations (not blockers — fine for a follow-up):
-
search()config instantiation: Insearcher.py, the non-MCPsearch()path creates a newMempalaceConfig()on every call to read archived wings. This means a filesystem read per search invocation. Consider either passing the config from the caller or caching it. Also,search()lacks theinclude_archivedparameter thatsearch_memories()has — might be worth adding for API consistency. -
$nescaling: With many archived wings, the$andfilter grows linearly (one$neper archived wing). For repositories with 50+ wings this could become unwieldy. A future optimization could store anarchivedmetadata field on each drawer entry and filter with a single{"archived": {"$ne": true}}, but that is a bigger change and not needed now.
We plan to use this feature in the MemPalace-AGI integration for archiving completed research cycles, so happy to see it land. Nice work! 👍
|
Thanks for the review and approval @web3guru888! Both points are noted:
Appreciate the detailed feedback! |
- archive_room() / unarchive_room() / get_archived_rooms() in config.py - searcher.py excludes archived rooms from where clause - mempalace_archive_room / mempalace_unarchive_room MCP tools - tool_status now reports archived_rooms per wing - 9 new tests for room-level archiving - Addresses @web3guru888 feedback on PR MemPalace#336 Made-with: Cursor
|
@web3guru888 Great suggestion — implemented room-level archiving in the latest push (9526e73). What's added:
Your ASTRA-dev use case (archive CLI commands ( |
|
This is exactly what we needed — thank you. The API surface is clean: Our test case: The One note: we track 31 rooms across 5 wings in production. The per-wing |
|
Good point on scalability — at 31 rooms across 5 wings the per-wing list approach should be fine, but agreed it's worth watching. If it grows significantly, migrating to a per-drawer |
…rchive nudges - Chrom metadata synapse_mark=new on new drawers (MCP + miner) - build_soft_archive_proposal for MemPalace#336-style archive wing suggestions - mempalace_status: enriched consolidation_details, phase3 block, tagging-window count - Config: consolidation_inactive_days, soft_archive_suggestions, target_wing Made-with: Cursor
|
Agreed — 31 rooms across 5 wings is well within comfortable range for the per-wing list approach. We're at similar scale and haven't felt any pressure there either. Good call keeping it simple now and revisiting if usage grows; no need to over-engineer the filter path prematurely. |
|
Hi, thanks for the contribution. This PR has merge conflicts with Could you rebase onto If this change is no longer relevant, feel free to close the PR. (This message is part of a periodic backlog pass, sent to all open PRs that match this state.) |
Closes #332
Summary
Add the ability to archive/unarchive wings so they are excluded from search results without deleting any data.
Problem
When a project ends or becomes inactive, its memories still appear in search results. The only current option is
delete-wing(#310), which permanently destroys data. Users need a non-destructive way to hide stale wings from active search.Solution
Config layer (
config.py)archive_wing(name)/unarchive_wing(name): toggle"archived": trueflag inwing_config.jsonget_archived_wings(): return set of archived wing namesload_wing_config()/save_wing_config(): public accessors forwing_config.jsonSearch layer (
searcher.py)search()andsearch_memories()now exclude archived wings by default using{"wing": {"$ne": ...}}in the ChromaDBwherefilter--wingis requested, archive filtering is skipped (explicit intent)search_memories()acceptsinclude_archived=Trueto override exclusionMCP layer (
mcp_server.py)mempalace_archive_wing/mempalace_unarchive_wing: new toolsmempalace_search: newinclude_archivedparametermempalace_status: shows archived wings separatelyData safety
wing_config.jsonunarchiveinclude_archived=TrueTesting
tests/test_archive.pycovering:Related: #331 (time-decay scoring — the other half of time-aware memory management)