Architecture: How to implement CU action memory so Vitto remembers past br...
Documentation for Sessions
🏗️ Architecture: How to implement CU action memory so Vitto remembers past br...
Date: 2026-03-18
Time: 00:16:06 UTC
Session: gspace1-231.9
Agent: backend
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How to implement CU action memory so Vitto remembers past browser automation sequences?
Task: S231.2 Phase 2.2 — CU action memory (GAP-11)
🎯 Decision Made
Chosen:
Extended GoalHistory schema in backend-ai-api with optional actionRecipe field (summary, steps[], extractedAt, sessionId). Added extractAndStoreActionRecipe() to ComputerUseLoopService that fires after session.status='completed'. Added getLastRecipeForProfile() for prior recipe injection into CU system prompt. Recipes compressed by Haiku to ~5 key steps.
Options Considered:
- Store in VittoMemoryService via HTTP call (rejected: cross-service, adds latency)
- Store in ComputerUseAuditService in-memory (rejected: already has 10K limit, no persistence)
- New collection in ai-agents DB (rejected: GoalHistory already tracks per-profile goals)
- Extend GoalHistory with actionRecipe (chosen: same service, same DB, natural fit)
💭 Reasoning
CU sessions were fire-and-forget (GAP-11). ComputerUseAuditService kept an in-memory log (10K entries, no DB). No 'last time I logged into Gmail, I clicked X then Y' memory. Solution stores recipes inside the existing GoalHistory schema (same service, same DB) to avoid cross-service HTTP calls. Prior recipe injection gives the CU loop a head start on familiar tasks. Fire-and-forget extraction (catch errors, don't block completion) ensures failed extraction never blocks task success.
📁 Files Involved
APIs/backend-ai-api/src/app/schemas/goal-history.schema.tsAPIs/backend-ai-api/src/app/infrastructure/services/goal-history.service.tsAPIs/backend-ai-api/src/app/infrastructure/services/computer-use-loop.service.ts
🔗 Related
- Decision ID:
dev_1773792966564_dguceez - Session: 231
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation