Skip to main content
BitsWeave
Concepts

Routing

Routing rules decide which agent handles each incoming broker event — deterministic rules first, an LLM fallback second.

When a broker receives an event (a PR opens, an alert fires), routing decides which agent picks it up.

broker event ──► routing rules ──► agent inbox ──► agent runs
 (unrouted)       match            (matched)         (claims & acts)

                    └─ no rule matched ──► LLM fallback names an agent

What a rule matches on

FilterFieldExample
Source brokerdefinitionIdgithub (omit = any source)
Event typeeventTypeissue.opened (omit = any event)
Payload predicatepredicateExpression$.repository.name == "api"
  • The predicate is an and/or/not tree of { path, cmp, value } leaves over the event payload. Operators: ==, !=, contains, matches, in. Paths are JSONPath ($.a.b, $.items[0]).
  • A rule targets one agent (or a workflow, with inputs mapped from the event).

How an event flows

  1. New broker messages sit unrouted.
  2. Each active rule is checked against each message; a match drops it into the target agent's inbox (routed_by: rule).
  3. One event can match multiple rules → it lands in multiple agents' inboxes (deduped per agent).
  4. If no rule matches, an LLM fallback names an agent (routed_by: llm).
  5. The agent's runner claims the inbox item and acts on it.

Priority is display-only

priority just orders rules in your list — it does not decide matching. Every active rule is evaluated against every message.

Manage rules

Any org member with write access manages routing — no platform-admin needed. Ask your connected agent, or call the tools:

You want to…Tool
List rulesrouting_rules_list
Create / update / deleterouting_rules_create · routing_rules_update · routing_rules_delete
Turn a rule on / offrouting_rules_activate · routing_rules_deactivate
Fix a mis-routerouting_corrections_create

Route GitHub issues labelled "bug" in repo api to @triage-agent.

A correction reassigns one specific message to the right agent (routed_by: correction) — use it when a rule (or the LLM) sent something to the wrong place. It's a one-off fix, not a rule.

Agents can author rules too — but only disposable ones (they must set an expiry), and an agent can only edit rules it created.

On this page