Architecture: How should WhatsApp users be identified, and why does Vitto ...
Documentation for Sessions
🏗️ Architecture: How should WhatsApp users be identified, and why does Vitto ...
Date: 2026-02-20
Time: 19:30:26 UTC
Session: gspace1-129.5
Agent: backend
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How should WhatsApp users be identified, and why does Vitto appear to have no memory between messages?
Task: Session 129: Fix WhatsApp memory persistence and user identity resolution
🎯 Decision Made
Chosen:
3-layer fix: ChannelUserLink mapping (phone→userId), conversation prompt fix (include ALL memories + profile facts), and auto user profile extraction from conversations
Options Considered:
- No alternatives documented
💭 Reasoning
Root cause analysis found 3 problems: (1) userId was set to raw phone number, which works for memory consistency within WhatsApp but creates separate memory spaces from the web panel. Created ChannelUserLinkDoc schema + ChannelUserService to map phone→GoGrab userId, with /link command for account verification. (2) The conversation prompt filtered OUT conversation-type memories from the 'What you know' section — only non-conversation memories were shown. Since all WhatsApp memories were type='conversation', the LLM truthfully said 'I don't have information.' Fixed by including ALL memory types in context. (3) No user profile facts were ever extracted — conversations were stored verbatim but facts like 'prefers dark mode' or 'runs a restaurant' were never distilled. Added extractUserProfileFacts() using a fast LLM call that creates type='user_profile' memories from each substantive conversation.
📁 Files Involved
apis/backend-vitto-api/src/app/mind/schemas/channel-user-link.schema.tsapis/backend-vitto-api/src/app/connectivity/channel-user.service.tsapis/backend-vitto-api/src/app/connectivity/connectivity.module.tsapis/backend-vitto-api/src/app/connectivity/channel-gateway.service.tsapis/backend-vitto-api/src/app/engine/vitto-engine.service.ts
🔗 Related
- Decision ID:
dev_1771615826104_185rzaw - Session: 129
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation