0 Router Based Agents

PreviousNext

Learn how routers orchestrate sub-agents to deliver fast, structured, and visual answers.

Router Based Agents

A router system lets your AI handle complex user queries by splitting work across multiple sub-agents.

Instead of a single, overloaded model doing everything, the router decides who should do what — like a manager assigning tasks to specialists.

Think of it as a brain with a team:
the brain understands intent, then delegates to the right experts.


Why Routers Matter

Routers make AI systems feel instant, structured, and reliable — even when queries are messy or multi-part.

For example:

"Show me sales this month and our best-selling products."

Here's what happens behind the scenes:

  1. Router detects intents → "sales" and "analytics"
  2. Two sub-agents spin up: one for Orders, one for Analytics
  3. Both work in parallel
  4. Results stream in as a sales table and a top-products chart

The user just sees an instant, visual answer.
But under the hood, multiple agents cooperated in perfect sync.


How It's Structured

A router-based system typically has four layers:

  1. 🧭 Router Layer – understands intent and assigns work
  2. 🤖 Sub-Agent Layer – each agent handles one domain (Orders, Inventory, etc.)
  3. 🧠 Data & Cache Layer – validates, caches, and returns clean data
  4. Streaming Output – combines text and visuals for real-time answers

Design Principles

This architecture is simple but powerful because:

  • Each agent has a small, static toolset (3–7 tools) → predictable behavior
  • The router is a light LLM call → fast, cheap, low latency
  • Agents can run in parallel or sequence → handles multi-intent queries smoothly
  • Everything streams live → text + charts + KPIs appear instantly

The result is a system that feels conversational, but is actually deeply structured and deterministic inside.


Example: Ecommerce Assistant

Let's say you're building an AI for an ecommerce platform.

When a user asks:

"What's our average order value this month, and how's our stock for top sellers?"

Your router detects two domains:

  • Orders → for sales metrics
  • Inventory → for stock levels

Two sub-agents run side-by-side.
They pull data, compute KPIs, and stream the answer as a summary + charts — all within seconds.

That's the power of a router system.


Getting Started

Ready to build your own router system? Start with these guides:


Next Steps