skillfed
REPO

wang2122/sprix-sage-router

The hardest routing question in multi-agent systems isn't discovery—it's what happens after execution has already started. SAGE (State-Aware Graph Exchange) is a decision layer that answers exactly that: given a task already in flight, should the incumbent agent finish alone, pull in collaborators, or hand the whole thing off to a specialist? Those three modes—SELF, COLLABORATE, HANDOFF—compete inside a single utility function rather than being handled by disconnected heuristics, which is the actual architectural bet this project is making.

The utility function is explicit and inspectable. It penalizes context-transfer loss when handing off, coordination overhead when collaborating, and uncertainty; it rewards predicted success probability weighted by task value. Team construction uses beam search over candidate prefixes rather than greedy selection, and coverage is computed as the probability that at least one team member handles each requirement—complementarity over redundancy. A planner and a coder with non-overlapping strengths beat two strong generalists who duplicate each other.

Trust is per-agent and per-requirement, not a single reputation score. Success in one capability domain doesn't bleed into another. Bid fidelity—whether an agent's quoted cost and latency matched what actually happened—is tracked separately and fed back into future routing decisions. This is a meaningful design choice: an agent that consistently underbids on latency should lose credibility on that dimension specifically.

The benchmark runs 2,500 tasks across five seeds in a simulator where hidden capability, pair effects, and realized costs deliberately diverge from SAGE's internal model. Online SAGE achieves a quality score of 0.634 versus 0.507 for an incumbent-only baseline, but spends considerably more—cost-to-budget ratio of 0.434 versus 0.239. The README doesn't hide this trade-off, and it explicitly flags that synthetic benchmark numbers are not evidence of real-world superiority. A proper evaluation would need real execution traces, adversarial conditions, and calibrated baselines. That honesty is worth noting.

The implementation has no runtime dependencies beyond Python 3.10, which makes it easy to drop into an existing project for experimentation. The roadmap is candid about what's missing: real A2A adapters for discovery and execution, learned task-text embeddings, and offline replay on actual marketplace traces are all unfinished. Signed Agent Card ingestion isn't done yet either.

What's here is a coherent algorithmic skeleton—DAG-aware role assignment, online trust updates, beam search team construction, and an auditable decision object that includes assignments, topology, rationale, and constraint status. Whether the utility function's penalty weights generalize beyond the synthetic simulator is an open question the authors acknowledge. For anyone building agent orchestration infrastructure and thinking carefully about mid-task replanning, this is a well-documented starting point for that design space.

A zero-dependency Python skeleton for mid-execution agent routing that competes SELF, COLLABORATE, and HANDOFF in one utility function—honest about what the synthetic benchmark can and cannot prove.

Sources & links