Architecture: How should the memory creation pipeline work — frontend-driv...
Documentation for Sessions
🏗️ Architecture: How should the memory creation pipeline work — frontend-driv...
Date: 2026-02-11
Time: 23:01:32 UTC
Session: gspace1-106.13
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How should the memory creation pipeline work — frontend-driven or backend-driven?
Task: Fix Vitto memory system — user-stated facts must persist across browsers/devices
🎯 Decision Made
Chosen:
Backend-only memory creation with two tiers: explicit intent detection (regex, immediate) + LLM extraction (async)
Options Considered:
- Frontend-driven memory creation (VittoMonitorService.createMemory)
- Backend-only memory creation with LLM extraction
- Backend-only with two tiers: explicit detection (regex) + LLM extraction (async)
- Hybrid: frontend saves locally, backend syncs to MongoDB
💭 Reasoning
The frontend VittoMonitorService.createMemory() saved to vitto-mind database but the recall pipeline (ChatService.loadUserContext) reads from user_agent_memories in gograb-api. Two separate databases, zero cross-talk. This is the root cause of 'forgetting.' The fix: (1) All memory creation happens on the backend via UserAgentService.saveMemory() to gograb-api. (2) Two-tier approach: explicit intent detection via regex for immediate saves (e.g., 'remember this, I'm the CEO') plus async LLM extraction for implicit facts. (3) Frontend NEVER creates memories — it only sends rawUserMessage alongside the enriched prompt. This ensures every fact is in one place (gograb-api) and available globally.
📁 Files Involved
apis/backend-ai-api/src/app/chat/chat.service.tsapis/backend-ai-api/src/app/chat/chat.controller.tslibs/libs-ai/gograb-ai-lib/src/lib/services/vitto-chat.service.tslibs/libs-ai/vitto-hub/src/lib/components/ai-panel/ai-panel.component.tslibs/libs-ai/vitto-chat/src/lib/services/vitto-chat-engine.service.ts
🔗 Related
- Decision ID:
dev_1770850892276_30mdlqn - Session: 106
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation