A KCMAP-based trusted planning workflow method for power data governance
By introducing a trusted planning workflow method based on KCMAP in power data governance, combining multi-agent collaborative technology and domain knowledge, the problems of low efficiency and limited application of intelligent technology in power data governance are solved, and more efficient and reliable are achieved data governance operation planning and execution.
Patent Information
- Application Number
- CN202411487039.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-24
AI Technical Summary
In the field of power data governance, the existing technology faces the problems of large workload, low efficiency, long online cycle and insufficient expansion capabilities. The lack of understanding of intelligent technology by business personnel has limited the application of intelligent technology in data governance.
A trusted planning workflow method for power data governance based on KCMAP is proposed, through the collection of knowledge about power data governance, designing the organizational structure of operation process knowledge, introducing multi-agent collaborative technology, designing trusted planning propt templates and building trusted planning for tasks Agile to realize the automated planning and execution of data governance operations.
By introducing domain knowledge and multi-agent collaborative technology, the planning quality and execution efficiency of data governance operations are improved, intention identification bias and agent ability illusion are reduced, and task success rate and system robustness are improved.
Smart Images

Figure CN119003744B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power data governance, and specifically relates to a trusted planning workflow method for power data governance based on KCMAP (Knowledge and Capability matching-Motivated Autonomous Planning). Background Art
[0002] In the field of power data governance, data governance operations are usually dominated by business experience, mainly relying on manual formulation of governance rules combined with customized coding, facing problems such as large workload, low efficiency, long online cycle and insufficient expansion capabilities. The application of machine learning algorithms has promoted the transformation of automation construction from experience-driven to data-driven, allowing business personnel to automatically mine potential governance rules and intelligently identify abnormal data by applying algorithms such as rule mining and anomaly detection, thereby improving governance efficiency and effectively alleviating the problems of large workload and low efficiency of traditional data governance routes. Despite this, when carrying out relevant power data governance operations, there is still a significant threshold for many business personnel with non-technical professional backgrounds to understand and master such complex intelligent technologies and tools. Business personnel may lack the necessary technical knowledge reserves and have insufficient understanding of the working principles, application scenarios, input restrictions and outputs of the algorithms, so as to avoid using them in actual governance operations due to lack of understanding. This not only limits the effective penetration and application of intelligent technologies in data governance, but also hinders the improvement of efficiency and accuracy of power data governance work.
[0003] The rapid rise of Large Language Model (LLM) and intelligent agent technology in the past two years has provided a promising solution to the above-mentioned challenges of power data governance: automation of power data governance operations driven by natural language.
[0004] The development of large language models (LLMs) is currently in a rapid development stage, and many cutting-edge models such as the GPT series, LLaMA series, and Qwen series are constantly emerging. These models have shown amazing capabilities in the field of language processing, such as language understanding, text generation, and question-answering. However, general large language models also face some challenges, such as lagging knowledge updates, hallucinations, insufficient knowledge in the field of power data governance, and inability to interact with external tools. These limitations affect their applicability and effectiveness in power data governance operations. An effective solution is to use agent technology to enable LLMs to interact with external tools. An agent refers to an entity with certain autonomy, learning ability, and decision-making ability. It can perceive information in the environment, reason and plan according to established goals or tasks, and affect the environment by performing actions, thereby achieving interaction with the environment and achieving goals. Among them, LLM plays the role of the "brain" of the agent, directing the agent to respond to various tasks. However, in actual data governance operations, relying solely on building a single "all-round" agent to solve all problems will face multiple challenges, including but not limited to:
[0005] Weak information processing capability: When dealing with highly complex problems, a single agent has limited information processing capabilities. Given that there is only an integrated design, all tasks are completed by one agent, which may be limited by its own cognitive boundaries in data collection, information interpretation and analysis, making it difficult to effectively disassemble problems and reasonably allocate resources, especially when dealing with data governance operations with large amounts of power data and complex business logic.
[0006] Low adaptability and flexibility: A single agent has difficulty adapting to dynamic changes in the environment or handling tasks that require multiple skills. Once a single agent is built, it can only adapt to a single governance scenario. For some common governance scenarios, the entire agent needs to be rebuilt, which has low flexibility.
[0007] Poor robustness: When a single agent faces complex environmental changes or its own failures, it is easy to cause the complete collapse of the entire system. Since it needs to take into account all information, it cannot make flexible adjustments to the problem effectively.
[0008] In response to the above-mentioned problems of single agents, the mainstream idea is to use a large language model as the brain to drive multiple agents to collaboratively solve complex tasks. Multi-agent collaboration refers to the process in which multiple agents complete one or more tasks through mutual cooperation, coordination and communication. The advantage of this technology is that it can effectively divide the work and collaborate on complex problems, significantly improving the robustness and reliability of task solving. At the same time, it has high adaptability and flexibility, and can dynamically adjust the number of agents according to task requirements to meet the needs of different task scenarios. In multi-agent collaboration technology, task decomposition planning is one of the most important core links. Task decomposition refers to breaking down a complex task into multiple subtasks, each of which is relatively simple and easy to execute; task planning is to plan and arrange these decomposed subtasks, assign appropriate agents to each subtask to generate subtask plans, and ensure the smooth execution of subtasks.
[0009] At present, in more mature multi-agent collaborative frameworks, such as MetaGPT and AutoGen, there are two mainstream task decomposition and planning methods: Decomposition-First and Interleaved. The decomposition-first method refers to first decomposing the task into subtasks, and then planning each subtask in turn; while the interleaved decomposition involves interleaved task decomposition and subtask planning, in which each decomposition only reveals one or two subtasks in the current state. Although the interleaved decomposition method can dynamically adjust the decomposition according to environmental feedback and improve fault tolerance, for complex tasks, too long trajectories will cause LLM to hallucinate in subsequent subtasks and subplans, deviating from the original goal. In comparison, the subtasks of the first decomposition method have a stronger correlation with the original task, which can effectively reduce the risk of task forgetting and hallucinations, and is more in line with the needs of coping with complex data governance operations.
[0010] At present, a commonly used first decomposition method is to plan the task completely autonomously. This method completely relies on the understanding and reasoning ability of LLM itself to decompose and plan the task. LLM generates a hierarchical structure composed of subtasks through in-depth analysis of task semantics, and allocates appropriate resources and execution strategies to each subtask. The advantage of this method is its high flexibility and adaptability. It can dynamically adjust the planning strategy according to the nature and complexity of the task, which is particularly suitable for open tasks. However, when carrying out power-related data governance operations, business personnel usually express the operation goals in brief and unclear natural language, while the operation processes behind these goals are complex and must strictly follow the business logic of the operation. If the task is completely planned autonomously by LLM, due to its high flexibility and lack of relevant business knowledge, it will lead to problems such as intention recognition bias, intelligent agent ability illusion, unreasonable planning and confusion of dependencies, making the success rate of completing the data governance operation goal in one go very low. One method is to study the task sequence planning method and limit the high flexibility of LLM by building a set of standard pipelines. Although this approach can significantly improve the success rate of completing tasks, it also brings some new challenges: First, human participation is required in the task planning process, which requires manual selection of the corresponding agent according to the task scenario, which is contrary to the goal of achieving "end-to-end" complex task automation. Secondly, the adaptability of the task scenario is limited. Once the Pipeline is built, it can only be applied to specific governance scenarios. For different scenarios, the agent needs to be reselected to build the application, which reduces the versatility of the method. Finally, this method requires business personnel to have certain professional knowledge so that they can accurately select agents according to the task, which increases the skill requirements for business personnel.
[0011] In response to the above challenges, the present invention studies and proposes a trusted planning workflow method for power data governance based on KCMAP (Knowledge and Capabilitymatching-Motivated Autonomous Planning). The core of this method is to carefully design a set of trusted planning workflows for data governance operations. By incorporating knowledge from the field of power data governance, designing proprietary prompts, and coordinating multiple intelligent agents to jointly limit the illusions and other problems that exist in LLM, the rationality of autonomous planning of data governance operations is enhanced, making it more in line with the business logic of governance operations. At the same time, a two-stage verification mechanism is introduced to further improve the success rate of completing task objectives. Summary of the invention
[0012] In order to overcome the problems in the prior art, the present invention proposes a KCMAP-based power data governance trusted planning workflow method.
[0013] The technical solution of the present invention to solve the above technical problems is as follows:
[0014] The present invention provides a KCMAP-based power data governance trusted planning workflow method, comprising the following steps:
[0015] Collect knowledge in the field of power data management, design the knowledge organization structure of the operation process, convert it into machine-readable vector form, and store it in the vector database;
[0016] Based on the idea of intelligent agents, memory, feedback and evaluation mechanisms are introduced into the retrieval enhancement generation technology, and a multi-order knowledge prompt template is designed to construct the DR-RAG model. Combined with the large language model, DR-RAG can retrieve information from the vector database and integrate the domain process knowledge related to the governance operation.
[0017] Design a capability matching prompt template and build a knowledge capability matching agent, match the domain process knowledge with the available agent capabilities provided in the capability matching prompt template, and remove or integrate redundant process knowledge to perform domain knowledge correction;
[0018] Integrate and modify domain process knowledge, design a trusted planning prompt template and build a task trusted planning agent, decompose and plan the power data governance operations, generate task plans, and design a task plan verification mechanism to verify the task plan.
[0019] During the scheduling and execution phase, we design execution verification prompt templates and verification tools to build execution verification agents. During the execution of the task plan, we verify the actions of each agent to ensure that each step is executed according to the task plan and the results meet expectations. We also adjust and correct deviations in the execution process to achieve the goals of power data governance operations.
[0020] Furthermore, the collecting of power data governance domain knowledge, designing of operation process knowledge organization structure, and conversion into machine-readable vector form include:
[0021] Collect knowledge in the field of power data governance and extract core concepts of power data governance knowledge, where the core concepts are abstract workflows;
[0022] For each core concept, sort out its key nodes and node rules to form the knowledge in the field of power data governance. The key nodes represent specific actions or basic concepts, and the node rules represent the non-strict dependency relationship between the key nodes and the core concepts.
[0023] Store and load power data governance domain knowledge in the form of files;
[0024] Segment the loaded text data to form text block data;
[0025] The segmented text block data is processed by word embedding to convert it into a machine-readable text block vector form.
[0026] Furthermore, in combination with the large language model, DR-RAG can retrieve information from the vector database and use the large language model to integrate domain process knowledge related to governance operations, including:
[0027] Propose data governance objectives or questions in natural language and convert them into multi-dimensional query vectors.
[0028] Performing similarity matching between the multidimensional query vector and the text block vector in the vector database;
[0029] Design a search and evaluation prompt template. The search and evaluation prompt template is defined as a tuple. :
[0030] ;
[0031] in, G Indicates the task roles and objectives; D Indicates retrieving matching text blocks; Q Represents the original query question; E Represents task examples, showing what the output is when the results are relevant and irrelevant;
[0032] Fill each retrieved text block with the original query question into the retrieval evaluation prompt template, input it into the large language model, guide the large language model to evaluate the retrieval results, generate a binary classification evaluation result, retain the relevant content, and obtain a filtered set of similar text blocks;
[0033] Design a reference flow to generate prompt templates, guide the large language model to generate reference solution flow for the job target; where the reference flow to generate prompt templates is defined as a tuple :
[0034] ;
[0035] in, Represents a collection of filtered text blocks; W Indicates important reminders, including important tips and constraints when completing tasks; O Indicates the output format;
[0036] Design a result evaluation prompt template to generate result evaluation output; wherein, define the generation evaluation prompt template as a tuple :
[0037] ;
[0038] in, R Indicates generation requirements, i.e., the reference flow after filling generates prompts; C It represents the content to be evaluated, i.e. the generated reference process;
[0039] Fill the generation requirements and the content to be evaluated into the generation result evaluation prompt template, guide the large language model to evaluate the generation results, and generate a binary evaluation result, namely, relevant True and irrelevant False;
[0040] When the evaluation result is irrelevant False, rewrite the query question, and re-search and generate a new process until the evaluation result is passed; when the evaluation result is relevant True, output the final generated power data governance operation process information;
[0041] Defines the query rewrite prompt template as a tuple :
[0042] ;
[0043] in, S Represents thinking steps, including the provided thinking process to guide the thinking of the large language model; F To evaluate the results; O Indicates the output format.
[0044] Furthermore, the designing capability matching prompt template and constructing a knowledge capability matching agent includes:
[0045] Design a capability matching prompt template, wherein the capability matching prompt template is defined as a tuple P C :
[0046] ;
[0047] in, G Indicates the task role and objectives, A represents the set of available agents; K Represent domain knowledge, including knowledge related to power data governance operations; Z Indicates matching rules; L Indicates the reasoning format; O Indicates the output format;
[0048] Design agent capability specifications and available agent sets A The capability specification of each available agent in the includes name, identifier, capability and additional information content;
[0049] Build a whitespace matching action / tool T B , used to ensure flexible modular design and the normal flow of incoming information;
[0050] Constructing a knowledge-ability matching agent, including:
[0051] Firstly, for the constructed available agent set, the capability expression of each agent in the available agent set is standardized according to the proposed specification format to form the agent capability specification;
[0052] Secondly, based on the capability matching prompt template, the standardized agent capability specification is filled into the prompt template as a parameter to generate a complete capability matching prompt template for guiding the model to complete the task;
[0053] Finally, combine the complete capability matching prompt template and the defined matching actions / tools T B , and a large language model to build an intelligent agent with knowledge matching capabilities:
[0054] ;
[0055] in, represents the knowledge ability matching agent, M Represents a large language model.
[0056] Furthermore, matching the domain process knowledge with the capabilities of the available agents provided in the capability matching prompt template includes:
[0057] Acquire the domain process knowledge K related to the power data governance operation objectives and input it into the constructed knowledge capability matching agent Perform matching in
[0058] First, based on the input domain process knowledge K Extract knowledge process node information:
[0059] ;
[0060] in, U K Represents the set of extracted knowledge process nodes, u i Indicates i process nodes, k is the number of process nodes;
[0061] Next, analyze the specific needs of each process node R( u ), and compare and match the requirements of each process node with the capabilities of each available agent:
[0062] ;
[0063] in, Representing an Agent a A collection of capabilities, Represents a matching set, including all process nodes u and Agent a The right one makes the process node u Demand R ( u ) is an intelligent agent a Capabilities A subset of
[0064] like , then it is believed that the intelligent agent a Capabilities and process nodes u The needs are met, the match is successful, and the u The intention statement remains unchanged;
[0065] If not present , so that , then remove the node u ;
[0066] If exists , so that ,and is a continuous process node, that is , then Merge into a new node and keep the overall knowledge flow logic unchanged.
[0067] Furthermore, the integration and correction of domain process knowledge, design of a trusted planning prompt template and construction of a task trusted planning agent include:
[0068] Design a trusted planning prompt template, where the trusted planning prompt template is defined as P M ,include:
[0069] ;
[0070] in, I Indicates the identifier description; Represents the revised domain knowledge; G Indicates the task role and objectives, A represents the set of available agents, O Indicates the output format; WIndicates important reminders, including important tips and constraints when completing tasks;
[0071] Build a collection of planning actions / tools T P , used to receive and process subtask plans generated by the large language model and store these plans in the agent's memory;
[0072] Build a trusted task planning agent, including:
[0073] First, a standardized intelligent agent capability specification A is formed;
[0074] Secondly, obtain the corrected domain process knowledge and trusted planning prompt template , the capability specification A and Fill in the trusted planning prompt template as a parameter to generate a complete trusted planning prompt template for guiding the model to complete the task;
[0075] Finally, combined with the complete trusted planning prompt template, the defined matching actions / tools T P , and a large language model to build a task-trusted planning agent:
[0076] ;
[0077] in, represents the task trusted planning agent, Q Represents the input problem, i.e., the task goal.
[0078] Furthermore, the decomposition and planning of the power data governance operation and the generation of a task plan include:
[0079] Take the input problem / job goal and feed it into the built task trusted planning agent To generate a task plan, the generation process is as follows:
[0080] First, based on the revised domain knowledge Break down the mission objectives:
[0081] ;
[0082] in, represents the decomposed subtask set, Indicates the decomposition of n subtasks, n Indicates the number of decomposed subtasks;
[0083] Secondly, for each subtask, find an agent that meets the subtask requirements from the available agent set for planning and generate a subtask plan:
[0084] ;
[0085] in, a mi Indicates that the subtask can be satisfied s i An available agent for the requirement.
[0086] Furthermore, the design of the mission plan verification mechanism verifies the mission plan, including:
[0087] Construct a four-layer verification mechanism for the output task plan :
[0088] ;
[0089] in, Represents the output task plan; FV It represents plan format verification, which verifies whether the input task plan meets the format requirements. If not, it will provide feedback to the task trusted planning agent to correct or regenerate the task plan according to the reason; AV represents agent verification, which verifies the agent in each subtask plan in the task plan to ensure that the agent in the plan is within the range of available agents provided; IV represents identifier verification, which verifies the agent identifier in the task plan to verify whether the identifier matches the agent. If not, it will provide feedback for correction; RV represents task plan rationality verification, which is based on the current task objectives and the revised domain knowledge. , Available Agent Set A , perform secondary verification on the task plan to verify whether the plan conforms to the current task objectives and domain knowledge. If not, feedback is given to the task trusted planning agent to regenerate the task plan.
[0090] Furthermore, the construction and execution verification agent includes:
[0091] Design the execution verification prompt template and define the execution verification prompt template as a tuple P V ,include:
[0092] ;
[0093] in, I T A statement indicating the set of available verification tools; G Indicates the task role and objectives, O Indicates the output format; WIndicates important reminders, including important tips and constraints when completing tasks;
[0094] Build verification actions / tools collection T E , used to verify the output content of different agents;
[0095] Format the description of available tools, including their names and functional descriptions;
[0096] The steps to build an intelligent agent for execution verification are as follows:
[0097] First, reuse the formatting tool expression;
[0098] Secondly, based on the acquisition execution verification prompt template , fill the formatted tool description and the output of the agent to be verified as parameters into the execution verification agent prompt template to generate a complete execution verification prompt for guiding the model verification output content;
[0099] Finally, combined with the complete execution verification prompt template, the defined verification action / tool set T E , and large language models M , build an execution verification agent :
[0100] ;
[0101] in, The output content of the intelligent agent to be verified, that is, the verification target; A description of the agent.
[0102] Furthermore, the actions of each intelligent agent are verified during task execution to ensure that each step is executed according to the task plan and the results meet expectations, and deviations in the execution process are adjusted and corrected in a timely manner to achieve the goals of power data governance operations, including:
[0103] When the agent executing the subtask outputs content, first output its content With description information Input build execution verification agent In Generate content in the corresponding format according to the prompt of the execution verification agent;
[0104] from Parse the validation tool you need to call in the generated content of and Pass them into the verification tool together;
[0105] Execute the verification tool to generate the corresponding verification results. If the verification fails, execute the verification agent The error information will be organized and sent to the agent to re-execute the subtask; if the verification passes, it will continue to execute the next subtask.
[0106] Compared with the prior art, the present invention has the following technical effects:
[0107] (1) In view of the problems that existing fully autonomous planning methods may produce intention recognition bias, agent capability illusion, agent forced matching and dependency logic confusion when using large language models for power data governance operation planning, this paper proposes a KCMAP-based power data governance trusted planning workflow method.
[0108] (2) In order to solve the problems of over-flexibility and uncontrollability of the large language model and intention recognition bias in the fully autonomous task planning method, the present invention introduces a domain knowledge fusion module in the proposed data governance operation trusted planning workflow method. This module first builds a domain knowledge base based on a carefully designed domain knowledge organization structure to increase the accuracy of demand and knowledge retrieval matching and improve the knowledge utilization effect; secondly, a DR-RAG (Domain-Reflective Retrieval-Augmented Generation) model for domain knowledge process retrieval service is proposed, and reflection and evaluation are added to RAG to enhance the reliability of retrieval generation results, so as to achieve the effect of retrieving and integrating the domain knowledge base and finally generating trusted domain process knowledge; finally, the generated domain process knowledge is used to assist the generation of relevant power data governance operation planning, which can not only effectively alleviate the unpredictable planning results caused by the illusion of the large language model, but also provide richer and more accurate domain process knowledge information for the task objectives, and improve the quality of task trusted planning agent decomposition and planning tasks.
[0109] (3) In order to solve the problem of agent capability illusion in the process of power data governance job planning, the present invention introduces a knowledge capability matching module in the proposed workflow method. This module constructs a knowledge capability matching agent through capability matching prompt, whose function is to match the process node information in the retrieved domain knowledge with the actual capabilities of each available agent. By screening the process information in the domain knowledge, redundant, unreasonable or knowledge beyond the capability range of the agent is removed or merged without affecting the overall logic, so as to make fine adjustments to the domain knowledge and reduce the capability illusion problem caused by the over-refined domain process knowledge but no agent with the capability in the process of decomposing and planning data governance jobs in the large language model. At the same time, after correction, the domain process knowledge becomes more reasonable and accurate, effectively reducing the risk of forced matching of agents during task planning.
[0110] (4) In response to the unreliability and logical confusion in the task plan generation process and its results in power data governance operations, the present invention designs and implements a task trusted planning agent, which realizes the trusted decomposition and planning of governance operations by integrating domain process knowledge; and assigns an identifier to each subtask step. These identifiers are not only used to mark the starting state, but also to record and transmit the collaborative status information of each agent. In this way, the responsibilities and status of each agent in the task process can be clearly tracked, ensuring the logical consistency and clarity of the task decomposition and execution process.
[0111] (5) In order to improve the success rate of achieving complex power data governance operation goals, the present invention proposes a two-stage verification mechanism. In the task trusted planning agent, a four-layer verification mechanism is established for the task plan generated by the plan: plan format verification, available agent verification, identifier verification and plan rationality verification, to further improve the rationality of the task plan. In the task plan scheduling execution stage, the present invention constructs a special execution verification agent to verify the output results of the agent corresponding to each subtask to ensure that the task is executed accurately according to the established plan. Through this staged verification process, the reliability and success rate of completing the task objectives can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0112] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0113] Figure 1 This is an overall flow chart of a KCMAP-based power data governance trusted planning workflow method proposed by the present invention;
[0114] Figure 2 Flowchart of the domain knowledge retrieval generation (DR-RAG) model constructed for the present invention;
[0115] Figure 3 A knowledge base text content display diagram is used for the present invention;
[0116] Figure 4 This is a diagram showing the specific results of each stage of DR-RAG in Experiment 1;
[0117] Figure 5 This is a graph showing the comparison results of Experiment 1 using the traditional RAG method;
[0118] Figure 6 This is a diagram showing the specific results of each stage of the task planning for Example 1 of Experiment 2;
[0119] Figure 7 This is a diagram showing the specific results of the task scheduling execution and verification of Example 1 in Experiment 2;
[0120] Figure 8 This is a diagram showing the final results of the rule exploration in Example 1 of Experiment 2;
[0121] Figure 9 This is a diagram showing the results of the comparative experiment conducted in the exploration of rules in Example 1 of Experiment 2;
[0122] Figure 10 This is a diagram showing the final results of anomaly detection in Example 2 of Experiment 2. DETAILED DESCRIPTION
[0123] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. The specific features, structures or characteristics in one or more embodiments may be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by technicians in the technical field of the present invention.
[0124] Large language models are considered to be a very promising solution to complex task planning problems due to their strong understanding ability. The current mainstream method for planning complex tasks based on large language models is fully autonomous planning, that is, the decomposition and planning of tasks completely rely on the understanding and reasoning ability of the large language model itself. This method has high flexibility and is suitable for some open tasks. However, for the complex operational requirements of power data governance with clear business processes and logic, the planning and execution of tasks must be carried out strictly in accordance with business procedures; and the inherent intention recognition confusion and agent capability illusion (assumptions, distortions, fabrications, etc. of the capabilities of available agents) of large language models in autonomous planning may lead to deviations in task planning and execution and fail to generate correct results, ultimately leading to task failure.
[0125] In response to these problems, the present invention proposes a trusted planning workflow method for power data governance based on KCMAP (Knowledge and Capabilitymatching-Motivated Autonomous Planning). This method is based on business knowledge in the field of power data governance and uses five modules: power data governance domain knowledge base construction, domain knowledge retrieval generation, knowledge capability matching, task trusted planning and verification, and execution and verification. The five modules are interconnected and connected to form a complete workflow, realizing the trusted planning and verification of multi-agent collaborative power data governance operations.
[0126] In this embodiment, a KCMAP-based power data governance trusted planning workflow method specifically includes the following steps:
[0127] Step 100: Collect knowledge in the field of power data management, design the knowledge organization structure of the operation process, convert it into a machine-readable vector form, and store it in a vector database;
[0128] Step 200: Based on the agent concept, memory, feedback and evaluation mechanisms are introduced into the retrieval-augmented generation technology, and a multi-order knowledge prompt template is designed to construct the DR-RAG (Domain-Reflective Retrieval-Augmented Generation) model; combined with the large language model, DR-RAG can retrieve information from the vector database and integrate the domain process knowledge related to the governance operation;
[0129] Step 300: Design a capability matching prompt template and construct a knowledge capability matching agent, match the domain process knowledge with the available agent capabilities provided in the capability matching prompt template, and remove or integrate redundant process knowledge to perform domain knowledge correction;
[0130] Step 400: Integrate and modify domain process knowledge, design a trusted planning prompt template and build a task trusted planning agent to decompose and plan the power data governance operations and generate a task plan. And design a task plan verification mechanism to verify the task plan to ensure the correctness and rationality of the plan generation;
[0131] Step 500: In the scheduling execution phase, design an execution verification prompt template and verification tool to build an execution verification agent, verify the actions of each agent during task execution, ensure that each step is executed according to the task plan and the results meet expectations, and timely adjust and correct deviations in the execution process to achieve the power data governance operation goals.
[0132] The following is a detailed explanation of each of the above steps:
[0133] Step 100: Collect knowledge in the field of power data management, design the knowledge organization structure of the operation process, and convert it into a machine-readable vector form and store it in a vector database.
[0134] In order to use the knowledge in the electric power domain to help the large language model generate a more reasonable and effective task planning path, it is first necessary to create a domain knowledge expression form that is friendly to the large model. Obtain governance requirements and process knowledge through the description documents in the electric power data governance operation, such as the definition, process and objectives of the existing electricity price information anomaly identification operation, organize knowledge around the key nodes of the governance operation, and improve the retrievability of knowledge and the correlation between knowledge by refining the relevant information of the key nodes. Then, vectorize the knowledge and finally save it in the vector database to facilitate accurate retrieval. The specific steps are as follows:
[0135] Step 110: Organize knowledge around the key nodes of power data governance operations, extract the key nodes and their contents in power field tasks, and form power data governance field knowledge.
[0136] The expression of knowledge in the field of power data governance is as follows:
[0137] Step 1101: extracting the core concepts of power data governance knowledge, where the core concepts are abstract workflows, thereby forming the skeleton of the domain knowledge system;
[0138] In order to generate a reasonable planning path, we first extract the core concepts in the power field knowledge. Each core concept is an abstract workflow, which constitutes the skeleton of the power field knowledge system. Taking the power data governance field as an example, the abstract workflow can include power data acquisition, power data processing, power data analysis, etc.
[0139] Step 1102: for each core concept, sort out the key nodes to which it belongs, wherein the key nodes represent specific actions or concepts;
[0140] For the core concept of "power data processing", key nodes may include data cleaning, data standardization, and feature engineering. The definition of key nodes includes the name of the node and its description information to make specific explanations of the actions or concepts and provide necessary guidance.
[0141] Step 1103: sorting out rules for each key node;
[0142] Rules R are sorted out for each key node. R is defined as a list containing the names of core concepts, indicating that there is a non-strict dependency relationship between the key node and the core concepts that do not belong to the node. For example, data acquisition and data processing may be required before the "visual analysis" node, and the rule R can be expressed as [data acquisition, data processing, ...]. The node rule content is supplemented with the description information of the key node to provide it with the relevance and logic between knowledge, as a layer of protection to avoid the "planning illusion" of the large language model.
[0143] For example:
[0144] 1) Power data acquisition includes data collection; Description: Data collection is the initial step in acquiring data. Data can come from a variety of sources, including databases, APIs (Application Programming Interface), sensors, and user input. Commonly used data collection tools include: SQL (Structured Query Language), APIs, Web Scraping, etc. Pre-rule (optional): [None].
[0145] 2) Power data processing includes data cleaning; Description: Data cleaning is the process of removing errors and inconsistencies in data. Common data cleaning steps include: (1) Missing value processing: use mean interpolation, deletion of missing values or prediction methods to fill missing values; (2) Data format standardization: unify data formats, such as date format, text case, etc. Pre-rule (optional): [Data acquisition].
[0146] 3) Power data analysis includes rule mining. Description: Use rule mining algorithms to discover implicit knowledge in the data and constraint rules between fields, analyze the rules between data fields, and generate usable rules. Pre-rules (optional): [data acquisition, data processing].
[0147] Step 120: storing and loading the power data governance domain knowledge in the form of files;
[0148] In this embodiment, the electric power field knowledge organized according to step 110 is stored in the form of a Word document, and the core concepts and key nodes are set as title styles, and the key node descriptions and rules are the corresponding texts, so that there is certain structured information when storing, and it is also convenient for subsequent updates and maintenance. When loading knowledge, a semi-structured loading method is used to read the knowledge content, and the style of its chapter titles and content is retained.
[0149] Step 130: Segment the loaded text data to form text block data;
[0150] In order to adapt to the contextual limitations of large language models, avoid biased results caused by too much irrelevant information in the text, and improve the efficiency and accuracy of subsequent processing, it is necessary to segment the text data in the loaded knowledge and divide long documents or continuous texts into smaller, easier-to-process units.
[0151] In order to improve the retrieval effect, avoid the segmentation of semantically related texts, and retain the semantic integrity of each key node, this embodiment improves the document segmentation method:
[0152] First, the text is segmented based on the smallest chapter title so that the text block can completely maintain the structural information of the corresponding content of the chapter and the text, and style information such as "Title" and "Content" are added before each block, so that the large language model can better understand the text information; after the segmentation is completed, for text blocks with shorter character length after segmentation, if two adjacent text blocks are merged and still do not exceed the set block size, they will be merged to reduce the number of text blocks after segmentation and speed up the retrieval and matching speed.
[0153] Step 140: embedding the segmented text block data to convert it into a machine-readable text block vector form;
[0154] Select a suitable word embedding model, such as Sentence-BERT, BGE model, etc., to convert the text into a high-dimensional vector representation. First, the text needs to be segmented, and the segmentation result is expressed as , where each element Represents a word; secondly, the word segmentation results are matched according to the dictionary of the embedding model, and the results are converted into the corresponding token form in the dictionary, which is expressed as ,in, Represents the start of the input sequence, It is used to separate two sentences and indicate the end of the entire sequence. The converted sequence is input into the pre-trained model for embedding calculation. If Sentence-BERT is selected, it can be expressed as:
[0155] ;
[0156] in, That is the vector embedding result. In this way, each text block can be represented as a multi-dimensional vector, which can be used for text retrieval.
[0157] Step 150: storing the text block vector in a vector library to form an electric power domain knowledge base;
[0158] The text block vectors are stored in a vector database such as Chroma DB or FAISS. Chroma DB is an open source vector database, and FAISS is an open source library developed by Facebook. The vector database optimizes the data storage structure of high-dimensional vectors, making the storage and retrieval of large-scale vector data more efficient.
[0159] Step 200: Based on the idea of intelligent agents, memory, feedback and evaluation mechanisms are introduced into the retrieval enhancement generation technology, and a multi-order knowledge prompt template is designed to construct the DR-RAG model; combined with the large language model, DR-RAG can retrieve information from the vector database and integrate the domain process knowledge related to the governance operation.
[0160] This embodiment proposes DR-RAG for retrieval generation of power data governance workflow services. Different from the one-time retrieval generation of traditional RAG, DR-RAG adds memory, evaluation and reflection mechanisms to RAG, which can effectively alleviate the illusion problem of traditional RAG in the retrieval generation process, and meet more complex information needs through multiple rounds of retrieval, thereby improving the reliability of the generated results. The process is as follows: Figure 2 shown.
[0161] After entering the task objectives, DR-RAG is used to retrieve the power knowledge required to complete the task from the domain knowledge base and integrate it to enhance the controllability of subsequent processes. The specific steps are as follows:
[0162] Step 210: converting the task goal or query question proposed in natural language into a multi-dimensional query vector form;
[0163] The task objectives or query questions raised in natural language are converted into multi-dimensional vector forms in the same way as step 130, so that the questions can be matched with the knowledge in the power field, which is expressed as:
[0164] ;
[0165] in, is the query vector, Tokens corresponding to the query question.
[0166] Step 220: performing similarity matching between the query vector and the text block vector in the vector database;
[0167] The similarity between the matching query vector and each text block vector in the vector database is calculated using cosine similarity, and the calculation formula is:
[0168] ;
[0169] in, Indicates i The embedding vector of a text block, is the similarity score, Represents the magnitude of a vector.
[0170] According to the similarity score, the most relevant vectors to the query are retrieved, and the content in the corresponding text block is returned as the search matching result. D , expressed as:
[0171] ;
[0172] in, k is the number of matches set. For each successfully matched text block.
[0173] Step 230: Using the large language model to evaluate the search results of step 220 to ensure that the final search results are relevant to the query question;
[0174] The large language model is used to evaluate the search results of step 220, filter out low-quality or irrelevant search results, and ensure that the final search results are highly relevant to the query question.
[0175] The large language model takes a sequence input, i.e. a series of tokens. , calculate the probability distribution of the next word based on the input sequence and the output of the previous step p , and gradually generate a sequence , which can be expressed as:
[0176] ;
[0177] Based on this, we design a retrieval evaluation prompt template to enable the large model to generate the required output through context prompts. The retrieval evaluation prompt template is defined as a tuple , including the following parts:
[0178] ;
[0179] in, G Indicate the task role and objectives, define a clear role for it, and explain its objectives under this role; D Retrieve matching text blocks ({ document}); Q Represents the original query problem ({ question}), which is the input task requirement; E It represents a task example, showing what should be output when the results are relevant and irrelevant; "{}" contains the parameters to be input. The specific content of the prompt template for the search evaluation prompt is as follows:
[0180] ``` prompt
[0181] You are an evaluator who is responsible for evaluating the relevance of the retrieved documents to the user's question. You do not need to be rigorous in your evaluation, the goal is just to filter out incorrect search results. If a document contains keywords or semantic content that is relevant to the user's question, it is rated as relevant.
[0182] Please give a binary score "True" or "False" to indicate whether the document is relevant to the question.
[0183] ### The following are the retrieved documents:
[0184] { document}.
[0185] ### The following are the query questions:
[0186] { question}.
[0187] ### Example:
[0188] If it is determined to be relevant, it only returns "True", for example: True.
[0189] If it is determined to be irrelevant, please return "False" and explain the reason, for example: False, explanation: #Reason for irrelevant.
[0190] ```
[0191] Each knowledge text block retrieved The retrieval evaluation prompt word template is filled with the original query question and input into the large language model to guide the large language model to evaluate the retrieval results, generate a binary evaluation result, namely True and False, and give the corresponding evaluation reason. Filter out the text blocks with a False result and only keep the content with a True evaluation result. The process is expressed as:
[0192] ;
[0193] ;
[0194] in, The populated retrieval evaluation prompt template is used as the input sequence of the model. LLM represents a large language model, The output of the model is i Search evaluation results, is the filtered search result. If the final result is empty, the evaluation fails and the process directly goes to step 260.
[0195] Step 240: Design a reference flow to generate a prompt template to guide the large language model to generate a reference solution flow for the job target;
[0196] Design a reference flow to generate prompt templates, guide the large language model to generate reference solution flows for the job objectives, and organize the results into a sequential description form such as "Firstly, Secondly, ..., Finally". Define the reference flow to generate prompt templates as a tuple , contains the following parts:
[0197] ;
[0198] in, Represents a collection of filtered text blocks ({ documents}); W Indicates important reminders, indicated as , including important tips and constraints when completing tasks; O Indicates the output format, which defines the format requirements of the output results; G Indicate the task role and objectives, define a clear role for it, and explain its objectives under this role; Q Represents the original query problem ({ question}), which is the task requirement to be input; "{}" is the parameter to be input. The prompt template generated by referring to the process is as follows:
[0199] ``` prompt
[0200] You are a process summary expert. Please summarize the steps required to complete the user's needs based on the text content provided. You can summarize the logical process nodes based on the text content information provided and answer the user's questions in a detailed and professional manner.
[0201] Please think step by step to achieve the goal. Please strictly abide by the constraints and specifications in the "Important Reminder".
[0202] ### Similar text content:
[0203] { context}
[0204] ### Important reminder:
[0205] 1. You first need to identify the question the user is asking. Then, you need to summarize the text content provided and use only that content to answer the user's question, filtering out as much useless information as possible.
[0206] 2. The output summary must be in the same language as the user's question and must be as brief as possible.
[0207] 3. Note that you can only use the text content provided! Please do not expand the summary with your own knowledge! If the text content provided does not answer the user's question, just output "NO RELATIONSHIP. UPDATE TEXT CONTENT."
[0208] ### Please strictly follow the following format to output the final summary results:
[0209] "Firstly, xxx; Secondly, xxx; … ; Finally, xxx."
[0210] Please ensure that the content of the above xxx is concise and easy to understand.
[0211] ```
[0212] Fill the search results in the reference flow generation prompt template The original query question is input into the big language model, so that the big language model combines domain knowledge to generate a preliminary description and guidance of the power data governance operation process.
[0213] Step 250: Design and generate a result evaluation prompt template to generate a result evaluation output;
[0214] Design a generation result evaluation prompt template so that the large language model can evaluate the generation result of step 240 to ensure that the result meets the requirements. Define the generation evaluation prompt template as a tuple , contains the following parts:
[0215] ;
[0216] in, R Indicates the generation demand ( {requirement} ), i.e., the reference flow generated prompt after being filled in step 240; C Indicates the content to be evaluated ( {content} ), i.e., the reference process generated in step 240; G Indicate the task role and objectives, define a clear role for it, and explain its objectives under this role; E It represents a task example, showing what should be output when the results are relevant and irrelevant. "{}" contains the parameters to be input. The prompt template for generating result evaluation is as follows:
[0217] ``` prompt
[0218] You are an evaluator responsible for assessing whether an answer addresses the task generation requirements based on the following historical information. Please give a binary score, "True" or "False", to indicate whether it has been addressed.
[0219] <Observation History>
[0220] The following are the task generation requirements:
[0221] { requirement}。
[0222] The following is the task response:
[0223] { content} 。
[0224] < / Observation History>
[0225] Example:
[0226] If it is determined to be relevant, only return "True", for example: True.
[0227] If it is determined to be irrelevant, please return "False" and explain the reason, for example: False, Explanation: #Reason for irrelevance.
[0228] ```
[0229] Retrieve the conversation information generated in step 240, fill in the generation requirements and generation results in the conversation into the generation result evaluation prompt template, guide the large language model to evaluate the generation result, generate a binary classification evaluation result, namely True and False, and give the corresponding evaluation reason.
[0230] When the evaluation result is False, go to step 260; when the evaluation result is True, output the finally generated power data governance operation process information, which is then passed to the knowledge ability matching intelligent agent as prior knowledge so that subsequent task planning can have domain knowledge and decompose and plan tasks more precisely. The above process H can be defined as:
[0231] ;
[0232] Among them, indicates that the next step is query rewriting, indicates result output, EvaG is the evaluation content of the output.
[0233] Step 260: Rewrite the query question;
[0234] When the knowledge retrieval results or process generation results cannot pass the evaluation, it may be due to unclear expression of the query problem or the use of non-professional terms. In this case, the query problem needs to be rewritten to explore more retrieval possibilities. Design a query rewriting prompt template to guide the large language model to think step by step and generate a more reasonable query problem based on the existing information. Define the query rewriting prompt template as a tuple , including:
[0235] ;
[0236] Among them, S represents the thinking steps, expressed as , which contains the thinking process provided to guide the large language model to think step by step; F is the evaluation result ({ explanation}), that is, the result of the evaluation in step 230 or step 250; G、 R, C has the same meaning as the result evaluation prompt in step 250, O has the same meaning as the reference process generation prompt in step 240, and the parameters to be input are in "{}". The specific query rewriting prompt template is as follows:
[0237] ``` prompt
[0238] You are an expert in question rewriting, responsible for converting the input question into a more understandable and more suitable version for retrieval. Please think about the semantic intention behind the question based on the input information and process it through the following steps.
[0239] Execution steps:
[0240] 1. Based on the historical information and error explanations, think about the reasons for the failed evaluation result and identify possible problems with the initial query.
[0241] 2. Enhance the intention of the initial question and output the specific intention of the query. Rewrite and formulate an improved question based on the analysis and feedback.
[0242] <Observe history>
[0243] The following are the task generation requirements:
[0244] { requirement}.
[0245] The following are the task responses:
[0246] { content}.
[0247] < / Observe history>
[0248] ### The following is the explanation for failure:
[0249] { explanation}.
[0250] ### Here is the initial query:
[0251] { question}.
[0252] ### Please reply in the following json format:
[0253] {{
[0254] " possible problems ": "Problems with the initial query formulation that caused the evaluation to fail",
[0255] " question intent ": "Question intention determined based on historical knowledge",
[0256] " improved question ": "An improved question based on possible problems and question intent"
[0257] }}
[0258] ```
[0259] First, based on the evaluation results ({ explanation})Dialogue with history({ requirement} 、 { content}) to reflect on possible ambiguity or incompleteness in the query; secondly, further analyze the original query question ({ question}), enhance the query intent; finally, based on the previous analysis, rewrite the query question to generate a new query expression.
[0260] Step 270: iterate query;
[0261] After the query is rewritten in step 260 , a new search and process generation are started again from step 220 until the evaluation result of step 250 passes.
[0262] Step 300: Design a capability matching prompt template to construct a knowledge capability matching agent, match the domain process knowledge with the available agent capabilities provided in the capability matching prompt template, and eliminate or integrate redundant process knowledge to correct the domain knowledge.
[0263] The large language model should not exceed the capabilities of the preset intelligent agent when planning power data governance operations. In order to prevent the large language model from making excessive assumptions, expansions, or distortions about the capabilities of available intelligent agents, or even fabricating non-existent intelligent agents due to illusions when performing task decomposition planning, the present invention designs a capability matching prompt template and constructs a knowledge capability matching intelligent agent, matches the power data governance operation process information generated in step 200 with the capabilities of available intelligent agents, and removes and integrates redundant, uncertain, or out-of-capacity content in the domain knowledge process. The specific steps are as follows:
[0264] Step 310: Design capability matching prompt template;
[0265] The ability to match prompt template is defined as a tuple P C ,include:
[0266] ;
[0267] in, A Represents the set of available agents ({ agents}), expressed as , illustrating each available agent With its attributes and functions, available agents may include data exchange agents, data processing agents, etc.; K Represents domain knowledge ( {knowledge}) , including knowledge related to power data governance operations; Z Represents the matching rule, expressed as , clarify the matching rules that the large language model needs to follow when matching intelligent agents and power domain knowledge; L Indicates the reasoning format, indicating that the large language model needs to be reasoned according to a fixed reasoning format. The reasoning format is designed as " -Question: xxx; -Analysis:xxx; -Action:xxx; -Output:xxx ”; G, O The meaning is the same as step 240. Refer to the process to generate prompt. "{}" is the parameter to be input. The capability matching prompt template is as follows:
[0268] ``` prompt
[0269] You are an expert in matching agent capabilities. Your task is to understand the input reference operation process, extract the process nodes, and carefully check the capabilities of each agent, and match the agent capabilities with the nodes that match the process requirements.
[0270] At the same time, please strictly abide by the constraints and regulations in the "Important Reminders".
[0271] ### Available Agents:
[0272] {agents}
[0273] ### Important reminder:
[0274] 1. When matching, self-reflection is required to ensure that the node requirements match the capabilities of the agent. Nodes that do not match the capabilities of any agent do not need to be forced to match and can be removed directly.
[0275] 2. If multiple consecutive nodes are matched to the same agent, they should be merged into a comprehensive node and then matched with the agent.
[0276] 3. Each process node should only match one agent, and the order of output must be reasonable. It is strictly forbidden to distort, expand, speculate or fabricate the capabilities of the agent in order to match the node.
[0277] 4. A review must be conducted after matching to ensure that the match is reasonable.
[0278] 5. Only successfully matched process nodes and agents should be displayed in the final output.
[0279] ### Please think step by step according to the following pattern:
[0280] - Question : Do the requirements of xxx nodes match the capabilities of xxx agents?
[0281] - Analysis : Analyze and evaluate the problem.
[0282] - Verify : Verify that the assessment follows the reminder.
[0283] - Action : If the review is successful and there is a match, add the matching result to the output queue.
[0284] ...(this Question / Analysis / Verify / Action Can be repeated N times)
[0285] -Output: The final output result should be replied in the following JSON format:
[0286] {{
[0287] "Process Node Name 1": "Matched Agent",
[0288] "Process Node Name 2": "Matched Agent",
[0289] ...,
[0290] "summary_output": "Sort the matching results and output a summary"
[0291] }}
[0292] ```
[0293] Step 320: Agent capability specification;
[0294] The available agent set in step 310 A The complete description of each available agent in the capability matching prompt should have four parts: name, identifier, capability, and additional information, so that the large language model can successfully understand its capabilities and functions. The agent capability specification is designed as follows:
[0295] “ NAME: xxx -- IDENTIFIER: xxx -- CAPACITY: xxx / / [xxx]. ”.
[0296] in, NAME Represents the name part of the agent, IDENTIFIER Represents the identifier part, which is used to indicate the state of the agent, such as whether the agent is collaborative. CAPACITY Represents the capability part of the intelligent agent, [*] Indicates the additional information section, " xxx " is the corresponding content of each part.
[0297] Based on this specification, the capability specifications of all available intelligent agents preset in the system are organized.
[0298] Step 330: Build the Blank Matching Action / Tool T B ;
[0299] Since the knowledge ability matching agent does not need to call external tools, a blank matching action / tool is constructed T B Its function is to ensure flexible modular design and the normal flow of incoming information, and to reserve possible functional expansion in the future.
[0300] Step 340: construct a knowledge and ability matching agent;
[0301] The steps to build a knowledge-ability matching agent are as follows:
[0302] First, for the constructed available agent set, as shown in Table 1, the capability expression of each agent in the set is standardized according to the specification format proposed in step 320 to form an agent capability specification;
[0303] Table 1 The set of available agents that have been constructed
[0304]
[0305] Secondly, based on step 310, obtain the capability matching prompt template P C, standardize the capability specification A As a parameter {agents} The content of is filled into the prompt template to generate a complete capability matching prompt for guiding the model to complete the task;
[0306] Finally, combine the complete capability matching prompt template and the matching action / tool defined in step 330 T B , and a large language model to build an intelligent agent with knowledge matching capabilities:
[0307] ;
[0308] in, represents the knowledge ability matching agent, K Represents the domain knowledge to be matched by the input, M Represents a large language model.
[0309] Step 350: knowledge process node matching;
[0310] From step 250, domain knowledge related to the power data governance task is obtained K , which is input into the knowledge ability matching agent constructed in step 340 The matching process is as follows:
[0311] First, based on the input domain process knowledge K Extract knowledge process node information:
[0312] ;
[0313] in, U K Represents the set of extracted knowledge process nodes, u i represents the i-th process node, k is the number of process nodes;
[0314] Next, analyze the specific needs of each process node R ( u ), and compare and match the requirements of each process node with the capabilities of each available agent:
[0315] ;
[0316] in, Representing an Agent a A collection of capabilities, Represents a matching set, including all process nodes u and Agent a The right one makes the process nodeu Demand R ( u ) is an intelligent agent a Capabilities A subset of
[0317] like , then it is believed that the intelligent agent a Capabilities and process nodes u The needs are met, the match is successful, and the u The intention statement remains unchanged;
[0318] If not present , so that , then remove the node u ;
[0319] If exists , so that ,and is a continuous process node, i.e. , then Merge into a new node and keep the overall knowledge flow logic unchanged.
[0320] Step 360: Output the matching result;
[0321] Based on the knowledge flow matching results of step 350, the domain knowledge representation is reorganized and optimized based on the large language model to ensure that the overall logical structure remains reasonable after removing or merging certain knowledge flow nodes. The reorganized domain knowledge is output as the correction result.
[0322] Step 400: Integrate and modify domain process knowledge, design a trusted planning prompt template and build a task trusted planning agent to decompose and plan the power data governance operation and generate a task plan. And design a task plan verification mechanism to verify the task plan to ensure the correctness and rationality of the plan generation.
[0323] Construct a trusted task planning agent, integrate the corrected domain knowledge output from step 360 as prior knowledge into the thinking and reasoning process of the trusted task planning agent, and use the first decomposition method to decompose and plan the task, formulate a subtask plan for each decomposed subtask, and finally merge all subtask plans to generate a complete task plan. The integration of domain knowledge makes the decomposition and planning of tasks more reasonable and controllable. The specific steps are as follows:
[0324] Step 410: Design a trusted planning prompt template;
[0325] Define the trusted planning prompt template as P M , contains the following parts:
[0326] ;
[0327] in, I Indicates the identifier description, expressed as ; K’ Represents the modified domain knowledge ( {knowledge}) ; G, W, O The meaning is the same as step 240. Refer to the process to generate prompt. A The meaning is the same as step 320. The trusted planning prompt template is as follows:
[0328] ``` prompt
[0329] You are an expert in task decomposition and planning. Please use your knowledge and understanding to understand the user's intentions and goals, decompose and plan the task goals, and generate a task plan that can be completed by intelligent agents without user assistance.
[0330] Note that if "knowledge enhancement" content is provided in the context, coordinate the agent to solve the user's problem based on this knowledge. If "knowledge enhancement" is not provided, coordinate the agent to solve the problem by yourself.
[0331] Please think step by step to achieve your goals. At the same time, please strictly abide by the constraints and specifications in the "Important Reminders".
[0332] ### Available Agents:
[0333] { agents}
[0334] ### Identifier Description:
[0335] { identifier}
[0336] ### Knowledge Enhancement:
[0337] { knowledge}
[0338] ### Important reminder:
[0339] 1. First, determine if information from the "knowledge enhancement" module is available. If so, incorporate this information into the reasoning process to guide the creation of the task plan. Then, based on this enhanced thinking, develop a more comprehensive and reasonable task plan.
[0340] 2. Each task step can only match the available agents provided, and it is forbidden to generate non-existent agents.
[0341] 3. Each step of the task plan should exist to advance the solution of the user's goal and should not generate meaningless steps. Make sure each step has a clear goal and complete content.
[0342] 4. The identification of the agent is fixed, and each identifier has a clear correspondence in the set of available agents. When creating a task plan, the original identifier of the agent must be strictly maintained.
[0343] 5. Once an agent with the identifier '[FINAL]' appears, it means that the plan has been completed and any subsequent task plans are prohibited from being generated.
[0344] 6. Pay attention to the dependencies and logic of each step of the task plan. Consider whether the dependent data can be obtained based on the current goal. If not, explain in the goal that the dependent data needs to be generated.
[0345] ### Please reply in the following format: [
[0347] {{
[0348] “ subtask_number ”: “Subtask number, such as 1, 2, 3”,
[0349] “ agent ”: “The name of the agent that completed this subtask”,
[0350] “ identifier ”: “The identifier carried by the agent that completed this subtask”,
[0351] “ content ”: “The subtask content of the current step, ensuring that it can be performed by the agent”,
[0352] “ rely ”: “Subtask number to which it depends ( subtask_number ), such as 1, 2, 3, or empty if not dependent. ”
[0353] }}, ... ]
[0356] ```
[0357] There are currently four identifiers designed in the template, which are defined as follows :
[0358] ;
[0359] in,[ START ] indicates that in multi-agent collaboration, this agent is usually used as the starting agent and can be used alone; [ SINGLE] indicates that the agent can only be used alone and cannot collaborate with other agents; [ COOPERATION ] indicates that the agent has the ability to collaborate with other agents; [ FINAL ] indicates that in multi-agent collaboration, this agent usually serves as the ending agent.
[0360] Each agent The identifier configuration can be represented as a collection:
[0361] ;
[0362] in, Including Agents All identifiers configured, and there is no conflict between the identifiers.
[0363] Step 420: Build a set of planning actions / tools T P ;
[0364] Constructing a set of planning actions for a task-trusted planning agent T P , responsible for receiving and processing the subtask plans generated by the large language model, and storing these plans in the agent's memory for subsequent execution and tracking, including but not limited to:
[0365]
[0366] in, PE Represents parsing the output of the large language model to ensure that the generated subtask plan can be correctly understood and executed by the agent; FT Represents a formatted step plan, which converts the subtask plan into a standard format for easy storage and execution; MS Represents memory and manages all subtask plans; EH It represents exception handling and feedback. When problems occur during execution, timely feedback can be given and the plan can be readjusted.
[0367] Step 430: construct a task trusted planning agent;
[0368] To build a trusted task planning agent, the steps are as follows:
[0369] First, reuse the normalized agent capability specification formed in step 340 A ;
[0370] Secondly, based on step 360 and step 410, the corrected domain process knowledge is obtained respectively K’ and trusted planning prompt template , the capability specification A and K’As a parameter {agents} and {knowledge} The content of is embedded into the trusted planning prompt template to generate a complete trusted planning prompt for guiding the model to complete the task;
[0371] Finally, combine the complete trusted planning prompt template and the matching action / tool set defined in step 420 T P , and a large language model to build a task-trusted planning agent:
[0372] ;
[0373] in, represents the task trusted planning agent, Q Represents the input problem, i.e., the task goal.
[0374] Step 440: generating a task plan;
[0375] Get the input problem / job goal and input it into step 430 to build the completed task trusted planning agent To generate a task plan, the generation process is as follows:
[0376] First, based on the revised domain process knowledge K’ Break down the mission objectives:
[0377] ;
[0378] in, represents the decomposed subtask set, Indicates the decomposition of n subtasks, n Indicates the number of subtasks decomposed.
[0379] Second, for each subtask , find the agent that meets the subtask requirements from the available agent set for planning and generate the subtask plan:
[0380] ;
[0381] in, a mi Indicates that the subtask can be satisfied s i An available agent for the requirement.
[0382] The generated subtask plan includes subtask_number, agent, identifier, content, rely There are several parts, see the above task trusted planning prompt for details.
[0383] Finally, all the generated subtask plans are merged according to the dependencies between the subtasks to generate a complete task plan:
[0384] ;
[0385] in, Represents the generated task plan, Indicates that formatting is planned to be merged.
[0386] Step 450: Mission plan verification;
[0387] A four-layer verification mechanism is constructed for the task plan outputted in step 440:
[0388] ;
[0389] in, It represents the task plan outputted from step 4-4. FV It represents the plan format verification, which verifies whether the input task plan meets the format requirements. If not, it will feedback to the task trusted planning agent to correct or regenerate the task plan according to the reason; AV represents the agent verification, which verifies the agent in each subtask plan in the task plan to ensure that the agent in the plan is within the range of available agents provided; IV represents the identifier verification, which verifies the agent identifier in the task plan to verify whether the identifier matches the agent. If not, it will feedback and correct it; RV represents the task plan rationality verification, which is based on the current task goal ({ goal}), Corrected domain knowledge ({ knowledge}), Available Agent Set A ({ agents}), design a task plan verification prompt template, perform secondary verification on the task plan, verify whether the plan conforms to the current task objectives and domain knowledge, and if not, give feedback to the task trusted planning agent to regenerate the task plan. The specific prompt template for task plan rationality verification is as follows:
[0390] ``` prompt
[0391] As an expert in assessing the rationality of mission plans, your task is to deeply analyze the mission objectives, domain knowledge, and mission plans provided by users. Based on this analysis, you need to make professional judgments on the rationality of the mission plan.
[0392] Please think step by step to achieve your goal. You can use the resources given below.
[0393] ### Available Agents:
[0394] { agents}
[0395] ### Domain knowledge:
[0396] { knowledge}
[0397] ### Please conduct strict verification from the following aspects:
[0398] 1. Verify whether the task plan is relevant to the task objectives and whether the logic is coherent and smooth.
[0399] 2. If domain knowledge is provided, please comprehensively consider the task objectives and domain knowledge, and evaluate whether the task plan is reasonable and whether it can effectively achieve the task objectives.
[0400] 3. Based on the content of the available agents, verify whether the content of each step of the plan matches the capabilities of the corresponding agents.
[0401] 4. According to the content of the available agents, reverse reasoning is performed on the task plan, starting from the last step of the task plan, and gradually analyzing it in reverse order to verify whether the execution conditions of the next step are met by the previous step.
[0402] ### If the task plan fully complies with the above four aspects, the task plan is considered reasonable and can complete the task, and True should be returned; otherwise, False is returned, and the reason why the plan is unreasonable is explained.
[0403] ### Mission Objectives:
[0404] { goal}
[0405] ```
[0406] After passing the four-layer verification, the task plan is output and regarded as a credible task plan.
[0407] Step 500: In the scheduling execution phase, design an execution verification prompt template and verification tool to build an execution verification agent, verify the actions of each agent during task execution, ensure that each step is executed according to the task plan and the results meet expectations, and timely adjust and correct deviations in the execution process to achieve the power data governance operation goals.
[0408] After step 450, the task scheduling and execution phase is entered, and each subtask is executed in sequence according to the trusted task plan output in step 450. In view of the fact that the hallucination problem of the large language model may cause errors in the thinking process or generated results of the agent, in order to ensure that the task can be executed strictly according to the plan, the present invention verifies the subtask execution process of each agent through an execution verification agent, thereby improving the success rate of the entire task. The specific steps are:
[0409] Step 510: Design and execute verification prompt template;
[0410] Define the execution verification prompt template as a tuple P V , contains the following parts:
[0411] ;
[0412] in, I T A statement representing the set of available verification tools ({ eva_tools}); G. W, O The meaning is the same as step 240. Refer to the process to generate a prompt template. The execution and verification prompt template are as follows:
[0413] ``` prompt
[0414] As an assistant to evaluate the rationality of the agent's output, your goal is to select the appropriate evaluation tool to evaluate the agent's output according to the "Important Reminder". Please think step by step to achieve your goal. You can use the following given tools.
[0415] ### Evaluation Tools:
[0416] {eva_tools}
[0417] ### Important reminder:
[0418] 1. First check whether the output contains SQL statements or operations that execute table reads. If so, you need to verify the related operations.
[0419] 2. Secondly, determine whether the agent output contains tool call information. If so, the rationality of the tool needs to be verified.
[0420] 3. If the output contains thinking content, the rationality of the thinking needs to be evaluated.
[0421] 4. The above assessment is completed by calling the tool, just determine which tool is needed.
[0422] ### Please reply in the following json format:
[0423] {{
[0424] " thought ": "Some steps to think about. ",
[0425] " tool_name ": "The name of the selected assessment tool."
[0426] }}
[0427] ```
[0428] Step 520: Build verification action / tool set T E ;
[0429] Different agents have different functions and their specific output contents are also different. This paper summarizes and constructs three general types of verification tools to form a tool set: T E , in order to verify the output content of different agents. Specifically:
[0430] Tool call rationality verification tool. This verification tool is suitable for agents that contain one or more tools and complete specific tasks through tool calls. It verifies whether the tool call information output by the agent can meet the corresponding task objectives. Design a tool call rationality prompt template, the specific content is as follows: ``` prompt
[0431] As an assistant in assessing the rationality of the task process, your role is to deeply analyze the agent's task objectives and task plans. Based on this analysis and the tool information provided, you need to make professional judgments on the rationality of the agent's use of tools.
[0432] ### Agent tool information:
[0433] { agent_tools}
[0434] ### Important reminder:
[0435] 1. Comprehensively consider the task objectives and tool information, and evaluate whether the task plan and tool selection are reasonable and whether they can effectively achieve the task objectives.
[0436] 2. If the task plan meets the above requirements, it is considered reasonable and True should be returned; otherwise, False is returned and the reason for unreasonableness is given.
[0437] ### The following are the current mission objectives:
[0438] { goal}
[0439] ### Here is the agent output:
[0440] { output}
[0441] ```
[0442] By calling the rationality prompt template through the tool, the large model can output content according to the intelligent agent ({ output}), current task target ({ goal}) and agent tool information ({agent_tools}) Complete the rationality verification task of the intelligent tool call and generate a binary verification result, that is, True or False.
[0443] SQL or table field verification tool. This verification tool is suitable for agents with data query and access functions. If the agent generates SQL or reads data, it is necessary to verify whether the SQL or table content completely contains all the fields in the task target to prevent errors in subsequent steps. Design SQL and table field verification prompt template, the specific content is as follows: ``` prompt
[0444] You are a SQL query result review assistant. Please determine whether the query result columns meet the task objectives based on the query result information or table information.
[0445] ### Notes:
[0446] If the task objective does not explicitly indicate the required columns, reply 'true' and do not consider subsequent steps. Otherwise:
[0447] 1. Extract the required columns from the task target, and then check whether the number of query result columns is consistent with the task target. Note that the extraction is based only on the task target, without reference to SQL and result column content!
[0448] 2. Compare each query result column with the task objective requirements one by one. Comments on some column names are reflected in the table information.
[0449] 3. Identify if there are any omissions or errors. If there are any omissions or errors, the result is incorrect. Think step by step.
[0450] ### Please reply in the following format:
[0451] {{
[0452] " required columns ": "Required columns extracted from the mission objective, formatted as a list. Leave empty if there are no relevant requirements in the mission objective",
[0453] " required columns num ": "The statistical length of the required column, formatted as a string",
[0454] " match ": "Binary matching result: True or False",
[0455] " thought ":"Summarize your thinking behind the review results. "
[0456] }}
[0457] ### The following are the current mission objectives:
[0458] { goal}
[0459] ### Here is the agent output:
[0460] { output}
[0461] ```
[0462] Through SQL and table field verification prompt template, the large model can output content according to the agent ({ output}) and the current task target ({ goal}), extract the required fields in the task target, compare them one by one with the fields of the query content output by the agent, and generate a binary classification verification result to complete the verification task.
[0463] Answer content evaluation verification tool. The answer content evaluation tool is aimed at the output content of the intelligent agent when there is no tool call or SQL generation, ensuring that the intelligent agent's thinking and generation results can meet or solve the current task objectives. Design the answer content evaluation prompt template, the specific content is as follows: ``` prompt
[0464] You are an answer evaluator, and your goals are: 1. Evaluate whether the answer helps solve the current task objectives; 2. Evaluate whether the answer deviates from the initial question or deviates from some requirements.
[0465] ### Please give a binary score True or False to represent the evaluation result.
[0466] ### The following are the current mission objectives:
[0467] { goal}
[0468] ### Here is the agent output:
[0469] { output}
[0470] ```
[0471] By answering the content evaluation prompt template, the large model can output content based on the agent ({ output}) and the current task target ({ goal}) to complete the content evaluation verification task and generate a binary classification evaluation result.
[0472] Step 530: Formatting the available tool representation;
[0473] The description of an available tool mainly includes its name and functional description. The standard tool description is designed as follows:
[0474] “ NAME: xxx -- CAPACITY: xxx ”
[0475] in, NAME Represents the name part of the tool, CAPACITY Represents the functions of the verification tool.
[0476] The statements of all tools in step 520 are organized based on the specification.
[0477] Step 540: construct an execution verification agent;
[0478] The steps to build an intelligent agent for execution verification are as follows:
[0479] First, reuse the formatting tool expression formed in step 530 ;
[0480] Next, based on step 510, obtain the verification prompt template , formatting tool representation and the output of the agent to be verified as parameters {eva_tools} and {output} Fill in the prompt template to generate a complete execution verification prompt for guiding the model verification output content;
[0481] Finally, combine the complete execution verification prompt template and the verification action / tool set defined in step 520 T E , and large language models M , build an execution verification agent :
[0482] ;
[0483] in, is the output content of the intelligent agent to be verified, that is, the verification target, The description information constructed for the agent in step 320.
[0484] Step 550: Task execution verification;
[0485] When the agent executing the subtask outputs content, first output its content With description information Input the execution verification agent constructed in step 540 In Generate the corresponding format of content according to the prompt template. Parse the validation tool you need to call in the generated content of and Finally, the verification tool is executed to generate the corresponding verification result. If the verification fails, the verification agent is executed. The error information will be organized and sent to the agent to re-execute the subtask; if the verification passes, it will continue to execute the next subtask.
[0486] Method effect display:
[0487] 1. Experiment 1:
[0488] Experiment 1 mainly demonstrated: the content and knowledge segmentation results of the power data governance domain knowledge base constructed based on the domain knowledge organization structure of the present invention; the effect of DR-RAG proposed in the present invention in domain knowledge retrieval and generation (based on the above knowledge base).
[0489] Build a knowledge base related to power data governance operations, take rule mining in data analysis scenarios as an example, and use DR-RAG to automatically generate corresponding reference knowledge. The example is as follows:
[0490] Question: Explore the rules among the fields of user classification, electricity consumption category, voltage level, urban and rural category, metering point classification, metering method, wiring method, and phase line;
[0491] Example of knowledge base content:
[0492] 1. Data acquisition:
[0493] 1.1 Data Collection: Data collection is the initial step to obtain data. Data can come from a variety of sources, including databases, APIs, sensors, and user input. Commonly used data collection tools include: SQL, API, Web Scraping, etc.
[0494] Prefix rules (optional): [None].
[0495] 2. Power data processing:
[0496] 2.1 Data cleaning;
[0497] Data cleaning is the process of removing errors and inconsistencies from data. Common data cleaning steps include:
[0498] Missing value handling: fill in missing values using mean interpolation, deletion of missing values, or prediction methods;
[0499] Data format standardization: unify data formats, such as date format, text case, etc.
[0500] Pre-rule (optional): [Data acquisition].
[0501] …
[0502] 3. Power data analysis
[0503] 3.5 Rule mining;
[0504] Description: Use rule mining algorithms to discover implicit knowledge in data and constraint rules between fields, analyze the rules between data fields, and generate usable rules.
[0505] Pre-rules (optional): [data acquisition, data processing].
[0506] The following is an example of knowledge base segmentation results, where the maximum text block size is set to 256 characters.
[0507] Title: Power Data Analysis; Title: Rule Mining; Content: Use rule mining algorithms to discover implicit knowledge in data and constraint rules between fields, analyze the rules between data fields, and generate usable rules. Pre-rules (optional): [data acquisition, data processing]. …
[0508] The output results of each link of DR-RAG are shown in Figure 4 .
[0509] Figure 5 This is the comparison result generated by traditional segmentation and retrieval. The segmentation method is based on the size of the text block. The text block size is set to 256 characters. The retrieval generation method is "input question - retrieval matching - process generation - output". The retrieval matching returns the three most similar text blocks. From the results, it can be seen that the second text block returned by the retrieval matching is related to the question, but part of the content is segmented into other blocks. At the same time, irrelevant text blocks are also included in the matching results, which ultimately leads to inaccurate generation results. Figure 5 , it can return complete key node information in retrieval matching, filter out irrelevant text blocks in retrieval evaluation, generate more accurate results, and further pass verification using evaluation nodes.
[0510] (II) Experiment 2:
[0511] Experiment 2 mainly demonstrates: the effect of the trusted planning method proposed in the present invention; the effect of the task execution verification method proposed in the present invention.
[0512] Taking rule mining and anomaly detection in data analysis scenarios as examples, it involves four parts: data acquisition, data processing, algorithm call, and result summary output. The set of agents that can be called is shown in Table 1.
[0513] This experimental process automatically selects and plans relevant agents from the available agents provided above to complete the task objectives through simple natural language instructions, using the knowledge base built in Experiment 1. The example is as follows:
[0514] Example 1: Pattern Exploration
[0515] Question: Explore the rules among the fields of user classification, electricity consumption category, voltage level, urban and rural category, metering point classification, metering method, wiring method, and phase line
[0516] The specific results of the stage are shown in Figure 6 ; Execute verification agent output results see Figure 7 The final experimental results are shown in Figure 8 ; The results of the task planning comparison experiment are shown in Fig. 9 .
[0517] from Figure 8 It can be seen from the final results that by adopting the method of the present invention, only a simple natural language instruction "explore the rules between fields such as user classification, electricity consumption category, voltage level, urban and rural category, metering point classification, metering method, wiring method, phase line, etc." can be used to integrate domain knowledge to generate reliable task planning, and successfully schedule and complete the power data governance data analysis work involving seven intelligent agents, thereby improving the stability of multi-agent collaboration in all aspects.
[0518] Fig. 9 This is the task planning result generated directly without using the power data governance domain knowledge, that is, using the prompt constructed in step 410, removing the modified domain knowledge generated by steps 200 and 300, and inputting it into the large language model for generation. It can be seen that Fig. 9 Some illusions appeared in the task planning results generated in the process. For example, in the first step, the "DataProcessor" was used to read and process data at the same time, without properly splitting the tasks and assigning them to the agents. In the second step, unnecessary task processes appeared, and there was no need to query the data again.
[0519] Example 2: Anomaly Detection
[0520] Problem: Analyze the anomalies among the fields of user classification, power consumption category, voltage level, wiring method, phase line, operating capacity, power consumption capacity at metering point, and comprehensive multiple
[0521] The anomaly detection process is the same as Example 1. The final results are shown in Fig.10 .
[0522] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A KCMAP-based power data governance trusted planning workflow method, characterized in that: The following steps are involved: Collect knowledge in the field of power data management, design the knowledge organization structure of the operation process, convert it into machine-readable vector form, and store it in the vector database; Based on the idea of intelligent agents, memory, feedback and evaluation mechanisms are introduced into the retrieval enhancement generation technology, and a multi-order knowledge prompt template is designed to construct the DR-RAG model. Combined with the large language model, DR-RAG retrieves information from the vector database and integrates the domain process knowledge related to the governance operation. Design a capability matching prompt template and build a knowledge capability matching agent, match the domain process knowledge with the available agent capabilities provided in the capability matching prompt template, and remove or integrate redundant process knowledge to perform domain knowledge correction; Integrate and modify domain process knowledge, design a trusted planning prompt template and build a task trusted planning agent to decompose and plan power data governance operations and generate task plans; And design a mission plan verification mechanism to verify the mission plan; In the dispatch execution phase, we design execution verification prompt templates and verification tools to build execution verification agents, verify the actions of each agent when the task plan is executed, ensure that each step is executed according to the task plan and the results meet expectations, adjust and correct deviations in the execution process, and achieve the goal of power data governance operations; The collecting of power data governance domain knowledge, designing of operation process knowledge organization structure, and conversion into machine-readable vector form include: Collect knowledge in the field of power data governance and extract core concepts of power data governance knowledge, where the core concepts are abstract workflows; For each core concept, sort out its key nodes and node rules to form the knowledge in the field of power data governance. The key nodes represent specific actions or basic concepts, and the node rules represent the non-strict dependency relationship between the key nodes and the core concepts. Store and load power data governance domain knowledge in the form of files; Segment the loaded text data to form text block data; Perform word embedding processing on the segmented text block data to convert it into a machine-readable text block vector form; Combined with the large language model, DR-RAG can retrieve information from the vector database and integrate domain process knowledge related to governance operations, including: Propose data governance objectives or questions in natural language and convert them into multi-dimensional query vectors. Performing similarity matching between the multidimensional query vector and the text block vector in the vector database; Design a search and evaluation prompt template. The search and evaluation prompt template is defined as a tuple. : ; in, G Indicates the task roles and objectives; D Indicates retrieving matching text blocks; Q Represents the original query question; E Represents task examples, showing what the output is when the results are relevant and irrelevant; Fill each retrieved text block and the original query question into the retrieval evaluation prompt template, input it into the large language model, guide the large language model to evaluate the retrieval results, generate a binary classification evaluation result, retain the relevant content, and obtain a filtered set of similar text blocks; Design a reference flow to generate prompt templates, guide the large language model to generate reference solution flow for the job target; where the reference flow to generate prompt templates is defined as a tuple : ; in, Represents a collection of filtered text blocks; W Indicates important reminders, including important tips and constraints when completing tasks; O Indicates the output format; Design a result evaluation prompt template to generate result evaluation output; wherein, define the generation evaluation prompt template as a tuple ,include: ; in, R Indicates generation requirements, that is, the reference process generates a prompt template after filling; C It represents the content to be evaluated, i.e. the generated reference process; Fill the generation requirements and the content to be evaluated into the generation result evaluation prompt template, guide the large language model to evaluate the generation results, and generate a binary evaluation result, namely, relevant True and irrelevant False; When the evaluation result is irrelevant False, rewrite the query question, and re-search and generate a new process until the evaluation result is passed; when the evaluation result is relevant True, output the final generated power data governance operation process information; Defines the query rewrite prompt template as a tuple ,include: ; in, S Represents thinking steps, including the provided thinking process to guide the thinking of the large language model; F To evaluate the results; The design capability matching prompt template and the construction of the knowledge capability matching intelligent agent include: Design a capability matching prompt template, wherein the capability matching prompt template is defined as a tuple P C : ; in, G Indicates the task role and objectives, A represents the set of available agents; K Represent domain knowledge, including knowledge related to power data governance operations; Z Indicates matching rules; L Indicates the reasoning format; O Indicates the output format; Design agent capability specifications and available agent sets A The capability specification of each available agent in the includes name, identifier, capability and additional information content; Build a whitespace matching action / tool T B , used to ensure flexible modular design and the normal flow of incoming information; Constructing a knowledge-ability matching agent, including: Firstly, for the constructed available agent set, the capability expression of each available agent in the available agent set is standardized according to the proposed specification format to form the agent capability specification; Secondly, based on the capability matching prompt template, the standardized agent capability specification is filled into the prompt template as a parameter to generate a complete capability matching prompt template for guiding the large language model to complete the task; Finally, combine the complete capability matching prompt template and the defined matching actions / tools T B , and a large language model to build an intelligent agent with knowledge matching capabilities: ; in, represents the knowledge ability matching agent, M Represents a large language model; The matching of the domain process knowledge with the capabilities of the available agents provided in the capability matching prompt template includes: Acquire domain process knowledge related to power data governance operational objectives K , which is input into the constructed knowledge ability matching agent Perform matching in First, based on the input domain process knowledge K Extract knowledge process node information: ; in, U K Represents the set of extracted knowledge process nodes, u i Indicates i process nodes, k is the number of process nodes; Next, analyze the specific needs of each process node R ( u ), and compare and match the requirements of each process node with the capabilities of each available agent: ; in, Representing an Agent a A collection of capabilities, Represents a matching set, including all process nodes u and Agent a The right one makes the process node u Demand R ( u ) is an intelligent agent a Capabilities A subset of like , then it is believed that the intelligent agent a Capabilities and process nodes u The needs are met, the match is successful, and the u The intention statement remains unchanged; If not present , so that , then remove the node u ; If exists , so that ,and is a continuous process node, that is , then Merge into a new node and keep the overall knowledge flow logic unchanged; The integration and correction of domain process knowledge, design of a credible planning prompt template and construction of a task credible planning agent include: Design a trusted planning prompt template, where the trusted planning prompt template is defined as P M ,include: ; in, I Indicates the identifier description; K’ Represents the revised domain knowledge; G Indicates the task role and objectives, A represents the set of available agents, O Indicates the output format; W Indicates important reminders, including important tips and constraints when completing tasks; Build a collection of planning actions / tools T P , used to receive and process the subtask plans generated by the large language model and store these plans in the agent's memory; Build a trusted task planning agent, including: First, a standardized intelligent agent capability specification A is formed; Secondly, obtain the corrected domain process knowledge K’ and trusted planning prompt template , the capability specification A and K’ Fill in the trusted planning prompt template as a parameter to generate a complete trusted planning prompt template for guiding the large language model to complete the task; Finally, combined with the complete trusted planning prompt template, the defined matching actions / tools T P , and a large language model to build a task-trusted planning agent: ; in, represents a task-trusted planning agent; Q Represents the input problem, i.e., the task goal; M Represents a large language model; The decomposition and planning of the power data governance operation and the generation of a task plan include: Take the input problem / job goal and feed it into the built task trusted planning agent To generate a task plan, the generation process is as follows: First, based on the revised domain knowledge Break down the mission objectives: ; in, represents the decomposed subtask set, Indicates the decomposition of n subtasks, n Indicates the number of decomposed subtasks; Secondly, for each subtask, find an agent that meets the subtask requirements from the available agent set for planning and generate a subtask plan: ; in, a mi Indicates that the subtask can be satisfied s i An available agent for the requirement; The design of the mission plan verification mechanism verifies the mission plan, including: Construct a four-layer verification mechanism for the output task plan : ; in, Represents the output task plan; FV It represents plan format verification, which verifies whether the input task plan meets the format requirements. If not, it will provide feedback to the task trusted planning agent to correct or regenerate the task plan according to the reason; AV represents agent verification, which verifies the agent in each subtask plan in the task plan to ensure that the agent in the plan is within the range of available agents provided; IV represents identifier verification, which verifies the agent identifier in the task plan to verify whether the identifier matches the agent. If not, it will provide feedback for correction; RV represents task plan rationality verification, which is based on the current task objectives and the revised domain knowledge. , Available Agent Set A , perform secondary verification on the task plan to verify whether the plan conforms to the current task objectives and domain knowledge. If not, feedback is given to the task trusted planning agent to regenerate the task plan; The construction execution verification agent includes: Design the execution verification prompt template and define the execution verification prompt template as a tuple P V ,include: ; in, I T A statement indicating the set of available verification tools; G Indicates the task role and objectives, O Indicates the output format; W Indicates important reminders, including important tips and constraints when completing tasks; Build verification actions / tools collection T E , used to verify the output content of different agents; Format the description of available tools, including their names and functional descriptions; The steps to build an intelligent agent for execution verification are as follows: First, reuse the formatting tool expression; Secondly, based on the acquisition execution verification prompt template , fill the formatted tool description and the output of the agent to be verified as parameters into the execution verification agent prompt template to generate a complete execution verification prompt template for guiding the model verification output content; Finally, combined with the complete execution verification prompt template, the defined verification action / tool set T E , and large language models M , build an execution verification agent : ; in, The output content of the intelligent agent to be verified, that is, the verification target; A description of the agent. The actions of each intelligent agent are verified during task execution to ensure that each step is executed according to the task plan and the results meet expectations, and deviations in the execution process are adjusted and corrected in a timely manner to achieve the goals of power data governance operations, including: When the agent executing the subtask outputs content, first output its content With description information Input build execution verification agent In Generate content in the corresponding format according to the prompt template of the execution verification agent; from Parse the validation tool you need to call in the generated content of and Pass them into the verification tool together; Execute the verification tool to generate the corresponding verification results. If the verification fails, execute the verification agent The error information will be organized and sent to the agent to re-execute the subtask; if the verification passes, it will continue to execute the next subtask.
Citation Information
Patent Citations
Personalized traffic report dynamic generation method and device based on AI intelligent agent and medium
CN117785965A
Vector knowledge base-based large-model question-answer dialogue method and system and storage medium
CN118484526A