A multi-agent cooperation and dynamic UI interaction method based on a streaming protocol

By coordinating multi-agent collaboration and dynamic UI interaction through streaming protocols, the problems of visualization, scalability, and closed-loop feedback in existing AI interaction systems are solved, achieving transparency, scalability, and efficient human-computer interaction in multi-agent collaboration.

CN122346347APending Publication Date: 2026-07-07CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
Filing Date
2026-04-08
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing AI interaction systems lack visualization capabilities in multi-agent collaboration, have non-standardized and difficult-to-expand interaction components, and lack closed-loop feedback mechanisms, resulting in a "black box" operation process, low user trust, and low efficiency.

Method used

A multi-agent collaboration method based on streaming protocols is adopted. The backend coordinates the interactive content output by the agents through streaming transmission protocols, the frontend dynamically renders UI components and listens for user operations, and the backend sends back structured feedback data to realize the visualization of multi-agent collaboration, dynamic UI component control and precise closed-loop feedback.

Benefits of technology

It enables the visualization of multi-agent collaboration processes, enhances system transparency and user trust, improves system scalability and development efficiency, enhances human-machine alignment efficiency and AI task execution accuracy, and reduces system coupling and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122346347A_ABST
    Figure CN122346347A_ABST
Patent Text Reader

Abstract

This invention relates to the field of artificial intelligence technology, providing a method for multi-agent collaboration and dynamic UI interaction based on a streaming protocol. The method includes: a backend multi-agent orchestration layer coordinating at least two agents with different roles to execute tasks; encapsulating the interactive content output by each agent into AG-UI protocol data packets; and pushing these packets to the frontend in the order of task execution via a streaming protocol. Upon receiving the AG-UI protocol data packets, the frontend parses the component identifiers and data attributes within them, dynamically loads and renders the corresponding UI components, and listens for user interactions on the UI components. The frontend encapsulates the modified component state data and corresponding action identifiers together into structured feedback data and sends it back to the backend. The backend then converts the user's interactions into context information for the agents based on the structured feedback data. This invention enables visualization of the multi-agent collaboration process, dynamic backend control of frontend UI components, precise structured human-machine closed-loop feedback, and dynamic decoupling of agent roles from UI components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for multi-agent collaboration and dynamic UI interaction based on streaming protocols. Background Technology

[0002] With the rapid development of large language model technology, AI-based agent systems have been widely applied in complex business scenarios such as task planning, data analysis, and automated execution. In real-world business environments, a single agent often struggles to complete complex tasks independently, requiring multiple agents with different functions (such as perception agents, planning agents, and execution agents) to work collaboratively. Furthermore, the efficiency of interaction between the user and the agent system directly impacts system availability and task execution effectiveness. Therefore, establishing an efficient, transparent, and scalable human-computer interaction mechanism, enabling users to clearly perceive and easily intervene in the multi-agent collaboration process, has become a critical issue that urgently needs to be addressed in the current AI application field.

[0003] Currently, most mainstream AI interaction systems adopt a single-agent model, outputting results in the form of a text stream through simple dialog boxes. Some advanced systems have introduced enhanced interaction methods such as Markdown rendering or function call cards, but their core interaction logic remains at a linear "question and answer" level, exhibiting the following three significant shortcomings.

[0004] First, there is a lack of visualization capabilities for multi-role collaboration. In complex business scenarios involving multiple agents working together, the existing UI cannot distinguish the source of messages generated by different agents. Users can only see mixed text output and cannot clearly perceive which agent is currently working, which stage the task has reached, or how the agents connect with each other. This results in the system operating in a "black box" state, reducing the system's explainability and user trust.

[0005] Second, interactive components are non-standardized and difficult to extend. Existing rich interactive components (such as confirmation boxes, form editors, etc.) are usually implemented using hard-coding on the front end, and the back end cannot dynamically determine which type of interactive component the front end should render based on the task context. When adding or modifying interactive components, the front end code must be updated and a new version must be released, which severely limits the system's flexibility and rapid iteration capabilities.

[0006] Third, there is a lack of a component-based closed-loop feedback mechanism. In existing technologies, user feedback on modifications to AI-generated content (such as task plans and execution parameters) typically requires re-entering natural language commands. This approach is not only inefficient, but more importantly, the system cannot accurately capture which specific component, field, or step the user made the modification to, resulting in low human-machine alignment efficiency and making it difficult for AI to accurately understand the user's fine-tuning intentions.

[0007] Chinese patent CN119088866A discloses a collaborative multi-agent conversation processing method that uses primary key IDs to achieve static indexing and rendering of UI components. However, it is essentially a predefined, fixed-mapped component calling method. Its focus is on how to "translate" AI-generated feedback information into front-end renderable UI elements, rather than establishing a structured interactive loop between the agent and the user.

[0008] Therefore, how to provide an interactive method that can support multi-agent collaboration, dynamically render UI components, and achieve precise structured feedback has become an urgent technical problem to be solved. Summary of the Invention

[0009] In view of this, in order to overcome the shortcomings of the prior art, the present invention aims to provide a method for multi-agent collaboration and dynamic UI interaction based on streaming protocols.

[0010] This invention provides a method for multi-agent collaboration and dynamic UI interaction based on streaming protocols, the method comprising:

[0011] Step S1: The backend multi-agent orchestration layer coordinates at least two agents with different roles to perform tasks, encapsulates the interactive content output by each agent into AG-UI protocol data packets, and pushes them to the frontend in the order of task execution through a streaming protocol.

[0012] Step S2: After receiving the AG-UI protocol data packet, the front end parses the component identifier and data attributes in it, dynamically loads and renders the corresponding UI component, and listens for user interaction on the UI component.

[0013] Step S3: The front end encapsulates the modified component state data and the corresponding action identifier into structured feedback data and sends it back to the back end. The back end converts the user's interaction into context information of the intelligent agent based on the structured feedback data.

[0014] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S1, the backend multi-agent orchestration layer coordinates at least two agents with different roles to perform tasks in the following manner: the orchestration layer dynamically selects and calls at least two of the following agents: perception agent, planning agent, execution agent, or system agent, according to the task type of the user instruction; each agent processes the task sequentially according to the preset task flow order, and the output of each agent is independently encapsulated into an AG-UI protocol data packet.

[0015] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S1, the perceptual agent is used to analyze user intent and output state synchronization components, the planning agent is used to generate task plans and output editable plan editing components, and the system agent is used to output confirmation components before high-risk operations; the component types output by different agents are dynamically determined by the backend inference logic according to the current task stage.

[0016] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S1, the streaming protocol adopts server-sent events or WebSocket protocol; the backend continuously pushes multiple AG-UI protocol data packets through the streaming protocol, and the frontend receives and renders the corresponding UI components in an incremental manner.

[0017] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S1, the AG-UI protocol data packet includes at least the following fields: a role field for identifying the identity of the source agent of the message, a type field for identifying the message type as a UI rendering instruction, and a content field for carrying UI rendering logic. The content field includes a component field for specifying the name of the front-end UI component, a props field for passing component data attributes, and an actionId field for identifying a unique identifier for the interaction action.

[0018] Optionally, the present invention provides a multi-agent collaboration and dynamic UI interaction method based on streaming protocols, which presets the value of the type field to distinguish between ordinary text stream messages and UI component rendering instructions. After receiving the data packet, the front end determines the value of the type field. If it is the preset value, the dynamic component rendering process is initiated; otherwise, it is processed as an ordinary text message.

[0019] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S2, the front end dynamically loads and renders the corresponding UI components in the following manner: The front end maintains a component mapping table that stores the correspondence between component names and actual component constructors or rendering functions. Based on the parsed component field value, the front end searches for the corresponding component in the component mapping table. If found, the component is instantiated and rendered using the data in the props field as attribute parameters; if not found, the preset degradation processing logic is executed.

[0020] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S2, the front end listens to the user's interaction operations on the UI component in the following manner: when the front end renders a UI component containing an actionId field, it binds the actionId to the component instance; when the user performs an interaction operation on the UI component, the front end collects the component state data of the UI component and combines the actionId and the component state data into a structured feedback data packet in JSON format.

[0021] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S3, the backend converts the user's interaction operation into the context information of the agent according to the structured feedback data, including: after receiving the structured feedback data packet, the backend parses the actionId and component state data therein; according to the actionId, it maps to the corresponding agent or task step, and converts the component state data into a structured large language model prompt word context.

[0022] Optionally, in the multi-agent collaboration and dynamic UI interaction method based on streaming protocols of the present invention, in step S3, the structured feedback data returned by the front end supports two modes: incremental feedback and full feedback. In the incremental feedback mode, the front end only returns the fields modified by the user and their modified values; in the full feedback mode, the front end returns the complete status data of the component; the back end dynamically selects to request incremental feedback or full feedback mode according to the task type and component type.

[0023] This invention, based on a streaming protocol, provides a multi-agent collaboration and dynamic UI interaction method with the following beneficial technical effects:

[0024] I. Visualizing the Multi-Agent Collaboration Process

[0025] It effectively solves the "black box" problem in multi-agent collaboration, significantly improving the system's transparency, explainability, and user trust.

[0026] II. Implementing dynamic control of front-end UI components from the backend

[0027] The backend only needs to send JSON data packets conforming to this protocol to dynamically control the frontend to render any registered interactive component, eliminating the need for frequent frontend version releases. Meanwhile, predefined general components (such as status list components, plan editing components, and confirmation card components) can be reused by any agent in different task stages, greatly improving system scalability and development efficiency.

[0028] III. Achieving precise structured human-machine closed-loop feedback

[0029] Transforming users' vague intentions into precise structured data significantly improves human-machine alignment efficiency and the accuracy of AI task execution.

[0030] IV. Achieving dynamic decoupling between intelligent agent roles and UI components

[0031] This completely decouples business logic from UI presentation, allowing the backend to iterate and optimize task flows independently while the frontend maintains common component rendering capabilities, significantly reducing system coupling and maintenance costs. Attached Figure Description

[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating the multi-agent collaboration and dynamic UI interaction method based on a streaming protocol according to an exemplary embodiment 1 of the present invention.

[0034] Figure 2 This is a flowchart illustrating the different agent output component types of the multi-agent collaboration and dynamic UI interaction method based on streaming protocols according to an exemplary embodiment 1 of the present invention.

[0035] Figure 3 This is a schematic diagram of the AG-UI protocol data packet field structure of the multi-agent collaboration and dynamic UI interaction method based on streaming protocols according to an exemplary embodiment 1 of the present invention.

[0036] Figure 4 This is a schematic diagram of the type field judgment and processing flow of the multi-agent collaboration and dynamic UI interaction method based on streaming protocol according to an exemplary embodiment 1 of the present invention.

[0037] Figure 5 This is a schematic diagram illustrating the process of dynamically loading and rendering UI components according to an exemplary embodiment 1 of the present invention, which describes a method for multi-agent collaboration and dynamic UI interaction based on a streaming protocol. Detailed Implementation

[0038] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0039] It should be noted that, in the absence of conflict, the following embodiments and features can be combined with each other; and, based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0040] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0041] Example 1

[0042] Exemplary embodiment 1 of the present invention provides a method for multi-agent collaboration and dynamic UI interaction based on streaming protocols. Figure 1 This is a flowchart illustrating a multi-agent collaboration and dynamic UI interaction method based on a streaming protocol according to an exemplary embodiment 1 of the present invention. Figure 1 As shown, in this embodiment, the method of the present invention is implemented in the following manner:

[0043] Step S1: The backend multi-agent orchestration layer coordinates at least two agents with different roles to perform tasks, encapsulates the interactive content output by each agent into AG-UI protocol data packets, and pushes them to the frontend in the order of task execution through a streaming protocol.

[0044] In this embodiment, the backend multi-agent orchestration layer dynamically selects and calls at least two of the following agents: perception agent, planning agent, execution agent, or system agent, based on the task type of the user instruction. Each agent processes tasks sequentially according to a preset task flow order, and the output of each agent is independently encapsulated into an AG-UI protocol data packet.

[0045] Figure 2 This is a flowchart illustrating different agent output component types in the multi-agent collaboration and dynamic UI interaction method based on a streaming protocol according to Exemplary Embodiment 1 of the present invention. Figure 2 As shown, the perception agent is used to analyze user intent and output state synchronization components, the planning agent is used to generate task plans and output editable plan editing components, and the system agent is used to output confirmation components before high-risk operations; the types of components output by different agents are dynamically determined by the backend inference logic based on the current task stage.

[0046] In this embodiment, the streaming protocol uses either server-sent events or the WebSocket protocol; the backend continuously pushes multiple AG-UI protocol data packets through the streaming protocol, and the frontend receives and renders the corresponding UI components in an incremental manner.

[0047] Figure 3 This is a schematic diagram of the AG-UI protocol data packet field structure of the multi-agent cooperation and dynamic UI interaction method based on a streaming protocol according to Exemplary Embodiment 1 of the present invention; as shown Figure 3 As shown, in practical applications, the AG-UI protocol data packet of this embodiment includes at least the following fields: a role field for identifying the identity of the intelligent agent from which the message originates, a type field for identifying the message type as a UI rendering instruction, and a content field for carrying UI rendering logic. The content field includes a component field for specifying the name of the front-end UI component, a props field for passing component data attributes, and an actionId field for identifying a unique identifier for the interactive action.

[0048] Figure 4 This is a schematic diagram illustrating the type field judgment and processing flow of a multi-agent collaboration and dynamic UI interaction method based on a streaming protocol according to Exemplary Embodiment 1 of the present invention; as follows: Figure 4 As shown in this embodiment, the value of the preset type field, such as ag-ui, is used to distinguish between ordinary text stream messages and UI component rendering instructions. After receiving the data packet, the front end determines the value of the type field. If it is the preset value, the dynamic component rendering process is entered; otherwise, it is processed as an ordinary text message.

[0049] Step S2: After receiving the AG-UI protocol data packet, the front end parses the component identifier and data attributes, dynamically loads and renders the corresponding UI component, and listens for user interaction on the UI component.

[0050] Figure 5 This is a schematic diagram illustrating the dynamic loading and rendering process of UI components in a multi-agent collaboration and dynamic UI interaction method based on a streaming protocol according to an exemplary embodiment 1 of the present invention. Figure 5 As shown, in this embodiment, the front end dynamically loads and renders the corresponding UI components in the following manner: The front end maintains a component mapping table that stores the correspondence between component names and actual component constructors or rendering functions. Based on the parsed component field value, the front end searches for the corresponding component in the component mapping table. If found, the component is instantiated and rendered using the data in the props field as attribute parameters. If not found, the preset degradation processing logic is executed.

[0051] The front-end listens for user interactions on UI components in the following way: When rendering a UI component that contains an actionId field, the front-end binds the actionId to the component instance; when the user performs an interaction on the UI component, the front-end collects the component state data of the UI component and combines the actionId and the component state data into a structured feedback data packet in JSON format.

[0052] Step S3: The front end encapsulates the modified component state data and the corresponding action identifier into structured feedback data and sends it back to the back end. The back end converts the user's interaction into context information of the intelligent agent based on the structured feedback data.

[0053] In this embodiment, the backend converts the user's interactive operation into the context information of the intelligent agent based on the structured feedback data, including: after receiving the structured feedback data packet, the backend parses the actionId and component state data in it; according to the actionId, it maps to the corresponding intelligent agent or task step, and converts the component state data into a structured large language model prompt word context.

[0054] It should be noted that in this embodiment, the structured feedback data returned by the front end supports two modes: incremental feedback and full feedback. In the incremental feedback mode, the front end only returns the fields modified by the user and their modified values; in the full feedback mode, the front end returns the complete status data of the component; the back end dynamically selects whether to request incremental feedback or full feedback mode based on the task type and component type.

[0055] Example 2

[0056] Exemplary Example 2 of the present invention provides a method for multi-agent collaboration and dynamic UI interaction based on streaming protocols. The method of this embodiment will be further described below in a specific scenario.

[0057] The method in this embodiment is applicable to task awareness and state synchronization scenarios. In this scenario, after analyzing the user's intent, the sensing agent does not output text but directly pushes a state list component to inform the user that the system is understanding the task. The AG-UI protocol data is as follows:

[0058] data: {

[0059] "role": "Perceptual intelligent agent",

[0060] "type": "ag-ui",

[0061] "content": {

[0062] "component": "StatusList",

[0063] "props": {

[0064] "title": "Task Understanding",

[0065] "items": ["Analyzing user intent...", "Core requirement identified: Kanban optimization"]

[0066] }

[0067] }

[0068] }

[0069] The front end renders a dynamic step bar or checklist, which displays the progress in real time as you check off items.

[0070] The method in this embodiment is applicable to collaborative editing of complex plans. In this scenario, after the planning agent generates an initial plan, the structured data is displayed through the PlanEditor component, allowing users to modify it directly on the UI, rather than through dialogue. The AG-UI protocol data is as follows:

[0071] data: {

[0072] "role": "Planning agent",

[0073] "type": "ag-ui",

[0074] "content": {

[0075] "component": "PlanEditor",

[0076] "props": {

[0077] "items": [

[0078] {"id": "p1", "description": "Generate preliminary plan", "assignedAgent": "Planning agent", "status": "pending"} ]

[0080] },

[0081] "actionId": "update_plan_content"

[0082] }

[0083] }

[0084] The front-end renders an editable table or dashboard. After the user modifies the content, the front-end sends the modified data, combined with the actionId: "update_plan_content", back to the back-end.

[0085] The method in this embodiment is applicable to scenarios involving human-machine verification and decision-making intervention. In this scenario, before performing a high-risk operation, the system agent requests human verification via a card. The AG-UI protocol data is as follows:

[0086] data: {

[0087] "role": "system",

[0088] "type": "ag-ui",

[0089] "content": {

[0090] "component": "ConfirmationCard",

[0091] "props": {

[0092] Message: "Execution plan has been generated. Confirm and start execution?"

[0093] "positiveLabel": "Confirm execution",

[0094] "negativeLabel": "Planned Modifications",

[0095] "negativeActionId": "modify_plan_request"

[0096] },

[0097] "actionId": "confirm_plan

[0098] }

[0099] }

[0100] The front-end renders a card with two buttons. Clicking "Confirm Execution" will trigger a `confirm_plan` event sent to the back-end, thereby unlocking the subsequent execution of the intelligent agent.

[0101] In the above scenario, the method of this embodiment is implemented in the following manner:

[0102] The backend orchestration layer pushes the aforementioned AG-UI protocol data in sequence according to the task stage. After receiving the ag-ui type data, the frontend searches for component libraries such as StatusList and PlanEditor. If the component exists, it updates the view using props; if it is an incremental update, it only renders the changed parts.

[0103] When a user modifies a plan in the PlanEditor or clicks the ConfirmationCard button, the frontend not only sends the click event but also sends the component's current complete state or diff value as the payload, along with the corresponding actionId, back to the backend.

[0104] After receiving feedback, the backend transforms the user's structured operations into a new Prompt context, guiding the agent to adjust subsequent steps.

[0105] The multi-agent collaboration and dynamic UI interaction method based on streaming protocols in this invention has the following beneficial technical effects:

[0106] I. Visualizing the Multi-Agent Collaboration Process

[0107] By introducing a "role" field into the protocol data packets output by the multi-agent orchestration layer, the identity of the source agent for each message is clearly identified. The front-end uses this field to differentiate and display the output content of different agents using various methods such as different role avatars and message blocks. This allows users to intuitively perceive "which agent is doing what," clearly understand the complete task flow, effectively solve the "black box" problem in multi-agent collaboration, and significantly improve the system's transparency, explainability, and user trust.

[0108] II. Implementing dynamic control of front-end UI components from the backend

[0109] A standardized AG-UI protocol data structure is defined, containing a `component` field to specify the name of the front-end UI component and a `props` field to pass component data attributes. The backend only needs to send JSON data packets conforming to this protocol to dynamically control the frontend to render any registered interactive component, eliminating the need for frequent frontend version releases. Furthermore, predefined general components (such as status list components, plan editing components, and confirmation card components) can be reused by any intelligent agent in different task stages, greatly improving system scalability and development efficiency.

[0110] III. Achieving precise structured human-machine closed-loop feedback

[0111] The `actionId` field is pre-embedded in the UI component protocol. During user interaction, the front-end sends this identifier, along with the component's complete state data or difference data, back to the back-end. The back-end uses the `actionId` to map the user's structured actions to the context of prompts for the intelligent agent, enabling the system to accurately understand which component, field, and step the user made what modification or selection. Compared to existing technologies that rely on users re-entering natural language for feedback, this invention transforms the user's ambiguous intentions into precise structured data, significantly improving human-computer alignment efficiency and the accuracy of AI task execution.

[0112] IV. Achieving dynamic decoupling between intelligent agent roles and UI components

[0113] This design paradigm employs backend inference logic to dynamically determine which components the frontend renders, rather than relying on traditional hard-coded routing logic. At different task stages (such as perception, planning, and execution confirmation), the backend automatically selects the appropriate component type based on the context, while the frontend only needs to maintain a component mapping table and render according to instructions. This completely decouples business logic from UI presentation, allowing the backend to independently iterate and optimize task flows, while the frontend maintains general component rendering capabilities, significantly reducing system coupling and maintenance costs.

[0114] The above section on beneficial effects systematically elaborates on the technical advantages of this invention from four aspects, using objective and concise language and clear and coherent logic. Please feel free to inform us if further adjustments or additions are needed.

[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0116] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for multi-agent collaboration and dynamic UI interaction based on streaming protocols, characterized in that, The method includes: Step S1: The backend multi-agent orchestration layer coordinates at least two agents with different roles to perform tasks, encapsulates the interactive content output by each agent into AG-UI protocol data packets, and pushes them to the frontend in the order of task execution through a streaming protocol. Step S2: After receiving the AG-UI protocol data packet, the front end parses the component identifier and data attributes in it, dynamically loads and renders the corresponding UI component, and listens for user interaction on the UI component. Step S3: The front end encapsulates the modified component state data and the corresponding action identifier into structured feedback data and sends it back to the back end. The back end converts the user's interaction into context information of the intelligent agent based on the structured feedback data.

2. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S1, the backend multi-agent orchestration layer coordinates at least two agents with different roles to perform tasks in the following manner: the orchestration layer dynamically selects and calls at least two of the following agents: perception agent, planning agent, execution agent, or system agent, according to the task type of the user instruction; each agent processes the task sequentially according to the preset task flow order, and the output of each agent is independently encapsulated into an AG-UI protocol data packet.

3. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 2, characterized in that, In step S1, the perceptual agent is used to analyze the user's intent and output a state synchronization component, the planning agent is used to generate a task plan and output an editable plan editing component, and the system agent is used to output a confirmation component before high-risk operations. The component types output by different intelligent agents are dynamically determined by the backend inference logic based on the current task stage.

4. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S1, the streaming protocol uses either server-sent events or the WebSocket protocol; the backend continuously pushes multiple AG-UI protocol data packets through the streaming protocol, and the frontend receives and renders the corresponding UI components in an incremental manner.

5. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S1, the AG-UI protocol data packet contains at least the following fields: a role field for identifying the identity of the intelligent agent from which the message originates, a type field for identifying the message type as a UI rendering instruction, and a content field for carrying UI rendering logic. The content field contains a component field for specifying the name of the front-end UI component, a props field for passing component data attributes, and an actionId field for identifying a unique identifier for the interactive action.

6. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 5, characterized in that, The default value of the type field is used to distinguish between ordinary text stream messages and UI component rendering instructions. After receiving the data packet, the front end checks the value of the type field. If it is the default value, the dynamic component rendering process is initiated; otherwise, it is treated as an ordinary text message.

7. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S2, the front-end dynamically loads and renders the corresponding UI components in the following way: The front-end maintains a component mapping table that stores the correspondence between component names and actual component constructors or rendering functions. Based on the parsed component field value, the front-end searches for the corresponding component in the component mapping table. If found, the component is instantiated and rendered using the data in the props field as attribute parameters. If not found, the pre-defined fallback processing logic is executed.

8. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S2, the front end listens for user interaction on UI components in the following way: when rendering a UI component containing an actionId field, the front end binds the actionId to the component instance; When a user interacts with this UI component, the front end collects the component's state data and combines the actionId with the component's state data into a structured feedback data packet in JSON format.

9. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S3, the backend converts the user's interaction into context information of the agent based on the structured feedback data, including: after receiving the structured feedback data packet, the backend parses the actionId and component state data in it; based on the actionId, it maps to the corresponding agent or task step and converts the component state data into a structured large language model prompt context.

10. The method for multi-agent collaboration and dynamic UI interaction based on streaming protocols according to claim 1, characterized in that, In step S3, the structured feedback data returned by the front end supports two modes: incremental feedback and full feedback. In incremental feedback mode, the front end only returns the fields modified by the user and their modified values; in full feedback mode, the front end returns the complete status data of the component; the back end dynamically selects whether to request incremental feedback or full feedback mode based on the task type and component type.

Citation Information

Patent Citations

  • Session processing method and system of collaborative multi-agent

    CN119088866A