-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi agents with manager #32687
Multi agents with manager #32687
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@aymeric-roucher did you consider wrapping managed agents as tools, the way you did with Gaia? Would passing a separate list of managed agents be beneficial in some way? |
@plaggy passing the list of agents as tools works as done on GAIA, but it leads to confusion between managed agents and tools, which leads to errors. This is why passing managed agents as a different argument than tools is mandatory IMO. |
error_msg = f"Error: unknown tool {tool_name}, should be instead one of {list(self.toolbox.tools.keys())}." | ||
available_tools = self.toolbox.tools | ||
if self.managed_agents is not None: | ||
available_tools = {**available_tools, **self.managed_agents} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this part can be moved to self.toolbox() since it's a dedicated function for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to leave managed agents as a separate thing from Tools, since they're supposed to be handled differently here.
@@ -337,6 +352,7 @@ def __init__( | |||
verbose: int = 0, | |||
memory_verbose: bool = False, | |||
grammar: Dict[str, str] = None, | |||
managed_agents: List = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be a list of ManagedAgent objects? It'd help to have some hints on how/where ManagedAgent is designed to be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's supposed to be! Since ManagedAgent is not defined yet, I have a chicken-and-egg definition problem, that's why I did not put a type hint. But if you have an idea on how to do this hint i'll include it!
@aymeric-roucher is the idea to provide agents-as-tools a verbose description of the task in a prompt so they'd perform better? |
@aymeric-roucher let me know when you'd like me to review this PR! |
e0bc2fe
to
8ed5ebd
Compare
@LysandreJik this is ready for review! 🤗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Yes, no problem for me to either split the module in several or to have a specific folder to host different modules/objects
* Add Multi agents with a hierarchical system
* Add Multi agents with a hierarchical system
* Add Multi agents with a hierarchical system
What does this PR do?
Add native support for multi-agents in a tree-like hierarchic structure, by allowing an agent to manage other agents and call them as if they were tools.
cc @LysandreJik and @plaggy