5 agent modes that big companies and big models must know

Master the five agent modes of large manufacturers and large models to improve interactivity and accuracy.
Core content:
1. Reflection mode: Iterate and optimize LLM output through user feedback
2. Tool usage mode: LLM calls external tool API to enhance answering ability
3. ReAct mode: Combine reasoning and generative LLM to achieve a complete closed loop
Reflection pattern
The following is an introduction to the workflow of this mode:
User input query : The user sends a query request to the Agent through the interface or API.
LLM generates initial output : The Large Language Model (LLM) receives a user’s query and generates a preliminary response.
User Feedback : Users evaluate and provide feedback on initial responses.
LLM Reflective Output : Based on user feedback, LLM reflects on its initial response, i.e., re-evaluates and adjusts the output it generates.
Iterative process : This process may require multiple iterations until the user is satisfied with the final response.
Return to user : The final response is returned to the user, who can receive the result through the interface or API.
This mode is often used to improve the interactivity and accuracy of large language models, continuously optimizing the model's output through user feedback.
Tool use pattern
The following is an introduction to the workflow of this mode:
User input query : The user sends a query request to the agent through the interface or API.
LLM processes queries : The large language model (LLM) inside the agent receives the user's query and processes it. During this process, LLM may need to call external tools or APIs to obtain more accurate information.
Calling tools and APIs : If the query requires additional information or data, LLM calls tools and APIs stored in the vector database to obtain this information.
Generate Response : LLM generates a response based on the information obtained from the tools and API. This response may be text, table, or other format of data.
Return to user : Finally, the generated response is returned to the user, who can receive the result through the interface or API.
This pattern is often used to augment the capabilities of large language models by enabling them to access external resources to provide more comprehensive and accurate responses.
ReAct Pattern
The following is an introduction to the workflow of this mode:
User : A user makes a query to the system, such as a task or request that needs to be completed.
LLM (Reason) : After receiving the user's query, the reasoning language model (LLM - Reason) will analyze the query and generate corresponding strategies or plans.
Tools : Based on the generated strategy or plan, the system calls the corresponding tools to perform specific operations.
Environment : After the tool performs the operation, it feeds the results back to the environment.
LLM (Generate) : The results returned by the environment are fed back to the generative language model (LLM - Generate), and the generative language model generates the final response based on the results.
Response : The response generated by the generative language model is returned to the user.
This model realizes a complete closed loop from user query to final response by combining the inference language model and the generative language model. The inference language model is responsible for strategy generation, and the generative language model is responsible for result interpretation and response generation.
Planning Pattern
The following is an introduction to the workflow of this mode:
User : A user makes a query to the system, such as a task or request that needs to be completed.
Planner : After receiving the user's query, the planner will analyze and generate a series of tasks (Generated tasks). These tasks may be specific execution steps or subtasks.
Generated tasks : The tasks generated by the planner will be passed to the executor (ReAct Agent).
Executor (ReAct Agent) : The executor executes individual tasks based on the generated tasks and returns the results to the planner.
Result feedback : After the executor completes a task, it will feedback the result to the planner. If all tasks have been completed, the planner will confirm that the task is completed (Finished?).
Response : The planner generates a final response based on the task completion status and results and returns it to the user.
This model ensures the orderly execution of tasks and timely feedback of results, thereby achieving effective processing of user needs.
Multi-agent pattern
The following is an introduction to the workflow of this mode:
User : A user makes a query to the system, such as a task or request that needs to be completed.
Project Manager Agent (PM agent) : After receiving the user's query, the Project Manager Agent (PM agent) will analyze and assign tasks to other agents.
DevOps agent : The project manager agent assigns tasks to the DevOps agent.
Tech lead agent : The DevOps agent further assigns the tasks to the Tech lead agent.
Software Development Engineer Agent (SDE agent) : The technical lead agent assigns tasks to the software development engineer agent (SDE agent).
Execute tasks : Each agent performs corresponding operations according to the assigned tasks and feeds back the results to the upper-level agent.
Result Feedback : Finally, after all agents complete their tasks, they will feed back the results to the project manager agent.
Comprehensive response : The project manager agent combines the results of all agents to generate a final response (Response) and returns it to the user.
This model can handle complex tasks more efficiently through the collaborative work of multiple agents, ensuring the orderly execution of tasks and timely feedback of results.