In the chapter on "Building Typical Multi Agent App", we constructed a typical multi-agent application using one master agent and three sub-agents. In this chapter, we will further refine this agent collaboration method into a standard template for easier reuse and sharing in the future.
We can see that the intelligent question-answering scenario mainly consists of three core agents: the planning agent, the executing agent, and the expressing agent. The insurance planning agent is mainly responsible for breaking down complex user questions; the insurance executing agent is primarily responsible for executing information retrieval, collecting necessary information through knowledge tools for the questions planned; and the insurance expressing agent combines user inquiries to provide the final answers and expressions.
Demo Path: demo_startup_app_with_agent_templates
In the multi-agent applications mentioned above, we find that this model has strong reusability. We encapsulate the running process into an agent template called InsuranceAgentTemplate. Thus, most question-and-answer scenarios involving agents only require minor adjustments based on this template to be quickly constructed.
Refer to insurance_agent_template.py. Here, a certain level of abstraction has been applied to common methods used by the agent, including registering the agent, handling memory/LLM/tools/prompts, and executing the main functionalities. Most of these methods can be reused in the insurance agent.
In fact, the AU framework provides a considerable number of agent templates, including Rag, React, PEER modes, etc. It is recommended to use these existing templates to build your own agents.
You might have noticed that the standard template comprised of the three agents mentioned above includes Planning (Plan), Executing (Execute), and Expressing (Express). We refer to this as the PEE model. In complex scenarios, we hope this model can further self-evaluate and adjust, so we can add an evaluation node at the end. This is what the PEER framework refers to. PEER uses agents with different responsibilities—Plan, Execute, Express, and Review—to break down complex problems into manageable steps, execute the steps in sequence, and iteratively improve based on feedback, enhancing the performance of reasoning and analysis tasks. Typical use cases: Event interpretation, industry analysis.
Template Demo:demo_startup_app_with_agent_templates
You can run PEER demo in the test file.