An incoming email may ask for certain actions to be taken. There are 2 things that need to be done:
- Determine if email is asking to do a particular thing
- Do that particular thing
It is possible that the email may ask for more than one thing but I am not too concerned at this stage for that corner case. The things that can be done are already known (there are about 4). So, crew needs to figure out which thing is being requested out of the 4 (if any) and then go ahead and do it. What kind of crew would I need to assemble to satisfy this use-case?
My knee-jerk is to assemble the crew hierarchically where I have an agent for determining if the ask is of a certain kind and then have another agent for that particular task. Given 4 different types of ask, I would have 8 agents.
Another option would be to have a manager agent determine the type of ask and call any of the 4 action agents to satisfy the request for a grand total of 5 agents.
I can also create a crew for ea. action since it may involve multiple steps.
Any thoughts?
Another option would be feeding the result of a message-type determination agent to a Router
.
Have you considered doing this with just two agents, since they only process one task each?
- Classifier Agent (Agent 1)
This agent would be responsible for receiving the request and determining which of the 4 actions is required. It would act as a “filter” that interprets the email’s content and decides which action is correct, or if no action is needed.
- Function: Classify the request based on the information received. It would use a language classification model to analyze the email and map it to one of the 4 actions or determine that the request does not fit any of the options.
- Operation: After classification, the agent passes the task directly to the second agent.
- Executor Agent (Agent 2)
This agent would be tasked with executing any of the 4 actions identified by the first agent. Once the request is classified by Agent 1, Agent 2 would know which action needs to be performed and would execute it directly.
- Function: Execute any of the 4 known tasks.
- Operation: This agent would be programmed to handle any of the possible actions, depending on the request classified by the first agent.
How the Process Would Work:
- Request Receipt: An email is received containing a request that may involve one of the 4 actions.
- Classification: Agent 1 analyzes the email and determines which action is required (or if no action is required). It makes this decision using natural language processing (NLP) techniques to interpret the message.
- Execution: Once the decision is made, Agent 1 passes the task to Agent 2, which performs the corresponding action. Agent 2 is already pre-programmed to handle the four different actions, so it simply selects and executes the correct action.
Advantages of this Model:
- Simplicity: You reduce the number of agents to the minimum. With just two agents, the system is easier to monitor and manage.
- Scalability: If new types of actions are added in the future, Agent 1 would only need an update in the classification logic, while Agent 2 would need to be updated to handle new actions.
- Fewer Unnecessary Interactions: By eliminating hierarchy and multiple levels of agents, you avoid redundancies and allow the system to operate more directly.
Disadvantages:
- Dependence on a Single Executor Agent: Agent 2 would need to be flexible enough to handle all 4 actions, which could create complexity if the tasks are very different from each other.
- Load on the Classifier Agent: If the classification is not done correctly, the Executor Agent might end up performing the wrong action.
Application:
This two-agent model would be ideal for systems where the actions are well-defined and relatively simple. If the four actions are distinct but not overly complex to execute, this model could work very well.
You would just need to ensure that the Classifier Agent (Agent 1) has a good model for identifying the correct action and that the Executor Agent (Agent 2) is capable of handling multiple actions effectively.
2 Likes