Multi-agent system construction method and device based on service-oriented agent architecture
By constructing a multi-agent system using a service-oriented intelligent agent architecture, the problem of low agent collaboration efficiency in multi-agent systems is solved, achieving efficient resource utilization and flexible task execution, and is suitable for high-concurrency and complex task scenarios.
Patent Information
- Application Number
- CN202511260107.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Multi-agent systems suffer from poor flexibility, adaptability, and execution efficiency, as well as resource waste, due to the organization and collaboration of single-function agents. They also lack fully automated integration and deployment methods.
A service-oriented intelligent agent architecture is adopted. Service-oriented intelligent agents are integrated into the server by writing configuration files. A microservice registry center is used for service configuration and discovery to build a multi-agent system. Task coordination is carried out through an intelligent agent scheduling module.
It enables efficient collaborative execution of multi-agent systems, improves resource utilization and task throughput, supports flexibility and reliability in high-concurrency and complex task scenarios, and simplifies system maintenance.
Smart Images

Figure CN120750753B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a multi-agent system construction method and device based on a service-oriented agent architecture. BACKGROUND
[0002] With the development of large models and distributed computing, multi-agent systems can autonomously complete analysis and reasoning, planning and decision-making, and task execution, and can especially help solve complex multi-step tasks. Multi-agent enables agents with different functions to collaborate to complete complex tasks and overcome the shortcoming of large language models having brains but no hands. At the same time, the rapid evolution of new computing models and environments such as cloud computing, edge computing, and service computing is driving software systems to evolve towards networked, service-oriented, and intelligent systems.
[0003] In related technologies, multi-agent systems are mainly organized by several functionally single agents and fixed agent workflows to collaborate with multi-agents, and lack a full-process automation method for agent construction, agent deployment, and multi-agent collaboration. Service-oriented agents can realize the automation of the above processes through service-oriented modeling, construction, deployment, and scheduling methods. The main difficulties of current multi-agent systems are: (1) it is difficult to continuously integrate large-scale agents with different functions and tools; (2) there is a lack of integration and deployment methods for multi-agent systems; (3) there is a lack of multi-agent scheduling and collaboration methods with high availability, high throughput, and maximum resource utilization; therefore, flexibility, adaptability, and execution efficiency are poor and resources are wasted. SUMMARY
[0004] The present application provides a multi-agent system construction method, device and medium based on a service-oriented agent architecture to solve the problem of poor flexibility, adaptability, and execution efficiency and resource waste caused by the organization of multi-agent collaboration by functionally single agents in related technologies.
[0005] The first aspect embodiment of the present application provides a multi-agent system construction method based on a service-oriented agent architecture, including the following steps: writing a configuration file of a service-oriented agent based on a service-oriented agent architecture; integrating a plurality of service-oriented agents into a server according to the configuration file; starting microservices of the plurality of service-oriented agents, and performing service configuration on the plurality of service-oriented agents according to a registration center of the microservices and meta information of the plurality of service-oriented agents; after starting the service configuration, performing service discovery, pulling the meta information of the plurality of service-oriented agents on the registration center, generating nodes of the plurality of service-oriented agents according to the meta information of the plurality of service-oriented agents, constructing a multi-agent system according to the nodes of the plurality of service-oriented agents, and utilizing the multi-agent system to collaboratively execute a task.
[0006] Optionally, the service-oriented agent architecture comprises an infrastructure module, a service-oriented task execution module, an agent service network module, and an agent scheduling module, wherein the infrastructure module is configured to integrate a large language model, a knowledge graph, a vector database, and basic conditions of cloud service resources; the service-oriented task execution module is configured to encapsulate agent capabilities in the form of target services, implement parallel execution and context isolation; the agent service network module is configured to dynamically manage meta-information of agent services through a service registry center, to cross-service call multi-agent collaborative processing tasks; and the agent scheduling module is configured to generate an initial execution graph according to task requirements, and optimize resource allocation through dynamic programming.
[0007] Optionally, the configuration file comprises an agent service group, a service name, a registry center address, a service address, and a device type.
[0008] Optionally, the service configuration of the plurality of service-oriented agents according to the registry center of the microservice and the meta-information of the plurality of service-oriented agents comprises: obtaining a registration request sent by the registry center of the microservice; determining the meta-information of the plurality of service-oriented agents and an available service list according to the registration request; and performing service configuration on the plurality of service-oriented agents according to the meta-information of the plurality of service-oriented agents and the available service list.
[0009] Optionally, the multi-agent system is used to cooperatively execute tasks, comprising: obtaining a task list and an available service list; generating a task plan according to the task list; screening agents of the available service list to execute tasks according to the task plan, and filling records of the executed tasks into an execution graph until all tasks in the task list are completed, and feeding back the execution graph to a scheduler.
[0010] Optionally, the generation of the task plan according to the task list comprises: obtaining task requirements of each task in the task list; matching a corresponding main task list and an initial execution node according to the task requirements; and generating a task plan according to the main task list and the initial execution node.
[0011] Optionally, the screening of the agents of the available service list to execute tasks according to the task plan comprises: screening execution agents that meet preset conditions according to the task plan, and dispatching corresponding execution agents and corresponding execution graphs according to the available service list; playing back execution graph content of the execution agents according to task requirements, and filling execution conditions in the execution graph until all subtasks of the current task are completed, to generate a new execution graph and return the new execution graph to the scheduler.
[0012] Optionally, after returning the execution graph to the scheduler, the method further includes: determining whether the routing list information in the execution graph is empty; if the routing list information is not empty, scheduling the agent service pointed to by the route; if the routing list information is empty, executing the next agent service in the main task list.
[0013] A second aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the multi-agent system construction method based on a service-oriented intelligent agent architecture as described in the above embodiments.
[0014] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to perform the multi-agent system construction method based on a service-oriented intelligent agent architecture as described in the above embodiments.
[0015] Therefore, this application has at least the following beneficial effects:
[0016] (1) The embodiments of this application can write configuration files for service-oriented intelligent agents based on the service-oriented intelligent agent architecture; integrate multiple service-oriented intelligent agents into the server according to the configuration files; start microservices of multiple service-oriented intelligent agents, configure services for multiple service-oriented intelligent agents according to the registration center of the microservices and the metadata of multiple service-oriented intelligent agents; start service discovery after the service configuration is completed, pull the metadata of multiple service-oriented intelligent agents from the registration center, generate nodes of multiple service-oriented intelligent agents according to the metadata of multiple service-oriented intelligent agents, build a multi-intelligent agent system according to the nodes of multiple service-oriented intelligent agents, and use the multi-intelligent agent system to collaboratively execute tasks. When a new intelligent agent is added, it only needs to update the configuration file and register, and adapt to node changes in real time. The load-based scheduling strategy reduces resource contention, improves throughput, records the entire process of the execution graph, supports task backtracking and performance analysis, and is suitable for scenarios that require high concurrency, high reliability and complex task collaboration.
[0017] (2) Model and construct intelligent agent systems with services as the basic unit; realize service-oriented integration and deployment of multi-agent systems to improve development efficiency; use services as the basic unit for scheduling and collaboration to realize a multi-agent asynchronous scheduling method with execution graph as the context transmission medium, thereby improving task execution throughput and efficiency.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0020] Figure 1 A flowchart of a multi-agent system construction method based on a service-oriented agent architecture according to an embodiment of the present application is provided.
[0021] Figure 2 A schematic diagram of the overall flow of a multi-agent system construction method based on a service-oriented agent architecture according to an embodiment of the present application is provided.
[0022] Figure 3 A schematic diagram of a service-oriented agent architecture according to an embodiment of the present application is provided.
[0023] Figure 4 A schematic diagram of an agent service registration and discovery process according to an embodiment of the present application is provided.
[0024] Figure 5 A schematic diagram of scheduling of a service-oriented agent according to an embodiment of the present application is provided.
[0025] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is provided. DETAILED DESCRIPTION
[0026] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which like or similar elements or components are denoted by like reference numerals throughout the several views. The embodiments described below are examples in which the present application is applied, and are intended to explain the present application, and should not be understood as limiting the present application.
[0027] A multi-agent system construction method, device and medium based on a service-oriented agent architecture according to an embodiment of the present application are described below with reference to the accompanying drawings.
[0028] Specifically, Figure 1 A flowchart of a multi-agent system construction method based on a service-oriented agent architecture according to an embodiment of the present application is provided.
[0029] As shown in Figure 1 , the multi-agent system construction method based on a service-oriented agent architecture includes the following steps:
[0030] In step S101, a configuration file of a service-oriented agent is written based on a service-oriented agent architecture.
[0031] The service-oriented intelligent agent architecture includes an infrastructure module, a service-oriented task execution module, an intelligent agent service network module, and an intelligent agent scheduling module. The infrastructure module is used to integrate a large language model, a knowledge graph, a vector database, and basic conditions of cloud service resources. The service-oriented task execution module is used to encapsulate intelligent agent capabilities in the form of target services, implement parallel execution, and isolate contexts. The intelligent agent service network module is used to dynamically manage meta-information of intelligent agent services through a service registry center to cross-service call multi-intelligent agent collaborative processing tasks. The intelligent agent scheduling module is used to generate an initial execution graph according to task requirements and optimize resource allocation through dynamic programming.
[0032] It can be understood that the embodiments of the present application can compile a configuration file of a service-oriented intelligent agent based on a service-oriented intelligent agent architecture, support a hybrid deployment mode, improve resource utilization, parallel and isolation mechanisms, improve throughput, dynamically manage service meta-information through a registry center, and newly added nodes take effect immediately, and the execution efficiency is greatly improved.
[0033] Specifically, as shown in Figure 2 and Figure 3 The service-oriented intelligent agent architecture is initialized. The service-oriented intelligent agent architecture includes an infrastructure module, a service-oriented task execution module, an intelligent agent service network module, and an intelligent agent scheduling module. Specifically,
[0034] (1) Infrastructure module: mainly provides stable running environment and resource support for agents, including large language models, knowledge graphs, recommendation systems, vector databases, tool chains, API (Application Programming Interface), and cloud services, etc., to provide the basic conditions for the running of agents. Among them, the large language model support includes closed-source large language models represented by OpenAI (Open Artificial Intelligence) that can be called through API, as well as open-source large language models that can be deployed locally. Through configuration files, each agent can be flexibly configured with a large language model, or the framework can identify and call appropriate models according to the task, such as using multi-modal large language models in image recognition tasks. Knowledge graphs can automatically store or extract triple structured information during the running of agents, providing more accurate domain knowledge in specific fields to help reduce hallucinations. The recommendation system is used to solve the specialized recommendation needs of specific fields, such as product recommendation. The vector database is used for retrieval and enhancement generation, as well as the caching and reasoning acceleration of trajectory graphs in the active reasoning process of agents. Tool chains, APIs, and cloud services are all existing tools for agents to use. The infrastructure module provides tool and resource support for the entire RGPS (Requirements, Goals, Processes, and Systems) knowledge-driven service-oriented agent architecture through configuration or adaptive selection for the service task execution module to call.
[0035] (2) Service task execution module: supported by agent services, each agent provides capabilities in the form of Web services, and task execution can be achieved through services to realize parallel execution and context isolation, ensuring high throughput while improving resource utilization.
[0036] (3) Agent service network module: multiple agent services form an agent service network through service registration and discovery, and the agent services in the network can realize multi-agent collaboration through cross-service calls between microservices according to the needs of collaboration.
[0037] (4) Agent scheduling module: agent scheduling will plan initial task steps in advance according to user requirements to form the main part of the task execution graph, and each step will be handed over to an agent service as the initial node to start execution. During the execution process, further dynamic planning of sub-tasks will be carried out through the agent scheduler service to realize dynamic planning and execution, and the context synchronization of the entire execution process will be carried out in the execution graph.
[0038] In the embodiment of the present application, the configuration file includes an agent service group, a service name, a registration center address, a service address and a device type.
[0039] Specifically, as shown in Figure 2 , the construction and modeling of the service agent are performed through a service agent configuration file, which includes five parts: an agent service group , an agent service name , a registration center address , a service address and a device type .
[0040] The agent service group divides the visible domain of the agent group in the service runtime, and the agent group services in the same visible domain can discover each other and be called according to the task via the scheduling service; the agent service name is the identification of the agent after service, used to distinguish the agent service, as the unique identification of service registration and discovery, service deployment and invocation; the registration center address is the address information of the registration center to be connected by the agent service, including the address link url, access key and key, used to ensure that the agent service safely registers and discovers the service through the registration center; the service address includes the service ip address and the service port number, used to register the access mode of the own service as metadata to the registration center for service discovery by the service invoker; the device type is used to identify the device running the own service, and different device types will affect the calling mode of the service agent, such as the network communication protocol selection being HTTP (HyperText Transfer Protocol, HyperText Transfer Protocol) protocol on non-Internet of Things devices and MQTT (Message Queuing Telemetry Transport, Message Queuing Telemetry Transport protocol) protocol on Internet of Things devices.
[0041] In step S102, a plurality of service agents are integrated into the server according to the configuration file.
[0042] It can be understood that the embodiment of the present application can integrate a plurality of service agents into the server according to the configuration file, which not only can significantly improve the development and operation and maintenance efficiency of the system, but also can enhance the flexibility, scalability and reliability of the system.
[0043] It should be noted that, as Figure 2As shown, integration and deployment of service-enabled agents: service-enabled agent automatic integration based on pipeline tools, agent service registration and discovery based on microservice architecture. Service-enabled agent automatic integration based on pipeline tools is used to continuously integrate the agent code written by the agent developer into the server as a basic unit in the git repository through automatic scripts, improving development efficiency; agent service registration and discovery based on microservice architecture organizes each agent in the form of microservice, registers the service information of itself to the registration center according to the configuration file of the agent service, and pulls the meta information of other microservices registered to the registration center from the registration center. The meta information of other microservices will be dynamically updated with the registration and deregistration of services.
[0044] In step S103, the microservices of the plurality of service-enabled agents are started, and the plurality of service-enabled agents are configured for services according to the registration center of the microservices and the meta information of the plurality of service-enabled agents.
[0045] It can be understood that the embodiments of the present application start the microservices of the plurality of service-enabled agents, and configure the services according to the registration center and the agent meta information, which can significantly improve the integration speed, flexibility, resource utilization efficiency and collaboration ability between agents of the system, simplify the maintenance work of the system, and finally provide more efficient and reliable service experience for users.
[0046] In the embodiments of the present application, the plurality of service-enabled agents are configured for services according to the registration center of the microservices and the meta information of the plurality of service-enabled agents, including: obtaining a registration request sent by the registration center of the microservices; determining the meta information of the plurality of service-enabled agents and an available service list according to the registration request; and configuring the plurality of service-enabled agents for services according to the meta information of the plurality of service-enabled agents and the available service list.
[0047] It can be understood that the embodiments of the present application can configure services through the microservice registration center and the agent meta information, which not only realizes automatic service discovery and registration, but also greatly improves the flexibility, scalability and resource utilization of the system.
[0048] Specifically, as shown in Figure 2 and Figure 4 (1) Service-enabled agent automatic integration based on pipeline tools: this step is used to automatically verify, unit test and upload the agent code written in the code repository of the service-enabled agent written by the developer to the server through gitlab, jenkins and other pipeline tools, supporting source code uploading mode and containerized packaging mode such as docker.
[0049] (2) Agent service registration and discovery based on micro-service architecture: Each agent service will run in the form of micro-service, and service meta information including service network communication address and agent node information will be registered on the registration center at the beginning of running. The network communication address is similar to the traditional micro-service, so that other services can access the service through the network communication protocol; the agent node information contains the information of multiple agent nodes in the agent group in the agent service, which will be an important reference information for other agent services in multi-agent collaborative selection. In addition to service registration, each agent service will pull the meta information of other agent services registered on the registration center at the beginning of starting, and perform service discovery. The process will be dynamically updated during the subsequent service running period, to ensure that each agent service can keep the information consistent with the registration center, for example, new agent services are registered or existing agent services are deregistered, which can be dynamically updated.
[0050] In step S104, after the service configuration is completed, the service discovery is started, the meta information of multiple service-intelligent is pulled from the registration center, the nodes of multiple service-intelligent are generated according to the meta information of multiple service-intelligent, the multi-agent system is constructed according to the nodes of multiple service-intelligent, and the multi-agent system is used to cooperatively execute tasks.
[0051] It can be understood that, by using the service discovery process after the service configuration, the agent nodes are generated by using the agent meta information on the registration center and the multi-agent system is constructed, which can significantly improve the integration speed, resource management efficiency, task execution quality and collaboration ability of the system, and also enhances the flexibility and maintainability of the system.
[0052] In the embodiment of the application, the multi-agent system is used to cooperatively execute tasks, including: obtaining a task list and an available service list; generating a task plan according to the task list; screening the agent of the available service list to execute the task according to the task plan, and filling the record of executing the task to an execution graph until all tasks in the task list are completed, and feeding back the execution graph to the scheduler.
[0053] It can be understood that, the method for cooperatively executing tasks by using the multi-agent system in the embodiment of the application not only improves the efficiency and accuracy of task execution, but also enhances the flexibility and adaptability of the system; through dynamic management of the task list, accurate screening of the agent service and real-time updating of the execution graph, this scheme can ensure that stable and reliable service output can be provided even in the face of complex and variable task requirements.
[0054] It should be noted that, as Figure 2As shown, the execution graph structure and construction principle are executed, wherein the execution graph is triggered by a task, and records the whole process of the multi-agent system after receiving the task is cooperatively executed by multiple agent services. Specifically as follows:
[0055] (1) The structure of the execution graph includes execution graph basic information and execution graph hierarchical detail information. The execution graph basic information is used to record the initial information and summary information of the task, including execution graph task ID (Identification, identification), total hierarchical number, task total target, total token consumption, total amount consumption, total time consumption, task plan list, and total participating agent list. The execution graph hierarchical detail information includes context information of all agent services in the agent service network according to the hierarchical execution, each hierarchical level includes multiple agent services executed in parallel, which respectively complete the subtasks split by the previous hierarchical level. These context information includes the name of each executed agent service, subtask name, interaction information with the large model, input parameter list, output parameter list, task state, execution node token consumption, execution node amount consumption, execution node execution time, and task type (including agent and group). In addition, each hierarchical level also includes a routing list of the next hierarchical level, each route represents a list of downstream nodes of the current execution node, and each downstream node includes an execution task name, a task type (including agent and group), and an input parameter list. The agent scheduling service will dispatch all agent services to the next hierarchical level according to the routing list.
[0056] (2) Execution graph construction: the construction of the execution graph is cooperatively completed by the execution nodes of each hierarchical level, and the whole presents that the execution graph subgraph is distributedly generated by each agent microservice, and then the execution graph subgraph is synchronized by the scheduling service to be merged into a complete execution graph. With the execution of the task, the execution graph will be dynamically expanded according to the hierarchical level, and finally the whole execution graph will correspond to the complete solution of the task initially proposed by the user.
[0057] In the embodiment of the present application, the task plan is generated according to the task list, including: obtaining the task demand of each task of the task list; matching the corresponding main task list and initial execution node according to the task demand; and generating the task plan according to the main task list and the initial execution node.
[0058] It can be understood that the task plan generation process according to the task list in the embodiment of the present application can significantly improve the intelligent level and execution efficiency of task planning through accurate task demand analysis, efficient main task matching and scientific task plan generation. Not only can the complex task be efficiently decomposed and executed, but also the task arrangement can be flexibly adjusted in the dynamic environment, thereby providing a stable and reliable service experience for the user.
[0059] In the embodiment of the present application, the agent is screened from the available service list according to the task plan to perform the task, including: screening the execution agent that meets the preset condition according to the task plan, and scheduling the corresponding execution agent and the corresponding execution graph according to the available service list; replaying the execution graph content of the execution agent according to the task demand, and filling the execution situation in the execution graph until all subtasks of the current task are completed, generating a new execution graph and returning it to the scheduler.
[0060] The preset condition can be set according to actual needs, and is not limited.
[0061] It can be understood that the embodiment of the present application can screen the agent according to the task plan and dynamically schedule the execution task, combine the replay and expansion mechanism of the execution graph, and significantly improve the efficiency, flexibility and reliability of the task execution; not only can ensure the efficient decomposition and execution of complex tasks, but also can flexibly adjust the task arrangement in the dynamic environment, and provide stable and reliable service experience for users.
[0062] In the embodiment of the present application, after the execution graph is returned to the scheduler, it further includes: judging whether the routing list information in the execution graph is empty; if the routing list information is not empty, scheduling the agent service pointed by the routing; if the routing list information is empty, executing the next execution agent service of the main task list.
[0063] It can be understood that the embodiment of the present application judges whether the routing list information in the execution graph is empty, and dynamically adjusts the task scheduling strategy according to the state, which significantly improves the flexibility, efficiency and reliability of the task execution.
[0064] It should be noted that after the scheduling service receives the reporting request of the subtask, the state of the subtask is updated, if the subtask is completed, the scheduling continues along the main planning of the execution graph to the start node of the next subtask; if not, according to the routing information in the execution graph, the scheduling is performed to the next agent service that needs to participate in the cooperation to complete the current subtask.
[0065] Each subtask is repeatedly executed until all subtasks are completed to form a complete execution graph, the whole execution graph is sent to the summary agent service by the scheduling service for summary output, the final result is returned to the user, and the complete execution graph is visualized. The interaction process of the scheduling service and each agent service is as shown in Figure 5 .
[0066] Specifically, as shown in Figure 5 , a service-based multi-agent system scheduling method based on an execution graph; (1) at the beginning of the task, the task first enters the scheduling service for task recording and resource verification, enters the planning agent service for main task planning, generates execution graph basic information, and transmits the execution graph to the planning agent service.
[0067] (2) Then the intelligent agent service plans to find all online intelligent agent services through service discovery, and matches the main task list and the corresponding initial execution node according to the task. The main task list is added to the execution graph and returned to the scheduling service.
[0068] (3) The scheduling service finds the first execution intelligent agent service of the main task list, records the execution subtask at the scheduler level, and schedules to the execution intelligent agent service according to the resource idle condition, while carrying the execution graph.
[0069] (4) The execution intelligent agent service receives the scheduling request, first performs the execution graph context playback, fills the content in the execution graph into the memory of the current intelligent agent service, and then executes the current subtask by the intelligent agent group and multiple intelligent agents in the current intelligent agent service. The execution context is expanded to the execution graph, and it is judged whether the subtask is completed. If not, the downstream execution node list is automatically discovered and planned, filled into the routing list, and the execution graph is returned to the scheduler.
[0070] (5) The scheduling service judges whether the routing list information is empty. If not, the intelligent agent service pointed by the routing is scheduled. If empty, the next execution intelligent agent service of the main task list is executed in step (3). That is, after each subtask in the main task list is completed, the next subtask is scheduled. Whether each subtask is completed is dynamically decided by the intelligent agent service network module.
[0071] (6) When all subtasks are completed, the scheduling service summarizes the scheduling summary intelligent agent service on the entire execution graph context, and returns the final execution result to the user. At the same time, the entire execution graph is presented to the user as a complete task reasoning process.
[0072] According to the multi-intelligent agent system construction method based on the service-based intelligent agent architecture, a configuration file of the service-based intelligent agent is written based on the service-based intelligent agent architecture; a plurality of service-based intelligent agents are integrated into a server according to the configuration file; microservices of the plurality of service-based intelligent agents are started, and the plurality of service-based intelligent agents are configured according to a registration center of the microservices and meta information of the plurality of service-based intelligent agents; after the service configuration is started, service discovery is performed, the meta information of the plurality of service-based intelligent agents on the registration center is pulled, nodes of the plurality of service-based intelligent agents are generated according to the meta information of the plurality of service-based intelligent agents, a multi-intelligent agent system is constructed according to the nodes of the plurality of service-based intelligent agents, the multi-intelligent agent system is used to cooperatively execute a task, when a new intelligent agent is added, the configuration file is only updated and registered, and the node change is adapted in real time, a scheduling strategy based on load reduces resource contention, improves throughput, an execution graph records a whole process, supports task backtracking and performance analysis, and is suitable for scenes requiring high concurrency, high reliability and complex task cooperation.
[0073] The method for constructing a multi-agent system based on a service-oriented intelligent agent architecture according to this application will be described in detail below with reference to specific embodiments:
[0074] The task is to "generate a PDF report on the development trend of a large model in 2025." This involves a multi-agent system comprising search agent services, inference agent services, image generation agent services, and PDF file generation agent services. The specific steps are as follows:
[0075] Step 1: The user submits their request, such as "Generate a PDF report on the development trends of large AI models in 2025." The system first receives the user input and then passes it to the task planning module.
[0076] Step 2: The task planning module breaks down the task requirements into multiple sub-tasks based on the available service list capabilities and generates an execution plan.
[0077] Step 3, Subtask Execution
[0078] Each subtask is executed by a corresponding group of agents. The following is the specific implementation of each agent:
[0079] (1) Search for relevant information: Search for information related to the task from the Internet or other data sources.
[0080] (2) Generate report content: Generate structured report content based on search results.
[0081] (3) Generate charts: Generate the required charts, such as trend charts or data visualizations, based on the report content.
[0082] (4) Generate PDF file: Combine the report content and charts into a single PDF file.
[0083] Step 4, Dynamic Task Scheduling
[0084] The system dynamically determines the next task based on the routing list. If the routing list is not empty, it continues to schedule the next agent; if it is empty, it executes the next task in the main task list.
[0085] Therefore, the system can automatically generate task plans based on user needs and assign subtasks to the most suitable agents; each agent focuses on a specific task, ensuring the professionalism and efficiency of the task; the system dynamically adjusts task scheduling based on the routing list, and can quickly switch to alternative paths when branch tasks appear or tasks fail; finally, a complete PDF report is generated, containing structured content and charts to meet user needs.
[0086] Figure 6A structural schematic diagram of an electronic device is provided for an embodiment of the present application. The electronic device can include
[0087] The memory 601, the processor 602 and the computer program stored in the memory 601 and executable on the processor 602.
[0088] The processor 602 implements the multi-agent system construction method based on the service-oriented intelligent agent architecture provided in the above embodiments when executing the program.
[0089] Further, the electronic device further includes
[0090] The communication interface 603 is used for communication between the memory 601 and the processor 602.
[0091] The memory 601 is used to store the computer program executable on the processor 602.
[0092] The memory 601 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.
[0093] If the memory 601, the processor 602 and the communication interface 603 are independently implemented, the communication interface 603, the memory 601 and the processor 602 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0094] Optionally, in a specific implementation, if the memory 601, the processor 602 and the communication interface 603 are integrated on a chip, the memory 601, the processor 602 and the communication interface 603 can complete communication between each other through an internal interface.
[0095] The processor 602 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the application.
[0096] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program or instructions, and the computer program or instructions are executed by a processor to implement the method for constructing a multi-agent system based on a service-oriented agent architecture as described above.
[0097] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or N embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples without contradiction.
[0098] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "N" is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0099] Any process or method descriptions in flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code which include one or more executable instructions for implementing the specified logic functions (or steps) and which can be stored in one or more memories associated with the processor, and the preferred embodiments of the application include additional or fewer steps, or combinations of steps, or the same steps in a different order, or with one or more of the steps being performed concurrently, or with the inclusion of additional or fewer steps performed in place of some of the steps described, as will be appreciated by those skilled in the art. The descriptions of the processes and methods are intended to be illustrative and not limiting.
[0100] It should be understood that portions of the application can be implemented in hardware, software, firmware, or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if implemented in hardware, and in another embodiment, the hardware can be implemented with any or a combination of the following technologies, which are each well known in the art: a discrete logic circuit having logic gates for implementing logic functions upon an application of data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0101] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by programs instructing related hardware, and the programs can be stored in a computer readable storage medium. When the programs are executed, one or a combination of the steps of the method embodiments is included.
Claims
1. A method for constructing a multi-agent system based on a service-oriented agent architecture, characterized in that, The method comprises the following steps: writing a configuration file of the service agent based on the service agent architecture, wherein the configuration file comprises an agent service group, a service name, a registration center address, a service address, and a device type; integrating multiple service agents into a server according to the configuration file; starting microservices of the multiple service agents, registering meta-information containing service network communication addresses and agent node information to a registration center of the microservices, and performing service configuration on the multiple service agents according to the registration center of the microservices and the meta-information of the multiple service agents; starting service discovery after the service configuration is completed, pulling the meta-information of the multiple service agents from the registration center, generating nodes of the multiple service agents according to the meta-information of the multiple service agents, constructing a multi-agent system according to the nodes of the multiple service agents, and cooperatively executing tasks by using the multi-agent system, wherein cooperatively executing tasks by using the multi-agent system comprises: obtaining a task list and an available service list, generating a task plan according to the task list, screening agents of the available service list to execute tasks according to the task plan, filling records of executing tasks into an execution graph until all tasks in the task list are completed, and feeding back the execution graph to a scheduler; wherein generating a task plan according to the task list comprises: obtaining task requirements of each task in the task list, matching a corresponding main task list and an initial execution node according to the task requirements, and generating a task plan according to the main task list and the initial execution node; wherein screening agents of the available service list to execute tasks according to the task plan comprises: screening execution agents that meet preset conditions according to the task plan, dispatching corresponding execution agents and corresponding execution graphs according to the available service list, replaying execution graph content of the execution agents according to the task requirements, filling execution conditions in the execution graph until all subtasks of the current task are completed, and generating a new execution graph to return to the scheduler; wherein after the execution graph is returned to the scheduler, it further comprises: judging whether the routing list information in the execution graph is empty; if the routing list information is not empty, dispatching the agent service pointed by the routing; and if the routing list information is empty, executing the next execution agent service of the main task list.
2. The method of claim 1, wherein the method further comprises: The service agent architecture comprises: an infrastructure module, a service task execution module, an agent service network module, and an agent scheduling module, wherein the infrastructure module is configured to integrate a large language model, a knowledge graph, a vector database, and basic conditions of cloud service resources; the service task execution module is configured to encapsulate agent capabilities in the form of target services, and realize parallel execution and context isolation; the agent service network module is configured to dynamically manage meta-information of agent services through a service registration center, so as to cross-service call multi-agent cooperative processing of tasks; the agent scheduling module is configured to generate an initial execution graph according to task requirements, and optimize resource allocation through dynamic programming.
3. The method of claim 1, wherein the method further comprises: The service configuration of the plurality of service agents according to the registration center of the micro service and the meta information of the plurality of service agents comprises: Obtaining a registration request sent by the registration center of the micro service; According to the registration request, the meta information and the available service list of the plurality of service agents are determined; According to the meta information and the available service list of the plurality of service agents, the plurality of service agents are configured.
4. An electronic device, comprising: Comprise: Memory, processor and computer program stored on the memory and executable on the processor, the processor executes the program to realize the multi-agent system construction method based on the service agent architecture as claimed in any one of claims 1-3.
5. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the multi-agent system construction method based on the service agent architecture as claimed in any one of claims 1-3.