AutoAgents: A Framework for Automatic Agent Generation

Guangyao Chen, Siwei Dong, Yu Shu, Ge Zhang, Jaward Sesay, Börje Karlsson, Jie Fu, Yemin Shi

Abstract

Large language models (LLMs) have enabled remarkable advances in automated task-solving with multi-agent systems. However, most existing LLM-based multi-agent approaches rely on predefined agents to handle simple tasks, limiting the adaptability of multi-agent collaboration to different scenarios. Therefore, we introduce AutoAgents, an innovative framework that adaptively generates and coordinates multiple specialized agents to build an AI team according to different tasks. Specifically, AutoAgents couples the relationship between tasks and roles by dynamically generating multiple required agents based on task content and planning solutions for the current task based on the generated expert agents. Multiple specialized agents collaborate with each other to efficiently accomplish tasks. Concurrently, an observer role is incorporated into the framework to reflect on the designated plans and agents' responses and improve upon them. Our experiments on various benchmarks demonstrate that AutoAgents generates more coherent and accurate solutions than the existing multi-agent methods. This underscores the significance of assigning different roles to different tasks and of team cooperation, offering new perspectives for tackling complex tasks.

Introduction

While Large Language Models (LLMs) are powerful, they often struggle with complex, multi-step tasks that require deep domain expertise or long-term planning. To solve this, researchers developed Multi-Agent Systems (MAS), where different "roles" (e.g., a Coder and a Reviewer) work together. However, most current MAS frameworks are rigid: the roles are handcrafted by humans and fixed regardless of the task. Manually defining experts for every possible scenario is impossible to scale. AutoAgents addresses this "rigidity gap" by allowing the system to dynamically synthesize the exact experts it needs for the specific problem at hand.

The AutoAgents Framework

The AutoAgents framework operates in two distinct phases: the Drafting Stage and the Execution Stage. This dual-stage approach ensures that the team composition and the execution plan are refined before any actions are taken.

The AutoAgents framework consists of a Drafting Stage for planning and an Execution Stage for task fulfillment, supported by specialized observers and self-refinement loops.

Drafting Stage

Instead of jumping straight to the task, the system first holds a "meeting" between three predefined meta-agents:

  • Planner: Proposes a team of specialized agents and a step-by-step execution plan.
  • Agent Observer: Critiques the proposed team, ensuring the roles are rational and have the right tools.
  • Plan Observer: Critiques the execution plan for coherence and completeness. They iterate until they reach an optimal "blueprint" for the task.

Execution Stage

The generated agents (e.g., "Story Planner," "Researcher," "Writer") carry out the plan. This stage is managed by an Action Observer who acts as a project manager, coordinating communication and adapting the plan if obstacles arise. The system utilizes a triple-memory architecture—Long-term, Short-term, and Dynamic memory—to manage context efficiently and stay within token limits.

Key Insights and Results

A critical finding is that collaborative discussion significantly enhances the quality of the generated agent team. When allowed to discuss its own composition, the system creates more comprehensive teams tailored to the task's nuances, such as adding UI/UX designers and testers to a programming task.

Comparison showing how collaborative discussion between the Planner and Agent Observer leads to a more comprehensive set of expert roles.

Performance Benchmarks

The authors evaluated AutoAgents on MT-bench (open-ended QA) and Trivia Creative Writing:

  • Superiority over GPT-4: In open-ended QA, AutoAgents achieved a 76.3% win rate against a single GPT-4 agent and a 91.3% win rate against AgentVerse.
  • Knowledge Integration: On the Trivia Creative Writing task, AutoAgents scored 85.9%, an 11.6% improvement over standard prompting.
  • Ablation Studies: Removing self-refinement or observer agents resulted in a ~3% performance decrease, confirming that the collaborative architecture is essential for high performance.

Conclusion and Future Work

AutoAgents demonstrates that dynamic role generation and collaborative refinement are key to solving complex tasks with LLMs. While the framework requires more computational resources due to iterative feedback loops, it provides significantly more coherent and accurate solutions than rigid, predefined systems. Future work will focus on expanding the framework to handle real-world software engineering tasks and improving the Action Observer's ability to handle environmental changes during execution.

Summary updated

BibTeX
@inproceedings{chen2024autoagents,
  author = {Guangyao Chen and Siwei Dong and Yu Shu and Ge Zhang and Jaward Sesay and Börje Karlsson and Jie Fu and Yemin Shi},
  title = {{AutoAgents: A Framework for Automatic Agent Generation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=mMa0ZjK1u5},
}
Figure