Router
The Router is a central component of the AgentOpera framework that intelligently routes user messages to the most appropriate agent based on intent classification. This document explains how the Router system works and how to extend it with custom intents and domain-specific agents.
Core Concepts
Intent Classification
The Router system uses an LLM-based intent classifier to determine the user's intent from their messages. Each intent is associated with a specific agent that is specialized to handle tasks related to that intent.
Agent Registry
The Agent Registry maintains a catalog of available agents and their capabilities. It serves as a lookup service that maps intents to appropriate agents and provides descriptions of agent capabilities.
Semantic Router Agent
The Semantic Router Agent orchestrates the routing process. It receives user messages, determines the appropriate agent through intent classification, and forwards the messages to the selected agent.
Router Architecture
The Router architecture in AgentOpera consists of three key components:
Intent Classifier: Analyzes user messages to identify their intent.
Agent Registry: Maintains a catalog of available agents and their capabilities.
Semantic Router Agent: Routes messages to the appropriate agent based on the classified intent.
Implementation Details
Intent Registry
The Intent Registry manages the mapping between intents and agents:
LLM Intent Classifier
The LLM Intent Classifier uses a language model to determine the user's intent:
Semantic Router Agent
The Semantic Router Agent handles routing logic:
Quick Start Guide for Adding a New Business Agent
To add a new domain-specific agent to the Router system:
Define your intent: Create a clear description of what your agent handles
Create your agent implementation: Implement a
RoutedAgentsubclassUpdate the intent registry: Add your intent and agent mapping
Register your agent with the runtime: Make it available for routing
Test your agent: Send a message that should trigger your agent's intent
Last updated