Triage Agent with classification and routing
This example demonstrates how to build and implement a Triage Agent using EggAI. The Triage Agent is designed to handle incoming messages, classify them based on predefined criteria (e.g., urgency, type, or category), and route them to the appropriate agents or services for further processing. By ensuring efficient task delegation and resource utilization, the Triage Agent plays a critical role in optimizing workflows.
Key Features:
- Message Classification: Automatically classifies user messages into one of three target agents:
PolicyAgent
,TicketingAgent
, orTriageAgent
. - Dynamic Routing: Routes messages to the most suitable agents or services based on the classification outcome, enabling efficient and accurate task handling.
- Chain of Thought Reasoning: Utilizes the
dspy
library for structured decision-making, enhancing the reasoning process in message classification. - Comprehensive Testing Suite: Includes test datasets and pytest-based evaluation to validate the performance and accuracy of the classification model.
The code for this example is available here.
Prerequisites
Ensure you have the following dependencies installed:
- Python 3.10+
- Docker and Docker Compose
Ensure you have a valid OpenAI API key set in your environment:
Setup Instructions
Clone the EggAI repository:
Move into the examples/intent_classification
folder:
Create and activate a virtual environment:
Install the required dependencies:
Start Redpanda using Docker Compose:
Run the Tests
This will demonstrate the intent classifier working with a sample dataset.
Clean Up
Stop and clean up the Docker containers:
Next Steps
Ready to explore further? Check out:
- Advanced Examples: Discover more complex use cases in the examples folder.
- Contribution Guidelines: Get involved and help improve EggAI!
- GitHub Issues: Submit a bug or feature request.
- Documentation: Refer to the official docs for deeper insights.