Implementation method, system and device of business intelligence system based on large model ReAct
By using the large-scale ReAct paradigm and A2A/MCP protocol, an autonomous decision-making business intelligence system is built, which solves the rigid process problems of the existing ChatBI platform, realizes dynamic task planning and autonomous decision-making, and improves user experience and system flexibility.
Patent Information
- Application Number
- CN202510875086.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The existing ChatBI platform has a rigid processing flow and lacks flexibility. Intelligent agents operate in isolation, making it difficult to conduct dynamic task planning and autonomous decision-making. In addition, the tool calling method is hard-coded, resulting in poor flexibility.
Adopting the large-model ReAct paradigm, the main agent drives multiple functional agents and external tools to work together, using A2A and MCP protocols to achieve loose coupling, dynamically plan and analyze paths and make autonomous decisions, supporting plug-and-play features.
It enables autonomous decision-making business analysis and improves user experience. The system is flexible and scalable and can quickly adapt to new business scenarios and data sources.
Smart Images

Figure CN120372068B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, system, and device for implementing a business intelligence system based on a large model ReAct. Background Art
[0002] Chat-based Business Intelligence (ChatBI) is an interactive analytics platform that integrates natural language processing (NLP) and business intelligence (BI).
[0003] Currently, the processing flow architecture of the existing ChatBI platform is as follows: Figure 1 As shown, it relies on a pre-defined, relatively fixed process to respond to query requests, resulting in a rigid process and a lack of flexibility and adaptability. Furthermore, its operating mode is primarily a single-agent service model, where agents often operate in isolation. Individual agents possess limited contextual information, which easily creates information barriers, makes collaboration difficult, and lacks dynamism. Furthermore, the hard-coded tool invocation method employed also lacks flexibility.
[0004] Based on this, there is an urgent need for a technical solution that can break the rigid fixed process and realize dynamic and flexible completion of autonomous decision-making business analysis in the business intelligence system. Summary of the Invention
[0005] To solve the above problems, the embodiments of the present application provide a method, system and device for implementing a business intelligence system based on a large model ReAct.
[0006] In one aspect, an embodiment of the present application provides a method for implementing a business intelligence system based on a large model ReAct, the method being applied to the ChatBI platform; the method comprising:
[0007] The main agent receives the query request information from the user terminal and guides the large language model LLM to perform cyclic reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project. The cyclic reasoning process includes:
[0008] Step 1: Thinking phase: LLM analyzes the input information from the upstream task and determines the corresponding pending actions for the downstream task. The input information is the query request information or the inference action feedback result from step 3. The pending actions include one or more action tasks obtained from task decomposition.
[0009] Step 2: Action phase: Execute corresponding reasoning actions according to the action tasks and their types corresponding to the to-be-executed actions; wherein the reasoning actions include at least one or more of the following: selecting and calling one or more preset functional agents in the functional agent pool through a preset communication protocol group, selecting and calling one or more preset calling tools in a preset tool set through a preset communication protocol group, or interacting with the user for clarification; the preset communication protocol group includes the A2A protocol for communicating with the preset functional agents and the MCP protocol for communicating with the preset calling tools;
[0010] Step 3: Observation phase: Receive the feedback results of the reasoning action and update the loop reasoning context, and determine whether to trigger the next round of loop reasoning until the preset loop termination conditions are met, and obtain the decision analysis results corresponding to the query request information;
[0011] Based on each of the decision analysis results obtained by the circular reasoning, a query result is generated and sent to the user terminal; wherein the query result is a single-modal response result or a multi-modal response result.
[0012] On the other hand, an embodiment of the present application further provides an implementation system of a business intelligence system based on a large model ReAct, the system being applied to the ChatBI platform; the system comprising:
[0013] The receiving and loop reasoning module is used for the main agent to receive query request information from the user terminal and guide the large language model LLM to perform loop reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project. The loop reasoning process includes:
[0014] The analysis and determination submodule is used in step 1: the thinking phase: the LLM is used to analyze the input information from the upstream task and determine the corresponding pending actions for the downstream task; wherein the input information is the query request information or the reasoning action feedback result from step 3; the pending actions include one or more action tasks obtained from task decomposition;
[0015] An execution submodule is used in step 2: an action phase: executing corresponding reasoning actions according to the action tasks corresponding to the to-be-executed action and the action task types thereof; wherein the reasoning actions include at least one or more of the following: selecting and calling one or more preset functional agents in a functional agent pool through a preset communication protocol group, selecting and calling one or more preset calling tools in a preset tool set through a preset communication protocol group, or interacting with a user for clarification; the preset communication protocol group includes an A2A protocol for communicating with the preset functional agents and an MCP protocol for communicating with the preset calling tools;
[0016] The receiving and determining submodule is used in step 3: observation phase: receiving the inference action feedback results and updating the loop reasoning context, and determining whether to trigger the next round of loop reasoning until the preset loop termination condition is met, and obtaining the decision analysis results corresponding to the query request information;
[0017] A generation module is used to generate a query result based on each decision analysis result obtained by the circular reasoning and send it to the user terminal; wherein the query result is a single-modal response result or a multi-modal response result.
[0018] In another aspect, an embodiment of the present application further provides a device for implementing a business intelligence system based on a large model ReAct, the device being applied to a ChatBI platform; the device comprising:
[0019] at least one processor; and,
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned method for implementing a business intelligence system based on a large model ReAct.
[0022] Compared with the prior art, this application has the following significant effects:
[0023] (1) Through the above technical solutions, this application integrates the ReAct paradigm, A2A communication protocol and MCP tool call protocol to build a new autonomous decision-making business analysis system architecture. With the main intelligent agent driven by a large language model as the core, it coordinates multiple specialized functional intelligent agents and external tools to work together, realizing an end-to-end intelligent analysis process from understanding user intentions, dynamically planning analysis paths, autonomously calling resources to integrating and presenting results. It solves the technical problems of the existing ChatBI platform's rigid processing process and difficulty in flexibly carrying out dynamic task planning and autonomous decision-making to execute business analysis, effectively improving the user experience of the ChatBI platform.
[0024] (2) Through standardized A2A and MCP protocols, functional agents and tools are loosely coupled. Functional agents and tools can be easily added, deleted, or replaced based on business needs without requiring large-scale modifications to the core system. This “plug-and-play” feature enables the system to quickly adapt to new business scenarios, data sources, and analytical technologies, making it highly flexible and scalable. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0026] Figure 1 This is a schematic diagram of the processing flow architecture of an existing ChatBI platform in an embodiment of the present application;
[0027] Figure 2 A flowchart of a method for implementing a business intelligence system based on a large model ReAct in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of the processing flow architecture of a method for implementing a business intelligence system based on a large model ReAct in the implementation of this application;
[0029] Figure 4 This is a sequence diagram of agent registration and calling of a method for implementing a business intelligence system based on a large model ReAct in an embodiment of the present application;
[0030] Figure 5 This is a timing diagram of the interaction between the main agent and the calling tool of an implementation method of a business intelligence system based on the large model ReAct in an embodiment of the present application;
[0031] Figure 6 Another flowchart of a method for implementing a business intelligence system based on a large model ReAct in an embodiment of the present application;
[0032] Figure 7 This is a structural diagram of an implementation system of a business intelligence system based on a large model ReAct in an embodiment of the present application;
[0033] Figure 8 This is a structural diagram of an implementation device of a business intelligence system based on a large model ReAct in an embodiment of the present application. DETAILED DESCRIPTION
[0034] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0035] Figure 1 This is a diagram of the processing flow architecture of the existing ChatBI platform. Query represents the query request information entered by the user. The existing ChatBI follows Figure 1 The fixed process follows the following flow: receiving user questions -> identifying intents and entities -> generating SQL statements (if a database is involved) -> executing SQL -> retrieving data -> (optionally) generating graphs -> returning results. The process consists of a series of fixed nodes with either serial connections or limited branching. Agents operate in isolation, and system and tool integration is often hard-coded.
[0036] Based on this, the embodiments of the present application provide a method, system and device for implementing a business intelligence system based on the large model ReAct, which is used to solve the technical problems of the rigid processing flow of the existing ChatBI platform, which makes it difficult to flexibly carry out dynamic task planning and autonomous decision-making to perform business analysis.
[0037] The following describes in detail various embodiments of the present application with reference to the accompanying drawings.
[0038] The embodiment of the present application provides a method for implementing a business intelligence system based on a large model ReAct, which is applied to the ChatBI platform, such as Figure 2 As shown, the method may include steps S201-S205:
[0039] S201, the main intelligent agent receives query request information from the user terminal, and guides the large language model LLM to perform cyclic reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project.
[0040] It should be noted that the execution entity of this application is a server, and the corresponding software product of this application is deployed on the server. The server is used as the execution entity of the implementation method of the business intelligence system based on the large model ReAct for illustrative purposes only. The execution entity is not limited to the server. In actual use, a server cluster can also be used. This application does not specifically limit this. Figure 3 This is a schematic diagram of the processing flow architecture of the ChatBI platform for this application, which includes an input layer module (Messages), a core control layer module, an execution layer module, a tool layer, and an output layer module. The input layer module includes functional modules such as UserInput, Topics, and Historical Information. UserInput receives the user's original questions, instructions, or requirements and is the "starting point" of the entire system; Topics preliminarily classify user input and identify the core areas of the conversation (such as "e-commerce analysis" and "supply chain optimization") to help the system quickly match tools / agents; Historical Information stores the context of multiple rounds of conversation (user questions, system answers, intermediate conclusions, etc.), which can be stored using historical conversation vectors to solve the "long conversation forgetting" problem. It is combined with the "Memory Module" to enable the reuse of historical information.
[0041] The core control layer module includes the ChatBI main agent, state machine, and memory module. The ChatBI main agent uses preset prompts to integrate user input, historical information, system roles, and agent collaboration to determine which tools and agents to call and how to assign tasks. The core driver of the main agent is based on a pre-trained large language model (LLM). The training samples are sample data of several query requests for inference. The training samples are input into the LLM for training until the model output accuracy is greater than the preset threshold. Alternatively, the Qwen332B model can be used, which is not specifically limited in this application. The state machine is used to manage the "lifecycle status" of conversations and tasks to ensure the orderly progress of the process, such as waiting for input, analyzing, outputting results, and abnormal interruption. The memory module implements hierarchical storage of "long-term memory + medium-term memory + short-term memory" to address the context management issues of long conversations. Short-term memory stores real-time information from the current conversation round (such as the user's latest questions and temporary data returned by the tool). Medium-term memory retains key conclusions from recent conversations (such as "the main reason for the decline in Q1 sales is logistics costs") and supports multi-round backtracking. Long-term memory accumulates common knowledge from historical conversations (such as industry analysis frameworks and common tool call logic) for model training or cross-scenario reuse.
[0042] The execution layer (Agents) include at least pre-configured functional agents, including the Table Recall Agent, the NL2SQL Agent, the Summarization Agent, and the Evaluation Agent. Pre-configured functional agents may also include: the User Intent Clarification Agent, the Data Pattern Understanding Agent, the Complex Query Decomposition Agent, the Data Analysis and Insight Agent, the Result Interpretation and Summarization Agent, and the Visualization Suggestion and Generation Agent. The specific configuration is determined by the user based on the actual usage scenario. The pre-configured functional agents communicate with each other via the A2A protocol. For example, the Table Recall Agent can communicate with the Entity Extraction Agent and the Retrieval-augmented Generation (RAG) retrieval agent.
[0043] The tool layer (Tools) includes the preset calling tools in the preset tool set, such as the RAG search tool, and can also include other tools, such as database connection and query execution tools: responsible for connecting to the database and executing SQL statements. Code Executor: responsible for executing code snippets such as Python, used for complex data processing or calculations. Chart generation library API: encapsulates interfaces of chart libraries such as Matplotlib, Plotly, and ECharts. External knowledge base retrieval engine: used to query unstructured knowledge such as company documents and industry reports. Business rule engine: used to execute predefined business rules. API call tool: used to call internal or third-party API services.
[0044] Tools are called in a standardized manner using the unified MCP protocol. The master agent (or authorized functional agent) must understand the tool's capability description and generate MCP-compliant call instructions. Each tool must provide a clear API definition (expected input parameters, parameter types, required parameters, and descriptions) and output format (success / failure flags, return data, and error messages). Furthermore, tool metadata must be provided in accordance with the MCP protocol to facilitate LLM understanding and usage.
[0045] The output layer module can include the functions of reverse clarification and output answer. When the user input is vague or key information is missing, it can actively ask for additional information and integrate the conclusions of each intelligent agent to generate the final answer that is fed back to the user. It supports multimodal output (text, charts, voice, etc., which needs to be combined with other modules for expansion).
[0046] In an embodiment of the present application, the structure of the above-mentioned preset Prompt project includes at least the following pre-defined modules: role definition module, core instruction module, available resource module, functional agent list and description module, tool list and description module, database Schema / domain knowledge module, conversation history module, current user request module, output format requirement module and dynamic information injection module.
[0047] Among them, role definition: define the role of LLM as an intelligent business analysis assistant. Core instructions: clearly state that the ReAct paradigm (think-act-observe) needs to be followed to solve user problems. Available resources: define available resources. Functional agent list and description: agents that can be called through the A2A protocol and their capabilities. Tool list and description: tools that can be called through the MCP protocol and their capabilities (such as the example above). Database Schema / domain knowledge: data structure or background knowledge related to the current analysis topic. Conversation history: a complete record of the current user's interaction with the system. Current user request: the latest question raised by the user. Output format requirements: LLM is required to clearly output the "Thought" process and the final selected "Action" (which agent / tool to call, or what to reply to the user). Dynamic information injection: in each iteration, the actions and observations of the previous round need to be dynamically updated to the Prompt to form a closed loop.
[0048] In one embodiment of the present application, after the master agent receives the query request information from the user terminal, the process further includes:
[0049] Match the user profile corresponding to the user terminal in the preset user profile database. The preset user profile database includes several user profiles built based on user behavior information. User behavior information includes at least: historical query behavior, business metrics of interest, commonly used chart types, and role permissions. Add the matched user profile to the loop reasoning context, so that the LLM performs loop reasoning matching the user profile.
[0050] In other words, the server in this application can also connect to a pre-set user profile database to record user profiles of user terminals that have interacted with the system. User profiles can include user tags based on user behavior information such as historical query behavior, business metrics of interest, commonly used chart types, and role permissions, such as high-frequency financial analysis users and preference bar charts. User profiles can be added to the loop reasoning context to adjust the LLM's response strategy, thereby adjusting the prompts to personalized levels during the loop reasoning process.
[0051] In simple terms, ReAct builds a user profile by recording and analyzing historical user queries, business metrics of interest, commonly used chart types, department affiliation, or role permissions. When making ReAct decisions, the main agent considers this user profile information to provide more personalized services. For example, it prioritizes strategic KPI summaries for executives and recommends more granular regional or product analysis for sales personnel. It also recommends commonly used chart types based on user preferences.
[0052] Furthermore, the main agent in this application possesses the ability to continuously learn and optimize its ReAct strategy. This can be achieved by collecting user feedback (such as thumbs-up / downvotes on results, correction suggestions) or based on the final success / failure of a task, using reinforcement learning techniques (such as reinforcement learning from human feedback (RLHF) or reinforcement learning (RL) based on task success signals) to adjust the LLM's behavior. The goal of this optimization is to enable it to make better inferences and judgments during the "thinking" phase and select more effective agent / tool invocation sequences during the "acting" phase.
[0053] For RLHF, human annotators are required to score or compare the LLM's thought and action paths. For task-success-based RL, clear task success criteria (such as user satisfaction and accurate query results) need to be defined. The collected feedback data is used to update the LLM's parameters (if fine-tuning is allowed) or to fine-tune and optimize the prompt template and strategy.
[0054] The circular reasoning process of this application includes the following three steps S202-S204, which are as follows.
[0055] S202, step 1: thinking stage: using LLM to analyze the input information from the upstream task and determine the actions to be performed corresponding to the downstream task.
[0056] The input information is the query request information or the inference action feedback result from step 3. The action to be executed includes one or more action tasks obtained by task decomposition.
[0057] In the embodiment of the present application, the LLM analyzes the input information from the upstream task and determines the actions to be performed corresponding to the downstream task, specifically including:
[0058] When the input information is input into the LLM to determine that there are multiple action tasks in the input information, a corresponding subtask sequence is generated. The subtask sequence is arranged in the order of execution of each action task. The execution order is determined by the LLM based on the input information. The action call sequence is determined based on the subtask sequence, the functional information of each agent in the functional agent list and description module, and the functional information of each tool in the tool list and description module. The action call sequence includes the order of calling each preset functional agent and / or each preset calling tool that matches each action task according to the subtask sequence. Based on the subtask sequence and the action call sequence, the to-be-executed action corresponding to the action stage is generated.
[0059] That is to say, when "thinking" is executed according to the preset ReAct paradigm, LLM can identify the action tasks that need to be performed by the input information, thereby calling the agent or tool in the action stage, or asking the user to provide further explanations to clarify the query request. If LLM recognizes that the input information corresponds to multiple action tasks, LLM can also analyze the execution order of the multiple action tasks to generate a subtask sequence, and generate an action call sequence that performs actions in the execution order based on the agent function information and tool function information. The two sequences are then combined to construct the action to be executed. The upstream task can be step 3, or it can be a task triggered by the main agent or the user terminal.
[0060] In other words, for particularly complex analytical tasks, the main agent does not just select a single agent or tool, but is able to autonomously and dynamically plan and build an execution chain consisting of multiple agents and tools in a specific order. For example, first call NL2SQL, then execute the query, then call the data analysis agent, and finally call the visualization agent. The system can even dynamically adjust the composition of subsequent chains based on the intermediate results. LLM needs to have stronger task decomposition and planning capabilities in the "thinking" stage. This application needs to introduce more complex planning algorithms or utilize LLM's own multi-step reasoning capabilities, evaluate the complexity of the task, decompose it into subtasks, and then match the most suitable agent or tool for each subtask, and determine their execution order and dependencies.
[0061] S203, step 2: action phase: according to each action task corresponding to the action to be executed and its action task type, execute the corresponding reasoning action.
[0062] The reasoning action includes at least one or more of the following: selecting and invoking one or more preset functional agents from a pool of functional agents through a preset communication protocol group, selecting and invoking one or more preset invoking tools from a preset tool set through a preset communication protocol group, or interacting with the user for clarification. The preset communication protocol group includes the A2A protocol for communicating with preset functional agents and the MCP protocol for communicating with preset invoking tools.
[0063] During the action phase, the server can match the desired preset functional agents and / or pre-defined tools based on the action task type, the functional agent list, the description module, and the tool list and description module, and then execute the action task in sequence. If interaction with the user is needed for clarification, the server can generate supplementary information for the user to query and request.
[0064] The functional agent pool contains a group of relatively independent agents that are responsible for performing specific subtasks. These agents can be configured according to specific business needs, such as:
[0065] User Intent Clarification Agent: Responsible for generating clarification questions when user input is ambiguous. Data Pattern Understanding Agent: Responsible for parsing and understanding the database's table structure, field meanings, associations and other metadata. NL2SQL Conversion Agent: Responsible for converting users' natural language queries into precise SQL statements. Data Retrieval and Recall Agent: Responsible for executing database queries or retrieving information from other data sources (such as knowledge bases, documents). Complex Query Decomposition Agent: Responsible for decomposing complex user requests into multiple executable sub-queries or sub-tasks. Data Analysis and Insight Agent: Responsible for performing statistical analysis, trend prediction, anomaly detection, pattern recognition, etc. on the acquired data to explore potential insights. Result Interpretation and Summarization Agent: Responsible for explaining and summarizing the analysis results (data, charts) in natural language to make them easier to understand. Visualization Suggestion and Generation Agent: Responsible for recommending appropriate visualization types based on data characteristics and user intent, and calling the chart library to generate charts.
[0066] Each pre-configured functional agent interacts with the master agent or other functional agents via a unified A2A protocol. Each agent has a clear functional definition, input (task description, data), and output (results, status). Its internal implementation can be rule-based, using traditional machine learning models, small, specialized LLMs, or even calling external APIs. The key is that its interface adheres to the A2A protocol.
[0067] A preset toolset contains a set of external tools or services that can be called by the main agent or a specific functional agent. These tools provide the ability to perform specific operations, such as:
[0068] Database connection and query execution tool: Responsible for connecting to the database and executing SQL statements. Code executor: Responsible for executing code snippets such as Python for complex data processing or calculations. Chart generation library application programming interface (API): Encapsulates the interface of charting libraries such as Matplotlib, Plotly, and ECharts. External knowledge base search engine: Used to query unstructured knowledge such as company documents and industry reports. Business rule engine: Used to execute predefined business rules. API calling tool: Used to call internal enterprise or third-party API services.
[0069] Tools are called in a standardized manner using the unified MCP protocol. The master agent (or authorized functional agent) must understand the tool's capability description and generate call instructions that comply with the MCP specification. Each tool must provide a clear API interface definition and output format. The API interface definition includes expected input parameters, parameter types, mandatory requirements, and descriptions. The output format includes success / failure flags, return data, and error messages. Furthermore, metadata describing the tool must be provided in accordance with the MCP protocol for LLM to understand and use.
[0070] In the embodiment of the present application, the A2A protocol interface implementation defines specific specifications for communication between agents. For example, the message format: usually adopts the JSON format, including standard message headers (such as sender_agent_id, receiver_agent_id, message_id, timestamp, message_type (REQUEST, RESPONSE, NOTIFY)) and message body (task_description, payload, status_code, result). Interaction mode: supports request / response mode (for task invocation) and possible subscription / publish mode (for status updates or event notifications). Service registration and discovery (optional): A mechanism can be implemented to allow functional agents to register their capabilities with the central authority when they start, so that the master agent can dynamically discover and select them.
[0071] MCP protocol interface implementation: defines the specific specifications for the interaction between LLM and tools. For example, tool description specifications: use natural language or structured formats (such as JSON Schema) to describe the tool's name, function, input parameters (name, type, description, whether required), output format, possible error codes, etc. These descriptions need to be injected into the main agent's prompt or queried through a specific mechanism. Call instruction format: defines the structured instruction format that the LLM needs to generate for calling the tool (such as a specific JSON structure or function call syntax). Result return format: defines the standardized result format returned to the LLM after the tool is executed, including execution status, data, and error information.
[0072] Furthermore, the functional agent list and description module of this application includes an agent capability list generated after each preset functional agent sends capability registration information to a preset registration center. Through the A2A protocol, the master agent uses the agent capability list to query the preset functional agent matching the action to be executed. The capability registration information includes at least the label of each preset functional agent and a list of executable task types.
[0073] In other words, this application has a registration center to register intelligent entities. Figure 4The sequence diagram for agent registration and calling is as follows: Figure 4 As shown, Functional Agent A and Functional Agent B can send capability registration information, including registered capabilities (agent_id, task_list), to the Registration Center. The Registration Center then generates a list of agent capabilities. When the Central Agent queries available agents and capabilities during the thinking phase, the Registration Center returns the agent list and capabilities to the Central Agent. The Central Agent can then make a request for a task using pending actions, and the functional agent returns a response (processing results / status). Agents can also proactively notify (event reporting). The Central Agent broadcasts status based on the event report, synchronizing the event with the reporting agent. The Central Agent can then select an agent based on its capabilities.
[0074] Figure 5 This is a timing diagram of the interaction between the main agent and the calling tool under the MCP protocol, such as Figure 5 As shown in the figure, the central decision-making agent (LLM), that is, the main agent, can generate tool call instructions (JSON) and send them to the system MCP interface layer. The interface layer parses the instructions and calls the tool (with parameters). After the tool is executed, it returns a standard result (JSON). The system MCP interface layer forwards the standardized result (JSON). The main agent parses the result and uses it in subsequent thinking.
[0075] S204, step 3: observation phase: receiving the reasoning action feedback results and updating the loop reasoning context, and determining whether to trigger the next round of loop reasoning, until the preset loop termination condition is met, and obtaining the decision analysis results corresponding to the query request information.
[0076] The observation phase accepts the feedback from the reasoning action in step 3 above and updates it to the loop reasoning context. It also analyzes whether the current result has answered the user's query and determines whether the preset loop termination conditions have been met. If the preset loop termination conditions are met, the decision analysis results for each action task can be output.
[0077] This application follows the preset ReAct paradigm of "think-act-observe" to execute circular reasoning. Figure 6 As shown, the process execution logic is described with an example:
[0078] Step 1: User input reception and preliminary analysis
[0079] The system receives natural language business analysis requests input by users through chat interfaces and other means.
[0080] The main agent performs a preliminary understanding of the user input and may determine at this stage whether clarification is needed. If so, its first action may be to invoke a "user intent clarification agent" or directly generate clarification questions, thereby interacting with the user and receiving user feedback.
[0081] Step 2: Think
[0082] The main agent enters the core thinking phase. It will comprehensively consider the following information: the clear intention of the current user question, the complete conversation history, the list of available functional agents and their capability descriptions, the available tool sets and their capability descriptions, relevant database schema information or domain knowledge, and the observation results of the previous round of actions (if it is an iterative loop).
[0083] The LLM then performs reasoning analysis, for example: Is the current information sufficient to answer the question? It identifies the type of question (data query, attribution analysis, prediction, visualization, etc.) and its complexity. It determines whether further clarification of the user's intent is necessary. If clarification is not necessary, it plans the optimal next action. Should it invoke an agent to handle a subtask (such as NL2SQL conversion), directly invoke a tool (such as executing known SQL), or decompose the task?
[0084] Then: The main agent generates one or more candidate action plans internally and evaluates and selects the best one. This thinking process can be guided by a specific prompt to guide the LLM to explicitly output its reasoning steps.
[0085] Step 3: Action
[0086] The main agent executes the optimal action determined in the previous step. Actions are mainly of the following types:
[0087] Action Type 1: Calling a Functional Agent
[0088] The master agent constructs a task request message according to the A2A protocol. This message includes the target agent's ID, the task description (e.g., converting the following natural language into a SQL query), and the required data or context (e.g., the natural language question and relevant table structure information). The request is then sent to the designated functional agent via the A2A protocol's communication interface.
[0089] Action Type 2: Invoke Tool
[0090] The master agent generates a command to invoke a specific tool according to the MCP protocol specification. The command includes the tool name and all required parameters (e.g., SQL statements for a database execution tool, data and chart configuration for a chart generation tool). The command is then sent to the tool executor via the MCP communication interface.
[0091] Action Type 3: Interacting with the User
[0092] The main agent generates a natural language text. This text may be a clarification question to the user, a request for confirmation of an intermediate result, or a provisional conclusion or suggestion. The text is presented to the user through the user interface.
[0093] Step 4: Observation
[0094] The main agent waits for and receives the results, i.e., observations, from the previous action executor. Observations can come from various sources and types:
[0095] a) From the functional agent: task execution results (such as generated SQL statements, analysis reports, and status codes) returned through the A2A protocol.
[0096] b) From the tool: Tool execution results returned via the MCP protocol (such as queried data tables, generated chart URLs, code execution output, success / failure status, and error messages).
[0097] c) From the user: user responses to clarifying questions, confirmation of intermediate results, or further instructions.
[0098] Step 5: Iteration loop and termination condition
[0099] The main agent integrates the received observations into its current knowledge state and dialogue history, updating the loop reasoning context. Based on the new observations, it returns to step 2: Reflection, beginning a new ReAct cycle. The LLM evaluates whether the observations meet expectations and resolve some or all of the issues, and plans the next action accordingly.
[0100] The preset loop termination conditions include at least one or more of the following:
[0101] Based on the query information, the main agent determines whether the solution evaluation value of the reasoning action feedback result after the loop reasoning is greater than the preset termination threshold. The solution evaluation value includes at least the following dimension evaluation sub-values: information completeness, logical consistency, and user intent;
[0102] The number of iterations of the loop reasoning is greater than the preset iteration threshold;
[0103] The master agent receives a termination instruction from the user terminal;
[0104] The main agent determines that it cannot answer the query request information based on the functional agent pool and preset tool set.
[0105] The above-mentioned preset termination threshold and preset iteration number threshold can be set by the user according to the actual usage scenario and updated regularly based on expert experience. This application does not make any specific restrictions on this.
[0106] The preset loop termination conditions can be generally understood as follows: the central decision-making agent determines that the user's question has been satisfactorily answered, the user explicitly expresses satisfaction or ends the conversation, the preset maximum number of iterations or resource limits are reached (to prevent infinite loops), or the central decision-making agent determines that it is unable to continue solving the problem based on the existing information and capabilities, and explains the situation to the user.
[0107] S205: Generate query results based on the decision analysis results obtained through circular reasoning and send them to the user terminal.
[0108] The query result is a single-mode response result or a multi-mode response result.
[0109] In this application, when the ReAct cycle terminates and the problem is considered solved, the main agent is responsible for integrating the key information from the entire analysis process. The "Result Interpretation and Summarization Agent" may be called to convert technical analysis results (such as data tables) into easy-to-understand natural language summaries. The "Visualization Suggestion and Generation Agent" may be called to present the data in the form of appropriate charts. Ultimately, the system presents a complete single-modal response result or multi-modal response result to the user, which may include one or more of the following forms. The forms include: text explanation, structured data, and charts.
[0110] In one embodiment of the present application, after performing circular reasoning, the method further includes:
[0111] Determine key information of historical conversations with the user terminal and encode the key information of historical conversations into historical conversation vectors to construct a cyclic reasoning context based on the historical conversation vectors.
[0112] In other words, this application overcomes the context-forgetting problem that can occur with LLM when handling extremely long conversations. It introduces more advanced conversation history management technology, vectorized memory: This embeds key information from historical conversations (user questions, AI responses, and important observations) into a vector space, generating a historical conversation vector. Similarity retrieval is performed when needed, and the most relevant historical information is injected into the current prompt. Specifically, this application can design storage strategies such as KV caching, parameterized memory, and contextual memory, design short-term and long-term memory retrieval strategies, and design compression strategies such as KVzip technology and memory condensed graph compression strategies. Effective memory storage, retrieval, and compression strategies are designed to ensure that, during multiple rounds of complex analytical conversations, the central decision-making agent always has access to relevant and necessary contextual information, enabling it to make coherent and accurate decisions. Specific memory storage, retrieval, and compression strategies can be set by the user based on actual usage scenarios and are not specifically limited by this application.
[0113] At the same time, this application designs a summary network to implement context memory. An auxiliary model or the LLM itself can be used to regularly perform rolling summaries on the conversation history to retain core information and reduce the length of prompts.
[0114] In addition, this application also has an active insight discovery and early warning mechanism. Specifically: during the analysis process or background monitoring, this application actively discovers potential business opportunities, risk points, abnormal patterns or key trend changes in the data, and actively pushes them to relevant users in an appropriate manner (such as notifications, suggestions, and early warnings).
[0115] This application can pre-define in the agent what constitutes a "valuable insight" or "anomaly requiring early warning" (possibly based on rules, statistical thresholds, or machine learning models); a dedicated "insight discovery agent" or "anomaly detection agent" can be designed and called by the main agent at the appropriate time, or these agents can be allowed to run continuously in the background. This application does not make specific restrictions on this.
[0116] Furthermore, in order to enhance the system's ability to handle user input errors or unreasonable requests, when the server recognizes that the user's question may be logically inconsistent, inconsistent with the currently selected analysis topic / data set, or obviously beyond the system's capabilities, the system does not simply report an error or ask a counter-question, but can provide more constructive feedback and guidance. Specifically, if a user suddenly asks about "employee turnover rate" in a conversation about "sales data", the system can recognize the topic switch and intelligently prompt the user: "Your question seems to be different from the current sales analysis topic. Do you want to switch to the human resources analysis topic?" Or, if the user's query conditions are too strict and there is no data, the system can try to relax certain conditions and give suggestions. This can be achieved by training LLM or setting up an intelligent agent, and this application does not make specific restrictions on this.
[0117] Through the above technical solutions, this application integrates the ReAct paradigm, A2A communication protocol and MCP tool calling protocol to build a new autonomous decision-making business analysis system architecture. With the main intelligent agent driven by a large language model as the core, it coordinates multiple specialized functional intelligent agents and external tools to work together, realizing an end-to-end intelligent analysis process from understanding user intentions, dynamically planning analysis paths, autonomously calling resources to integrating and presenting results. It solves the technical problems of the existing ChatBI platform's rigid processing procedures and difficulty in flexibly carrying out dynamic task planning and autonomous decision-making to execute business analysis, effectively improving the user experience of the ChatBI platform.
[0118] Furthermore, through standardized A2A and MCP protocols, functional agents and tools are loosely coupled. These agents and tools can be easily added, removed, or replaced based on business needs without requiring major modifications to the core system. This "plug-and-play" nature enables the system to quickly adapt to new business scenarios, data sources, and analytical techniques, providing exceptional flexibility and scalability.
[0119] To further illustrate the implementation method of the business intelligence system based on the large model ReAct of this application, this application also provides the following two embodiments, as follows.
[0120] Example 1: Processing a typical database query and visualizing query request information.
[0121] Suppose a user inputs: "Help me find the total sales of all products in the East China region last quarter (assuming it's Q1 2025) and generate a bar chart by product category." The system database contains the sales_records table (with fields: order_id, product_id, product_category, sales_amount, order_date, region).
[0122] Detailed steps
[0123] User input reception: The master agent (LLM) receives the user query request information.
[0124] Thought 1:
[0125] LLM analysis request: The intention is to query aggregate data (total sales) and visualize it.
[0126] Identify key information: Time = "2025 Q1", Location = "East China Region", Indicator = "Total Sales", Grouping Dimension = "Product Category", Chart Type = "Histogram".
[0127] Judging the sufficiency of information: basically sufficient, data query can be carried out directly.
[0128] Action planning: First, convert natural language into SQL, then execute SQL to retrieve data, and finally generate a chart based on the data. The optimal action is to call the NL2SQL agent.
[0129] Action 1: Call the NL2SQL agent
[0130] The master agent constructs the A2A request message:
[0131] receiver_agent_id:"nl2sql_agent"
[0132] task_name:"convert_nl_to_sql"
[0133] parameters:{natural_language_query:"Query the total sales by product category in the East China region in Q1 2025", database_schema:{...sales_records table structure...}}.
[0134] Send a request through the A2A interface.
[0135] Observation 1: Receiving NL2SQL results
[0136] The NL2SQL agent processes the request and generates SQL statements.
[0137] A2A returns the response message:
[0138] status_code: 200
[0139] result: { sql_query: "SELECT product_category, SUM(sales_amount) astotal_sales FROM sales_records WHERE order_date>= '2025-01-01' AND order_date<'2025-04-01' AND region = 'East China Region' GROUP BY product_category"}.
[0140] Thought 2:
[0141] The LLM receives the SQL statement.
[0142] Evaluate the SQL: The statement looks reasonable and meets the user's intent.
[0143] Plan your action: The next step is to execute this SQL statement. The best action is to call the database execution tool.
[0144] Action 2: Call the database execution tool
[0145] The main agent builds the MCP call instruction:
[0146] tool_name: "database_executor"
[0147] arguments: { query: "SELECT product_category, SUM(sales_amount) astotal_sales FROM sales_records WHERE ..."}.
[0148] Send instructions through the MCP interface.
[0149] Observation 2: Receiving database execution results
[0150] The database execution tool connects to the database and executes SQL.
[0151] Results returned by MCP:
[0152] status: "success"
[0153] result: { data: [ {"product_category": "Electronic Products", "total_sales":150000}, {"product_category": "Clothing", "total_sales": 80000}, ... ], error_message: null}.
[0154] Thought 3:
[0155] LLM receives the query result data.
[0156] Judgment status: Data has been successfully obtained.
[0157] Planned Action: The user requests to generate a bar chart. A chart generation tool needs to be called. The optimal action is to call the chart generation tool.
[0158] Action 3: Call the chart generation tool
[0159] The main agent builds the MCP call instruction:
[0160] tool_name: "chart_generator"
[0161] arguments: { data: [ {"product_category": "Electronic products", ...}, ... ],chart_type: "bar", x_axis: "product_category", y_axis: "total_sales", title:"Sales of various product categories in East China in Q1 2025"}.
[0162] Send commands through the MCP interface.
[0163] Observation 3: Receiving chart generation results
[0164] The chart generation tool calls the underlying library (such as Plotly) to generate charts.
[0165] The result is returned by MCP:
[0166] status: "success"
[0167] result: { chart_url: "http: / / internal-charts.com / chart-uuid-xyz.png",error_message: null} / / Or return the chart object itself.
[0168] Thought 4:
[0169] The LLM receives the chart URL.
[0170] Judgment status: Data query and chart generation are completed.
[0171] Action Planning: The task is essentially complete, and the results (textual summaries and charts) need to be presented to the user. This can involve a result interpretation agent, or the main agent can organize the language itself. Assume direct organization.
[0172] Action 4: Reply to the user
[0173] The main agent generates the final response:
[0174] "According to your query, the total sales in the East China region for the first quarter of 2025 were distributed by product category as follows: [Embed or link chart here] The sales of the main categories were: Electronics 150,000 yuan, Clothing 80,000 yuan..." The response is presented to the user through the user interface.
[0175] Termination: The ReAct cycle ends and the task is completed.
[0176] This embodiment illustrates:
[0177] This demonstration demonstrates how the system, through the ReAct loop, sequentially calls the NL2SQL agent (A2A), the database execution tool (MCP), and the chart generation tool (MCP) to complete a complex request involving a query and visualization. Each step embodies the "think-act-observe" process. The A2A and MCP protocols serve as standardized interfaces. The master agent (LLM) drives the entire process through its reasoning and planning capabilities. The LLM possesses enhanced metacognitive capabilities and dialogue strategies.
[0178] Example 2: Handling a complex analysis request requiring clarification and multiple rounds of interaction
[0179] Suppose a user enters: "Why did our company's profits decrease recently?" This is a typical open-ended attribution analysis question.
[0180] Detailed steps
[0181] User input reception: The master agent receives the request.
[0182] Thought 1:
[0183] LLM Analysis Request: The intention is to find out the reasons for the decline in profits.
[0184] Identify the problem: This question is very open-ended. The "recent" timeframe is unclear, the "profit" metric is unclear (gross profit? net profit?), the "decline" requires a benchmark, and the "reason" could involve multiple factors, including revenue, costs, and expenses.
[0185] Judging the sufficiency of information: seriously insufficient and must be clarified.
[0186] Planned Action: Questions need to be asked to the user to clarify the scope of analysis. The optimal action is to invoke the user intent clarification agent or directly generate clarification questions. Assume direct generation.
[0187] Action 1: Reply to the user (clarification)
[0188] The main agent generates clarifying questions: "Which specific time period are you interested in (e.g., last month, last quarter)? Compared to which period (e.g., compared to the previous period, or compared to the same period last year)? Also, are you referring to the company's overall net profit?"
[0189] Send questions through the user interface.
[0190] Observation 1: Receiving user responses
[0191] User response: "It refers to the company's overall net profit last month compared to the month before that."
[0192] Thought 2:
[0193] LLM receives the user's response and updates the context: time = last month, indicator = overall net profit, comparison period = the month before last.
[0194] Analysis task: You need to obtain the net profit data of the previous month and the month before last, compare them, and try to find the main driving factors of the decline (revenue changes? Cost changes? Expense changes?).
[0195] Planning Actions:
[0196] Action a: Get revenue data for the previous month and the month before that.
[0197] Action b: Obtain cost data for the previous month and the month before that (such as sales costs and operating costs).
[0198] Action c: Get expense data for the previous month and the month before that (such as administrative expenses and sales expenses).
[0199] Action d: Calculate net profits and compare.
[0200] Action e: (Optional) Call the data analysis agent to perform attribution analysis.
[0201] Select the optimal sequence of actions: First, retrieve the data. Data retrieval agents / tools can be invoked in parallel or serially. Assume that revenue and cost data are retrieved first. The optimal action is to invoke the NL2SQL agent to generate the query, then invoke the database tool to execute it.
[0202] Action 2: Call NL2SQL Agent (get revenue and cost)
[0203] The main agent constructs an A2A request to generate SQL to query the total revenue and total cost of the previous month and the month before that.
[0204] Observation 2: Receiving SQL statements
[0205] The NL2SQL agent returns the corresponding SQL statement.
[0206] Action 3: Call the database execution tool
[0207] The main agent constructs the MCP instruction and executes the above SQL.
[0208] Observation 3: Receiving revenue and cost data
[0209] The database tool returns revenue and cost data for the previous month and the month before that.
[0210] Thinking 3: LLM receives data.
[0211] Analyzing the data: It was found that revenue decreased slightly last month, but costs increased significantly.
[0212] Conclusion: Rising costs are likely the primary cause of declining profits. Further research is needed to determine the specific components of rising costs.
[0213] Action planning: This involves obtaining detailed cost data (such as raw material costs, labor costs, etc.), or directly invoking a data analysis agent to conduct a more in-depth analysis of the existing data. Assume that you choose to invoke a data analysis agent.
[0214] Action 4: Invoke the Data Analysis and Insight Agent
[0215] The main agent constructs an A2A request:
[0216] receiver_agent_id: "data_analyzer"
[0217] task_name: "analyze_profit_change"
[0218] parameters: { current_period_data: {...last month's revenue and cost...}, previous_period_data: {...the month before last's revenue and cost...}, analysis_focus: "identify drivers forprofit drop"}.
[0219] Observation 4: Receiving analysis reports
[0220] The data analysis agent performs calculations and analysis (it may also call other tools or models internally).
[0221] The analysis report returned via A2A: "Net profit decreased from 5 million in the month before last to 3 million last month. The main reason was a significant increase of 1.5 million in sales costs, of which the increase in raw material procurement costs was the main reason (contributing approximately 1.2 million in increase). Sales revenue decreased slightly by 500,000."
[0222] Thought 4:
[0223] LLM receives the analysis report.
[0224] Judgment status: The main direct cause of the decline in profits has been found (increased raw material costs).
[0225] Plan actions: This preliminary conclusion can be presented to the user, and the user can be asked whether further analysis is needed on the specific reasons for the increase in raw material costs (such as which materials have increased in price, supplier issues, etc.).
[0226] Action 5: Respond to the user (provide preliminary conclusions and ask questions)
[0227] The main agent generates a response: "Our analysis found that the main reason for the company's overall net profit decline last month compared to the month before was a significant increase in sales costs, particularly an increase of approximately 1.2 million yuan in raw material procurement costs. Would you like to further analyze which raw material costs caused the increase?"
[0228] ...(Continue the ReAct cycle based on subsequent user feedback)...If the user wants to go deeper, the system will plan new actions, such as querying more fine-grained procurement data, calling intelligent agents or tools related to supplier analysis, etc.
[0229] Final termination: When the user is satisfied or the system determines that further analysis is impossible, the cycle ends and a final analysis summary report is provided.
[0230] This embodiment illustrates:
[0231] Demonstrates how the system can handle open-ended, complex analysis requests that require multiple rounds of interaction.
[0232] The ReAct paradigm highlights its iterative nature: through repeated clarification with the user, the gradual invocation of internal agents and tools, and observation of results, the problem is continually approached. This demonstrates the central role of the main agent in task decomposition, information evaluation, and dynamic planning. It also showcases the collaborative work between different functional agents (clarification, NL2SQL, and data analysis).
[0233] In addition, regarding the main agent selection strategy: During the "thinking" phase, when multiple available agents or tools can perform similar tasks, the LLM's selection strategy can be based on the following four strategies: Ability Description Match: Select the one whose description best meets the current subtask requirements. Historical Success Rate: Prioritize those with a high success rate for similar tasks in the past. Execution Cost / Speed: When the performance is similar, select the one that is faster or consumes less resources. Context Dependence: Consider the current dialogue state and select the one that best utilizes contextual information.
[0234] These policies can be optimized by setting priority rules in prompts or through reinforcement learning. When transferring complex data structures (such as multidimensional data cubes and analytical reports containing text and charts) between agents (via A2A) or between tools and LLMs (via MCP), standardized, easily serializable and deserializable formats, such as JSON, should be used. For large data sets, consider passing a reference to the data (such as a storage path or ID) so that the recipient can retrieve it on demand, avoiding excessive content in the message body.
[0235] Figure 7 A schematic diagram of the structure of a business intelligence system based on a large model ReAct provided in an embodiment of the present application is shown as follows: Figure 7 As shown, the system adopts the above-mentioned implementation method of the business intelligence system based on the large model ReAct, and the system is applied to the ChatBI platform. The implementation system 700 of the business intelligence system based on the large model ReAct includes:
[0236] The receiving and loop reasoning module 701 is used for the main agent to receive query request information from the user terminal and guide the large language model LLM to perform loop reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project. The loop reasoning process includes:
[0237] Analysis and Determination submodule 7011 is used in step 1: the thinking phase. The LLM analyzes the input information from the upstream task and determines the corresponding pending actions for the downstream task. The input information is either the query request or the inference action feedback from step 3. The pending actions include one or more action tasks derived from the task decomposition.
[0238] Execution submodule 7012 is used in step 2: the action phase. Based on the action tasks and their corresponding action task types, the corresponding reasoning actions are executed. Reasoning actions include at least one or more of the following: selecting and invoking one or more preset functional agents from a pool of functional agents via a preset communication protocol group; selecting and invoking one or more preset calling tools from a preset tool set via a preset communication protocol group; or interacting with the user for clarification. The preset communication protocol group includes the A2A protocol for communicating with preset functional agents and the MCP protocol for communicating with preset calling tools.
[0239] The receiving and determining submodule 7013 is used in step 3: observation phase: receiving the feedback results of the reasoning action and updating the loop reasoning context, and determining whether to trigger the next round of loop reasoning until the preset loop termination condition is met, and obtaining the decision analysis results corresponding to the query request information.
[0240] The generation module 702 is configured to generate a query result based on each decision analysis result obtained by the circular reasoning and send the query result to the user terminal. The query result is a single-modal response result or a multi-modal response result.
[0241] Figure 8 This is a schematic diagram of a structure of a business intelligence system based on a large model ReAct provided in an embodiment of the present application, and the device is applied to the ChatBI platform. Figure 8 As shown, the equipment includes:
[0242] At least one processor. And a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-described method for implementing a business intelligence system based on a large model ReAct.
[0243] The various embodiments in this application are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system and device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the partial description of the method embodiments.
[0244] The systems, devices, and methods provided in the embodiments of the present application correspond one-to-one. Therefore, the systems and devices also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and devices will not be repeated here.
[0245] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0246] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for implementing a business intelligence system based on a large model ReAct, characterized in that: The method is applied to the ChatBI platform; the method includes: The main agent receives the query request information from the user terminal and guides the large language model LLM to perform cyclic reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project. The cyclic reasoning process includes: Step 1: Thinking phase: LLM analyzes the input information from the upstream task and determines the corresponding pending actions for the downstream task. The input information is the query request information or the inference action feedback result from step 3. The pending actions include one or more action tasks obtained from task decomposition. Step 2: Action phase: Execute corresponding reasoning actions according to the action tasks and their types corresponding to the to-be-executed actions; wherein the reasoning actions include at least one or more of the following: selecting and calling one or more preset functional agents in the functional agent pool through a preset communication protocol group, selecting and calling one or more preset calling tools in a preset tool set through a preset communication protocol group, or interacting with the user for clarification; the preset communication protocol group includes the A2A protocol for communicating with the preset functional agents and the MCP protocol for communicating with the preset calling tools; Step 3: Observation phase: Receive the feedback results of the reasoning action and update the loop reasoning context, and determine whether to trigger the next round of loop reasoning until the preset loop termination conditions are met, and obtain the decision analysis results corresponding to the query request information; Based on each of the decision analysis results obtained by the circular reasoning, a query result is generated and sent to the user terminal; wherein the query result is a single-modal response result or a multi-modal response result; The preset Prompt project includes at least the following predefined modules: role definition module, core instruction module, available resource module, functional agent list and description module, tool list and description module, database schema / domain knowledge module, conversation history module, current user request module, output format requirement module and dynamic information injection module; The functional agent list and description module includes an agent capability list generated after each of the preset functional agents sends capability registration information to a preset registration center, so that the master agent can query the preset functional agent matching the to-be-executed action through the agent capability list through the A2A protocol; wherein the capability registration information at least includes a label of each of the preset functional agents and a list of executable task types; Among them, agent registration and calling include: functional agent A and functional agent B send capability registration information to the registration center, including registration capability agent_id and task_list, and the registration center can generate the agent capability list; when the main agent queries available agents and capabilities in the thinking stage, the registration center returns the agent list and capabilities to the main agent; then, the main agent can make task requests through pending actions, the functional agent returns the processing results / status, and the agent actively reports events; the main agent broadcasts the status according to the event report to synchronize the events of the event reporting agent; Among them, tools are called in a standardized manner through the unified MCP protocol; the master agent or authorized functional agent can understand the tool's capability description and generate call instructions that comply with the MCP specification; the interaction between the master agent and the calling tool under the MCP protocol includes: the master agent generates a tool call instruction and sends it to the system MCP interface layer, the interface layer parses the instruction and calls the tool; after the tool is executed, it returns a standard result, and the system MCP interface layer forwards the standardized result; the master agent parses the result and uses it in subsequent thinking; After performing the circular reasoning, the method further includes: Determining key information of historical conversations with the user terminal, and encoding the key information of historical conversations into a historical conversation vector, so as to construct the loop reasoning context according to the historical conversation vector; After the master agent receives the query request information from the user terminal, the method further includes: Matching a user portrait corresponding to the user terminal in a preset user portrait database; wherein the preset user portrait database includes a plurality of user portraits constructed based on user behavior information; the user behavior information includes at least: historical query behavior, business indicators of interest, commonly used chart types, and role permissions; The matched user profile is added to the loop reasoning context, so that the LLM performs loop reasoning matching the user profile.
2. The method for implementing a business intelligence system based on a large model ReAct according to claim 1, characterized in that: LLM analyzes input from upstream tasks and determines the actions to be performed for downstream tasks, including: When the input information is input into the LLM and it is determined that the input information contains multiple action tasks, a corresponding subtask sequence is generated; wherein the subtask sequence is arranged according to the execution order of each action task; the execution order is determined by the LLM based on the input information; Determine an action call sequence based on the subtask sequence, the functional information of each agent in the functional agent list and description module, and the functional information of each tool in the tool list and description module; wherein the action call sequence includes the order of calling each preset functional agent and / or each preset calling tool that matches each action task according to the subtask sequence; The to-be-executed action corresponding to the action phase is generated according to the subtask sequence and the action calling sequence.
3. The method for implementing a business intelligence system based on a large model ReAct according to claim 1, characterized in that: The preset loop termination conditions include at least one or more of the following: The master agent determines, based on the query request information, that a solution evaluation value of the reasoning action feedback result after the circular reasoning is greater than a preset termination threshold; the solution evaluation value includes at least the following dimension evaluation sub-values: information integrity, logical consistency, and user intention; The number of iterations of the loop reasoning is greater than a preset iteration number threshold; The master agent receives a termination instruction from the user terminal; The main agent determines that it is unable to answer the query request information based on the functional agent pool and the preset tool set.
4. The method for implementing a business intelligence system based on a large model ReAct according to claim 1, characterized in that: The preset functional agents include at least one of the following: user intention clarification agent, data pattern understanding agent, NL2SQL agent, complex query decomposition agent, data analysis and insight agent, result interpretation and summary agent, visualization suggestion and generation agent; each of the preset functional agents communicates with each other through the A2A protocol.
5. A business intelligence system based on a large model ReAct, characterized in that: The system adopts the implementation method of a business intelligence system based on a large model ReAct as described in any one of claims 1 to 4 above; the system is applied to the ChatBI platform; the system includes: The receiving and loop reasoning module is used for the main agent to receive query request information from the user terminal and guide the large language model LLM to perform loop reasoning on the query request information according to the preset ReAct paradigm through the preset Prompt project. The loop reasoning process includes: The analysis and determination submodule is used in step 1: the thinking phase: the LLM is used to analyze the input information from the upstream task and determine the corresponding pending actions for the downstream task; wherein the input information is the query request information or the reasoning action feedback result from step 3; the pending actions include one or more action tasks obtained from task decomposition; An execution submodule is used in step 2: an action phase: executing corresponding reasoning actions according to the action tasks corresponding to the to-be-executed action and the action task types thereof; wherein the reasoning actions include at least one or more of the following: selecting and calling one or more preset functional agents in a functional agent pool through a preset communication protocol group, selecting and calling one or more preset calling tools in a preset tool set through a preset communication protocol group, or interacting with a user for clarification; the preset communication protocol group includes an A2A protocol for communicating with the preset functional agents and an MCP protocol for communicating with the preset calling tools; The receiving and determining submodule is used in step 3: observation phase: receiving the inference action feedback results and updating the loop reasoning context, and determining whether to trigger the next round of loop reasoning until the preset loop termination condition is met, and obtaining the decision analysis results corresponding to the query request information; A generation module is used to generate a query result based on each decision analysis result obtained by the circular reasoning and send it to the user terminal; wherein the query result is a single-modal response result or a multi-modal response result.
6. A device for implementing a business intelligence system based on a large model ReAct, characterized in that: The device is applied to the ChatBI platform; the device includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the implementation method of a business intelligence system based on a large model ReAct as described in any one of claims 1 to 4 above.
Citation Information
Patent Citations
Data security analysis method based on large language model
CN119203232A
Question and answer method based on thinking chain and intelligent agent and ChatBI system
CN120012760A