Skip to content

Adaptive Routing

Tool: routing-adapt Model: Advanced Requires: ENABLE_ADAPTIVE_ROUTING=true

Triggered by: Workflow efficiency degrading, or a request to “self-optimize routing” and prune unused agent paths.

Intent: Mutates and reinforces good pathways dynamically without hardcoded modifications. Uses biological metaphors (ACO, Hebbian, Physarum, Quorum, Annealing).

Capability profile: adaptive_routing — requires structured_output, prefers cost_sensitive, fast_draft fallback. Gated by ENABLE_ADAPTIVE_ROUTING=true.

SkillRole
adapt-aco-routerAnt Colony Optimization — pheromone-trail routing reinforcement
adapt-annealingSimulated Annealing — global optimum routing discovery
resil-clone-mutateClone-and-mutate strategy evolution
adapt-hebbian-routerHebbian learning — “neurons that fire together wire together”
adapt-physarum-routerPhysarum slime-mold network optimization
adapt-quorumQuorum sensing for distributed consensus
resil-replayReplay consolidation of learned paths
{
executionLogs: unknown[];
targetMetric: string;
}

If the simulated annealing optimizer finds a structurally better layout, auto-updates the routing config and tests it against benchmarks. If tests fail, throws back to the previous routing table.

Terminal node — does not chain to other workflows on completion.

stateDiagram-v2
    [*] --> RouteSignals
    RouteSignals --> LocalFitnessInteraction
    LocalFitnessInteraction --> RoutingPatternFormation
    RoutingPatternFormation --> CoherenceCheck

    CoherenceCheck --> WeakRouting: unstable agent alignment
    CoherenceCheck --> StrongRouting: robust pheromone convergence

    WeakRouting --> EvolutionaryPerturbation
    EvolutionaryPerturbation --> LocalFitnessInteraction

    StrongRouting --> OptimalWorkflowBehavior
    OptimalWorkflowBehavior --> ConstraintFeedbackOnAgents
    ConstraintFeedbackOnAgents --> LocalFitnessInteraction

    OptimalWorkflowBehavior --> [*]
sequenceDiagram
    participant Orchestrator
    participant Pool (Analytical)
    participant Pool (Mechanical)
    participant Tool (Context)

    Orchestrator->>Pool (Analytical): Allocate Capability Profile
    activate Pool (Analytical)
    Pool (Analytical)->>Tool (Context): Issue Tool Calls (Parallel)
    Tool (Context)-->>Pool (Analytical): Return Data

    alt Shallow Loop
        Pool (Analytical)->>Pool (Analytical): Auto-correct Schema
    else Medium Loop
        Pool (Analytical)->>Pool (Mechanical): Delegate Fixes
    end

    Pool (Analytical)-->>Orchestrator: Synthesis Gate
    deactivate Pool (Analytical)

    opt Deep Loop
        Orchestrator->>Orchestrator: Complete Throw-back to Prior Stage
    end