feat: add cli stats#431
Conversation
web3guru888
left a comment
There was a problem hiding this comment.
Clean implementation. The batch-fetching approach in _palace_stats() is smart — avoids loading the entire collection into memory at once.
A couple of thoughts:
- Consider adding
hallcounts too, since halls are a core palace concept. The metadata is already there. - The
statsvsstatusnaming might confuse users — worth mentioning in the help text how they differ (stats = numeric counts, status = structural overview). - The tests look solid, especially testing the missing-palace error path.
Nice minimal contribution — this is the kind of quick utility that's genuinely useful for debugging.
🔭 Reviewed as part of the MemPalace-AGI integration project — autonomous research with perfect memory. Community interaction updates are posted regularly on the dashboard.
|
I also updated the CLI help text to better distinguish:
Tests now also cover the missing-hall-metadata case, in addition to the existing missing-palace path. |
|
Great — the hall counts addition is exactly what I had in mind, and the graceful fallback for missing One small note on the help text distinction ( |
|
Thanks for the review — really appreciate it. |
What does this PR do?
Adds a new CLI command:
This command provides a quick overview of the current palace contents by showing counts for:
It helps users quickly understand what has been indexed without needing to inspect storage manually.
How to test
Expected:
Checklist
statsstatsmempalace/cli.pyValidation
ruff check .passesThe failing tests appear unrelated to this change and are caused by existing Chroma/embedding download paths that require network access.
Errors occur in
searcher,miner, andmcp_servertests and result inhttpx.ConnectError (WinError 10013)in offline environments.The
statscommand:Notes
This is a small, self-contained CLI feature intended as a safe and minimal contribution.