Architecture: How to close the intelligence gap between MCP decisions (ai-...
Documentation for Sessions
🏗️ Architecture: How to close the intelligence gap between MCP decisions (ai-...
Date: 2026-03-24
Time: 02:51:07 UTC
Session: gspace1-262.3
Agent: backend
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How to close the intelligence gap between MCP decisions (ai-api) and Vitto's runtime decision-making?
Task: Close intelligence gaps between MCP and Vitto
🎯 Decision Made
Chosen:
Intelligence Bridge: 5-gap fix — (1) inject learning intelligence into Vitto's context assembly at task start, (2) fix pattern dedup with SHA-256 + upsert, (3) add domains[] and audience fields to Decision schema, (4) include golden decisions in pyramid context, (5) sync specializations to sub-agent definitions on daily cron
Options Considered:
- Fix all 5 gaps in one sub-project (chosen)
- Fix only real-time intelligence injection (Gap 1) and defer rest
- Build the UI first and wire backends later
💭 Reasoning
12K+ MCP decisions exist in ai-api but Vitto never reads them at runtime. The only bridge is a daily cron that syncs patterns to sub-agent knowledge docs. Pattern mining has a dedup bug (simple char sum hash + Date.now() = identical patterns stored 20+ times). Decisions lack domain categorization (type field exists but no domain/audience). Golden decisions exist but aren't injected into Vitto's context. Agent specializations computed from decisions never sync to sub-agent performance metrics. All 5 gaps are independent fixes that compose into a complete intelligence loop.
📁 Files Involved
APIs/backend-vitto-api/src/app/engine/context-assembly/context-assembly.service.tsAPIs/backend-ai-api/src/app/learning/jobs/pattern-mining.job.tsAPIs/backend-ai-api/src/app/schemas/ai-infrastructure.schema.tsAPIs/backend-ai-api/src/app/learning/learning.service.tsAPIs/backend-vitto-api/src/app/engine/learning-sync.service.ts
🔗 Related
- Decision ID:
dev_1774320666952_1qcqf6x - Session: 262
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation