feat: add user_mapper.py for cross-channel memory unification#19163
feat: add user_mapper.py for cross-channel memory unification#19163Cyrene963 wants to merge 1 commit into
Conversation
1231b79 to
500d2b0
Compare
1 similar comment
|
Thanks for pointing out #9308! You're right that both address cross-channel identity, but they solve it at different scopes: #9308 (Honcho gateway layer):
#19163 (filesystem layer):
The gap in #9308: if a non-owner user (e.g., a classmate sharing the bot) uses both Telegram and CLI, their memories are still split. #9308's Proposed approach:
I'll update #19163 to also support automatic owner detection (symlink the global MEMORY.md/USER.md to the owner's user directory on first setup), reducing the manual config burden. |
500d2b0 to
9ea7ce0
Compare
|
The Questions before merge:
The core logic looks solid. The file is well-structured with clear docstrings. Resolving the location and persistence questions would unblock merge. |
|
Thanks for the thorough review, @ether-btc! Good questions. Here's the breakdown: 1. Location:
|
9ea7ce0 to
4cf1e75
Compare
…cation Adds command that: 1. Reads config.yaml to find Telegram home channel chat_id 2. Falls back to largest memory directory detection 3. Automatically migrates data and creates symlinks 4. Sets up global MEMORY.md/USER.md for CLI access Addresses feedback on NousResearch#9308 overlap: - NousResearch#9308 auto-detects owner at gateway layer (Honcho only) - This provides auto-setup for owner + manual mapping for any user - Works with all memory providers, not just Honcho Commands: auto-setup, map, unmap, list, resolve, migrate
4cf1e75 to
eba9d52
Compare
Summary
Addresses community feedback on multi-user isolation design: same user on different channels (CLI, Telegram, Discord) gets separate memory banks.
Solution
user_mapper.py— a filesystem utility that unifies a user's memories across channels via symlinks:MEMORY.md/USER.mdsymlinked to user's directorymemories/{chat_id}/symlinked to user's directoryCommands
Relationship to PR #17989
Complementary, not competing. #17989 is the foundation; this builds on it.
How It Works
memories/user_{username}/as the real data directorymemories/{chat_id}/→user_{username}/MEMORY.md/USER.md→user_{username}/(for CLI)Limitations
MEMORY.mdsymlink means all non-Telegram sessions (CLI, cron) share the same user's memory. Fine for single-user setups; multi-user CLI needs code-level user_id support.Test Results
All 5 tests pass locally: