Agent Routing
Input
Help me write a React component for user authentication
Pattern
write|React|authentication
Target Agent
Code Agent92%
Agent RoutingRouting...
Input
What is the weather like today?
Target Agent
Determining...
Overview
A compound component for visualizing how messages are routed to specific agents in multi-agent systems. Shows the input message with pattern matching highlights, the matched routing rule, and the target agent with confidence scores. Supports animated states during active routing decisions.
Installation
bunx shadcn@latest add @elements/routing-indicatorUsage
import {
RoutingIndicator,
RoutingIndicatorHeader,
RoutingIndicatorContent,
RoutingMatch,
} from "@/components/elements/ai-elements/multi-agent/routing-indicator";
export function RoutingIndicatorExample() {
return (
<RoutingIndicator
input="Can you help me search for information about React hooks?"
matchedPattern="search"
targetAgent="Research Agent"
confidence={0.92}
isRouting={false}
/>
);
}
export function ActiveRoutingExample() {
return (
<RoutingIndicator
input="Help me write a Python function"
isRouting={true}
/>
);
}Props
RoutingIndicator
| Prop | Type | Default | Description |
|---|---|---|---|
input | string | - | The input message being routed |
matchedPattern | string | - | The pattern that matched |
targetAgent | string | - | The agent that will handle the request |
confidence | number | - | Confidence score (0-1) |
isRouting | boolean | false | Show animated routing state |
Sub-components
RoutingIndicatorHeader- Header with routing statusRoutingIndicatorContent- Container for routing visualizationRoutingInput- Input display with pattern highlightingRoutingFlow- Visual flow from pattern to agentRoutingIndicatorEmpty- Empty state componentRoutingMatch- Compact pattern-to-text match display
Features
- Real-time routing animation with shimmer effect
- Pattern matching highlights in input text
- Visual flow from matched pattern to target agent
- Confidence score badges
- Animated "determining" state during routing
- Pattern badges showing routing rules
- Indigo-themed active routing state
- Support for regex pattern matching