A method for intelligent agent-driven BI analysis scenario
Through the agent-driven method, large models and tool chain execution are used to solve the problems of user cognition and technical barriers in complex enterprise scenarios, and the efficient, accurate and low-cost implementation of BI analysis scenarios is achieved.
Patent Information
- Application Number
- CN202411846420.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-04
AI Technical Summary
In complex enterprise scenarios, traditional BI systems increase users' cognitive and technical barriers, and increase the implementation cost of BI analysis scenarios.
By combining the agent, tool chain, tool library and scenario library, the agent uses a large model to complete the BI analysis of the entire process. The scene library implements specific and diverse BI business scenarios; the tool chain implements chain execution of large models, BI scenarios and other tools; the agent uses the call to the big model to analyze user input tasks and match the corresponding tool chain execution to obtain BI scenario results.
It reduces users' proficiency needs for BI systems, simplifies BI analysis process, reduces implementation costs, and improves the efficiency and accuracy of BI analysis scenarios.
Smart Images

Figure CN119760234A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a method for an intelligent agent to drive a BI analysis scenario. Background Art
[0002] In the current information technology field, business intelligence (BI) systems are widely used in all walks of life as important tools for data analysis and decision support. BI analysis scenarios are scenarios in which enterprise data is analyzed in a business environment using technologies such as data warehouses, data mining, and data analysis to help enterprises make more informed business decisions. It has industry relevance and business relevance, that is, the content of BI analysis scenarios varies according to industries, enterprises, and businesses. On the other hand, the process of BI analysis scenarios is consistent, that is, the process of BI analysis is usually a process of using BI tools or systems to analyze and gain insights, draw conclusions, and generate informed business decisions, which includes problem definition, scope delineation, indicator selection, data preparation, data acquisition, indicator calculation, data visualization and indicator analysis, and drawing conclusions and action guidance or suggestions. Traditional BI systems mainly rely on data integration, data visualization, interactive analysis, friendly user interfaces, reports, and dashboards. Users rely on these tools or methods, need to be proficient in using tools, and have a deep understanding and analysis of the business logic of the field to effectively carry out BI analysis activities in the field. Especially in complex scenarios of enterprises, the complexity of data and business creates cognitive and technical barriers for users, which increases the implementation cost of BI analysis scenarios.
[0003] In recent years, with the development of artificial intelligence applications, especially the emergence of intelligent agents based on large language models, it has become possible to build BI intelligent agents that can fully or partially replace the daily work of human analysts. The present invention combines intelligent agents, tool chains, tool libraries and scenario libraries, so that intelligent agents can use large models to complete the entire BI analysis process. Among them, the scenario library implements specific and diverse BI business scenarios; the tool chain implements the chain execution of large models, BI scenarios and other tools; the tool chain is also a configuration tool that can flexibly arrange any tools and scenarios; the intelligent agent performs task analysis on the user's input, the system scenario library and the data dictionary by calling the large model, and matches the corresponding tool chain according to the call result and executes it to obtain the BI scenario result. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a method for an agent-driven BI analysis scenario that overcomes the above problems or at least partially solves the above problems. The analysis method includes:
[0005] Step S1: Initialize the tool chain object library, tool library and BI scenario library;
[0006] Step S2: The front-end module interacts with the user, obtains the user input and sends it to the Web service;
[0007] Step S3: The Web service receives the request, records it in the database, and calls the agent;
[0008] Step S4: The agent parses the task and matches the toolchain according to the scenario;
[0009] Step S5: the agent executes the toolchain using the scene parameters;
[0010] Step S6: the agent calls the BI scenario tool;
[0011] Step S7: The agent completes the execution of the remaining steps of the tool chain;
[0012] Step S8: The Web service returns the received output to the front end.
[0013] Optionally, the step S1: initializing the tool chain object library, tool library and BI scenario library specifically includes:
[0014] The BI scenario tool uses the BI scenario name to dynamically load and execute BI scenarios from the database and file system;
[0015] Reinitialize the toolchain configuration library by using two methods: timed scanning and interface triggering;
[0016] The system will re-read the BI scenario and tool chain configuration from the database or file system and reset the BI scenario library and tool chain object library.
[0017] Optionally, the step S2: the front-end module interacts with the user, obtains the user input and sends it to the Web service specifically includes:
[0018] The front end includes chat interaction, control interaction, and chart display functions, and is developed using HTML, CSS, and Vue.js technologies;
[0019] The front end sends the user input in text form to the Web server;
[0020] Data transmission adopts streaming transmission, using the Server-Sent-Event of the HTTP protocol or the WebSocket protocol, maintaining a long connection with the server. The long connection ensures that the data is transmitted to the user in real time.
[0021] Optionally, the step S3: the Web service receives the request and records it in the database, and calling the agent specifically includes:
[0022] Web services use a layered structure, with WebAPI at the top and agents, ORM, and database at the bottom.
[0023] The intelligent agent includes scene recognition, entity recognition and tool chain;
[0024] The web interface layer is responsible for receiving external calls, the agent is responsible for driving the BI process, and the ORM and database are responsible for reading and writing records;
[0025] The Web service stores the content sent by the user in the conversation record database to ensure that the records used are searchable and traceable; then the content is used as a parameter to call the intelligent agent.
[0026] Optionally, the step S4: the agent parses the task and matches the tool chain according to the scenario specifically includes:
[0027] The intelligent agent uses the text understanding ability of the large model to perform scene recognition and entity recognition on the user's questions;
[0028] Entity recognition relies on large language models that use fine-tuning of instructions to improve accuracy and data dictionary implementation of BI systems;
[0029] The contents of the data dictionary are stored in the database and are periodically read and updated from the BI system by the extraction, transformation, and loading pipeline;
[0030] The agent finds the corresponding toolchain object from the tool object library based on the recognized scenario name, and calls the toolchain with the scenario name, entity, user question and HTTP streaming object as scenario parameters.
[0031] Optionally, the step S5: the agent uses the scene parameters to execute the tool chain specifically includes:
[0032] The parameters of the scene call include the scene name, entity and streaming interface object;
[0033] A toolchain is a chain of tools. Each node is a tool. The agent executes each tool in sequence. Data is transferred between tools through the global Context object. The toolchain executor executes the tools according to the arranged parameters and sequence.
[0034] Before executing a single tool, a new local Context object will be created, and then the parameters in the global object will be copied to the local object according to the parameter name specified in the input selector, and then the local object will be used to execute the tool;
[0035] After a single tool is executed, use the output selector to select parameters from the local object and write them to the global object;
[0036] The output and input selectors are implemented in the same way, which includes a selection list, where each list item includes an input key and an output key;
[0037] The trigger includes a judgment key and a judgment condition. After each tool chain is executed, the corresponding data in the global context is read according to the trigger key, and the trigger is determined according to the judgment condition.
[0038] The judgment conditions include equivalence conditions, regular expression conditions, and comparison conditions. If the execution result meets the trigger condition, the trigger logic will be executed, and the intermediate result will usually be returned before the entire tool chain is executed.
[0039] At the end of the toolchain execution, the result in the global Context will be returned according to the output selector in the configuration.
[0040] Optionally, the step S6: the agent calling the BI scenario tool specifically includes:
[0041] The scenario segmentation is determined by the incoming intent, indicators, and dimensions. In a scenario, there are many different processing situations depending on the indicators and dimensions.
[0042] In the data query phase, entities are broken down into SQL query statements or interface calls based on the rules of the segmented scenarios and sent to the data source for query;
[0043] In the data analysis phase, according to the rules of the segmented scenarios, the data query results, dimensions and indicators are converted into data analysis interface calls, and then sent to the analysis service API for calling;
[0044] Generate charts using query and analysis results. After completing indicator calculations, format the calculation result data into a format compatible with Echarts.js, such as multi-dimensional bar charts and bar-discount overlay charts.
[0045] Return results, returning data queries, analyses, and tables to the scenario tool.
[0046] Optionally, the step S7: the agent completes execution of the remaining steps of the tool chain includes:
[0047] After the BI scenario tool is executed, data will be written into the global context, and the trigger tool will post a trigger, which will return the result using the streaming interface.
[0048] Use the prompt word tool to generate prompt words from the intent, scenario, query results, analysis results, and two-dimensional table results; use the big model tool to call the big model and prompt it to interpret the data in the scenario;
[0049] The large model tool triggers the post-trigger and writes the returned results to the streaming interface in real time.
[0050] At the end of the toolchain execution, the output selector in the configuration is used to extract the toolchain execution results and return them to the agent, and then returned to the web service.
[0051] Optionally, the step S8: the Web service returns the received output to the front end specifically includes:
[0052] After receiving the agent's execution results, the Web service records them in the chat record database and returns the results to the front end;
[0053] The front-end page receives two kinds of results, one is a structured chart and the other is natural language;
[0054] The former will be rendered into a dynamic chart using the Echarts.js library, and the latter will be displayed as text for users to read;
[0055] After the Web service returns the results, it disconnects the streaming interface and the BI analysis scenario is completed.
[0056] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0058] Figure 1 A flowchart of a method for an agent-driven BI analysis scenario provided by an embodiment of the present invention;
[0059] Figure 2 Provides a flowchart of the interaction between modules of the method according to the embodiment of the present invention;
[0060] Figure 3 A hierarchical software architecture diagram of the Web service provided by the embodiment of the present invention;
[0061] Figure 4 A tool chain and tool execution flow chart provided for an embodiment of the present invention;
[0062] Figure 5 BI scenario tool and BI scenario flowchart provided for the embodiment of the present invention. DETAILED DESCRIPTION
[0063] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0064] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0065] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0066] like Figure 1 and Figure 2 As shown, a method of an intelligent agent driving BI analysis scenario of the present invention includes:
[0067] Step S1: Initialize the tool chain object library, tool library and BI scenario library;
[0068] The system's automatic BI analysis relies on tools and BI scenarios, both of which are classes in programming languages. The tool class is a set of fixed, static classes that exist in the system's source code library and are loaded when the system starts; the BI scenario class is a set of variable, dynamic classes that exist in the database or file system and use the programming language dynamic loading mechanism for syntax detection and dynamic loading, such as Python's importlib. The tool class includes ordinary tools, triggers, and BI scenario tools. Ordinary tools complete a function, such as generating prompt words, calling large models, or calling APIs; trigger classes are triggered under specific circumstances to complete functions including outputting results; BI scenario tools use BI scenario names to dynamically load and execute BI scenarios from databases and file systems.
[0069] Each toolchain configuration is an independent configuration file, such as YAML, which exists in a database or file system. The toolchain configuration file includes the scenario name, scenario description, toolchain configuration, trigger configuration, and toolchain output selector; the toolchain configuration is a chain configuration of multiple tools connected in front and behind, and each tool includes the tool class name, input selector, and output selector. The toolchain represents the order in which the tools are executed, and the execution results of the previous tools serve as the input of the following tools. The toolchain class is a class whose properties include all the configuration items in the toolchain configuration.
[0070] The system reads all toolchain configurations from the database and file system, and uses data-to-object mapping tools, such as Pydantic, to parse toolchain configuration files and finally map configuration items to objects. The BI scenario class, tool class, trigger name, selector attribute, etc. in the system are dynamically loaded and instantiated into objects, finally forming a toolchain object library.
[0071] The system will ensure that the configuration in the tool chain is consistent with that in the tool library and scenario library. When the system instantiates the tool chain, it will perform a consistency check on the items in the configuration file, including whether the scenario name has a corresponding BI scenario class, whether the tool class name exists, whether the trigger exists, whether the selection keys of the input and output selectors are consistent, etc. If there is an inconsistency, the system initialization will identify it and throw an exception.
[0072] After the system is started, the toolchain configuration library can be reinitialized through scheduled scanning and interface triggering. The system will re-read the BI scenario and toolchain configuration from the database or file system, and reset the BI scenario library and toolchain object library. Developers can dynamically add new BI scenarios to the system to meet new BI analysis needs.
[0073] Step S2: The front end interacts with the user, obtains user input and sends it to the Web service.
[0074] The front end includes chat interaction, control interaction, chart display and other functions, which are developed using HTML, CSS, and Vue.js technologies. The front end sends the user's input in text form to the Web server. Data transmission adopts streaming transmission, using the HTTP protocol's Server-Sent-Event (SSE) or WebSocket protocol, and maintains a long connection with the server. The long connection ensures that data can be transmitted to users in real time, improving the user experience.
[0075] Step S3: The Web service receives the request, records it in the database, and then calls the agent.
[0076] like Figure 3 As shown in the figure, the Web service uses a layered structure, with the top layer being the Web API and the lower layers being the agent, ORM, and database. The agent includes scene recognition, entity recognition, and tool chain. The Web interface layer is responsible for receiving external calls, the agent is responsible for driving the BI process, and the ORM and database are responsible for reading and writing records.
[0077] The Web service stores the content sent by the user in the conversation record database to ensure that the records used are searchable and traceable; then the content is used as a parameter to call the intelligent agent.
[0078] Step S4: The agent parses the task and matches the toolchain according to the scenario.
[0079] The agent first uses the text understanding ability of the big model to perform scene recognition and entity recognition on the user's question. Scene recognition is essentially a text classification task: first, all scene names and descriptions in the toolchain object library are combined to form all selectable categories; then, together with the template, an intent recognition prompt word is formed, and the prompt word content is roughly: "You are a senior BI analyst. Based on the user's question and the Q&A record, select the most suitable business scenario from the following..."; finally, it is sent to the big model to return the recognized scene. Here, each toolchain configuration has a unique name and a description. This name and description must contain the content of the specific BI scenario, and the meaning must accurately express this scenario, so that the intent recognition in the previous steps can be matched according to the user's question. For situations where multiple scenarios may match, the system will prompt the big model to select the scenario with the highest matching degree.
[0080] Entity recognition relies on the use of instruction fine-tuning to improve the accuracy of large language models and data dictionaries of BI systems. Instruction fine-tuning uses base large models such as Qwen2.5_7B, and the chinese_ner_sft dataset for fine-tuning. The data dictionary is converted into text format by the tables, datasets, model names, etc. in the system and stored in the database or file system. During entity recognition, the data dictionary and user questions are combined into prompt words, which roughly read: "You are an expert in the field of text entity recognition. You need to extract indicators, dimensions, time, organization, and entities from the given sentence based on the items in the data dictionary, and output them in json format. The content of the data dictionary is:..." The system will select a set of entities with the highest matching degree.
[0081] The contents of the data dictionary are stored in the database and are regularly read and updated from the BI system by the extraction, transformation, and loading pipeline (ETL pipeline). New entities in the BI system can be reflected in the data dictionary, allowing the system to query new data.
[0082] The agent finds the corresponding toolchain object from the tool object library based on the recognized scenario name, and calls the toolchain with the scenario name, entity, user question and HTTP streaming object as scenario parameters.
[0083] Step S5: The agent executes the toolchain using the scene parameters.
[0084] The parameters of the scene call include the scene name, entity and streaming interface object.
[0085] The tool chain is a chain of tools. Each node is a tool, and the agent executes each tool in sequence. Figure 4 As shown in a. Data is passed between tools through the global Context object, and the toolchain executor executes the tools according to the arranged parameters and order. Before executing a single tool, a new local Context object will be created, and then the parameters in the global object will be copied to the local object according to the parameter name specified in the input selector, and then the local object will be used to execute the tool. After the execution of a single tool, the output selector is used to select parameters from the local object and write them to the global object. The selector is configured in the toolchain configuration YAML file, and the reading and writing of parameters in the global Context are declared to ensure parameter transmission between tools.
[0086] The output and input selectors are implemented in the same way, which includes a selection list. Each list item includes an input key and an output key. The input key is responsible for selecting parameters from the global context, and the output key selects the key name written to the local context. The output selector is responsible for selecting from the local context and writing to the global context. During the execution of the toolchain, an independent local context object will be created for each tool, and the global context object will be updated according to the configuration of the selector after the execution is completed. This method creates a separate variable space for each tool execution, avoiding the tool from writing data by mistake, and giving the toolchain the opportunity to rename variables to avoid the output of the tool and the existing names being duplicated.
[0087] The trigger includes a judgment key and a judgment condition. After each tool chain is executed, the corresponding data in the global context is read according to the trigger key, and the judgment condition is used to determine whether to trigger. The judgment conditions include equivalence conditions, regular expression conditions, comparison conditions, etc. If the result of the execution meets the trigger condition, the trigger logic will be executed, so that the intermediate result is usually returned before the entire tool chain is executed. At the end of the tool chain execution, the result in the global context will be selected and returned according to the output selector in the configuration. For the execution process of a single tool, see Figure 4 b.
[0088] Step S6: The agent calls the BI scenario tool.
[0089] The task of the BI scenario tool is to match and execute the corresponding BI scenario. BI scenarios are specific programs that aim to achieve a specific BI requirement, such as indicator insight analysis, strategy recommendation, strategy evaluation or strategy optimization.
[0090] The execution order of the BI scenario tool is as follows: first, according to the name of the scenario, find the corresponding scenario object from the BI scenario library and load it dynamically. Then, pass in the scenario parameters and execute the scenario. After the call is completed, write the result to the local context. Figure 5 As shown in a.
[0091] The input of BI scenarios is entities and intents, and the output is data that meets the rendering format requirements or Markdown tables that are easy to interpret for large models. After the scenario is executed, the trigger will be triggered and the chart will be output. In the user interaction front-end page, Echarts.js can directly render the data into a visual chart.
[0092] BI scenario is the encapsulation of an analytical scenario. The implementation method varies according to the scenario. However, it can be roughly divided into the following steps (refer to Figure 5 b):
[0093] The first step is to determine the sub-scenario of the scenario based on the incoming intent, indicators, and dimensions. In one scenario, there may be multiple different processing situations depending on the indicators and dimensions, such as single-dimensional analysis and query, multi-dimensional analysis and query, and multi-indicator query.
[0094] The second step is the data query stage. According to the rules of the segmented scenarios, the entities are refined into SQL query statements or interface calls, and then sent to the data source for query. The indicators represent the tables in the From statement, the dimensions represent the columns in the Select statement, and the aggregation statement can formulate dimensions according to the characteristics of the scenario, such as Group by age, gender, organization, etc. The data source can be a BI analysis system, an OLAP data warehouse, or a data mart.
[0095] The third step is the data analysis phase. According to the rules of the segmented scenarios, the data query results, dimensions and indicators are converted into data analysis interface calls, and then sent to the analysis service API for calling. The analysis service is an analysis implemented according to the characteristics of the scenario, such as customer group analysis, indicator attribution analysis, etc.
[0096] The fourth step is to generate charts using the query and analysis results. After the indicator calculation is completed, the calculation result data is formatted into a format compatible with Echarts.js, such as multi-dimensional bar charts, bar-discount overlay charts, etc. In order to facilitate large model data analysis, table data in Markdown format is also provided.
[0097] The fifth step is to return the results, returning the data query, analysis, and table to the scenario tool.
[0098] Step S7: The agent completes the execution of the remaining steps of the tool chain.
[0099] After the BI scenario tool is executed, data will be written into the global context. This data will trigger the tool post-trigger, and the trigger will use the streaming interface to return the result. Then use the prompt word tool to generate prompt words based on the intent, scenario, query results, analysis results, and two-dimensional table results. The prompt words are "You are a senior data analyst. You need to provide users with analysis of XX scenarios based on the following data." Then use the big model tool to call the big model and prompt it to interpret the data in the scenario. The big model tool triggers the post-trigger and writes the returned results to the streaming interface in real time.
[0100] The BI big model is a big model for the financial vertical field that has been specially fine-tuned to adapt to BI analysis. It has stronger financial report analysis capabilities, chart analysis capabilities, report writing capabilities, report summary analysis and financial industry analysis capabilities.
[0101] Since the tool chain is flexible, the remaining steps of the tool chain are not limited to data analysis, but can also be data comparison, indicator recommendation, etc.
[0102] At the end of the toolchain execution, the output selector in the configuration is used to extract the toolchain execution results and return them to the agent, and then returned to the web service.
[0103] Step S8: The Web service returns the received output to the front end.
[0104] After receiving the execution result of the agent, the Web service records it in the chat record database and returns the result to the front end. The front end page receives two results, one is a structured chart and the other is natural language. The former will be rendered into a dynamic chart using the Echarts.js library, and the latter will be displayed as text for users to read. After the Web service returns the result, it disconnects the streaming interface, and the BI analysis scenario is completed.
Claims
1. A method for driving a BI analysis scenario by an intelligent agent, characterized in that: The analysis method comprises: Step S1: Initialize the tool chain object library, tool library and BI scenario library; Step S2: The front-end module interacts with the user, obtains the user input and sends it to the Web service; Step S3: The Web service receives the request, records it in the database, and calls the agent; Step S4: The agent parses the task and matches the toolchain according to the scenario; Step S5: the agent executes the toolchain using the scene parameters; Step S6: the agent calls the BI scenario tool; Step S7: The agent completes the execution of the remaining steps of the tool chain; Step S8: The Web service returns the received output to the front end.
2. The method for driving BI analysis scenarios by an agent according to claim 1, characterized in that: The step S1: initializing the tool chain object library, the tool library and the BI scenario library specifically include: The BI scenario tool uses the BI scenario name to dynamically load and execute BI scenarios from the database and file system; Reinitialize the toolchain configuration library by using two methods: timed scanning and interface triggering; The system will re-read the BI scenario and tool chain configuration from the database or file system and reset the BI scenario library and tool chain object library.
3. The method for agent-driven BI analysis scenario according to claim 1, characterized in that: The step S2: the front-end module interacts with the user, obtains the user input and sends it to the Web service, specifically includes: The front end includes chat interaction, control interaction, and chart display functions, and is developed using HTML, CSS, and Vue.js technologies; The front end sends the user's input in text form to the Web server; Data transmission adopts streaming transmission, using the Server-Sent-Event of the HTTP protocol or the WebSocket protocol, maintaining a long connection with the server. The long connection ensures that the data is transmitted to the user in real time.
4. The method for driving BI analysis scenarios by an agent according to claim 1, characterized in that: Step S3: The Web service receives the request and records it in the database. The calling agent specifically includes: Web services use a layered structure, with WebAPI at the top and agents, ORM, and database at the bottom. The intelligent agent includes scene recognition, entity recognition and tool chain; The web interface layer is responsible for receiving external calls, the agent is responsible for driving the BI process, and the ORM and database are responsible for reading and writing records; The Web service stores the content sent by the user in the conversation record database to ensure that the records used are searchable and traceable; then the content is used as a parameter to call the intelligent agent.
5. The method for agent-driven BI analysis scenario according to claim 1, characterized in that: The step S4: the agent analyzes the task and matches the tool chain according to the scenario, specifically including: The intelligent agent uses the text understanding ability of the large model to perform scene recognition and entity recognition on the user's questions; Entity recognition relies on large language models that use fine-tuning of instructions to improve accuracy and data dictionary implementation of BI systems; The contents of the data dictionary are stored in the database and are periodically read and updated from the BI system by the extraction, transformation, and loading pipeline; The agent finds the corresponding toolchain object from the tool object library based on the recognized scenario name, and calls the toolchain with the scenario name, entity, user question and HTTP streaming object as scenario parameters.
6. The method for agent-driven BI analysis scenario according to claim 1, characterized in that: The step S5: the agent uses the scene parameters to execute the tool chain specifically includes: The parameters of the scene call include the scene name, entity and streaming interface object; A toolchain is a chain of tools. Each node is a tool. The agent executes each tool in sequence. Data is transferred between tools through the global Context object. The toolchain executor executes the tools according to the arranged parameters and sequence. Before executing a single tool, a new local Context object will be created, and then the parameters in the global object will be copied to the local object according to the parameter name specified in the input selector, and then the local object will be used to execute the tool; After a single tool is executed, use the output selector to select parameters from the local object and write them to the global object; The output and input selectors are implemented in the same way, which includes a selection list, where each list item includes an input key and an output key; The trigger includes a judgment key and a judgment condition. After each tool chain is executed, the corresponding data in the global context is read according to the trigger key, and the trigger is determined according to the judgment condition. The judgment conditions include equivalence conditions, regular expression conditions, and comparison conditions. If the execution result meets the trigger condition, the trigger logic will be executed, and the intermediate result will usually be returned before the entire tool chain is executed. At the end of the toolchain execution, the result in the global Context will be returned according to the output selector in the configuration.
7. The method for agent-driven BI analysis scenario according to claim 1, characterized in that: The step S6: the agent calling the BI scenario tool specifically includes: The scenario segmentation is determined by the incoming intent, indicators, and dimensions. In a scenario, there are many different processing situations depending on the indicators and dimensions. In the data query phase, entities are broken down into SQL query statements or interface calls based on the rules of the segmented scenarios and sent to the data source for query; In the data analysis phase, according to the rules of the segmented scenarios, the data query results, dimensions and indicators are converted into data analysis interface calls, and then sent to the analysis service API for calling; Generate charts using query and analysis results. After completing indicator calculations, format the calculation result data into a format compatible with Echarts.js, such as multi-dimensional bar charts and bar-discount overlay charts. Return results, returning data queries, analyses, and tables to the scenario tool.
8. The method for driving BI analysis scenarios by an agent according to claim 1, characterized in that: The step S7: the agent completes the execution of the remaining steps of the tool chain including: After the BI scenario tool is executed, data will be written into the global context, and the trigger tool will post a trigger, which will return the result using the streaming interface. Use the prompt word tool to generate prompt words from the intent, scenario, query results, analysis results, and two-dimensional table results; use the big model tool to call the big model and prompt it to interpret the data in the scenario; The large model tool triggers the post-trigger and writes the returned results to the streaming interface in real time. At the end of the toolchain execution, the output selector in the configuration is used to extract the toolchain execution results and return them to the agent, and then returned to the web service.
9. The method for agent-driven BI analysis scenario according to claim 1, characterized in that: The step S8: the Web service returns the received output to the front end specifically includes: After receiving the agent's execution results, the Web service records them in the chat record database and returns the results to the front end; The front-end page receives two kinds of results, one is a structured chart and the other is natural language; The former will be rendered into a dynamic chart using the Echarts.js library, and the latter will be displayed as text for users to read; After the Web service returns the results, it disconnects the streaming interface and the BI analysis scenario is completed.
Citation Information
Cited By
Spatial analysis method based on large model agent driving
CN120806132A