How to Parallelize Agents in a GroupChat Workflow #4215
-
I'm working on a project where I use the autogen library to coordinate multiple agents in a GroupChat workflow. The workflow currently involves:
grp_chat = autogen.GroupChat(
agents=[self._data_fetcher_agent,
self._solution_generator_agent,
self._solution_evaluator_agent],
messages=[],
max_round=self.config.get("workflow.max_turns", 2),
speaker_selection_method=custom_speaker_selection_func
)
for task in tasks_list:
conversation_result = self._data_fetcher_agent.initiate_chat(
self._groupchat_manager,
message=self.message_generator,
problem=task,
n_results=5,
)
solutions.append(self.get_generated_solution(conversation_result.chat_history, "solution_generator")) Currently, the agents process each task sequentially, but this approach becomes time-consuming as the number of tasks increases. I want to parallelize the execution so that agents can work on multiple tasks simultaneously. Does the autogen.GroupChatManager support parallel execution natively? If not, are there any recommended patterns or libraries for implementing parallelism in this context? I’d love to hear your thoughts and suggestions! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The v0.2 group chat does not support parallel speakers. You would need to upgrade to v0.4 and use the Core API. Though at this point you need to do a bit more work to set this up. You can follow the example patterns, especially Mixture of Agents, for how to create parallel agents. The Group Chat pattern is by design a sequential execution pattern. For parallel execution I think mixture of agents is a good starting point. |
Beta Was this translation helpful? Give feedback.
The v0.2 group chat does not support parallel speakers. You would need to upgrade to v0.4 and use the Core API. Though at this point you need to do a bit more work to set this up. You can follow the example patterns, especially Mixture of Agents, for how to create parallel agents.
The Group Chat pattern is by design a sequential execution pattern. For parallel execution I think mixture of agents is a good starting point.