Skip to content

Multi Agent Routing

VINH BUI edited this page Nov 1, 2026 · 1 revision

Multi-Agent Routing

Run as many agents as you like on one daemon. There is no seat cap: each agent that asks for work gets the work that fits it, another agent reviews it, and the reviewer merges what it approves. The rules are deterministic, with no model involved.

Set it up

av init --for claude --for codex --for grok --for gemini --for cursor

# What each agent is good at, and what it costs (1 is the cheapest)
av agent set claude --best code,tests --can docs --cost 4
av agent set grok   --best docs,review --can code,tests --cost 2
av agent set cursor --best code --can tests,ui,docs --cost 3 --max-open 2

# Post work to the shared backlog
av post --repo myrepo --title "Redraw the logo"  --goal "..." --needs image
av post --repo myrepo --title "Use the new logo" --goal "..." --after redraw-the-logo
av backlog

# Start each agent only when something fits it
av --agent claude watch -- claude
av --agent grok watch --every 30 -- grok -p "take your next av job"

Each agent CLI runs the work on its own subscription. Scholion holds no keys for the agents' models, and the daemon never launches processes; av watch does, on your machine.

Who gets what

  • An agent can take an item when every tag it --needs is in the agent's best or can.
  • The best-fitting agent (the item's --prefer, then most best tags, then cheapest) has it to itself for --reserve seconds (default 600). After that, any agent that can do it may take it, so work moves on when an agent runs out of quota.
  • Untagged work goes to the cheapest agent.
  • An item posted with --after ITEM[,ITEM] is not offered until every listed item has merged; av backlog shows it as waiting on ….

av next: the order of work

av next (or the MCP tool start_task with no title or goal) closes the loop. It offers, in order:

  1. Reviews of other agents' submitted work. An agent never reviews its own task, and reviews work it could have done (unless only the owner could, in which case anyone else may). A review offered to one agent is reserved for it for 10 minutes. An approved task is offered as "merge it".
  2. Its own conflicted tasks: an approved task whose merge conflicted comes back to its owner with instructions (sync onto main, resolve, re-check, resubmit). If the owner does not act within the lease, any fitting agent may claim it.
  3. Handoffs (an untagged handoff keeps its item's tags).
  4. Abandoned tasks whose owner went quiet for a whole lease (the owner may resume its own).
  5. Backlog items.

Options:

  • --wait N (MCP wait, at most 50 s) holds the call until something fits.
  • --take review,merge,work keeps only those kinds of job, so a review-only agent is never given backlog work and a worker is never reserved others' reviews.
  • A dry run says what it would give without taking it. That is what av watch polls.

Teams and limits

Each agent CLI is treated as an engineering team: Scholion gives it work, has another team review it and keeps the shared memory, while the CLI splits the work among its own subagents. Those subagents carry the team's name, so a team never reviews its own work. Post items the size of a team's job (a goal with a definition of done), not single steps.

--max-open N caps how many open tasks a team holds at once (tasks in review do not count). At the cap, next gives it only reviews, merges and its own abandoned tasks, so one team running many subagents cannot take the whole backlog.

Handing off to a skill

av handoff --done "..." --remaining "..." --needs image

Only an agent with the image tag is offered the rest.

Dashboard

http://localhost:7420/ui shows tasks by status, a Teams panel (skills, cost, open tasks against the limit), the backlog and who each item is reserved for, a live activity feed, and each task's records, changed files, claim and review state. "Build context pack" shows exactly what the next agent would receive.

Try it

  • examples/routing-smoke/setup.sh sets up a sample project with profiles and a tagged backlog for real agents.
  • examples/routing-smoke/deepseek-demo.sh runs two Claude Code agents on DeepSeek Flash through the whole loop on its own daemon, for about $0.03. It shows the loop working, not token savings.

Clone this wiki locally