Implement intelligent agent learning from Knowledge Graph execution history with per-task-type expertise tracking, recency bias, and learning curves. ## Phase 5.3 Implementation ### Learning Infrastructure (✅ Complete) - LearningProfileService with per-task-type expertise metrics - TaskTypeExpertise model tracking success_rate, confidence, learning curves - Recency bias weighting: recent 7 days weighted 3x higher (exponential decay) - Confidence scoring prevents overfitting: min(1.0, executions / 20) - Learning curves computed from daily execution windows ### Agent Scoring Service (✅ Complete) - Unified AgentScore combining SwarmCoordinator + learning profiles - Scoring formula: 0.3*base + 0.5*expertise + 0.2*confidence - Rank agents by combined score for intelligent assignment - Support for recency-biased scoring (recent_success_rate) - Methods: rank_agents, select_best, rank_agents_with_recency ### KG Integration (✅ Complete) - KGPersistence::get_executions_for_task_type() - query by agent + task type - KGPersistence::get_agent_executions() - all executions for agent - Coordinator::load_learning_profile_from_kg() - core KG→Learning integration - Coordinator::load_all_learning_profiles() - batch load for multiple agents - Convert PersistedExecution → ExecutionData for learning calculations ### Agent Assignment Integration (✅ Complete) - AgentCoordinator uses learning profiles for task assignment - extract_task_type() infers task type from title/description - assign_task() scores candidates using AgentScoringService - Fallback to load-based selection if no learning data available - Learning profiles stored in coordinator.learning_profiles RwLock ### Profile Adapter Enhancements (✅ Complete) - create_learning_profile() - initialize empty profiles - add_task_type_expertise() - set task-type expertise - update_profile_with_learning() - update swarm profiles from learning ## Files Modified ### vapora-knowledge-graph/src/persistence.rs (+30 lines) - get_executions_for_task_type(agent_id, task_type, limit) - get_agent_executions(agent_id, limit) ### vapora-agents/src/coordinator.rs (+100 lines) - load_learning_profile_from_kg() - core KG integration method - load_all_learning_profiles() - batch loading for agents - assign_task() already uses learning-based scoring via AgentScoringService ### Existing Complete Implementation - vapora-knowledge-graph/src/learning.rs - calculation functions - vapora-agents/src/learning_profile.rs - data structures and expertise - vapora-agents/src/scoring.rs - unified scoring service - vapora-agents/src/profile_adapter.rs - adapter methods ## Tests Passing - learning_profile: 7 tests ✅ - scoring: 5 tests ✅ - profile_adapter: 6 tests ✅ - coordinator: learning-specific tests ✅ ## Data Flow 1. Task arrives → AgentCoordinator::assign_task() 2. Extract task_type from description 3. Query KG for task-type executions (load_learning_profile_from_kg) 4. Calculate expertise with recency bias 5. Score candidates (SwarmCoordinator + learning) 6. Assign to top-scored agent 7. Execution result → KG → Update learning profiles ## Key Design Decisions ✅ Recency bias: 7-day half-life with 3x weight for recent performance ✅ Confidence scoring: min(1.0, total_executions / 20) prevents overfitting ✅ Hierarchical scoring: 30% base load, 50% expertise, 20% confidence ✅ KG query limit: 100 recent executions per task-type for performance ✅ Async loading: load_learning_profile_from_kg supports concurrent loads ## Next: Phase 5.4 - Cost Optimization Ready to implement budget enforcement and cost-aware provider selection.
171 lines
7.5 KiB
XML
171 lines
7.5 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 250" width="600" height="250">
|
|
<defs>
|
|
<!-- Gradiente principal -->
|
|
<linearGradient id="mainGradient" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
<stop offset="0%" style="stop-color:#22d3ee;stop-opacity:1" />
|
|
<stop offset="50%" style="stop-color:#a855f7;stop-opacity:1" />
|
|
<stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
|
|
</linearGradient>
|
|
|
|
<!-- Gradiente vertical para dispersión -->
|
|
<linearGradient id="dispersionGradient" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
<stop offset="0%" style="stop-color:#22d3ee;stop-opacity:1" />
|
|
<stop offset="100%" style="stop-color:#ec4899;stop-opacity:0" />
|
|
</linearGradient>
|
|
|
|
<!-- Filtro de desenfoque suave -->
|
|
<filter id="softGlow">
|
|
<feGaussianBlur stdDeviation="2" result="coloredBlur"/>
|
|
<feMerge>
|
|
<feMergeNode in="coloredBlur"/>
|
|
<feMergeNode in="SourceGraphic"/>
|
|
</feMerge>
|
|
</filter>
|
|
|
|
<!-- Filtro glass más pronunciado -->
|
|
<filter id="glassEffect">
|
|
<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
|
|
<feOffset in="blur" dx="0" dy="2" result="offsetBlur"/>
|
|
<feFlood flood-color="#ffffff" flood-opacity="0.1" result="flood"/>
|
|
<feComposite in="flood" in2="offsetBlur" operator="in" result="comp"/>
|
|
<feMerge>
|
|
<feMergeNode in="comp"/>
|
|
<feMergeNode in="SourceGraphic"/>
|
|
</feMerge>
|
|
</filter>
|
|
</defs>
|
|
|
|
<!-- Fondo negro -->
|
|
<rect width="600" height="250" fill="#000000"/>
|
|
|
|
<!-- Icono: V estilizada con dispersión de partículas -->
|
|
<g transform="translate(80, 80)">
|
|
<!-- Base sólida de la V -->
|
|
<path d="M 0 0 L 30 60 L 60 0"
|
|
stroke="url(#mainGradient)"
|
|
stroke-width="6"
|
|
fill="none"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
filter="url(#softGlow)"/>
|
|
|
|
<!-- Partículas dispersándose desde la punta superior izquierda -->
|
|
<g opacity="0.8">
|
|
<circle cx="5" cy="5" r="3" fill="#22d3ee">
|
|
<animate attributeName="cx" values="5;0;-5" dur="2s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="5;-5;-15" dur="2s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="3;2;1" dur="2s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="2s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="8" cy="3" r="2.5" fill="#a855f7">
|
|
<animate attributeName="cx" values="8;5;2" dur="2.5s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="3;-8;-20" dur="2.5s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2.5;1.5;0.5" dur="2.5s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="2.5s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="10" cy="8" r="2" fill="#ec4899">
|
|
<animate attributeName="cx" values="10;12;15" dur="3s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="8;-3;-18" dur="3s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2;1;0.5" dur="3s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="3s" repeatCount="indefinite"/>
|
|
</circle>
|
|
</g>
|
|
|
|
<!-- Partículas desde la punta superior derecha -->
|
|
<g opacity="0.8">
|
|
<circle cx="55" cy="5" r="3" fill="#ec4899">
|
|
<animate attributeName="cx" values="55;60;65" dur="2.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="5;-5;-15" dur="2.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="3;2;1" dur="2.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="2.2s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="52" cy="3" r="2.5" fill="#a855f7">
|
|
<animate attributeName="cx" values="52;55;58" dur="2.7s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="3;-8;-20" dur="2.7s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2.5;1.5;0.5" dur="2.7s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="2.7s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="50" cy="8" r="2" fill="#22d3ee">
|
|
<animate attributeName="cx" values="50;48;45" dur="3.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="cy" values="8;-3;-18" dur="3.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2;1;0.5" dur="3.2s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="1;0.5;0" dur="3.2s" repeatCount="indefinite"/>
|
|
</circle>
|
|
</g>
|
|
|
|
<!-- Estela de vapor desde el centro -->
|
|
<g opacity="0.5">
|
|
<circle cx="30" cy="30" r="2.5" fill="#a855f7">
|
|
<animate attributeName="cy" values="30;10;-10" dur="2.8s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2.5;1.8;0.8" dur="2.8s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.8;0.4;0" dur="2.8s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="28" cy="35" r="2" fill="#22d3ee">
|
|
<animate attributeName="cy" values="35;15;-8" dur="3.3s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2;1.5;0.5" dur="3.3s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.7;0.3;0" dur="3.3s" repeatCount="indefinite"/>
|
|
</circle>
|
|
|
|
<circle cx="32" cy="35" r="2" fill="#ec4899">
|
|
<animate attributeName="cy" values="35;15;-8" dur="3.1s" repeatCount="indefinite"/>
|
|
<animate attributeName="r" values="2;1.5;0.5" dur="3.1s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.7;0.3;0" dur="3.1s" repeatCount="indefinite"/>
|
|
</circle>
|
|
</g>
|
|
</g>
|
|
|
|
<!-- Texto VAPORA -->
|
|
<g filter="url(#glassEffect)">
|
|
<text x="220" y="125"
|
|
font-family="'JetBrains Mono', 'Fira Code', monospace"
|
|
font-size="64"
|
|
font-weight="800"
|
|
fill="url(#mainGradient)"
|
|
letter-spacing="4">
|
|
VAPORA
|
|
</text>
|
|
</g>
|
|
|
|
<!-- Línea decorativa debajo del texto -->
|
|
<line x1="220" y1="140" x2="540" y2="140"
|
|
stroke="url(#mainGradient)"
|
|
stroke-width="2"
|
|
opacity="0.4">
|
|
<animate attributeName="x2" values="540;560;540" dur="3s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.4;0.7;0.4" dur="3s" repeatCount="indefinite"/>
|
|
</line>
|
|
|
|
<!-- Tagline -->
|
|
<text x="220" y="165"
|
|
font-family="'Inter', sans-serif"
|
|
font-size="13"
|
|
fill="#a855f7"
|
|
opacity="0.8"
|
|
letter-spacing="2">
|
|
EVAPORATE COMPLEXITY. BUILD IN THE CLOUD.
|
|
</text>
|
|
|
|
<!-- Puntos decorativos que pulsan -->
|
|
<g opacity="0.6">
|
|
<circle cx="200" cy="125" r="3" fill="#22d3ee">
|
|
<animate attributeName="r" values="3;4;3" dur="2s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.6;1;0.6" dur="2s" repeatCount="indefinite"/>
|
|
</circle>
|
|
<circle cx="560" cy="125" r="3" fill="#ec4899">
|
|
<animate attributeName="r" values="3;4;3" dur="2s" begin="1s" repeatCount="indefinite"/>
|
|
<animate attributeName="opacity" values="0.6;1;0.6" dur="2s" begin="1s" repeatCount="indefinite"/>
|
|
</circle>
|
|
</g>
|
|
|
|
<!-- Reflejos glassmorphism adicionales -->
|
|
<g opacity="0.2">
|
|
<rect x="220" y="95" width="340" height="8" fill="url(#mainGradient)" rx="4"/>
|
|
<rect x="220" y="145" width="280" height="4" fill="url(#mainGradient)" rx="2"/>
|
|
</g>
|
|
</svg>
|