sprix-sage-router: Sprix SAGE Router: Why the Best Agent Is Often the Wrong Choice

A state-aware routing layer for A2A networks that weighs progress, permissions, trust, and handoff friction before it commits a task to SELF, COLLABORATE, or HANDOFF.

8 min read • View on GitHub • More from wang2122

A wide editorial scene of a decision desk with three paths branching away from a single routed task. One path keeps the work on the current agent, one splits into a small collaborative team, and one passes a folder across a threshold to a specialist. The image explains that routing is a stateful choice between continuing, recruiting, and handing off.
SAGE does not pick a winner. It decides whether the task should stay put, recruit help, or move elsewhere.

Sprix SAGE Router is an open-source algorithmic research output of that initiative. Company attribution describes the project's origin; this public repository remains a research preview and does not expose proprietary production systems or data.

wang2122, Author/Maintainer · GitHub - wang2122/sprix-sage-router
Key Takeaways

When the best agent is the wrong answer

Most agent routers ask a simple question: who is best? SAGE asks a harder one: what state is the task in right now? That matters when work is already underway, context is expensive to rebuild, and an otherwise strong agent cannot legally or practically take over.

A hedcut-style portrait of wang2122 derived from the verified GitHub avatar. It serves as a reference face for the project's author and anchors the article in a real maintainer rather than an invented persona.

The three-way decision: SELF, COLLABORATE, HANDOFF

SAGE's core output is not a single agent ID. It is a mode. SELF means keep going alone. COLLABORATE means recruit complementary help. HANDOFF means transfer ownership to a better fit. That triage is the whole point, because binary route or do-not-route systems miss the middle ground where many real tasks live.

A task does not move through SAGE as a yes or no question. It moves through a mode decision.

from enum import Enum

class Mode(Enum):
    SELF = "self"
    COLLABORATE = "collaborate"
    HANDOFF = "handoff"

Why progress matters more than prestige

This is the sharpest idea in the project. SAGE tracks execution state, including transferable_context, so a task that is 80 percent complete can stay with the current agent even if a specialist looks better on paper. The router prices context loss, not just future capability.

A close-up workbench scene showing a nearly completed task attached to a dense bundle of context, notes, gears, and thread. Across a narrow bridge, a specialist waits behind a gate. The composition explains why a superior expert can still be the wrong choice if the task is already too expensive to transfer.
Progress changes the math. The more context a task carries, the more expensive a handoff becomes.

That is why SAGE feels less like a scheduler and more like a sober project manager. It does not merely ask who can do the next step. It asks who can do it with the least waste, the least loss of context, and the least risk of breaking what already works.

How SAGE prices trust, coverage, and friction

Under the hood, the router combines contextual trust, team coverage, and a utility function that weighs value against success probability, handoff loss, and coordination overhead. The result is practical Bayesian bookkeeping, not mystical autonomy. A candidate agent is useful only if its permissions pass, its trust is credible for the requirement at hand, and the team configuration does not introduce more friction than value.

Utility = expected value × success probability - handoff loss - coordination overhead

If permissions fail, the candidate is removed before utility is computed.

SAGE Router is a research-preview Python framework that decides at runtime whether an agent should continue alone, recruit collaborators, or hand off a task above the A2A protocol. It ranks SELF, COLLABORATE, and HANDOFF routes in one utility function, with learned per-requirement trust, budget and deadline constraints, and task-DAG scheduling.

Trendshift, Project Summary/Aggregator · wang2122/sprix-sage-router — GitHub trending stats & insights

Security before optimization

This is a strong product choice. SAGE filters unauthorized agents before it even starts comparing utility, which means access control is not an afterthought. In an enterprise or cross-org A2A setting, that is the difference between an interesting ranking engine and a system people can actually trust.

ApproachDecision styleHandles partial progress?Permission-aware?Learns from outcomes?Best for
SAGE RouterState-aware triage across SELF, COLLABORATE, HANDOFFYesYesYesA2A routing where tasks are already in motion
Static agent rankingPick the highest scored agentNoSometimesUsually noSimple selection problems
Generic workflow orchestratorFollow predefined graph stepsLimitedDepends on the stackSometimesStructured pipelines with known paths
Binary routerRoute or keep localWeakVariesRarelySmall decision trees with few constraints

How it learns without a database

The learning loop is deliberately light. SAGE updates Beta-style beliefs from task outcomes, so trust shifts with evidence instead of waiting for a separate analytics layer. That gives it adaptivity without the operational weight of a full model registry or history service.

In practice, that means the router can warm up from use. It is not trying to know everything in advance. It is trying to become less wrong, one completed task at a time.

Where it fits in the agent stack

SAGE is not a full agent framework. It sits above execution and below discovery, which is exactly where routing intelligence belongs. If A2A or MCP tells you which agents exist, SAGE helps decide who should continue, who should join, and who should take over.

LayerWhat it solvesSAGE's role
DiscoveryWhich agents are availableConsumes available candidates
RoutingWho should do the work nowOwns the decision
ExecutionHow the task gets carried outDoes not replace it
FrameworkFull agent lifecycleCan host SAGE, but SAGE is smaller and narrower

What this project is really testing

The real experiment here is whether delegation in agent systems can be explicit, auditable, and state-aware instead of hidden inside heuristics. That is a worthwhile bet. The codebase is compact, dependency-free, and clearly meant to test an idea before it becomes an ecosystem.

SAGE's best claim is not that it always finds the optimal agent. It is that it knows when the optimal agent is the wrong answer.