810 B
810 B
Phase 8: Adaptive Router
Purpose: Route execution paths based on accumulated state and historical performance.
TS Module: src/tier2-primitives/workflows/adaptive-router.ts
What It Does
At workflow branch points, chooses the path most likely to succeed. Uses epsilon-greedy: 90% exploit best path, 10% explore alternatives.
Path Selection
- Check historical path records (quality × success rate × frequency)
- If no history: use accumulator state for first-guess routing
- Record outcome after each branch execution
- Update path scores: weighted average of quality + success + frequency bonus
Key Rules
- Exploration (epsilon) prevents overfitting to early successes
- Path history resets on session boundary
- For new tasks, routes based on semantic similarity to past paths