Architecture: How should Vitto handle in-session memory continuity to prev...
Documentation for Sessions
🏗️ Architecture: How should Vitto handle in-session memory continuity to prev...
Date: 2026-03-19
Time: 21:56:05 UTC
Session: gspace1-239.3
Agent: backend
Confidence: 92%
Status: ✅ Documented
📋 Decision Context
Question:
How should Vitto handle in-session memory continuity to prevent forgetting within conversations?
Task: S239: Fix in-session memory loss
🎯 Decision Made
Chosen:
Virtual context management via ConversationGenomeService + WindowManagerService. Genome compresses conversation history into structured representation (topics, decisions, facts, artifacts) at 10-30x token reduction. WindowManager maintains a sliding window of recent messages with intelligent eviction (semantic Belady — evict least-likely-to-be-referenced). When context window fills, older messages are compressed into genome rather than truncated.
Options Considered:
- Simple sliding window (drop oldest messages)
- Full history always in context (token-expensive)
- Conversation genome compression with sliding window hybrid
- Summary-only approach (lose all detail)
💭 Reasoning
Root cause of in-session forgetting: S237 fixed history injection into agent loop, but when conversations exceed ~50 messages, the raw history exceeds token budgets and gets truncated — losing critical context. Simple truncation (drop oldest) loses important early decisions. The ConversationGenome approach (inspired by MemGPT's virtual memory) compresses N messages into ~1K tokens while preserving semantic content. The WindowManager ensures the most recent K messages stay in full fidelity while older messages live in compressed genome form. This gives Vitto both recency (last 10 messages verbatim) and depth (full conversation genome). Heuristic v1 uses keyword extraction without LLM calls — zero added cost. LLM-powered recompile (v2) runs every 5 messages using cheap model.
📁 Files Involved
APIs/backend-vitto-api/src/app/mind/services/conversation-genome.service.tsAPIs/backend-vitto-api/src/app/mind/services/window-manager.service.tsAPIs/backend-vitto-api/src/app/engine/context-assembly/context-assembly-helpers.ts
🔗 Related
- Decision ID:
dev_1773957365813_7vu89il - Session: 239
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation