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:

  1. Frontend-driven memory creation (VittoMonitorService.createMemory)
  2. Backend-only memory creation with LLM extraction
  3. Backend-only with two tiers: explicit detection (regex) + LLM extraction (async)
  4. 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


🔗 Related


Auto-generated by MCP Smart Consolidation