AI ROUTES CLEANUP
Comprehensive guidelines for AI-assisted development within the Editor platform
AI Routes Cleanup & Organization Plan
🎯 Goals
- Remove outdated/broken components
- Connect all components to real backend-ai-api
- Use flash-persistence for local data
- Ensure consistent data flow
- Organize routes logically
📋 Current Routes Analysis
✅ Working Components (Keep & Improve)
1. Training Center - /ai/ai-agents-training-center
- ✅ Connected to ModuleIntelligenceHarvesterService
- ✅ Uses PatternExtractorService
- ✅ Real data from flash-persistence
- 🔧 Action: Ensure backend sync works
2. Agent Knowledge Viewer - /ai/agent-knowledge/:agentId?
- ✅ Connected to backend API (
/ai-api/platform/agents/:agentId/knowledge) - ✅ All services properly wired
- ✅ Fixed takeUntilDestroyed errors
- 🔧 Action: Test with real agent data
3. AI Dashboard - /ai/dashboard
- ✅ Using ModuleIntelligenceHarvesterService
- ✅ Using PatternExtractorService
- 🔧 Action: Remove any remaining mock data calls
⚠️ Needs Update (Fix & Connect)
4. Platform Intelligence - /ai/platform-intelligence
- Component:
PlatformIntelligenceDashboardComponent - 🔧 Action: Connect to
/ai-api/platform/agentsAPI - 🔧 Action: Show real platform agents and their training status
5. Cursor Agents Dashboard - /ai/cursor-agents
- Component:
CursorAgentsDashboardComponent - 🔧 Action: Connect to
/ai-api/agentsAPI - 🔧 Action: Show development agents (cursor-angular-agent, cursor-backend-agent, etc.)
6. Space Assistants - /ai/vitto-hubs
- Component:
SpaceAssistantsDashboardComponent - 🔧 Action: Connect to tenant-specific AI APIs
- 🔧 Action: Show tenant-isolated assistants
7. AI Agents Dashboard - /ai/agents-dashboard
- Component:
AiAgentsDashboardComponent - 🔧 Action: Consolidate with other agent views?
- 🔧 Action: Or make this the "All Agents" overview
8. Agent Mesh - /ai/mesh
- Component:
AgentMeshVisualizationComponent - 🔧 Action: Connect to real agent communication data
- 🔧 Action: Use WebSocket for real-time updates
9. Memory Browser - /ai/memory
- Component:
MemoryBrowserComponent - 🔧 Action: Connect to
/ai-api/memoryendpoints (if they exist) - 🔧 Action: Browse flash-persistence data
10. AI Playground - /ai/playground
- Component:
AiPlaygroundComponent - 🔧 Action: Connect to real AI services
- 🔧 Action: Test agent capabilities interactively
11. Visual Memory Map - /ai/memory-map
- Component:
VisualMemoryMapComponent - 🔧 Action: Connect to vector memory data
- 🔧 Action: Visualize knowledge clusters
❌ Outdated/Broken (Remove or Major Refactor)
12. AI Tester - /ai/ai-tester
- Component:
AiTesterComponent - ❌ Problem: Tons of commented-out code, circular dependencies
- ❌ Problem: Trying to manage API keys (should be backend responsibility)
- ❌ Problem: Not using our standard patterns
- 🗑️ Action: REMOVE or completely rewrite as "AI Service Testing Tool"
- If keeping: Remove all key management UI
- If keeping: Only test AI responses through backend proxies
- If keeping: Make it a developer tool, not user-facing
13. AI Guide - /ai/guide
- Component:
AiGuideComponent - ⚠️ Review: Is this still useful or is it outdated documentation?
- 🔧 Action: Update or remove
14. AI Config - /ai/ai-config
- Component:
AiConfigComponent - ⚠️ Review: What configs do users need to set?
- 🔧 Action: Simplify or remove (most config should be backend)
15. AI Integration Examples - /ai/integration-examples
- Component:
AiIntegrationExamplesComponent - ⚠️ Review: Is this developer documentation?
- 🔧 Action: Move to docs or remove
🆕 Missing (Consider Adding)
Agent Training History -
/ai/training-history- Show training sessions, outcomes, improvements over time
Pattern Library -
/ai/patterns- Browse all learned patterns across all agents
Real-time Agent Monitor -
/ai/monitor- Live view of agent activity, tasks, performance
🛠️ Implementation Plan
Phase 1: Remove/Clean (Immediate)
- ✅ Fix takeUntilDestroyed errors in agent-knowledge
- 🔄 Remove or drastically simplify ai-tester
- Remove/consolidate duplicate agent dashboards
- Remove outdated demo/example components
Phase 2: Connect to Real APIs (High Priority)
- Update Platform Intelligence Dashboard
- Update Cursor Agents Dashboard
- Update Space Assistants Dashboard
- Connect Memory Browser
- Connect Agent Mesh
Phase 3: Polish & Enhance (Medium Priority)
- Add real-time WebSocket updates
- Add comprehensive error handling
- Add loading states everywhere
- Ensure consistent UI/UX
Phase 4: New Features (Low Priority)
- Add training history viewer
- Add pattern library browser
- Add real-time monitoring
📊 Backend API Endpoints Available
Platform AI (/ai-api/platform/agents)
GET /:agentId/knowledge- Full agent knowledgeGET /:agentId/patterns- Learned patternsGET /:agentId/decisions- Successful decisionsGET /:agentId/anti-patterns- Failed approachesGET /:agentId/specializations- Specialization areasPOST /:agentId/generate-docs- Generate documentationPOST /:agentId/import-from-docs- Import from docs
Module Intelligence (/ai-api/ai-agents/module-intelligence)
POST /harvest- Sync harvested intelligenceGET /modules- All modulesGET /modules/:moduleId- Single moduleGET /patterns/:category- Patterns by categoryPOST /find-similar- Find similar modulesPOST /outcomes/track- Track outcomeGET /outcomes/:outcomeId- Get outcomeGET /outcomes/stats- Outcome statisticsPOST /outcomes/report-to-mcp- Report to MCPPOST /patterns/extract- Extract patternsGET /patterns/stats- Pattern statisticsPOST /docs-data/sync- Sync docs/data
Agent Tasks (/ai-api/agents)
- Task management endpoints (mostly TODOs)
🎨 UI/UX Standards
- Loading States: All API calls must show loading indicators
- Error Handling: Graceful fallbacks, user-friendly error messages
- Empty States: "No data yet" messages with helpful actions
- Consistent Design: Use Material Design components
- Real-time Updates: Use signals for reactive UI
🔄 Data Flow
Frontend Components
↓
Angular Services (with signals)
↓
HttpClient → `/ai-api/*` (proxied to port 3001)
↓
backend-ai-api (NestJS)
↓
MongoDB (AI databases) + Flash-persistence sync
✅ Success Criteria
- ❌ No mock data anywhere
- ✅ All components connect to real APIs or flash-persistence
- ✅ No circular dependencies or commented-out code
- ✅ Consistent error handling
- ✅ Fast, responsive UI with loading states
- ✅ Clear, logical route organization
- ✅ Agent knowledge visible and useful
Created: 2025-01-16 Status: In Progress