build_from_library
, which help users build an automatic task-solving
process powered by a multi-agent system from a pre-defined agent
library. Specifically, in build_from_library
, we prompt an LLM to
explore useful agents from a pre-defined agent library, generating
configurations for those agents for a group chat to solve the user’s
task.
Requirement
AutoBuild requireautogen[autobuild]
, which can be installed by the
following command:
Preparation and useful tools
We need to specify aconfig_path
, default_llm_config
that include
backbone LLM configurations.
Example for generating an agent library
Here, we show an example of generating an agent library from a pre-defined list of agents’ names by prompting agpt-4
. You can also
prepare a handcrafted library yourself.
A Library contains each agent’s name, description and system_message.
The description is a brief introduction about agent’s characteristics.
As we will feed all agents’ names and description to gpt-4 and let it
choose the best agents for us, each agent’s description should be simple
but informative.
First, we define a prompt template for description and system_message
generation and a list of agents’ name:
gpt-4
model to generate each agent’s system
message as well as the description:
Build agents from library (by LLM)
Here, we introduce how to build agents from the generated library. As in the previousbuild
, we also need to specify a building_task
that
lets the build manager know which agents should be selected from the
library according to the task.
We also need to specify a library_path_or_json
, which can be a path of
library or a JSON string with agents’ configs. Here, we use the
previously saved path as the library path.
build_from_library
from the AgentBuilder to
generate a list of agents from the library and let them complete the
user’s execution_task
in a group chat.