Architecture: How should Vitto's reasoning be made visible without adding ...
Documentation for Sessions
🏗️ Architecture: How should Vitto's reasoning be made visible without adding ...
Date: 2026-03-19
Time: 14:20:39 UTC
Session: gspace1-238.7
Agent: backend
Confidence: 91%
Status: ✅ Documented
📋 Decision Context
Question:
How should Vitto's reasoning be made visible without adding a separate reasoning engine?
Task: Not specified
🎯 Decision Made
Chosen:
ReasoningService as a DECORATOR on existing AgentLoopService — enriches tool.starting/tool.called SSE events with hypothesis/observation metadata. Uses regex heuristics (V1) not LLM calls. Reasoning trace persisted in ExecutionTrace schema.
Options Considered:
- Full planning DAG engine (AutoGPT-style)
- LLM call per tool to generate hypothesis (expensive)
- Regex heuristic decorator on existing events (chosen)
💭 Reasoning
Root cause: Vitto's agent loop does implicit reasoning via the LLM, but there's zero observability into WHY a tool was chosen. Building an explicit planning DAG (like AutoGPT) would be over-engineering — implicit LLM reasoning consistently outperforms explicit DAGs in practice. The pragmatic approach adds OBSERVABILITY to existing reasoning rather than replacing it. Regex extraction from LLM text ("I'll", "Let me", "To...") is fragile but adequate for V1 — the real value is the persistence and rendering infrastructure. Future V2 can use structured output. The key architectural decision: metadata ON existing SSE events (not new event types) avoids stream flooding and requires zero frontend event routing changes.
📁 Files Involved
APIs/backend-vitto-api/src/app/engine/reasoning.service.tsAPIs/backend-vitto-api/src/app/engine/agent-loop.service.tsAPIs/backend-vitto-api/src/app/mind/schemas/execution-trace.schema.ts
🔗 Related
- Decision ID:
dev_1773930039256_m73uhq0 - Session: 238
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation