Decentralized multi-AI agent collaboration methods, computing devices, and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]然而,上述中心化调度架构在实际工程实践中暴露出:用户只能与中央调度器交互,无法直接观察各个Agent的工作过程和中间产物,存在协作过程不透明的问题
[0009] According to the technical solution provided by this invention, an instant messaging platform group is used as the message bus. Each AI agent is registered as an independent robot application account. Free collaboration is achieved through a mention function mechanism, enabling AI agents to work on an equal footing with users in the same communication environment, just like employees. This not only fully utilizes the AI agents' autonomous environmental perception, autonomous decision-making, execution, and memory capabilities, effectively improving project efficiency and quality, but also achieves decentralized multi-AI agent collaboration. The failure of any single robot application will not affect the normal operation and collaboration of other robot applications, eliminating the single point of failure problem of the central scheduler under the existing centralized architecture. At the same time, it allows users to understand the processing between robot applications, realizing the transparency of the collaboration process and solving the black box defect of AI agents. Users can intervene, ask follow-up questions, or adjust the direction at any time by mentioning any robot application without waiting for the entire collaboration process to end, improving the transparency of human-machine collaboration and providing a deep, transparent, and controllable human-machine collaborative production environment.
Smart Images

Figure CN122554423A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-agent artificial intelligence, specifically to a decentralized multi-AI agent collaboration method, computing device, and storage medium. Background Technology
[0002] A multi-agent system (MAS) is a system capable of coordinating and controlling multiple agents (AI agents) to make decisions. These AI agents can complete complex tasks through interaction and collaboration. In current AI applications, the collaborative completion of complex business tasks by multiple AI agents is an increasingly important requirement, such as managing the entire lifecycle of advertising campaigns. Existing multi-agent systems generally adopt a centralized scheduling architecture: a central scheduler is responsible for receiving user instructions, decomposing tasks, assigning them to various agents for execution, and summarizing the results before returning them to the user.
[0003] However, the above centralized scheduling architecture has revealed problems in actual engineering practice: users can only interact with the central scheduler and cannot directly observe the working process and intermediate products of each agent, resulting in a lack of transparency in the collaboration process.
[0004] Therefore, how to implement a decentralized multi-agent collaborative architecture to eliminate the dependence on a central scheduler and achieve autonomous collaboration between agents and natural human-machine interaction has become an urgent problem to be solved. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a decentralized multi-AI agent collaboration method, computing device and storage medium that overcomes or at least partially solves the above problems.
[0006] According to one aspect of the present invention, a decentralized multi-AI agent collaboration method is provided, the method comprising: Create groups for collaborative work on projects within an instant messaging platform. Group members include users and multiple chatbot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is identified, and the target AI agent is scheduled to process the message accordingly to obtain the processing result. The target robot application will then send the processing results back to the group.
[0007] According to another aspect of the present invention, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform the following operations: Create groups for collaborative work on projects within an instant messaging platform. Group members include users and multiple chatbot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is identified, and the target AI agent is scheduled to process the message accordingly to obtain the processing result. The target robot application will then send the processing results back to the group.
[0008] According to another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, the executable instruction causing a processor to perform operations corresponding to the decentralized multi-AI agent collaboration method described above.
[0009] According to the technical solution provided by this invention, an instant messaging platform group is used as the message bus. Each AI agent is registered as an independent robot application account. Free collaboration is achieved through a mention function mechanism, enabling AI agents to work on an equal footing with users in the same communication environment, just like employees. This not only fully utilizes the AI agents' autonomous environmental perception, autonomous decision-making, execution, and memory capabilities, effectively improving project efficiency and quality, but also achieves decentralized multi-AI agent collaboration. The failure of any single robot application will not affect the normal operation and collaboration of other robot applications, eliminating the single point of failure problem of the central scheduler under the existing centralized architecture. At the same time, it allows users to understand the processing between robot applications, realizing the transparency of the collaboration process and solving the black box defect of AI agents. Users can intervene, ask follow-up questions, or adjust the direction at any time by mentioning any robot application without waiting for the entire collaboration process to end, improving the transparency of human-machine collaboration and providing a deep, transparent, and controllable human-machine collaborative production environment.
[0010] This innovative technical solution proposes a Bot-to-Bot direct delivery mechanism, enabling robot applications to freely initiate collaboration through mention functions, autonomously call each other, and form dynamic collaboration chains, significantly enhancing collaboration flexibility and solving the technical barrier of message incompatibility between robot applications. A team isolation mechanism enables cross-team communication permission management. A two-layer anti-loop mechanism is also proposed, using hop count thresholds and loop count thresholds to achieve loop detection, effectively preventing circular calls without excessively restricting normal collaboration chains, thus ensuring security boundaries. Furthermore, a two-layer concurrency control model and session continuation mechanism are proposed, allowing messages from the same AI agent in the same group to be processed serially and combined with the dialogue context within the same group. Messages from the same AI agent in multiple groups can be processed in parallel, providing multi-group parallel expansion capabilities. Additionally, visual processing status feedback for messages can be provided within the group, using emoticons to indicate the processing status in the form of robot applications, allowing users in the group to intuitively see whether the robot application has started processing the message.
[0011] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0012] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a decentralized multi-AI agent collaboration method according to Embodiment 1 of the present invention is shown. Figure 2 A flowchart illustrating the system construction process of a decentralized multi-AI agent collaboration method according to Embodiment 2 of the present invention is shown. Figure 3 A flowchart illustrating a decentralized multi-AI agent collaboration method according to Embodiment 3 of the present invention is shown. Figure 4 A schematic diagram illustrating a visual processing status feedback is shown; Figure 5 A schematic diagram of a collaborative process for an advertising delivery scenario according to Embodiment 4 of the present invention is shown; Figure 6 A schematic diagram of the structure of a computing device according to Embodiment Six of the present invention is shown. Detailed Implementation
[0013] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0014] First, the terminology used in one or more embodiments of the present invention will be explained.
[0015] Agent (AI intelligent agent): refers to an agent that can perceive the environment and take actions to achieve specific goals.
[0016] Instant messaging platform (IM platform): A real-time communication tool based on the Internet that supports the transmission of text, files, voice and video.
[0017] Skill: refers to a technical concept in the field of artificial intelligence, which encapsulates the domain knowledge, operation process, tool calls and best practices required to complete a specific task; a skill is a packaged "skill pack" or "expert operation manual".
[0018] WebSocket is a protocol that enables full-duplex communication over a single TCP connection, allowing low-latency, bidirectional, real-time data transmission between clients and servers.
[0019] LLM CLI: refers to the command-line interface tool used to interact with the Large Language Model (LLM).
[0020] A session is a defined space for a chat conversation, uniquely identified by a session identifier (such as session_id), used for managing and isolating the entire lifecycle of the session. A session is a container for managing chat conversations, capable of hosting multiple rounds of question-and-answer sessions. A session contains the conversation context, session configuration, and session lifecycle (e.g., when it is created, when it expires, whether it is archived, and whether it is deleted).
[0021] Chat refers to the message records under each session, used to concatenate the prompt message to the LLM.
[0022] inotify refers to the file system event monitoring mechanism provided by the Linux kernel, which can monitor file or directory creation, modification, deletion and other operations in real time and notify users through event-driven methods.
[0023] Example 1 Figure 1 A flowchart illustrating a decentralized multi-AI agent collaboration method according to Embodiment 1 of the present invention is shown, as follows: Figure 1 As shown, the method includes the following steps: Step S101: Create a group for collaborative work for the project in the instant messaging platform.
[0024] A project typically involves multiple aspects of work and requires collaboration from multiple roles. This invention introduces multiple AI agents into the project workflow based on an instant messaging platform. Using instant messaging groups (i.e., group chats) as the message bus, each AI agent is registered as an independent bot account and runs as an independent process. Free collaboration is achieved through a mention mechanism, enabling AI agents to work collaboratively with users in the same communication environment, much like employees. This not only fully utilizes the AI agents' autonomous environmental perception, decision-making, execution, and memory capabilities, effectively improving project efficiency and quality, but also achieves decentralized multi-AI agent collaboration. The failure of any single bot application will not affect the normal operation and collaboration of other bot applications. Users can intervene, ask follow-up questions, or adjust the direction at any time by mentioning any bot application.
[0025] Based on the project's setup and planning information, a team and its members can be identified for collaborative work. These team members are then grouped as group members on an instant messaging platform. Specifically, group members include users and multiple robot applications. Users can be human users, and there is a mapping relationship between robot applications and AI agents. In this invention, robot applications and AI agents refer to the same entity from different perspectives: the platform's identity perspective and the work directory perspective.
[0026] Step S102: In response to the message sent by the message initiator in the group that mentions the target robot application, determine the target AI agent corresponding to the target robot application, and schedule the target AI agent to perform corresponding processing according to the message to obtain the processing result.
[0027] During collaborative work within a project, when a group member requires collaboration from other group members, these other members are referred to as the target collaborators. The original group member can then act as the message initiator, sending a message mentioning the target collaborator within the group. The target collaborator can then process the message accordingly to complete the collaboration. Specifically, messages can be sent to the target collaborator within the group using mention functionality (such as the @mention feature). The message initiator can be a user or a bot application; the target collaborator can include one or more group members, who may include users and / or bot applications—the specific limitations are not specified here. The message content can be determined by the user or bot application based on the actual project operation.
[0028] When the target collaborator is a robot application, it is referred to as the target robot application. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application can be determined according to the mapping relationship between robot applications and AI agents. Then, the target AI agent is scheduled and its execution capabilities are used to process the message accordingly to obtain the processing result.
[0029] In step S103, the target robot application replies the processing result to the group.
[0030] After the target AI agent receives the processing result, it can reply to the group as the target robot application. Users in the group and multiple robot applications can see all the conversations in the same communication environment. Collaboration happens naturally and does not require special interfaces.
[0031] This embodiment utilizes a decentralized multi-AI agent collaboration method, employing an instant messaging platform group as the message bus. Each AI agent is registered as an independent robot application account, and free collaboration is achieved through a mention function mechanism. This allows AI agents to work collaboratively with users in the same communication environment, much like employees. This not only fully leverages the AI agents' autonomous environmental perception, decision-making, execution, and memory capabilities, effectively improving project efficiency and quality, but also achieves decentralized multi-AI agent collaboration. The failure of any single robot application will not affect the normal operation and collaboration of other robot applications, eliminating the single point of failure problem of the central scheduler in the existing centralized architecture. Furthermore, it allows users to understand the processing between robot applications, achieving transparency in the collaboration process and solving the black-box defect of AI agents. Users can intervene, ask follow-up questions, or adjust directions at any time by mentioning any robot application without waiting for the entire collaboration process to end, improving the transparency of human-machine collaboration and providing a deep, transparent, and controllable production environment.
[0032] Example 2 Figure 2 A flowchart illustrating the system construction process of a decentralized multi-AI agent collaboration method according to Embodiment 2 of the present invention is shown, as follows: Figure 2 As shown, the method includes the following steps: Step S201: Obtain project setup planning information, analyze the project setup planning information, and determine the robot applications required for the project and the responsibilities of each robot application.
[0033] When a new project needs to be launched, but it is uncertain which robot applications are suitable, the initialization settings of the decentralized multi-AI intelligent agent collaborative system proposed in this invention can be automatically completed based on the project's construction planning information.
[0034] Specifically, this involves obtaining project setup and planning information, which may include the project's business domain, core workflow, external systems to be integrated, team size, and collaboration scenarios. The business domain describes the tasks the project will undertake, such as e-commerce operations, customer service, content creation, and data analysis. The core workflow describes the project's daily tasks and key steps, such as "daily data review → strategy formulation → campaign execution → post-launch review." External systems to be integrated specify which platforms or APIs the project needs to integrate with, such as advertising platform 1, advertising platform 2, and document platform 1. Team size indicates the number of employees required and their responsibilities, such as one analyst, two operations staff, and one designer. Collaboration scenarios describe how human users and the robot application interact and in which scenarios the robot application needs to collaborate, such as "after the analyst generates a report, operations adjust strategies accordingly."
[0035] In addition, to better complete the initial setup and ensure that the created groups better meet project requirements, the project setup planning information can further include security management information, data sensitivity, cost sensitivity, existing documents, and group structure. Security management information specifies which operations require manual confirmation, such as those involving funds, permissions, or external releases; data sensitivity indicates compliance requirements and data isolation needs; cost sensitivity indicates sensitivity to the cost of API calls to Large Language Models (LLMs), which influences the choice of LLM; existing documents refer to existing project-related documents, such as Standard Operating Procedures (SOPs), operation manuals, and API documentation, which facilitate direct conversion into Skills; and group structure specifies the number of groups the project aims for and the roles included in each group.
[0036] After obtaining the project setup planning information, the project setup planning information is analyzed to determine the number of roles in the workflow and break down the responsibilities corresponding to the project. Based on the number of roles, the collaboration and cohesion relationships between responsibilities, and the operational isolation requirements, the number of robot applications required for the project is determined, and the responsibilities of each robot application are divided.
[0037] The process involves decomposing responsibilities to determine the number of robot applications needed for the project, ensuring each application has a clear boundary. This determination requires considering the number of roles, the collaboration and cohesion relationships between responsibilities, and operational isolation requirements. Specifically, analyzing project setup planning information identifies the specific roles within the workflow; the collaboration relationships between responsibilities indicate which responsibilities require frequent collaboration, helping to determine if they are suitable for being split into different robot applications; the cohesion relationships between responsibilities indicate which responsibilities are highly cohesive, helping to determine if they are suitable for being merged into a single robot application; and operational isolation requirements indicate which operations in the project require safety isolation and must be handled by different roles.
[0038] Based on practical engineering experience, the optimal number of robot applications is between 3 and 8. Too few applications result in each robot being responsible for too many complex tasks, leading to excessively long prompts and decreased response quality. Too many applications, on the other hand, lengthen the collaboration chain, increase latency, and raise maintenance costs. Therefore, in real-world applications, it's advisable to start with a minimum usable set (e.g., 3 to 4). After the project has been running for a period, the responsibilities of each robot application can be further broken down as needed based on actual project performance.
[0039] After determining the number of robot applications required for the project and the responsibilities of each robot application, identity design information can be set for each robot application. The identity design information can be called an identity card, and the specific content of the identity design information is shown in Table 1.
[0040] Table 1. Information Items in the Identity Design Information for Robot Applications
[0041] In addition, the project's team structure needs to be set up. For example, the team structure could be:
[0042] This invention enables a multi-team, company-like organizational structure. The Boss is a top-level management robot application used to manage multiple teams; the Leader is a project manager robot application within a single team, used to manage other robot applications within that team, such as Bot 1 and Bot 2 in business team A in the above structure. For projects with a single team, a Boss can be omitted, thus achieving a flat organizational structure.
[0043] Step S202: Configure each robot application, the mapping relationship between the robot application and the AI agent, and the team structure information of the project in the developer platform to form a configuration file, configure the working directory of each AI agent, and set the corresponding skills.
[0044] After completing step S201, system initialization can be performed to set up the environment. To facilitate a clearer understanding of this invention, the relationship between robot applications and AI agents will be introduced here first.
[0045] In this invention, "robot application" and "AI agent" refer to the same entity from two different perspectives. Specifically, "AI agent" is a concept from the perspective of the working directory, referring to an independent workspace within the working directory, such as / project / agents / {agent_id} / . "Robot application" is a concept from the perspective of platform identity, referring to a robot application registered on the platform, possessing independent identification information, including appId, appSecret, and openId; where appId is the application ID, equivalent to the robot application's identification number; appSecret is the application key used to verify whether it belongs to this robot application; and openId is the API identifier within the platform, specifically a unique identifier for API calls, which other systems need to use to schedule the robot application.
[0046] The mapping relationship between robot applications and AI agents can be shown in Table 2. For example, in practical application scenarios, the responsibilities of the robot application with bot_id id1 may include directing and managing other robot applications; the responsibilities of the robot application with bot_id id2 may include receiving user requests, breaking down tasks, and assigning them to other group members; the responsibilities of the robot application with bot_id id3 may include querying advertising data, program information, and material libraries; the responsibilities of the robot application with bot_id id4 may include developing delivery strategies and budget plans based on data; the responsibilities of the robot application with bot_id id5 may include creating, adjusting, and managing advertisements on the advertising platform; the responsibilities of the robot application with bot_id id6 may include producing and managing advertising video materials; and the responsibilities of the robot application with bot_id id7 may include maintaining the infrastructure of the entire system.
[0047] Table 2. Mapping Relationship between Robot Applications and AI Agents
[0048] The robot application and the AI agent are two sides of the same coin. `bot_id` and `agent_id` are internal system identifiers used for file paths, configuration references, and code logic. `botName` is the display name of the robot application on the instant messaging platform, i.e., the name of the robot application that users see on the platform. `openId` is the API identifier on the platform, specifically a unique identifier for API calls, used for message routing, mention function conversion, etc. `bot_id`, `agent_id`, `botName`, and `openId` are managed uniformly through configuration files to ensure consistency in message routing, mention function conversion, and collaboration triggering.
[0049] In the developer platform, create each robot application required for the project, configure WebSocket persistent connection mode, and obtain the appId, appSecret, and openId of each robot application assigned by the platform. Configuring WebSocket persistent connection mode ensures a constantly open communication channel between the robot application and the server, enabling real-time message reception without repeated refresh checks.
[0050] Next, each robot application, the mapping relationship between robot applications and AI agents, and the project's team structure information are configured to form a configuration file. For example, the configuration file can record the robot application's profile information and team structure information. The robot application's profile information records the robot application's various identifiers, roles, and the path to the corresponding AI agent's working directory. The team structure information records which robot applications are included in the team, which robot application is the team leader, which group the team is linked to, and which robot application belongs to the basic platform team (capable of serving all robot applications across teams). The configuration file clearly defines the capabilities and responsibilities of each robot application, providing a foundation for process transparency.
[0051] The mapping relationship between the robot application and the AI agent is stored in the robot application's profile information. This mapping table is dynamically loaded via a function upon system startup. The table records mapping rules from botName to openId (e.g., for mention functionality conversion within the platform), from botName to bot_id (e.g., for message routing), from bot_id to botName (e.g., for display), and from bot_id to metadata (e.g., for use in the management dashboard).
[0052] Configure the working directory for each AI agent. Specifically, create a corresponding working directory for each AI agent, and configure the role description file, message receiving directory, message sending directory, and memory file in the working directory.
[0053] The role description file, specifically the CLAUDE.md file, records the identity design information and responsibilities of the corresponding robot application for the AI agent, as well as the tool routing table, response rules, collaboration matrix, and safety management information. The tool routing table records the skills required for different tasks; the response rules record which messages should be responded to and which should not; the collaboration matrix records which robot application should be invoked for processing in different scenarios; and the safety management information records which operations require manual confirmation. The role description file is read every time the system starts.
[0054] The message receiving directory can be represented as the inbox, essentially a JSON file queue where messages sent by other members are stored as files. The message sending directory can be represented as the outbox, also essentially a JSON file queue where messages to be sent are stored as files. To easily distinguish which messages have been sent, a sent archive directory, specifically the delivered directory, can be set up under the sent message directory to manage sent reply messages. The memory file can be represented as a memory file, used to store the persistent working memory of the AI agent, recording its accumulated experience. This invention uses a file system directory as the message queue, with each AI agent having its own independent message receiving and sending directories, realizing an asynchronous message communication mechanism based on the file system.
[0055] During the system initialization phase, corresponding skills also need to be set up. Specifically, based on the requirements of the external system, corresponding skills are created. Skills may include interface documentation, executable scripts, and automated test files.
[0056] This invention enables the implementation of a three-layer Skill scope and a four-layer Memory model. Table 3 shows the three-layer Skill scope, and Table 4 shows the four-layer Memory model.
[0057] Table 3. Three-layer Skill scope
[0058] Skills with the same name need to be covered in the order of priority: AI agent layer > team layer > global layer; AI agents or teams are allowed to personalize global skills.
[0059] Table 4. Four-layer Memory Model
[0060] Step S203: In the instant messaging platform, add the robot applications and users required for the project as group members, create a group for collaborative work for the project, and register the group to the configuration file.
[0061] After completing the above system initialization settings, you can configure groups. In the instant messaging platform, add the robot applications and users required for the project as group members, create groups, and register the groups in the configuration file. You can also configure scheduled tasks for the scheduler based on the project deployment plan, such as daily inspections and periodic reports.
[0062] This invention can also validate and optimize the created groups. Specifically, it involves end-to-end testing of the response of each robot application; validating the collaborative links between robot applications; adjusting concurrency configurations and session timeouts; and iterating the role description documents of the AI agents based on actual performance.
[0063] In one alternative implementation, if the project setup planning is still in the early exploratory stage, the project setup planning information can only contain simple planning information, such as "I want to do the XXX project, the main work is A→B→C, and it needs to connect to platforms X and Y". Based on the project setup planning information, this invention can plan a minimum usable solution (e.g., including 3 to 4 robot applications) and perform corresponding technical initialization, and then gradually expand it according to actual usage.
[0064] Step S204: Start system services.
[0065] The system services include message receiving and message sending services. The message receiving service establishes a communication channel to the instant messaging platform for each robot application, receiving messages from the group in real time. The message sending service monitors the sent message directory under the working directory of all AI agents, immediately sending new messages to the group upon detection.
[0066] In the message receiving service, the main process creates independent child processes for each robot application. Each child process runs its own corresponding message processing loop, trigger detection thread, and concurrency control semaphore. The main process is the entry point for the message receiving service; it does not handle any specific message sending or receiving but is responsible for the following: 1) During the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, such as parsing the openId of each robot application, so as to be used for subsequent message routing and to accurately deliver messages to the target robot application through the openId; initializes the concurrent queue status file for Dashboard monitoring; and starts the response timeout monitoring mechanism, such as monitoring the timeout of completed emoticon markers.
[0067] 2) Create an independent child process for each robot application, and establish an independent WebSocket long connection to the instant messaging platform within each child process. The main process creates an independent child process for each robot application registered in the configuration file, and each child process establishes a real-time connection with the server through the communication protocol.
[0068] 3) Poll the survival status of each child process, for example, every 30 seconds; if any child process of the robot application exits abnormally, the main process will recreate the child process for that robot application. This invention achieves child process protection and automatic startup through the main process. If a child process of a robot application crashes, the main process will automatically restore the child process without affecting other robot applications, effectively achieving system fault isolation.
[0069] 4) Monitor the heartbeat of the main process. If the main process has an abnormal heartbeat, restart the message receiving service. For example, send a WATCHDOG=1 heartbeat signal to systemd every 30 seconds; if the main process itself freezes, systemd will automatically restart the entire message receiving service.
[0070] 5) The main process monitors the modification timestamps of the configuration file and logs changes when they are detected, thus implementing configuration hot reloading detection. The actual configuration hot reloading is executed in each child process.
[0071] In other words, the main process acts as a process manager; it does not receive messages or trigger LLM, but is only responsible for starting child processes, protecting child processes, and reporting heartbeats. Multiple child processes are responsible for the actual processing, including receiving WebSocket messages, triggering LLM, and managing concurrency.
[0072] System services may also include scheduled task services and management panel services. Scheduled task services are used to execute periodic tasks according to a schedule, such as checking system health hourly. Management panel services provide a web-based management backend for human users to easily view system status.
[0073] In this invention, because there is no central scheduler for unified scheduling, each individual robot application possesses independent thinking and decision-making capabilities. It autonomously determines its collaborating partners through group messages (@mention), enabling natural collaboration. This allows AI agents to work collaboratively and on equal footing with users in the same communication environment, much like employees. Essentially, multiple independent sub-processes self-organize and collaborate through an instant messaging platform. Human users can intervene at any time, providing a transparent and controllable production environment with deep human-machine collaboration. The failure of any single robot application (e.g., sub-process crashes, LLM call timeouts) will not affect the normal operation of other robot applications, achieving decentralization. In actual operation, when a single robot application malfunctions, other robot applications can still respond normally to user and collaboration requests. The overall system availability is improved from the single-point dependency of a centralized architecture to the independent availability of each node, significantly enhancing system availability.
[0074] Existing multi-agent systems are typically API-driven, with messages flowing internally within the code and humans observing them through the API or UI. The solution provided by this invention, however, is driven by real-time communication. The group acts as the message bus, allowing users and multiple robot applications within the group to see all conversations within the same communication environment. Collaboration occurs naturally, without requiring special interfaces.
[0075] Furthermore, compared to existing multi-agent systems that use memory to store state, the message receiving directory, message sending directory, and memory file in this invention are essentially files with inherent persistence, allowing for easy recovery. Even after any robot application restarts, unprocessed messages remain stored in the message receiving directory. During debugging, the complete message stream can be viewed using the cat command. Moreover, maintenance can be achieved using standard Linux tools such as inotify, grep, and find, without relying on any message middleware.
[0076] Utilizing the decentralized multi-AI agent collaboration method provided in this embodiment, any single robot application possesses independent thinking and decision-making capabilities. In the message receiving service, the main process creates independent sub-processes for each robot application. The main process is responsible for starting, protecting, and reporting heartbeats of the sub-processes. Multiple sub-processes are responsible for actual work processing. These independent sub-processes self-organize and collaborate through an instant messaging platform. There is no central scheduler for unified scheduling, and the failure of any single robot application will not affect the normal operation of other robot applications, thus achieving decentralization. The overall system availability is improved from the single-point dependency of a centralized architecture to the independent availability of each node, significantly enhancing system availability. Compared with existing multi-agent systems, this invention implements a multi-team corporate organizational structure, innovatively setting up team isolation, a three-layer skill scope, a four-layer memory model, cross-team communication control, and a Leader mechanism. Furthermore, driven by instant messaging, users in the group and multiple robot applications can see all conversations in the same communication environment. Collaboration occurs naturally, and human users can intervene at any time, providing a deep human-machine collaborative, transparent, and controllable production environment.
[0077] Example 3 Figure 3 A flowchart illustrating a decentralized multi-AI agent collaboration method according to Embodiment 3 of the present invention is shown, as follows: Figure 3 As shown, the method includes the following steps: Step S301: Create a group for collaborative work on the project in the instant messaging platform.
[0078] The group members include users and multiple robot applications, with users specifically being human users. Specifically, the group can be created for the project as described in Example 2, which will not be repeated here.
[0079] Step S302: In response to a message sent by the message initiator in the group that mentions the target robot application, the mention field in the message is parsed to determine the identification information of the target robot application, and the target AI agent corresponding to the target robot application is determined by querying the mapping table.
[0080] During collaborative work on a project, when a group member needs other group members as collaborators, that group member can initiate a message by sending a message in the group mentioning the target collaborator. The target collaborator can then process the message accordingly to complete the collaboration.
[0081] The message initiator can include users, and can also include group members determined based on the actual operation of the project. The message initiator can be a user or a robot application. In this invention, users can intervene in any robot application at any time; that is, a human user can send a message mentioning any robot application (e.g., @any robot application) in the group at any time to intervene in that robot application. Robot applications in the group can also send messages in the group based on their collaborative relationships.
[0082] The target collaborator can include one or more group members, or even all group members. When the target collaborator is a user, it means that human user participation is required. The human user can process the message content accordingly, such as approving or publishing, and then reply to the group with the processing result. This will not be elaborated on here. When the target collaborator is a bot application, it means that the bot application needs to participate in the collaboration. For ease of distinction, this bot application will be referred to as the target bot application.
[0083] Messages can be sent to target collaborators in a group using mention features (such as the @mention function). For example, a message using @mention could be something like "@Machine1, please check the data for this account," or "@User1, please review this policy," or "@Machine1, check data; @Machine2, generate policy; @Machine3, prepare to execute," etc. Here, Machine1, Machine2, and Machine3 are the display names for robot applications 1 through 3, respectively.
[0084] Because the event subscription mechanism of instant messaging platforms does not push messages sent by one bot application to other bot applications in the same group, it means that when bot 1 @s bot 2 in the group, bot 1's message receiving channel cannot detect this message. This platform limitation makes direct collaboration between group chat-based bot applications (Bots) technically infeasible. The lack of message interoperability between bots within instant messaging platforms represents a technical barrier to achieving a decentralized collaborative architecture.
[0085] Specifically, in the instant messaging platform, bot applications cannot receive messages from other bot applications. WebSocket or event callbacks only push messages sent by human users to bot applications. If bot 1 sends a message in a group, bot 2's WebSocket connection will not receive the event for that message. This is a platform-level limitation and cannot be bypassed through configuration. The instant messaging platform's event triggering mechanism only recognizes @mentions initiated by humans. A human user @ing a bot application will trigger the bot application's event callback, but if bot 1 @s bot 2 in a group, bot 2 will not receive the mention event. Furthermore, although the message sent by bot 1 is visible to all group members, visibility does not equal reachability. Other bot applications' WebSocket connections will not push this message, and bot applications lack a real-time event mechanism to actively read group message history. Additionally, the instant messaging platform does not provide any APIs for direct communication between bot applications, nor does it offer bot application email or message queue mechanisms. Each bot application is essentially an isolated island, only able to interact with human users. Each bot application is an independent application with its own unique identifier; there is no trust relationship between bot applications, and they cannot read each other's messages or status.
[0086] To overcome the technical barriers to message communication between robot applications, this invention establishes a message bus on the server side for inter-robot applications. A direct Bot-to-Bot delivery mechanism implemented in the message sending service allows multiple AI agents to autonomously call each other. Specifically, in the Bot-to-Bot direct delivery scenario, the target robot application to be triggered is explicitly declared in the message using the `action_mentions` field. Taking robot application 1 delivering a message to robot application 2 as an example, AI agent 1 corresponding to robot application 1 writes the message into a JSON file in its message sending directory. This message contains the `action_mentions` field, which can specifically be "action_mentions: [agent_2]". The message sending service then sends this message to the instant messaging platform. When a message containing the action_mentions field is detected in the message sending directory, after the message is successfully sent to the instant messaging platform, the message is directly written to the receiving message directory under the working directory of the target AI agent (i.e., AI agent 2) corresponding to the target robot application (i.e. robot application 2), and the processing flow of the target AI agent is triggered by the trigger signal file.
[0087] Specifically, when a message initiator sends a message mentioning a target robot application in a group, if the initiator is a user, since the instant messaging platform's event subscription mechanism enables message push from human users to robot applications, the message is received through the message receiving service, the mention field in the message is parsed, and the identification information of the target robot application is determined. If the initiator is a robot application, since the instant messaging platform's event subscription mechanism cannot enable message push between robot applications, the message push needs to be based on the Bot-to-Bot direct delivery mechanism proposed in this invention. In this case, the mention field in the message in the sending message directory under the working directory of the AI agent corresponding to the robot application is parsed to determine the identification information of the target robot application.
[0088] The mention fields in the message can specifically be mention-related fields, including the `action_mentions` field, etc. The identification information of the target robot application can include its display name (i.e., `botName`) or `openId`. For example, if the mention-related field of a message is "display name 1 of robot application 1", then the identification information of the target robot application determined through parsing can include display name 1; similarly, if the mention-related field of a message is "openId2 of robot application 2", then the identification information of the target robot application determined through parsing can include openId2. After determining the identification information of the target robot application, the target AI agent corresponding to the target robot application can be determined by querying a mapping table. This mapping table is generated based on the mapping relationship between robot applications and AI agents in the configuration file.
[0089] Considering that the display names of robot applications in instant messaging platforms may change, potentially leading to unreliability in name-based routing mechanisms, this invention proposes a message routing mechanism based on openId. When the message receiving service starts, it obtains the globally unique openId of each robot application in the group via the instant messaging platform API, constructing a mapping table containing mapping rules from openId to agent_id. When a message is received from the group, the @mention in the message is parsed, the corresponding openId is extracted, and precise routing is performed by querying the mapping rules from openId to agent_id in the mapping table, thus routing to the corresponding target AI agent. If the message includes @all group members, it can be routed to the AI agent corresponding to the Leader robot application of the team to which the group belongs. If the message does not contain @mention, it may not be broadcast.
[0090] AI agents can freely initiate collaborations via @mention, forming dynamic collaboration chains, such as data analysis → strategy formulation → ad execution. This eliminates the need for pre-defined, fixed workflows, significantly enhancing collaboration flexibility. The length and form of the collaboration chain are determined by actual business needs.
[0091] In one optional implementation, an automatic collaboration (auto_collaborate) mode is also provided for Bot-to-Bot direct delivery scenarios. When "auto_collaborate": true is set in the JSON file of the sent message directory, the automatic collaboration function is enabled, and the system will automatically extract all @bot applications from the content and trigger the collaboration. For example... { "content": "@Machine 1 retrieves data @Machine 2 generates strategy @Machine 3 prepares to execute", "auto_collaborate": true } Machine 1, Machine 2, and Machine 3 are the display names of robot applications 1 to 3, respectively. These three robot applications will be triggered simultaneously, without needing to write the action_mentions field for each one individually.
[0092] This invention also proposes a two-layer anti-loop mechanism. The system maintains a hop count counter and a collaboration chain (also known as a transmission chain, scheduling chain, etc.). Loop detection is achieved through hop count thresholds (max_hops) and loop count thresholds (max_agent_revisits). This approach effectively prevents circular calls without overly restricting normal collaboration chains, ensuring a safety boundary. The hop count threshold and loop count threshold are dynamically adjusted based on team size, collaboration mode, and actual project operation. In the early stages of the project, the hop count threshold and loop count threshold can be set to conservative default values as a fallback, for example, max_hops=8, max_agent_revisits=2. As the collaboration chain lengthens, the team size increases, or the actual project operation becomes more complex, the hop count threshold and loop count threshold can be dynamically increased, for example, max_hops=10, max_agent_revisits=6.
[0093] In a specific practical application scenario, for a Bot-to-Bot direct delivery scenario, the two-layer anti-loop mechanism can be implemented through steps S303 to S304.
[0094] Step S303: Detect whether the number of jumps of the robot application in the same collaborative chain is greater than the jump threshold; if yes, proceed to step S307; if no, proceed to step S304.
[0095] The hop count threshold refers to the maximum number of hops in the entire collaboration chain, used to prevent infinite message transmission between robot applications. Each time a message is delivered directly from one bot to another, the hop count (hop_count) is incremented by 1. When the configurable hop count threshold is reached, the message is prevented from propagating further. Each time a message is passed from one robot application to another, the hop count is incremented by 1. Each message carries a collaboration chain array (chain array), which records the complete propagation path, that is, which robot applications it has passed through. The system checks whether the hop count of robot applications in the same collaboration chain is greater than the hop count threshold. Taking a hop count threshold of 8 as an example, if the hop count is greater than 8, the message is prevented from propagating further, and step S307 is executed to avoid the robot applications from passing messages to each other and forming an infinite loop. If the hop count is less than or equal to 8, step S304 is executed to perform loop detection.
[0096] Step S304: Detect whether the number of times the target robot appears in the same collaborative chain is greater than the loop count threshold; if yes, proceed to step S307; if no, proceed to step S305.
[0097] The loop count threshold refers to the maximum number of times the same robot application can appear in the same collaboration chain, used to prevent infinite loops such as "robot application 1 → robot application 2 → robot application 1 → robot application 2". The system checks whether the number of times the target robot application appears in the same collaboration chain is greater than the loop count threshold. Taking a loop count threshold of 2 as an example, if the number of times the target robot application appears in the same collaboration chain is greater than 2, then if it is greater than 2, the message is prevented from continuing to propagate, and step S307 is executed to avoid infinite loops caused by robot applications passing messages to each other. If it is less than or equal to 2, step S305 is executed, and subsequent steps continue.
[0098] Optionally, this invention also proposes a team isolation mechanism for Bot-to-Bot direct delivery scenarios, setting cross-team communication permission rules and performing verification before Bot-to-Bot delivery. The principle of the team isolation mechanism is that members within the same team can communicate freely, while cross-team communication is subject to certain restrictions. For example, robot applications from different teams cannot send messages to each other by default; only members of the same team and the technical support team can communicate freely.
[0099] If the message initiator is a robot application and the target collaborator is a target robot application, which is a Bot-to-Bot direct delivery scenario, then before scheduling the target AI agent to process the message accordingly, the cross-team communication permission rules are checked. Specifically, the can_communicate() function can be called to check whether communication is allowed between the robot application that initiated the message and the target robot application, according to the cross-team communication permission rules.
[0100] Cross-team communication permission rules are shown in Table 5. Free communication within the same team is allowed, as are bidirectional communication between the robot application Boss and the robot application Leader, and bidirectional communication between the support team and any team. Other cross-team communication is denied. Based on the verification results, it is determined whether the target AI agent is allowed to process the message accordingly.
[0101] Table 5. Cross-team communication permission rules
[0102] In this third embodiment, before step S303, the cross-team communication permission rules can be verified. If the verification result is allowed, step S303 is executed to continue the subsequent two-layer anti-loop detection. If the verification result is rejected, there is no need to perform the two-layer anti-loop detection, and the process can jump to step S307.
[0103] Step S305: The target AI agent is scheduled to process the message accordingly and obtain the processing result.
[0104] The message is written to the received message directory under the working directory of the target AI agent, and a trigger signal file is written under the shared trigger queue. Through the message receiving service, the target AI agent is scheduled to process the message according to the trigger signal file to obtain the processing result. Specifically, the message is converted into a standard format file and written to the received message (inbox) directory under the working directory of the target AI agent. This standard format file records information such as the message initiator, the group to which it is sent, the message body, and the target collaborators mentioned. Specifically, the standard format of the message may include the following fields: msg_id (unique message ID), chat_id (dialogue ID), sender (message initiator information, including user_id, name, and is_bot to determine if it is a bot application), content (message text content), mentions (list of @mentions), broadcast (whether it is broadcast), from_agent (source agent, this field is not empty when delivering directly from bot to bot), timestamp, etc.
[0105] In this invention, after writing the message to the target AI agent's received message directory, the target AI agent is not directly invoked. Instead, a trigger signal file is written to a shared trigger queue, which is essentially a shared JSON file queue. The trigger detection thread in each robot application's subprocess within the message receiving service polls the shared trigger queue. When the target robot application's subprocess detects the corresponding trigger signal file, it schedules the target AI agent to process the message accordingly and obtain the processing result. When the target robot application's subprocess detects its own trigger signal file, it processes it according to a unified message processing pipeline, including concurrency control, session resumption, and usage injection.
[0106] This invention proposes a message deduplication mechanism based on atomic file creation technology to prevent the same message from being processed twice. When any child process receives a message, a file system atomic operation (O_CREAT | O_EXCL) is used to create a corresponding tag file for the message in a shared deduplication directory. The data key of the tag file can be set according to the target AI agent's agent_id and message ID (msg_id). For example, the key can be in the format: agent_id:msg_id, which helps ensure cross-process security. The system checks if the tag file already exists. If it does, the message is not processed. In other words, the first child process to receive the message attempts to create a tag file named with the message ID as the data key. If the tag file already exists, it means that other child processes have already processed the message, so the message is ignored and does not need to be processed again. This ensures that the same message is processed only once, effectively preventing message duplication even if multiple robot application child processes receive the same message simultaneously. Furthermore, a configurable time-to-live (TTL) can be set for the tag file; the tag file is automatically cleaned up after expiration. For example, if the lifespan is set to 24 hours, the marked file will be automatically cleaned up if its lifespan exceeds 24 hours.
[0107] Considering that multiple AI agents may work simultaneously in multiple groups, it is necessary to ensure serial message processing within the same group to maintain context consistency, while allowing parallel processing between different groups to guarantee system throughput. To this end, this invention proposes a two-layer concurrency control model, enabling serial message processing for the same AI agent within the same group, and parallel processing of messages from the same AI agent in multiple groups. This two-layer concurrency control model naturally supports multi-group parallel services and has multi-group parallel scalability. Adding a new group only requires registration; no architectural modifications or additional scheduling logic are needed, and system throughput increases linearly with the number of service groups.
[0108] The first layer is the per-(agent, chat) layer for individual AI agents, used for session-level serial or parallel control. Specifically, when session resumption is enabled, messages from the same AI agent in the same group are processed serially to prevent session resume conflicts; when session resumption is disabled, configurable parallelism is allowed.
[0109] The second layer is the per-agent layer, used for parallel semaphore control at the AI agent level. Specifically, it can control a single AI agent to serve a maximum of N different groups or private chats simultaneously. The specific value of N can be customized for each individual AI agent, and when the number of objects requiring service exceeds N, it automatically queues up and waits for processing.
[0110] The specific implementation is as follows: In the first layer, a per-(agent, chat) key-value semaphore is used. When session continuation is enabled, the value is limited to 1, indicating serial processing. When session continuation is disabled, the value is configurable, used to set the allowed configurable parallelism. In the second layer, a per-agent key-value semaphore is used to limit the number of groups processing in parallel. The two layers of semaphores are nested for retrieval: the second-layer semaphore is retrieved first, followed by the first-layer semaphore; that is, the AI agent-level semaphore is retrieved first, followed by the session-level semaphore.
[0111] Because LLM calls are stateless, there is no contextual continuity between consecutive messages within the same group. To address this issue, this invention proposes a session continuation mechanism, enabling AI agents to consider the dialogue context within the same group during processing. Utilizing the resume mechanism of the LLM CLI, a mapping relationship between combined identifier information and session identifier information is maintained in the database, referred to as session mapping. The combined identifier information is obtained by combining the AI agent's identifier information and the dialogue identifier information in the message, for example, it can be (agent_id, chat_id); the session identifier information can be session_id. In other words, a session_id mapping is maintained for each (agent_id, chat_id) combination.
[0112] Upon message arrival, during the process of scheduling the target AI agent to process the message, a database query is performed based on the target AI agent's identifier and the dialogue identifier in the message to check for a corresponding unexpired session identifier. If a corresponding unexpired session identifier exists, the target AI agent is scheduled to process the message and the corresponding dialogue context using the recovery function, for example, by calling LLM with `--resume session_id`. If no corresponding unexpired session identifier exists, a new session is created. In the new session, the target AI agent is scheduled to process the message. After LLM processing is complete, `save_session(agent_id, chat_id, new_session_id)` can be executed to maintain the new session mapping.
[0113] Specifically, the database is queried to see if there is session identifier information corresponding to the combined identifier information. The combined identifier information is obtained by combining the identifier information of the target AI agent and the dialogue identifier information in the message, such as (agent_id, chat_id). If there is corresponding session identifier information, it is determined whether the session identifier information has expired based on the timeout threshold. If it has not expired, it is determined that there is corresponding unexpired session identifier information. If there is no corresponding session identifier information or the corresponding session identifier information exists but has expired, it is determined that there is no corresponding unexpired session identifier information.
[0114] In this invention, a timeout mechanism is set for session mappings to manage their expiration. For example, the session mapping records the last active timestamp; when the time since the last active timestamp exceeds a timeout threshold, the session automatically expires. After a session expires, a new session needs to be created to avoid interference from the dialogue context after the timeout. The timeout threshold is a configurable parameter, supporting both global default values and personalized configurations for individual AI agents.
[0115] Optionally, a session resume failure handling function is also set up. If the recovery function fails to be scheduled, for example, due to a corrupted session file causing the --resume call to fail, the mapping relationship between the combined identifier information and the session identifier information stored in the database is automatically cleared, and the session is retried in a stateless mode. That is, the session mapping is automatically cleared, and the scheduled target AI agent does not consider the dialogue context, but directly processes the message to ensure service availability.
[0116] In one optional implementation, the present invention can also provide visual processing status feedback for messages within a group, allowing users to intuitively see whether the target robot application has begun processing the message. Specifically, based on the processing status of the target AI agent, emoji markers corresponding to the processing status and the target robot application's identification information can be added to the message in the group.
[0117] Specifically, if the target AI agent is currently processing a message, the added emoticon can be an emoticon indicating processing, such as "typing" or "keyboard typing"; if the target AI agent is not currently processing a message, the added emoticon can be an emoticon indicating waiting for processing, such as "waiting in line"; if the target AI agent has already finished processing the message, the added emoticon can be an emoticon indicating completion, such as "task completed" or "raising hand to report". The added identifier information for the target robot application may specifically include the target robot's display name or its avatar in the group.
[0118] Figure 4 A schematic diagram of a visual processing status feedback is shown, such as... Figure 4 As shown, User 1 sends the message "@Machine2 Please help find video footage of this show that can be used for advertising" in the group. If the AI agent corresponding to Robot Application 2 is currently processing this message, then a "typing" emoji can be added to the message in the identity of Robot Application 2 to reflect that Robot Application 2 has started processing this message.
[0119] By adding emojis corresponding to the processing status and the target robot application's identifier to the original message in the group, the processing status can be fed back in the form of emojis from the perspective of the target robot application. This provides a convenient and visual feedback on the target robot application's processing status for the message, allowing users in the group to intuitively see whether the target robot application has started processing the message.
[0120] Step S306: Write the processing result to the message sending directory under the working directory of the target AI agent, and reply to the group with the processing result in the message sending directory through the message sending service.
[0121] The target AI agent (LLM process) writes the processing results to the outbox directory under the target AI agent's working directory, forming a JSON file. The message sending service can listen for write completion events (such as the IN_CLOSE_WRITE event) through inotify, and the detection latency can be less than 10 milliseconds.
[0122] When the message sending service detects a write completion event, it reads the processing results from the sent message catalog and generates a reply message that mentions the message initiator and includes the processing results. For example, it converts the mention field of the message initiator into the corresponding mention tag in the instant messaging platform, and then uses a markup language to convert the mention tag and processing results into a reply message in the form of a rich text card.
[0123] Specifically, the message sending service reads a JSON file from the outbox directory and converts the @mention text into actual @mention tags for the instant messaging platform. Then, it renders the message into a rich text card for the instant messaging platform using the lightweight markup language Markdown. Rich text cards are a message format that transcends the limitations of traditional plain text, enabling the integration of various elements such as buttons, images, segmented displays, and interactive menus.
[0124] Optionally, large language model usage statistics can be injected at a preset location (e.g., the bottom) in the reply message, so that users can easily and intuitively understand the LLM usage from the group's reply messages, facilitating cost monitoring and tracking. The large language model usage statistics reflect the resource consumption of the AI agent, and may include the number of tokens used, cost, and time consumed.
[0125] Then, the reply message is sent to the group via the instant messaging platform's interface. After the reply message is successfully sent, the processing results in the sent message directory are moved to the sent archive directory (i.e., the delivered directory).
[0126] The inotify-based file monitoring mechanism achieves message detection latency of less than 10 milliseconds, which is more than two orders of magnitude lower than the traditional polling method (usually around 2 seconds). Bot-to-Bot direct delivery bypasses the limitations of platform event subscription. The end-to-end latency of AI agent collaboration is only affected by AI inference time, and the communication link itself has almost no additional overhead, significantly reducing message delivery latency.
[0127] This invention also proposes a cross-group (i.e., cross-team) collaboration method based on a callback mechanism. If the target robot application is not included in the group, the processing result is sent back to the message initiator via the callback field, and the processing result is displayed in the group. Specifically, when the target robot application is not in the group that initiated the message, the callback field is automatically injected. For example, the callback field may include the callback_agent field and the callback_chat_id field. After the target AI agent corresponding to the target robot application completes the processing, the processing result is sent back to the message initiator via the callback_agent field and the callback_chat_id field, thus conveniently ensuring that the user can see the message processing result in the original group.
[0128] Step S307: Reject scheduling the target AI agent.
[0129] This embodiment utilizes a decentralized multi-AI agent collaboration method, where human users and robot applications communicate within the same group, with the entire process transparent and visible. A malfunction in any single robot application will not affect the normal operation of other robot applications, eliminating the need for a central scheduler for unified scheduling and achieving decentralization. The workflow and intermediate products of all robot applications are fully visible to human users within the group. Human users can intervene, ask follow-up questions, or adjust the direction of any robot application at any time by mentioning it, without waiting for the entire collaboration process to complete. This improves the transparency of human-machine collaboration, fundamentally enhancing human users' trust and sense of control over the AI system. Furthermore, an innovative Bot-to-Bot direct delivery mechanism is proposed, enabling robot applications to freely initiate collaboration through mention functions, autonomously calling each other to form dynamic collaboration chains, significantly enhancing collaboration capabilities. To enhance flexibility, the technology overcomes the technical barrier of message interoperability between robot applications. A team isolation mechanism enables cross-team communication permission management. A two-layer anti-loop mechanism is proposed, using hop count and loop count thresholds to detect loops, effectively preventing circular calls without excessively restricting normal collaboration chains, thus ensuring security boundaries. A two-layer concurrency control model and session continuation mechanism are also proposed, enabling serial message processing for the same AI agent within the same group, combined with the dialogue context within the same group. Messages from the same AI agent in multiple groups can be processed in parallel, providing multi-group parallel scalability. Furthermore, visual processing status feedback for messages is provided within groups, using emoticons to indicate processing status from the robot application's perspective, allowing users to intuitively see whether the robot application has started processing the message.
[0130] Example 4 Using the example of a project to be built—delivering overseas short drama advertisements via remote work—this invention will be described in detail. The project requires six "employees," with the following roles: one to manage the project, one to analyze data, one to formulate strategies, one to execute operations, one to create materials, and one to maintain the entire office system. Therefore, this project requires six independent robot applications that can communicate and collaborate like human users through groups on an instant messaging platform.
[0131] During the system setup process, six robot applications need to be registered one by one in the developer platform, as shown in Table 6.
[0132] Table 6. Relevant information on 6 robot applications corresponding to overseas short drama advertising projects.
[0133] After each robot application is created, the developer platform will assign an appId, appSecret, and openId to each robot application; at the same time, long connection mode needs to be enabled to keep a constantly open communication channel between the robot application and the server, so that messages can be received in real time without having to refresh and check repeatedly.
[0134] All robot application information, the mapping relationship between robot applications and AI agents, and the project's team structure information are written into a unified configuration file. This configuration file can record the robot application's profile information and team structure information. The robot application's profile information records the robot application's various identifiers, roles, and the working directory path of the corresponding AI agent. The team structure information records which robot applications belong to the "Overseas Short Drama Advertising Placement" team, which robot application is the team leader, which group the team is linked to, and which robot application belongs to the basic platform team (capable of serving all robot applications across teams).
[0135] On the server side, a working directory is configured for the AI agent corresponding to each robot application. The working directory contains a role description file (CLAUDE.md), a message receiving directory (inbox), a message sending directory (outbox), and a memory file (memory).
[0136] Start system services. System services include message receiving service and message sending service, and may also include scheduled task service and management panel service.
[0137] Through the above configuration steps, the six robot applications were successfully launched and can now collaborate within the group. A complete collaboration process involves a user submitting a request to the ad going live. The following real-world application scenario illustrates how the robot applications work together in a relay-style collaboration.
[0138] Scenario: A human user, acting as an advertising manager, wants to place ads for a newly launched English short drama on a social media platform.
[0139] Act 1: The user issues a request (second 0).
[0140] The campaign manager sent a message in a group chat on the instant messaging platform: @Machine1 Please help me create a set of ads on a social media platform for the drama ID 12345 (in English). The daily budget is... Yuan, target National Market Once this message is sent via an instant messaging platform, a series of automated processes will follow.
[0141] Act 2: A decentralized multi-AI agent collaborative system identifies and delivers messages (seconds 0-1).
[0142] The message receiving service completes the following actions in milliseconds: Identifying the target collaborator: The message contains the mention "@machine1". The system uses machine1's openId (unique identifier) to determine that the message was sent to machine1.
[0143] Message deduplication is performed using atomic file creation technology to prevent the same message from being processed twice. The first child process to receive the message attempts to create a tag file named with the message ID as the data key. If the tag file already exists, it means that other child processes have already processed the message, so the message is ignored and does not need to be processed again.
[0144] Write to Received Message Directory: Convert the message into a standard format file and place it in the inbox directory of Machine 1. The file content includes: message initiator information, which group it was sent to, the message body, and the target collaborators mentioned.
[0145] AI Processing Initiation: The AI program corresponding to Trigger 1 begins operation. A sophisticated two-layer queuing mechanism is provided through a two-layer concurrency control model. The first layer ensures that messages within the same group are processed sequentially, with a session continuation mechanism to guarantee that continuous dialogues within the same group can share the same dialogue context memory. The second layer allows messages from different groups to be processed simultaneously; the maximum number of messages that can be processed concurrently can be controlled through configuration.
[0146] Act 3: Machine 1 analyzes requirements and assigns tasks (seconds 1-30) After the AI program on machine 1 (which may be based on the Claude large language model) starts: (1) Read messages: Open the files in the inbox directory to understand the user's needs.
[0147] (2) Search tools: What “skills” are available in the search system? Skills are pre-written toolkits, such as “ad creation skills” and “data query skills”.
[0148] (3) Formulate a plan: The AI agent corresponding to Machine 1 determines that this task requires the cooperation of multiple roles and determines the order of cooperation: for example, the first step is to let Machine 2 query the program information and available advertising materials, the second step is to let Machine 3 formulate the placement strategy based on the data, and the third step is to let Machine 4 execute the advertising creation according to the strategy.
[0149] (4) Sending a collaboration request: The AI agent corresponding to Machine 1 writes a file in its own outbox directory with the content roughly meaning "@Machine 2 Please query the basic information and available materials of drama ID 12345". Among them, the file contains a special field called action_mentions, which is filled with the identification information of Machine 2. This field means: "Not only mentioning Machine 2 in the message, but also requesting the system to automatically deliver this message to Machine 2 so that it can start working".
[0150] Machine 1 will perform orchestration work when needed, but it is itself a regular AI agent and not a privileged component of the system.
[0151] Act 4: Message sending and automatic transfer between robot applications (30-35 seconds).
[0152] The message sending service detected a new file in the outbox directory of the AI agent corresponding to machine 1. The detection delay was less than 10 milliseconds, which was almost instantaneous.
[0153] Outbound transmission: (1) Convert the message content from plain text to rich text card format. Rich text cards can contain colored titles, tables, etc.
[0154] (2) Convert the “@machine2” text in the message into the actual @ mention in the instant messaging platform, so that a red dot reminder can appear next to the machine2 avatar.
[0155] (3) Use the identity of machine 1, for example, use its appId and appSecret to obtain a temporary token, and call the interface of the instant messaging platform to send the message to the group.
[0156] (4) Attach a line of text at the bottom of the message to reflect the usage statistics of the large language model, showing how much resources were consumed in this AI processing, such as how many words were processed, how much cost was consumed, and how long it took.
[0157] Transfer between robot applications: After the message is successfully sent, if the system detects that the message contains the `action_mentions` field, it will initiate the bot-to-bot direct delivery process: (1) Permission check, i.e., verifying cross-team communication permission rules: The can_communicate() function can be called to check whether communication between machine 1 and machine 2 is allowed according to the cross-team communication permission rules. After checking, it was found that both machine 1 and machine 2 belong to the "Overseas Short Drama Advertising Placement" team, and permission was granted.
[0158] (2) Two-layer anti-loop check: The system maintains a hop count counter and a collaboration chain. Each time a message is passed from one robot application to another, the hop count is incremented by one. Each message carries a collaboration chain array, which records which robot applications it has passed through. If the number of hops of a robot application in the same collaboration chain is greater than the hop count threshold, or the number of times the same robot application appears in the same collaboration chain is greater than the loop count threshold, the message transmission is blocked to prevent robot applications from passing each other and forming an infinite loop.
[0159] (3) Delivering messages: Write the message into a file and put it into the inbox directory of the AI agent corresponding to Machine 2. At the same time, write a trigger signal file into the shared trigger queue to notify the message receiving service: "There is a new message waiting for Machine 2 to process".
[0160] (4) Status feedback: Add an emoji to the original message in the group as if it were machine 2 to indicate that it is being processed, so that users in the group can see that machine 2 has started processing.
[0161] Act 5: Machine 2 queries data (seconds 35-90).
[0162] Machine 2's AI program starts, reads messages from the inbox directory, and begins working: (1) Query program information: Call the script of the "program information query" skill to obtain the basic information of the program, such as name, language, and category, through the API interface configured during system construction.
[0163] (2) Search for available materials: Call the script of the "Material Search" skill to find video materials of this show that can be used for advertising in the material library.
[0164] (3) Passing to the next robot application: Write the query results to its own outbox directory and specify machine 3 in the action_mentions field to trigger machine 3 to take over. The system executes the outgoing and Bot to Bot direct delivery process again (90~95 seconds). This time the collaboration chain becomes: machine 1 → machine 2 → machine 3, with 2 jumps.
[0165] Act 6: Machine 3 formulates its deployment strategy (seconds 95-180).
[0166] Machine 3's AI program receives data from Machine 2 and, combined with historical campaign cases and lessons learned stored in the system's knowledge base, formulates a detailed campaign plan: how to organize the advertising, how many groups to divide a large advertising campaign into; what kind of audience each group targets, and what the age, region, and interests of each group are; how to allocate the budget; what creative materials to use for each group of ads, and what their creative IDs are; and when to start the campaign, etc.
[0167] After machine 3 finishes writing the strategy, it writes a message in the outbox directory, specifying machine 4 to take over. The collaboration chain is extended to: machine 1 → machine 2 → machine 3 → machine 4, with a jump count of 3.
[0168] Act 7: Machine 4 Execution Creation (180-300 seconds).
[0169] The AI program on machine 4 receives the strategy from machine 3 and begins actual operation: (1) First, conduct a simulation test: Call the "Ad Creation" skill, but add a "dry-run" mode, which means "prepare and verify all parameters, but do not actually submit". This allows you to check if the parameters are correct without actually spending the budget.
[0170] (2) Create the ad after the simulation is passed: Create the ad in the "pause" state, that is, the ad has been created on the ad platform, but the budget has not yet been spent to run it, and it is waiting for the final confirmation from human users.
[0171] (3) Report the results in the group: Machine 4 sends a message to the group, listing the detailed information of the creation results: ad number, budget amount, target region, ad account information, landing page configuration, etc., and asks human users to confirm whether to start.
[0172] This message does not include the action_mentions field because Machine 4 does not need to pass it on to other robot applications; instead, it needs to wait for the human user to make further decisions.
[0173] Act 8: Human users identified, advertisement launched (300-360 seconds).
[0174] The human user, acting as the campaign manager, saw Machine 4's report in the group, confirmed it was correct, and replied "Confirm Startup".
[0175] This confirmation message is routed to Machine 4 again via the message receiving service. Because of the system's session continuation mechanism, Machine 4's AI program can continue the memory of the previous conversation, and Machine 4 can know that the "confirm launch" mentioned by the human user refers to the batch of advertisements that were just created.
[0176] Machine 4 calls the advertising platform's interface to switch the advertising status from "paused" to "running".
[0177] This concludes a complete multi-Bot collaboration process. Figure 5 The diagram illustrates a collaborative workflow for an advertising delivery scenario according to Embodiment 4 of the present invention. From the user submitting a request to the advertisement going live, the entire process takes approximately 6 minutes, requiring only one confirmation from the human user at the final step. Furthermore, the human user can intervene, ask follow-up questions, or adjust the direction at any time by @ing any robot application, without waiting for the entire collaborative process to end, greatly improving the transparency of human-machine collaboration.
[0178] Example 5 Embodiment 5 of the present invention provides a non-volatile storage medium storing at least one executable instruction that can execute the decentralized multi-AI agent collaboration method in any of the above method embodiments.
[0179] Specifically, the executable instructions can be used to cause the processor to perform the following operations: create a group for collaborative work on a project in an instant messaging platform, the group members including users and multiple robot applications; in response to a message sent by the message initiator in the group mentioning the target robot application, determine the target AI agent corresponding to the target robot application, schedule the target AI agent to process the message accordingly, and obtain the processing result; and have the target robot application reply to the group with the processing result.
[0180] In one alternative implementation, the message initiator includes group members determined based on the actual operation of the project.
[0181] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: acquire project setup planning information, analyze the project setup planning information, determine the robot applications required for the project and the responsibilities of each robot application; configure each robot application, the mapping relationship between robot applications and AI agents, and the team structure information of the project in the developer platform to form a configuration file, and configure the working directory of each AI agent and set the corresponding skills; in the instant messaging platform, add the robot applications and users required for the project as group members, create a group for collaborative work for the project, and register the group to the configuration file; start system services, wherein the system services include message receiving services and message sending services.
[0182] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: analyze the project setup planning information, determine the number of roles in the workflow, and break down the responsibilities corresponding to the project; determine the number of robot applications required for the project based on the number of roles, the collaboration and cohesion relationships between responsibilities, and the operational isolation requirements, and divide the responsibilities of each robot application.
[0183] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: create a corresponding working directory for each AI agent, and configure a role description file, a message receiving directory, a message sending directory, and a memory file in the working directory; wherein, the role description file records the identity design information and responsibilities, tool routing table, response rules, collaboration matrix, and security management information of the robot application corresponding to the AI agent.
[0184] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: configure the scheduler's timed tasks based on the project setup planning information.
[0185] In one alternative implementation, the main process in the message receiving service creates an independent sub-process for each robot application; the main process is the entry process for the message receiving service; and each sub-process runs a corresponding message processing loop, trigger detection thread, and concurrency control semaphore.
[0186] In an optional implementation, the executable instructions further cause the processor to perform the following operations: during the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, initializes the concurrent queue status file, and starts the response timeout monitoring mechanism; creates an independent child process for each robot application, and establishes an independent long connection to the instant messaging platform within each child process; polls to check the liveness status of each child process, and if any robot application's child process exits abnormally, the main process recreates a child process for that robot application.
[0187] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: monitor the heartbeat of the main process, and if the main process has an abnormal heartbeat, restart the message receiving service.
[0188] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: monitor the modification timestamps of the configuration file by the main process, and log when a change to the configuration file is detected.
[0189] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: in response to a message sent by the message initiator in a group that mentions the target robot application, parse the mention field in the message, determine the identification information of the target robot application, and determine the target AI agent corresponding to the target robot application by querying a mapping table; wherein the mapping table is generated based on the mapping relationship between robot applications and AI agents in the configuration file.
[0190] In one optional implementation, the executable instructions further cause the processor to perform the following operations: if the message initiator is a user, then receive the message through the message receiving service, parse the mention fields in the message, and determine the identification information of the target robot application; if the message initiator is a robot application, then parse the mention fields in the messages in the message sending directory under the working directory of the AI agent corresponding to the robot application, and determine the identification information of the target robot application.
[0191] In an optional implementation, the executable instructions further cause the processor to perform the following operations: write the message to the received message directory under the working directory of the target AI agent, and write the trigger signal file under the shared trigger queue; through the message receiving service, schedule the target AI agent to perform corresponding processing according to the message based on the trigger signal file, and obtain the processing result.
[0192] In an alternative implementation, the executable instructions further cause the processor to perform the following operations: the trigger detection thread in the subprocess of each robot application in the message receiving service polls the shared trigger queue; when the subprocess of the target robot application detects the corresponding trigger signal file, the target AI agent is scheduled to process the message accordingly to obtain the processing result.
[0193] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: when any child process receives a message, use file system atomic operations to create a corresponding tag file for the message in the shared deduplication directory; determine whether the tag file already exists, and if so, do not process the message.
[0194] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: if the message initiator is a robot application, then before scheduling the target AI agent to process the message accordingly, verify the cross-team communication permission rules; and based on the verification result, determine whether to allow the target AI agent to process the message accordingly.
[0195] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: detect whether the number of jumps of the robot application in the same collaborative chain is greater than a jump threshold; if so, refuse to schedule the target AI agent; if not, schedule the target AI agent to process the message accordingly.
[0196] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: detect whether the number of times the target robot application appears in the same collaborative chain is greater than the loop count threshold; if so, refuse to schedule the target AI agent; if not, schedule the target AI agent to process the message accordingly.
[0197] In one alternative implementation, the hop count threshold and loop count threshold are dynamically adjusted based on team size, collaboration mode, and actual project performance.
[0198] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: adding an emoji tag corresponding to the processing status of the message and the identification information of the target robot application to the message in the group, based on the processing status of the target AI agent.
[0199] In one optional implementation, the executable instructions further cause the processor to perform the following operations: query the database to see if there is a corresponding unexpired session identifier based on the identifier information of the target AI agent and the dialogue identifier information in the message; if there is a corresponding unexpired session identifier, schedule the target AI agent to perform corresponding processing according to the dialogue context corresponding to the message and the session identifier information using the recovery function based on the session identifier information; if there is no corresponding unexpired session identifier, create a new session, and schedule the target AI agent to perform corresponding processing according to the message in the new session.
[0200] In one optional implementation, the executable instructions further cause the processor to perform the following operations: query the database to see if there is session identification information corresponding to the combined identification information; the combined identification information is obtained by combining the identification information of the target AI agent and the dialogue identification information in the message; if there is corresponding session identification information, determine whether the session identification information has expired based on the timeout threshold; if it has not expired, determine that there is corresponding unexpired session identification information; if there is no corresponding session identification information or there is corresponding session identification information but it has expired, determine that there is no corresponding unexpired session identification information.
[0201] In an alternative implementation, the executable instructions further cause the processor to perform the following operations: if the recovery function scheduling fails, clear the mapping between the combined identification information and the session identification information stored in the database, and retry in a stateless mode.
[0202] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: write the processing result to the sending message directory under the working directory of the target AI agent; and reply to the group with the processing result in the sending message directory via a message sending service.
[0203] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: when the message sending service listens for a write completion event, the message sending service reads the processing results in the sent message directory and generates a reply message that mentions the message initiator and contains the processing results; the reply message is sent to the group through the interface of the instant messaging platform; after the reply message is successfully sent, the processing results in the sent message directory are moved to the sent archive directory.
[0204] In one alternative implementation, the executable instructions further cause the processor to perform the following operations: convert the mention field of the mention message initiator into the corresponding mention tag in the instant messaging platform, and convert the mention tag and processing result into a reply message in the form of a rich text card using a markup language; and inject large language model usage statistics at a preset position in the reply message.
[0205] In an alternative implementation, the executable instructions further cause the processor to perform the following operations: if the group does not contain the target robot application, the processing result is sent back to the message initiator via a callback field, and the processing result is displayed in the group.
[0206] Example 6 Figure 6 The diagram shows a structural schematic of a computing device according to Embodiment Six of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computing device.
[0207] like Figure 6 As shown, the computing device may include: a processor 602, a communications interface 604, a memory 606, and a communications bus 608.
[0208] in: The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608.
[0209] Communication interface 604 is used to communicate with other network elements such as clients or other servers.
[0210] The processor 602 is used to execute program 610, specifically to execute the relevant steps in the above-described decentralized multi-AI agent collaboration method embodiment.
[0211] Specifically, program 610 may include program code that includes computer operation instructions.
[0212] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computing device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0213] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0214] Specifically, program 610 can be used to cause processor 602 to perform the following operations: create a group for collaborative work for a project in an instant messaging platform, the group members including users and multiple robot applications; in response to a message sent by the message initiator in the group mentioning the target robot application, determine the target AI agent corresponding to the target robot application, schedule the target AI agent to process the message accordingly, and obtain the processing result; and have the target robot application reply to the group with the processing result.
[0215] In one alternative implementation, the message initiator includes group members determined based on the actual operation of the project.
[0216] In an optional implementation, program 610 further causes processor 602 to perform the following operations: acquire project setup planning information, analyze the project setup planning information, determine the robot applications required for the project and the responsibilities of each robot application; configure each robot application, the mapping relationship between robot applications and AI agents, and the team structure information of the project in the developer platform to form a configuration file, and configure the working directory of each AI agent and set the corresponding skills; in the instant messaging platform, add the robot applications and users required for the project as group members, create a group for collaborative work for the project, and register the group to the configuration file; start system services, wherein the system services include message receiving service and message sending service.
[0217] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: analyze project setup planning information, determine the number of roles in the workflow, and break down the responsibilities corresponding to the project; determine the number of robot applications required for the project based on the number of roles, the collaboration and cohesion relationships between responsibilities, and the operational isolation requirements, and divide the responsibilities of each robot application.
[0218] In an optional implementation, program 610 further causes processor 602 to perform the following operations: create a corresponding working directory for each AI agent, and configure a role description file, a message receiving directory, a message sending directory, and a memory file in the working directory; wherein, the role description file records the identity design information and responsibilities, tool routing table, response rules, collaboration matrix, and security management information of the robot application corresponding to the AI agent.
[0219] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: configure the scheduler's timed tasks based on project construction planning information.
[0220] In one alternative implementation, the main process in the message receiving service creates an independent sub-process for each robot application; the main process is the entry process for the message receiving service; and each sub-process runs a corresponding message processing loop, trigger detection thread, and concurrency control semaphore.
[0221] In an optional implementation, program 610 further causes processor 602 to perform the following operations: during the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, initializes the concurrent queue status file, and starts the response timeout monitoring mechanism; creates an independent child process for each robot application, and establishes an independent long connection to the instant messaging platform within each child process; polls and checks the liveness status of each child process, and if any robot application's child process exits abnormally, the main process recreates the child process for that robot application.
[0222] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: monitor the heartbeat of the main process, and if the main process has an abnormal heartbeat, restart the message receiving service.
[0223] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: monitor the modification timestamps of the configuration file by the main process, and log when a change in the configuration file is detected.
[0224] In an optional implementation, program 610 further causes processor 602 to perform the following operations: in response to a message sent by the message initiator in a group mentioning the target robot application, parse the mention field in the message, determine the identification information of the target robot application, and determine the target AI agent corresponding to the target robot application by querying a mapping table; wherein the mapping table is generated based on the mapping relationship between robot applications and AI agents in the configuration file.
[0225] In an optional implementation, program 610 further causes processor 602 to perform the following operations: if the message initiator is a user, then receive the message through the message receiving service, parse the mention fields in the message, and determine the identification information of the target robot application; if the message initiator is a robot application, then parse the mention fields in the message sent in the working directory of the AI agent corresponding to the robot application, and determine the identification information of the target robot application.
[0226] In an optional implementation, program 610 further causes processor 602 to perform the following operations: write the message to the received message directory under the working directory of the target AI agent, and write the trigger signal file under the shared trigger queue; through the message receiving service, schedule the target AI agent to perform corresponding processing according to the message based on the trigger signal file, and obtain the processing result.
[0227] In an optional implementation, program 610 further causes processor 602 to perform the following operations: trigger detection threads in the subprocesses of each robot application in the message receiving service poll the shared trigger queue; when the subprocess of the target robot application detects the corresponding trigger signal file, the target AI agent is scheduled to process the message accordingly to obtain the processing result.
[0228] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: when any child process receives a message, it uses file system atomic operations to create a corresponding tag file for the message in a shared deduplication directory; it determines whether the tag file already exists, and if so, it does not process the message.
[0229] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: if the message initiator is a robot application, then before scheduling the target AI agent to process the message accordingly, verify the cross-team communication permission rules; and based on the verification result, determine whether to allow the target AI agent to process the message accordingly.
[0230] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: detect whether the number of jumps of the robot application in the same collaboration chain is greater than the number of jumps threshold; if so, refuse to schedule the target AI agent; if not, schedule the target AI agent to process the message accordingly.
[0231] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: detect whether the number of times the target robot application appears in the same collaborative chain is greater than the loop count threshold; if so, refuse to schedule the target AI agent; if not, schedule the target AI agent to process the message accordingly.
[0232] In one alternative implementation, the hop count threshold and loop count threshold are dynamically adjusted based on team size, collaboration mode, and actual project performance.
[0233] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: adding emoticons corresponding to the processing status and identification information of the target robot application to the message in the group, based on the processing status of the target AI agent.
[0234] In an optional implementation, program 610 further causes processor 602 to perform the following operations: querying the database for corresponding unexpired session identification information based on the identification information of the target AI agent and the dialogue identification information in the message; if corresponding unexpired session identification information exists, then scheduling the target AI agent to perform corresponding processing based on the dialogue context corresponding to the message and session identification information using the recovery function based on the session identification information; if no corresponding unexpired session identification information exists, then creating a new session, and scheduling the target AI agent to perform corresponding processing based on the message in the new session.
[0235] In an optional implementation, program 610 further causes processor 602 to perform the following operations: querying the database to see if there is session identifier information corresponding to the combined identifier information; the combined identifier information is obtained by combining the identifier information of the target AI agent and the dialogue identifier information in the message; if there is corresponding session identifier information, then determining whether the session identifier information has expired based on the timeout threshold; if it has not expired, then determining that there is corresponding unexpired session identifier information; if there is no corresponding session identifier information or there is corresponding session identifier information but it has expired, then determining that there is no corresponding unexpired session identifier information.
[0236] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: if the recovery function scheduling fails, clear the mapping relationship between the combined identification information and the session identification information stored in the database, and retry in stateless mode.
[0237] In an optional implementation, program 610 further causes processor 602 to perform the following operations: write the processing result to the sending message directory under the working directory of the target AI agent; and reply to the group with the processing result in the sending message directory via a message sending service.
[0238] In an optional implementation, program 610 further causes processor 602 to perform the following operations: when the message sending service listens for a write completion event, the message sending service reads the processing results in the sent message directory and generates a reply message that mentions the message initiator and contains the processing results; the reply message is sent to the group through the interface of the instant messaging platform; after the reply message is successfully sent, the processing results in the sent message directory are moved to the sent archive directory.
[0239] In an optional implementation, program 610 further causes processor 602 to perform the following operations: convert the mention field of the mention message initiator into the corresponding mention tag in the instant messaging platform, and convert the mention tag and processing result into a reply message in the form of a rich text card using a markup language; inject large language model usage statistics at a preset position in the reply message.
[0240] In an alternative implementation, program 610 further causes processor 602 to perform the following operations: if the group does not contain the target robot application, the processing result is sent back to the message initiator via a callback field, and the processing result is displayed in the group.
[0241] The specific implementation of each step in procedure 610 can be found in the description of the corresponding steps in the above-described decentralized multi-AI agent collaboration embodiment, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process description in the aforementioned method embodiment, and will not be repeated here.
[0242] The solution provided in this embodiment enables AI agents to work collaboratively with users in the same communication environment, realizing decentralized multi-AI agent collaboration. The failure of any single robot application will not affect the normal operation and collaboration of other robot applications. At the same time, users can understand the processing between robot applications, realizing the transparency of the collaboration process.
[0243] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0244] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0245] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0246] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0247] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0248] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0249] This invention discloses: A1. A decentralized multi-AI agent collaboration method, comprising: Create groups for collaborative work on projects within an instant messaging platform; group members include users and multiple bot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is determined, and the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result. The target robot application then replies the processing result to the group.
[0250] A2. According to the method described in A1, wherein the message initiator includes group members determined based on the actual operation of the project.
[0251] A3. According to the method described in A1, the step of creating a group for collaborative work in an instant messaging platform further includes: Obtain project setup planning information, analyze the project setup planning information, and determine the robot applications required for the project and the responsibilities of each robot application; Configure each robot application, the mapping relationship between robot applications and AI agents, and the team structure information of the project in the developer platform to form a configuration file, and configure the working directory of each AI agent and set the corresponding skills; In the instant messaging platform, the robot applications and users required for the project are included as group members, a group for collaborative work is created for the project, and the group is registered to the configuration file; Start the system services, which include message receiving service and message sending service.
[0252] A4. According to the method described in A3, the step of analyzing the project construction planning information to determine the robot applications required for the project and the responsibilities of each robot application further includes: Analyze the project setup planning information to determine the number of roles in the workflow and break down the responsibilities corresponding to the project; Based on the number of roles, the collaborative and cohesive relationships between responsibilities, and the operational isolation requirements, determine the number of robot applications required for the project and assign responsibilities to each robot application.
[0253] A5. According to the method described in A3, configuring the working directory for each AI agent further includes: Create a corresponding working directory for each AI agent, and configure a role description file, a message receiving directory, a message sending directory, and a memory file in the working directory; The role description file records the identity design information and responsibilities of the robot application corresponding to the AI agent, as well as the tool routing table, response rules, collaboration matrix, and security management information.
[0254] A6. According to the method described in A3, after registering the group to the configuration file, the method further includes: Configure the scheduler's scheduled tasks based on the project setup plan information.
[0255] A7. The method according to any one of A3-A6, wherein, in the message receiving service, the main process creates an independent sub-process for each robot application; the main process is the entry process of the message receiving service; and each sub-process runs a corresponding message processing loop, a trigger detection thread, and a concurrent control semaphore.
[0256] A8. The method according to A7 further includes: During the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, initializes the concurrent queue status file, and starts the response timeout monitoring mechanism. Create an independent subprocess for each robot application, and establish an independent long connection to the instant messaging platform within each subprocess; The system polls and checks the liveness status of each child process. If any child process of the robot application exits abnormally, the main process will recreate the child process for that robot application.
[0257] A9. The method according to A7 or A8 further includes: The main process is monitored for heartbeat. If the main process has an abnormal heartbeat, the message receiving service is restarted.
[0258] A10. The method according to any one of A7-A9, the method further comprising: The main process monitors the modification timestamps of the configuration file and logs changes when changes are detected.
[0259] A11. The method according to any one of A1-A10, wherein determining the target AI agent corresponding to the target robot application in response to a message mentioning the target robot application sent by the message initiator in the group further comprises: In response to a message sent by the message initiator in the group that mentions the target robot application, the mention field in the message is parsed to determine the identification information of the target robot application, and the target AI agent corresponding to the target robot application is determined by querying the mapping table; The mapping table is generated based on the mapping relationship between robot applications and AI agents in the configuration file.
[0260] A12. According to the method described in A11, the step of parsing the mention field in the message to determine the identification information of the target robot application further includes: If the message initiator is a user, the message is received through the message receiving service, the mention fields in the message are parsed, and the identification information of the target robot application is determined; If the message initiator is a robot application, then the mention fields in the message in the sending message directory under the working directory of the AI agent corresponding to the robot application are parsed to determine the identification information of the target robot application.
[0261] A13. According to any one of A1-A12, the step of scheduling the target AI agent to perform corresponding processing based on the message to obtain a processing result further includes: The message is written to the received message directory under the working directory of the target AI agent, and a trigger signal file is written under the shared trigger queue. The target AI agent is scheduled to perform corresponding processing based on the message according to the trigger signal file through the message receiving service, and the processing result is obtained.
[0262] A14. According to the method described in A13, the step of scheduling the target AI agent to perform corresponding processing based on the message according to the trigger signal file via the message receiving service to obtain the processing result further includes: The shared trigger queue is polled by the trigger detection thread in the subprocess of each robot application in the message receiving service. When the subprocess of the target robot application detects the corresponding trigger signal file, the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result.
[0263] A15. The method according to A14 further includes: When any child process receives a message, it uses file system atomic operations to create a corresponding tag file for the message in the shared deduplication directory. Determine whether the tag file already exists; if so, do not process the message.
[0264] A16. The method according to any one of A1-A15, the method further comprising: If the message initiator is a robot application, then before scheduling the target AI agent to process the message accordingly, the cross-team communication permission rules are verified. Based on the verification results, determine whether to allow the target AI agent to process the message accordingly.
[0265] A17. The method according to any one of A1-A16, wherein before scheduling the target AI agent to perform corresponding processing according to the message, the method further comprises: Detect whether the number of jumps in the robot application within the same collaboration chain exceeds the jump threshold; If so, then the target AI agent will not be scheduled. If not, the target AI agent is scheduled to process the message accordingly.
[0266] A18. The method according to any one of A1-A16, wherein before scheduling the target AI agent to perform corresponding processing according to the message, the method further comprises: Detect whether the number of times the target robot appears in the same collaborative chain is greater than the loop count threshold; If so, then the target AI agent will not be scheduled. If not, the target AI agent is scheduled to process the message accordingly.
[0267] A19. As described in A17 or A18, wherein the hop count threshold and loop count threshold are dynamically adjusted based on team size, collaboration mode, and actual project operation.
[0268] A20. The method according to any one of A1-A19, the method further comprising: Based on the processing status of the message by the target AI agent, add an emoji tag corresponding to the processing status and the identification information of the target robot application to the message in the group.
[0269] A21. The method according to any one of A1-A20, wherein scheduling the target AI agent to perform corresponding processing based on the message further includes: Based on the identification information of the target AI agent and the dialogue identification information in the message, query the database to see if there is any corresponding non-expired session identification information; If there is a corresponding non-expired session identifier, then based on the session identifier, the recovery function is used to schedule the target AI agent to perform corresponding processing according to the message and the dialogue context corresponding to the session identifier; If no corresponding unexpired session identifier exists, a new session is created. In the new session, the target AI agent is scheduled to process the message accordingly.
[0270] A22. According to the method described in A21, the step of querying the database for corresponding unexpired session identifier information based on the identifier information of the target AI agent and the dialogue identifier information in the message further includes: The database is queried to determine whether there is session identifier information corresponding to the combined identifier information; the combined identifier information is obtained by combining the identifier information of the target AI agent and the dialogue identifier information in the message. If a corresponding session identifier exists, determine whether the session identifier has expired based on the timeout threshold. If it has not expired, it is determined that there is a corresponding unexpired session identifier. If no corresponding session identifier information exists, or if corresponding session identifier information exists but has expired, then it is determined that no corresponding unexpired session identifier information exists.
[0271] A23. The method according to A22 further includes: If the recovery function scheduling fails, the mapping relationship between the combined identifier information and the session identifier information stored in the database is cleared, and the process is retried in stateless mode.
[0272] A24. The method according to any one of A1-A23, wherein the step of the target robot application replying the processing result to the group further comprises: The processing result is written to the message sending directory under the working directory of the target AI agent; The processing results from the message sending catalog are sent back to the group via the message sending service.
[0273] A25. According to the method described in A24, the step of replying the processing result in the message catalog to the group via the message sending service further includes: When the message sending service detects a write completion event, it reads the processing results from the message sending directory and generates a reply message that mentions the message initiator and contains the processing results. The reply message is sent to the group through the interface of the instant messaging platform; After the reply message is successfully sent, the processing results in the sent message directory are moved to the sent archive directory.
[0274] A26. According to the method in A25, generating a reply message that mentions the message initiator and includes the processing result further includes: The mention field that mentions the message initiator is converted into the corresponding mention tag in the instant messaging platform, and the mention tag and the processing result are converted into a rich text card-style reply message using a markup language; Large language model usage statistics are injected at a preset location in the response message.
[0275] A27. The method according to any one of A1-A26, wherein the step of the target robot application replying the processing result to the group further comprises: If the target robot application is not included in the group, the processing result is sent back to the message initiator via a callback field, and the processing result is displayed in the group.
[0276] B28. A computing device, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the following operations: Create groups for collaborative work on projects within an instant messaging platform; group members include users and multiple bot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is determined, and the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result. The target robot application then replies the processing result to the group.
[0277] B29. The computing device according to B28, wherein the message initiator includes group members determined based on the actual operation of the project.
[0278] B30. The computing device according to B28, wherein the executable instructions further cause the processor to perform the following operations: Obtain project setup planning information, analyze the project setup planning information, and determine the robot applications required for the project and the responsibilities of each robot application; Configure each robot application, the mapping relationship between robot applications and AI agents, and the team structure information of the project in the developer platform to form a configuration file, and configure the working directory of each AI agent and set the corresponding skills; In the instant messaging platform, the robot applications and users required for the project are included as group members, a group for collaborative work is created for the project, and the group is registered to the configuration file; Start the system services, which include message receiving service and message sending service.
[0279] B31. The computing device according to B30, wherein the executable instructions further cause the processor to perform the following operations: Analyze the project setup planning information to determine the number of roles in the workflow and break down the responsibilities corresponding to the project; Based on the number of roles, the collaborative and cohesive relationships between responsibilities, and the operational isolation requirements, determine the number of robot applications required for the project and assign responsibilities to each robot application.
[0280] B32. The computing device according to B30, wherein the executable instructions further cause the processor to perform the following operations: Create a corresponding working directory for each AI agent, and configure a role description file, a message receiving directory, a message sending directory, and a memory file in the working directory; The role description file records the identity design information and responsibilities of the robot application corresponding to the AI agent, as well as the tool routing table, response rules, collaboration matrix, and security management information.
[0281] B33. The computing device according to B30, wherein the executable instructions further cause the processor to perform the following operations: Configure the scheduler's scheduled tasks based on the project setup plan information.
[0282] B34. The computing device according to any one of B30-B33, wherein in the message receiving service, a main process creates an independent sub-process for each robot application; the main process is the entry process of the message receiving service; and each sub-process runs a corresponding message processing loop, a trigger detection thread, and a concurrency control semaphore.
[0283] B35. The computing device according to B34, wherein the executable instructions further cause the processor to perform the following operations: During the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, initializes the concurrent queue status file, and starts the response timeout monitoring mechanism. Create an independent subprocess for each robot application, and establish an independent long connection to the instant messaging platform within each subprocess; The system polls and checks the liveness status of each child process. If any child process of the robot application exits abnormally, the main process will recreate the child process for that robot application.
[0284] B36. In the computing device according to B34 or B35, the executable instructions further cause the processor to perform the following operations: The main process is monitored for heartbeat. If the main process has an abnormal heartbeat, the message receiving service is restarted.
[0285] B37. The computing device according to any one of B34-B36, wherein the executable instructions further cause the processor to perform the following operations: The main process monitors the modification timestamps of the configuration file and logs changes when changes are detected.
[0286] B38. The computing device according to any one of B28-B37, wherein the executable instructions further cause the processor to perform the following operations: In response to a message sent by the message initiator in the group that mentions the target robot application, the mention field in the message is parsed to determine the identification information of the target robot application, and the target AI agent corresponding to the target robot application is determined by querying the mapping table; The mapping table is generated based on the mapping relationship between robot applications and AI agents in the configuration file.
[0287] B39. The computing device according to B38, wherein the executable instructions further cause the processor to perform the following operations: If the message initiator is a user, the message is received through the message receiving service, the mention fields in the message are parsed, and the identification information of the target robot application is determined; If the message initiator is a robot application, then the mention fields in the message in the sending message directory under the working directory of the AI agent corresponding to the robot application are parsed to determine the identification information of the target robot application.
[0288] B40. The computing device according to any one of B28-B39, wherein the executable instructions further cause the processor to perform the following operations: The message is written to the received message directory under the working directory of the target AI agent, and a trigger signal file is written under the shared trigger queue. The target AI agent is scheduled to perform corresponding processing based on the message according to the trigger signal file through the message receiving service, and the processing result is obtained.
[0289] B41. The computing device according to B40, wherein the executable instructions further cause the processor to perform the following operations: The shared trigger queue is polled by the trigger detection thread in the subprocess of each robot application in the message receiving service. When the subprocess of the target robot application detects the corresponding trigger signal file, the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result.
[0290] B42. The computing device according to B41, wherein the executable instructions further cause the processor to perform the following operations: When any child process receives a message, it uses file system atomic operations to create a corresponding tag file for the message in the shared deduplication directory. Determine whether the tag file already exists; if so, do not process the message.
[0291] B43. The computing device according to any one of B28-B42, wherein the executable instructions further cause the processor to perform the following operations: If the message initiator is a robot application, then before scheduling the target AI agent to process the message accordingly, the cross-team communication permission rules are verified. Based on the verification results, determine whether to allow the target AI agent to process the message accordingly.
[0292] B44. The computing device according to any one of B28-B43, wherein the executable instructions further cause the processor to perform the following operations: Detect whether the number of jumps in the robot application within the same collaboration chain exceeds the jump threshold; If so, then the target AI agent will not be scheduled. If not, the target AI agent is scheduled to process the message accordingly.
[0293] B45. The computing device according to any one of B28-B43, wherein the executable instructions further cause the processor to perform the following operations: Detect whether the number of times the target robot appears in the same collaborative chain is greater than the loop count threshold; If so, then the target AI agent will not be scheduled. If not, the target AI agent is scheduled to process the message accordingly.
[0294] B46. The computing device as described in B44 or B45, wherein the hop count threshold and loop count threshold are dynamically adjusted based on team size, collaboration mode, and actual project operation.
[0295] B47. The computing device according to any one of B28-B46, wherein the executable instructions further cause the processor to perform the following operations: Based on the processing status of the message by the target AI agent, add an emoji tag corresponding to the processing status and the identification information of the target robot application to the message in the group.
[0296] B48. The computing device according to any one of B28-B47, wherein the executable instructions further cause the processor to perform the following operations: Based on the identification information of the target AI agent and the dialogue identification information in the message, query the database to see if there is any corresponding non-expired session identification information; If there is a corresponding non-expired session identifier, then based on the session identifier, the recovery function is used to schedule the target AI agent to perform corresponding processing according to the message and the dialogue context corresponding to the session identifier; If no corresponding unexpired session identifier exists, a new session is created. In the new session, the target AI agent is scheduled to process the message accordingly.
[0297] B49. The computing device according to B48, wherein the executable instructions further cause the processor to perform the following operations: The database is queried to determine whether there is session identifier information corresponding to the combined identifier information; the combined identifier information is obtained by combining the identifier information of the target AI agent and the dialogue identifier information in the message. If a corresponding session identifier exists, determine whether the session identifier has expired based on the timeout threshold. If it has not expired, it is determined that there is a corresponding unexpired session identifier. If no corresponding session identifier information exists, or if corresponding session identifier information exists but has expired, then it is determined that no corresponding unexpired session identifier information exists.
[0298] B50. The computing device according to B49, wherein the executable instructions further cause the processor to perform the following operations: If the recovery function scheduling fails, the mapping relationship between the combined identifier information and the session identifier information stored in the database is cleared, and the process is retried in stateless mode.
[0299] B51. The computing device according to any one of B28-B50, wherein the executable instructions further cause the processor to perform the following operations: The processing result is written to the message sending directory under the working directory of the target AI agent; The processing results from the message sending catalog are sent back to the group via the message sending service.
[0300] B52. The computing device according to B51, wherein the executable instructions further cause the processor to perform the following operations: When the message sending service detects a write completion event, it reads the processing results from the message sending directory and generates a reply message that mentions the message initiator and contains the processing results. The reply message is sent to the group through the interface of the instant messaging platform; After the reply message is successfully sent, the processing results in the sent message directory are moved to the sent archive directory.
[0301] B53. The computing device according to B52, wherein the executable instructions further cause the processor to perform the following operations: The mention field that mentions the message initiator is converted into the corresponding mention tag in the instant messaging platform, and the mention tag and the processing result are converted into a rich text card-style reply message using a markup language; Large language model usage statistics are injected at a preset location in the response message.
[0302] B54. The computing device according to any one of B28-B53, wherein the executable instructions further cause the processor to perform the following operations: If the target robot application is not included in the group, the processing result is sent back to the message initiator via a callback field, and the processing result is displayed in the group.
[0303] C55. A computer storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the decentralized multi-AI agent collaboration method as described in any one of A1-A27.
Claims
1. A decentralized multi-AI agent collaboration method, comprising: Create groups for collaborative work on projects within an instant messaging platform; group members include users and multiple bot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is determined, and the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result. The target robot application then replies the processing result to the group.
2. The method of claim 1, wherein, The message initiators include group members determined based on the actual operation of the project.
3. The method according to claim 1, wherein creating a group for collaborative work in the instant messaging platform further comprises: Obtain project setup planning information, analyze the project setup planning information, and determine the robot applications required for the project and the responsibilities of each robot application; Configure each robot application, the mapping relationship between robot applications and AI agents, and the team structure information of the project in the developer platform to form a configuration file, and configure the working directory of each AI agent and set the corresponding skills; In the instant messaging platform, the robot applications and users required for the project are included as group members, a group for collaborative work is created for the project, and the group is registered to the configuration file; Start the system services, which include message receiving service and message sending service.
4. The method according to claim 3, wherein analyzing the project construction planning information to determine the robot applications required for the project and the responsibilities of each robot application further includes: Analyze the project setup planning information to determine the number of roles in the workflow and break down the responsibilities corresponding to the project; Based on the number of roles, the collaborative and cohesive relationships between responsibilities, and the operational isolation requirements, determine the number of robot applications required for the project and assign responsibilities to each robot application.
5. The method according to claim 3, wherein configuring the working directory for each AI agent further comprises: Create a corresponding working directory for each AI agent, and configure a role description file, a message receiving directory, a message sending directory, and a memory file in the working directory; The role description file records the identity design information and responsibilities of the robot application corresponding to the AI agent, as well as the tool routing table, response rules, collaboration matrix, and security management information.
6. The method of claim 3, further comprising, after registering the group to the configuration file: Configure the scheduler's scheduled tasks based on the project setup plan information.
7. The method according to any one of claims 3-6, wherein, In the message receiving service, the main process creates an independent sub-process for each robot application; the main process is the entry process of the message receiving service; each sub-process runs a corresponding message processing loop, trigger detection thread, and concurrent control semaphore.
8. The method according to claim 7, further comprising: During the startup phase of the message receiving service, the main process reads the configuration file, loads the credentials and parameters of multiple robot applications required by the project, calls the interface of the instant messaging platform to parse the identification information of each robot application, initializes the concurrent queue status file, and starts the response timeout monitoring mechanism. Create an independent subprocess for each robot application, and establish an independent long connection to the instant messaging platform within each subprocess; The system polls and checks the liveness status of each child process. If any child process of the robot application exits abnormally, the main process will recreate the child process for that robot application.
9. A computing device comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the following operations: Create groups for collaborative work on projects within an instant messaging platform; group members include users and multiple bot applications. In response to a message sent by the message initiator in the group that mentions the target robot application, the target AI agent corresponding to the target robot application is determined, and the target AI agent is scheduled to perform corresponding processing according to the message to obtain the processing result. The target robot application then replies the processing result to the group.
10. A computer storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the decentralized multi-AI agent collaboration method as described in any one of claims 1-8.