crewAI
crewAI copied to clipboard
Process.Hierachical - Can it do routing?
I have the following use case with multiple agents each one are specialized in doing a set of functions.
If question a belongs to a particular set of functions or tasks in A group answer using Agent A. Workflow is complete. Do not call any other agents. If question belongs to to set of functions or tasks in B group answer using Agent B. workflow is complete. do not call any other agents.
How to do this. I tried Process.Hierachical using 2 agents. It seems to call both and got into a loop.
Try running the crew 3-5 times to see if you can replicate the issue
Also try adding agent backstory by defining what the agent is responsible for, and most importantly, what the agent is not responsible for
Hi Slavakurilyak, Tried this few times again after describing what the agent is responsible for and what is it is not responsible for explicitly. Also the allow_delegation = False still the manager seems to delegate to an other agent who is not responsible for answering that question. The Thought says I need more information to answer this question. So delegating to coworker Agent X to answer this question even though allow_delegation = False. That seems to beat my expectation for the flag itself as we want a particular type of question is to be processed by a stand alone agent. I am trying a simple routing use case. If Question A Agent A, if Question B Agent B, If question C Agent C and so on. I want to use Process.hierarchical with no delegation mode so one agent answers it and the use case is recognized as complete. Any way you could think of implementing this. Thanks
actually, the tool 'delegate_work' only use role of agent, so add goal and backstory seems no help.
StructuredTool.from_function(
func=self.delegate_work,
name="Delegate work to co-worker",
description=self.i18n.tools("delegate_work").format(
coworkers=f"[{', '.join([f'{agent.role}' for agent in self.agents])}]"
),
),
I think the description template of delegate_work tool should add agent's backstory add goal in it.
Any more ideas or updates on this?
zhangxiaojiawow You mean Agent description should add agent backstory and goal. I am not able to understand what you meant here. Thanks
zhangxiaojiawow You mean Agent description should add agent backstory and goal. I am not able to understand what you meant here. Thankszhangxiaojiawow 你的意思是特工描述应该加上特工的背景故事和目标。我无法理解你在这里的意思。谢谢
I think the description for "Delegate work to co-worker" tool should use not only agent role but also the agent backstory, so that the LLM can assign task more accurately.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.