superlocalmemory
superlocalmemory copied to clipboard
feat: expose multi-scope memory controls via MCP, CLI, and Python API (PR 3/3)
Summary
PR 3/3 of the multi-scope memory feature (RFC #20).
Exposes scope controls to all entry points: MCP tools, CLI commands, and the Python API (MemoryEngine).
Changes
| File | Change |
|---|---|
core/engine.py |
store(): add scope + shared_with kwargs; recall(): add include_global + include_shared kwargs |
core/store_pipeline.py |
run_store(): add scope + shared_with params; enrich_fact(): preserve scope/shared_with on enriched facts; pass scope to MemoryRecord/AtomicFact constructors |
storage/database.py |
store_memory/store_fact/store_edge/store_temporal_event: write scope + shared_with columns; _row_to_fact: deserialize scope/shared_with |
mcp/tools_core.py |
remember: add scope + shared_with params; recall: add include_global + include_shared params |
cli/main.py |
remember: --scope (personal/shared/global), --shared-with; recall: --include-global/--no-global, --include-shared/--no-shared |
cli/commands.py |
cmd_remember: pass scope/shared_with to daemon/engine; cmd_recall: pass include_global/include_shared |
Design
- All new parameters have backward-compatible defaults
store():scope='personal',shared_with=Nonerecall():include_global=True,include_shared=True- CLI
--no-global/--no-sharedflags for explicit opt-out - MCP
shared_withaccepts comma-separated profile IDs
Dependencies
- Requires PR #42 (schema) and PR #43 (retrieval)
Test Results
- 755 passed on Ubuntu (all 3 Python versions)
- 75 passed on macOS (all 3 Python versions)
- Pre-existing failures only — no regressions from scope changes
Ref: #20