An AI Agent based on a large language model collaborative knowledge graph and its implementation method
By combining the large language model with the RPA process knowledge graph, the problem of the lack of professional knowledge in the RPA process generation of the large language model is solved, and a more accurate and efficient RPA process generation is achieved.
Patent Information
- Application Number
- CN202411978911.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The large language model lacks professional knowledge and normative constraints in the generation of RPA processes, resulting in inaccurate and inefficient RPA processes.
By combining large language models with RPA process knowledge graphs, we use the professional knowledge and specification constraints provided by the knowledge graph to generate RPA processes that comply with industry standards and specifications. The specific implementation includes the collaborative work of the natural language dialogue module, the RPA SOP process knowledge graph module and the RPA execution engine.
Improve the accuracy and efficiency of RPA process generation, ensure that the generated process complies with the business processes and specifications of specific industries, and reduces manual intervention and development time.
Smart Images

Figure CN119377360B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an AI Agent based on a large language model collaborative knowledge graph and an implementation method thereof. Background Art
[0002] AI Agent is a software program that can perceive the environment, make autonomous decisions, and take actions to achieve specific goals. It can simulate human intelligent behavior to a certain extent to provide services to users. Large language models (LLMs) are good at processing and generating human language. They can understand complex sentences, translate, summarize texts, and even create various creative content. Knowledge graphs store world knowledge in a structured way, representing entities, concepts, and the relationships between them. This structured knowledge representation enables knowledge graphs to support complex reasoning and queries and provide a reliable source of information. In recent years, large language models (LLMs) have made significant progress in natural language understanding and generation, providing new possibilities for the development of automated RPA processes. However, LLMs lack expertise in specific fields and it is difficult to generate accurate and standardized RPA processes. Currently, there is little research on the application of large language agents.
[0003] In the prior art, Chinese invention patent 202010981528.7 discloses a method, device, equipment and medium for generating an AI-based RPA process. It obtains conversations, processes conversation data, and generates at least one RPA process, thereby realizing automatic process mining by machines, avoiding manual mining of processes later, thereby improving mining efficiency. However, the above technical solution only clusters conversations, generates multiple conversations and obtains recommended processes based on them, and also performs similarity calculations to obtain recommended processes. However, the above technology has limited AI application effects as a general model, and the effects obtained by using only clustering algorithms are limited, resulting in both semantic understanding accuracy and RPA generation efficiency being affected. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide an AI Agent based on a large language model collaborative knowledge graph and its implementation method. The AI Agent based on a large language model collaborative knowledge graph of the present invention should be able to solve the problem of LLM lacking professional knowledge and normative constraints in the RPA process generation process, and use the RPA process knowledge graph to enhance the knowledge and reasoning ability of LLM, so that it can understand the business processes and specifications of a specific industry, and generate RPA processes that meet the requirements, thereby improving the accuracy and efficiency of RPA process generation.
[0005] In order to achieve the above invention purpose, the technical solution provided by the present invention is as follows:
[0006] An AI Agent based on a large language model and knowledge graph, whose architecture consists of a natural language dialogue module, a large language model module, an RPA SOP process knowledge graph module, and an RPA execution engine, where:
[0007] The natural language dialogue module is used to receive the natural language input by the user and parse the input natural language requirements to convert the natural language into a structured query statement;
[0008] The large language model module interacts with the natural language dialogue module and the RPA SOP process knowledge graph module respectively. The large language model module is responsible for understanding user needs, retrieving the knowledge graph according to the query statement, and generating RPA process steps according to the knowledge graph;
[0009] The RPA SOP process knowledge graph module stores standard SOP knowledge for specific industry vertical businesses, including process steps, operating rules and data dictionaries, and provides the large language model module with the expertise and regulatory constraints required for semantic understanding and generation, and provides knowledge query and reasoning services. The reasoning service is a basic function of the knowledge graph. The result of knowledge extraction and knowledge fusion is knowledge reasoning, but the reasoning service provided by the RPA SOP process knowledge graph module is relatively simple and not intelligent enough, and requires the assistance of a large language model to generate complex and usable results.
[0010] The RPA execution engine is responsible for executing the RPA process steps generated by the large language model module and interacting with the target system. In the application scenario, the RPA execution engine requires the target system to exist at the same time to complete the function collaboratively, so the executor needs to interact with the target system. The interaction includes the input, output or feedback of the target system. The target system is generally the software system that serves as the operation object.
[0011] In the AI Agent intelligent body based on the large language model collaborative knowledge graph of the present invention, the RPA SOP process knowledge graph module is constructed in an ontology manner to define concepts, entities, attributes and relationships in the field, providing a basis for knowledge representation and reasoning.
[0012] In the AI Agent intelligent body based on the collaborative knowledge graph of the large language model of the present invention, a combination of top-down and bottom-up methods is adopted when constructing the ontology. Top-down refers to referring to industry standards and domain expert knowledge to define core concepts and relationships including business processes, process steps, operations, data and rules. Bottom-up refers to analyzing data sources including RPA process scripts and business process diagrams, extracting entities, attributes and relationships, and mapping them to predefined ontology concepts.
[0013] In the AI Agent intelligent body based on the large language model and collaborative knowledge graph of the present invention, further, based on the defined ontology, the entities, relationships and attributes in the knowledge graph are represented in the form of RDF triples. The entities are the basic elements in the knowledge graph, representing things or concepts in the real world. URI is used to uniquely identify each entity. The types of entities include business processes, process steps, operations, data and rules; predefined relationship types are used to connect entities to indicate the relationship between them. The six relationship types defined are inclusion, sequential execution, conditional execution, operation object, input and output; the attributes are used to describe the characteristics of entities or relationships and provide more detailed information. Attributes are divided into entity attributes and relationship attributes.
[0014] In the AI Agent intelligent body based on the large language model collaborative knowledge graph of the present invention, when the RPA SOP process knowledge graph module is implemented, it includes knowledge extraction, knowledge fusion and knowledge storage, and knowledge extraction is performed from data sources including industry standard documents, RPA process scripts, business process diagrams and system logs. Knowledge fusion is to identify different expressions of the same entity in different data sources, map them to a unified entity identifier to achieve entity alignment, and merge knowledge fragments from different data sources into a unified knowledge graph to achieve knowledge merging. The data that has completed knowledge fusion is stored in a graph database to complete the knowledge storage of the RPA process knowledge graph.
[0015] In the AI Agent intelligent body based on the large language model and collaborative knowledge graph of the present invention, the large model module is enhanced in knowledge based on the RPA SOP process knowledge graph module, mainly semantic understanding, knowledge retrieval and knowledge enhancement. The natural dialogue module converts the user's natural language questions into structured query statements that can be executed on the knowledge graph. Knowledge retrieval is to query according to the structured query statements, retrieve the corresponding entities, relationships and attribute information from the knowledge graph, and use the query engine provided by the graph database to execute SPARQL queries. Knowledge enhancement is to integrate the retrieved knowledge information into the input or output of the large language model module, and guide the large language model module to generate more accurate text that conforms to the knowledge graph.
[0016] In the AI Agent intelligent body based on the large language model and knowledge graph of the present invention, further, the knowledge enhancement operation mainly includes knowledge injection, knowledge editing and knowledge constraint. Knowledge injection is to use knowledge information as the input of the large language model, and add relevant entities, relationships and attribute information to the prompt based on the prompt construction paradigm. Knowledge editing is to use the large language model to generate text, and use the knowledge graph to correct and improve the generated text. In the process of generating text with the large language model, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results. The constraints here refer to the semantic restriction range, such as Chinese. The accuracy of the result is to be precisely close to the target answer. Consistency means that the answers to the same type of questions are similar and cannot be too jumpy to remain stable.
[0017] In the AI Agent intelligent body based on the large language model and collaborative knowledge graph of the present invention, when generating RPA process steps according to the knowledge graph, the matching business process in the knowledge graph is retrieved according to the task objectives described by the user, and the standardized RPA process steps are generated according to the retrieved business process and the step sequence and rule constraints defined in the knowledge graph. For each process step, the large language model uses text generation and code generation to further refine the specific operations to be performed.
[0018] The present invention also relates to a method for implementing an AI Agent based on a large language model collaborative knowledge graph, the method comprising the following implementation steps:
[0019] In the first step, the user inputs the natural language requirements;
[0020] The second step is to parse the input natural language requirements and generate structured query statements;
[0021] The third step is to input the generated structured query statement together with the context information into the large language model. The large language model retrieves the knowledge graph according to the input query. The knowledge graph is stored in the graph database, which is stored in the RPA SOP process knowledge graph model. The constructed RPA SOP process knowledge graph model stores the standard SOP knowledge of vertical businesses in a specific industry. The professional knowledge graph provides the professional knowledge and normative constraints required for semantic understanding and generation for the large language model. The RPA SOP process knowledge graph model provides knowledge query and simple reasoning services.
[0022] The fourth step is to determine whether relevant knowledge can be retrieved from the knowledge graph. If relevant knowledge can be retrieved, it means whether a matching process can be found. If relevant knowledge can be retrieved, the matching process is found, and the fifth step is executed. If relevant knowledge cannot be retrieved, that is, the matching process cannot be found, the large language model guides the user to improve the demand, and return to the first step to re-enter the natural language demand;
[0023] In the fifth step, the large language model module uses relevant knowledge retrieval to enhance the generation of RPA process steps. The user confirms the generated RPA process and arranges the execution of the RPA process.
[0024] Step 6: Deploy the generated RPA process to the RPA execution engine, use the RPA execution engine to execute the RPA process and feedback the execution results;
[0025] Step 7: The large language model verifies the process execution results and dynamically adjusts the priority of the execution steps;
[0026] In the eighth step, the RPA execution engine executes all steps to obtain the final result.
[0027] In the implementation method of the AI Agent intelligent body based on the large language model collaborative knowledge graph of the present invention, the formation process of the RPA SOP process knowledge graph in the third step includes knowledge construction, knowledge representation and implementation, and the implementation includes knowledge extraction, knowledge fusion and knowledge storage.
[0028] In the implementation method of the AI Agent intelligent body based on the large language model and the knowledge graph of the present invention, it also includes knowledge enhancement based on the large model of the RPA process knowledge graph, converting the user's natural language questions into structured query statements that can be executed on the knowledge graph, using the encoder-decoder model to encode the natural language questions into semantic vectors, and then decoding them into structured query statements; retrieving relevant entity, relationship and attribute information from the knowledge graph according to the structured query statements; integrating the retrieved knowledge information into the input or output of the large language model module, and guiding the large language model to generate more accurate text that conforms to the knowledge graph. This is the process of the knowledge graph playing a role in the large language model, and it is also a manifestation of innovation.
[0029] In the implementation method of the AI Agent based on the large language model and collaborative knowledge graph of the present invention, further, when enhancing knowledge, it includes knowledge injection, knowledge editing and knowledge constraints. Knowledge injection is to use knowledge information as the input of the large language model, and add relevant entities, relationships and attribute information to the prompt based on the Prompt construction paradigm; knowledge editing is to use the large language model to generate text, and then use the knowledge graph to correct and improve the generated text. The correction and improvement here is to make simple adjustments to the word order, rules and weights to make them conform to the text habits such as grammar; in the process of generating text with the large language model, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results.
[0030] In the implementation method of the AI Agent based on the large language model collaborative knowledge graph of the present invention, the following implementation process is included when the RPA process is generated:
[0031] Process retrieval: retrieve matching business processes in the knowledge graph based on the task objectives described by the user;
[0032] Process normalization: Generate normalized RPA process steps based on the retrieved business process and the step sequence and rule constraints defined in the knowledge graph;
[0033] Operation refinement: For each process step, the large language model can further refine the specific operations that need to be performed, including the operation object, input data, and output data. Enhancing the output of the large language model means enhancing the generation results of the large model by retrieving the knowledge graph, and enhancing the accuracy of the generation results by retrieving relevant knowledge information from the knowledge graph.
[0034] Based on the above technical solution, the AI Agent based on a large language model collaborative knowledge graph and its implementation method and storage medium of the present invention have achieved the following technical effects through practical application compared with the prior art:
[0035] 1. The present invention realizes knowledge-driven AI Agent based on a large language model and a collaborative knowledge graph and its implementation method, performs knowledge enhancement based on a large language model of an RPA process knowledge graph, converts user natural language questions into structured query statements that can be executed on the knowledge graph, uses an encoder-decoder model to encode natural language questions into semantic vectors, and then decodes them into structured query statements; retrieves relevant entity, relationship and attribute information from the knowledge graph according to the structured query statements; integrates the retrieved knowledge information into the input or output of the large language model module, guides the large language model to generate more accurate text that conforms to the knowledge graph, uses the RPA process knowledge graph to provide professional knowledge and normative constraints for LLM, and by clamping the RPA process knowledge graph, makes the generation results of the large language model more intelligent, close to professional needs, close to professional reality, and improves the accuracy and standardization of process generation.
[0036] 2. The AI Agent based on the large language model collaborative knowledge graph and its implementation method of the present invention have a high degree of automation, can automatically generate RPA processes from user natural language requirements, automatically produce process step codes with the support of professional knowledge, reduce manual intervention, improve development efficiency, and embody the advantages of intelligent agents.
[0037] 3. The AI Agent intelligent body based on the collaborative knowledge graph of the large language model and its implementation method of the present invention achieve strong scalability. According to different industries and business needs, the corresponding RPA process knowledge graph can be constructed and expanded, so that the large language model can be gradually expanded and applied with the support of professional knowledge, and adapt to the generation of professional RPA process codes in different industries, so that the RPA engine is more professional and reliable when executing the code, and the interaction with other target systems is faster and more professional, which greatly improves the completion accuracy of professional work in vertical industries and is also conducive to the expansion of applications of different types of professions. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the composition and communication process of an AI Agent based on a large language model collaborative knowledge graph of the present invention.
[0039] Figure 2 It is a workflow diagram of an implementation method of an AI Agent intelligent body based on a large language model collaborative knowledge graph of the present invention. DETAILED DESCRIPTION
[0040] Below we will further elaborate on the AI Agent intelligent body based on a large language model collaborative knowledge graph, its implementation method and storage medium of the present invention in combination with the accompanying drawings and specific embodiments, in order to more clearly understand its module composition and working process, but this cannot be used to limit the scope of protection of the present invention.
[0041] The present invention aims at the intelligentization problem of traditional RPA and proposes an AI Agent based on a large language model and a collaborative knowledge graph and its implementation method. An AI Agent is a software program that can perceive the environment, make autonomous decisions and take actions to achieve specific goals. It can simulate human intelligent behavior to a certain extent to provide services to users. Large language models (LLMs) are good at processing and generating human language. They can understand complex sentences, translate, summarize texts, and even create various creative content. However, LLMs also have their limitations, such as being prone to "hallucinations" (i.e., making up facts), lacking in-depth understanding of knowledge in specific fields, and difficulty in making complex reasoning. Knowledge graphs store world knowledge in a structured way, representing entities, concepts, and the relationships between them. This structured knowledge representation enables knowledge graphs to support complex reasoning and queries and provide a reliable source of information. Knowledge graphs can make up for some of the shortcomings of LLMs, such as providing factual basis, making logical reasoning, and ensuring the accuracy of answers. AI Agent based on a large language model (LLM) and collaborative knowledge graphs is an intelligent system that combines two powerful AI technologies. It leverages the natural language understanding and generation capabilities of LLM and combines it with structured world knowledge in the knowledge graph to achieve more powerful and reliable intelligent behavior. Example 1
[0042] This embodiment aims to solve the problem of LLM (Large Language Model) lacking professional knowledge and regulatory constraints in the RPA process generation process. The RPA process knowledge graph is used to enhance the knowledge and reasoning ability of LLM, so that it can understand the business processes and specifications of a specific industry and generate RPA processes that meet the requirements, thereby improving the accuracy and efficiency of RPA process generation.
[0043] like Figure 1 As shown, this embodiment is an AI Agent based on a large language model collaborative knowledge graph, which includes a natural language dialogue module, a large language model module, an RPA SOP process knowledge graph module and an RPA execution engine, wherein:
[0044] The natural language dialogue module is used to receive the natural language input by the user and parse the input natural language requirements to convert the natural language into a structured query statement;
[0045] The large language model module interacts with the natural language dialogue module and the RPA SOP process knowledge graph module respectively. The large language model module uses structured query statements and morning and afternoon information to understand user needs, retrieves the knowledge graph from the RPA SOP process knowledge graph module according to the query statement, and then generates the RPA process steps according to the knowledge graph;
[0046] The RPA SOP process knowledge graph module stores standard SOP knowledge for specific industry vertical businesses, including process steps, operating rules, and data dictionaries, thereby providing the large language model module with the expertise and regulatory constraints required for semantic understanding and generation, and providing knowledge query and reasoning services. However, the reasoning service provided by the RPA SOP process knowledge graph module belongs to the basic function of the knowledge graph. The result of the knowledge extraction and knowledge fusion mentioned below is knowledge reasoning, but the reasoning service provided by the RPA SOP process knowledge graph module is relatively simple and not intelligent enough, and requires the assistance of a large language model to generate complex and usable results.
[0047] The RPA execution engine is responsible for executing the RPA process steps generated by the large language model module and interacting with the target system, including the input, output or feedback of the target system. The target system is generally a software system that is the object of operation. In the application scenario, the RPA execution engine requires the target system to exist at the same time to complete the function collaboratively, so the RPA execution engine as an executor needs to interact with the target system.
[0048] In the AI Agent intelligent body based on the collaborative knowledge graph of the large language model of the present invention, the RPA SOP process knowledge graph module is constructed in the form of ontology, defining concepts, entities, attributes and relationships in the field, and providing a basis for knowledge representation and reasoning. When constructing the ontology, a combination of top-down and bottom-up methods is used to implement the ontology construction. The ontology language is described by knowledge representation languages such as OWL (Web Ontology Language) or RDF Schema (RDFS). Top-down refers to referring to industry standards and domain expert knowledge to define core concepts and relationships including business processes, process steps, operations, data and rules. Bottom-up refers to analyzing data sources including RPA process scripts and business process diagrams, extracting entities, attributes and relationships, and mapping them to predefined ontology concepts.
[0049] When representing knowledge, based on the defined ontology, RDF triples (Subject-Predicate-Object) are used to represent entities, relationships, and attributes in the knowledge graph.
[0050] Entities are basic elements in the knowledge graph, representing things or concepts in the real world. Each entity is uniquely identified using a URI (Uniform Resource Identifier). The RPA process knowledge graph defines five core entity types, including business processes, process steps, operations, data, and rules.
[0051] Business Process: represents a complete business process and is the highest level of abstraction.
[0052] Examples: "Customer account opening process", "Order processing process", "Reimbursement approval process"
[0053] Attributes: can include process name, process description, department, etc.
[0054] Process Step: represents a specific operation step in a business process and is a component of the business process.
[0055] Examples: "Fill in customer information", "Verify account balance", "Send email notification"
[0056] Attributes: can include step name, step description, execution time, responsible person, etc.
[0057] Action: It represents the atomic operation that can be performed by the RPA system and is the lowest level executable unit.
[0058] Examples: "Click a button", "Enter text", "Read data", "Open a web page"
[0059] Attributes: can include operation name, operation parameters, operation object, etc.
[0060] Data: represents various data involved in the business process and is the input or output of process steps and operations.
[0061] Examples: "Customer Name", "Account Balance", "Order Number", "Email Address"
[0062] Attributes: can include data type, data format, data source, etc.
[0063] Rule: Represents the rules and constraints that need to be followed in the business process and is used to control the execution logic of the process.
[0064] Examples: "Account balance must be greater than 0", "Order status must be pending", "Age must be greater than 18 years old"
[0065] Attributes: can include rule description, conditional expressions, triggering events, etc.
[0066] For relationships, predefined relationship types are used to connect entities to indicate how they are related. The six relationship types defined are containment, sequential execution, conditional execution, operation object, input, and output.
[0067] Contains (hasStep): Indicates a one-to-many relationship between a business process and process steps, that is, a business process contains multiple process steps.
[0068] Example: "Customer account opening process" includes steps such as "fill in customer information", "verify identity information", and "open a bank account".
[0069] Sequential execution (followedBy): Indicates the sequential relationship between process steps, that is, which step needs to be executed after a process step is completed.
[0070] Example: After "Fill in customer information", execute "Verify identity information" in sequence.
[0071] Conditional On: Indicates the conditions that need to be met for the execution of a process step, that is, the step will only be executed if the specific conditions are met.
[0072] Example: The execution condition of "Send Email Notification" is "Order Status is Shipped".
[0073] Operation object (operateOn): Indicates which data the operation acts on, that is, which data the operation needs to read, modify or generate.
[0074] Example: The action object of "Click Button" is "Submit Button", and the action object of "Input Text" is "Customer Name" input box.
[0075] Input (hasInput): Indicates the input data required for the operation, that is, what data is needed as parameters to perform the operation.
[0076] Example: The input for "Verify Account Balance" is "Account Balance", and the input for "Send Email Notification" is "Email Address" and "Email Content".
[0077] Output (hasOutput): Indicates the output data generated by the operation, that is, what data will be generated after executing the operation.
[0078] Example: The output of "Read Data" is "Customer Information", and the output of "Calculate Total Amount" is "Total Amount".
[0079] The attributes are used to describe the characteristics of an entity or a relationship and provide more detailed information. Attributes are divided into entity attributes and relationship attributes.
[0080] Entity attributes: describe the characteristics of the entity itself, such as "process name" of "business process", "execution time" of "process step", "data type" of "data", etc.
[0081] Relationship attributes: describe the characteristics of a relationship, such as the "execution order" of "sequential execution" and the "conditional expression" of "conditional execution".
[0082] Example
[0083] # --- Entities ---
[0084] # Business Process
[0085] <Customer account opening process> rdf:type <business process>;
[0086] rdfs:label "Customer account opening process";
[0087] <Process description> "Automated process for opening new bank accounts";
[0088] <Department>"Customer Service Department" .
[0089] # Process steps
[0090] <Fill in customer information> rdf:type <process steps>;
[0091] rdfs:label "Fill in customer information";
[0092] <Step Description>"Collect and fill in basic information of new customers";
[0093] <Responsible Person> "Account Manager" .
[0094] <Verification identity information> rdf:type <process step>;
[0095] rdfs:label "Verify identity information";
[0096] <Step Description> "Verify the authenticity of the identity information provided by the customer";
[0097] <Execution time>"1 minute" .
[0098] <Open a bank account> rdf:type <Process steps>;
[0099] rdfs:label "Open a bank account";
[0100] <Step Description>"Create a new bank account based on customer information" .
[0101] # operate
[0102] <Click the "Submit Button"> rdf:type <action>;
[0103] rdfs:label "Click the submit button";
[0104] <Action name>"Click";
[0105] <Operation object>"Submit button".
[0106] # data
[0107] <Customer Name> rdf:type <data>;
[0108] rdfs:label "Customer Name";
[0109] <Data type>"string" .
[0110] <ID number> rdf:type <data>;
[0111] rdfs:label "ID number";
[0112] <data type>"string";
[0113] <Data format>"xxxxxxxxxxxxx" .
[0114] # --- relation---
[0115] <Customer Account Opening Process> <hasstep><Fill in customer information>.
[0116] <Customer account opening process> <hasstep><Verify identity information> .
[0117] <Customer account opening process> <hasstep><Open a bank account> .
[0118] <Fill in customer information> <followedby><Verify identity information> ;
[0119] <Execution order> "1".
[0120] <Verify identity information> <followedby><Open a bank account>;
[0121] <Execution order> "2".
[0122] <Fill in customer information> <operateon><Customer Name>.
[0123] <Fill in customer information> <operateon><ID number>.
[0124] <Click the "Submit Button"> <hasinput><Customer Name>.
[0125] <Click the "Submit Button"> <hasinput><ID number> .
[0126] When the RPA SOP process knowledge graph module is implemented, it includes knowledge extraction, knowledge fusion and knowledge storage.
[0127] 1) Knowledge extraction: Extract from industry standard documents, RPA process scripts, business process diagrams, system logs and other data sources. For structured or semi-structured data, such as RPA process scripts, system logs, etc., formulate rule templates to extract entities, relationships and attributes. For unstructured data, such as industry standard documents, business process diagrams, etc., use NLP technologies such as named entity recognition and relationship extraction to extract key information.
[0128] Example
[0129] Extract knowledge from RPA process scripts: Analyze the variable names, function calls, control flows and other information in the scripts, and extract entities such as operations, data, rules and the relationships between them.
[0130] Extract knowledge from business process graphs: Identify nodes and edges in the process graph, and extract information such as process steps, execution order, conditional branches, etc.
[0131] 2) Knowledge fusion: Identify different expressions of the same entity in different data sources, such as "customer information" and "user information", and map them to a unified entity identifier to achieve entity alignment. Determine the relationship type between the same entity pairs to achieve relationship disambiguation. For example, "process step A subsequently executes process step B" can be expressed as <process step A> <followedby><Process step B>. Merge knowledge fragments from different data sources into a unified knowledge graph to achieve knowledge merging and resolve possible conflicts and contradictions.
[0132] Example
[0133] Rule-based entity alignment: Use string similarity, dictionary matching, and other methods to identify different expressions that refer to the same entity.
[0134] Machine learning-based relation disambiguation: training a classification model to determine the type of relationship between entity pairs based on contextual information.
[0135] 3) Knowledge storage: Use the graph database Neo4j to store the RPA process knowledge graph.
[0136] Based on the RPA SOP process knowledge graph module, the large model module is enhanced with knowledge, mainly semantic understanding, knowledge retrieval and knowledge enhancement.
[0137] 1. Semantic Understanding (NLQ to SPARQL)
[0138] Transform user natural language questions (NLQs) into structured query statements (SPARQL) that can be executed on knowledge graphs. Use a deep learning-based approach: Use an encoder-decoder model to encode NLQs into semantic vectors and then decode them into SPARQL statements.
[0139] 2. Knowledge Retrieval
[0140] Retrieve relevant entity, relationship, and attribute information from the knowledge graph based on SPARQL query statements. Use the query engine provided by the graph database to execute SPARQL queries. Use graph traversal algorithms (such as depth-first search, breadth-first search) to retrieve relevant nodes and edges.
[0141] 3. Knowledge Enhancement
[0142] Integrate the retrieved knowledge information into the input or output of LLM (Large Language Model), guiding LLM to generate more accurate text that conforms to the knowledge graph. The main functions include knowledge injection, knowledge editing and knowledge constraint.
[0143] Knowledge Injection: Take knowledge information as the input of LLM and add relevant entity, relationship and attribute information to the prompt based on the prompt construction paradigm.
[0144] Knowledge Editing: Use LLM to generate text, and then use the knowledge graph to correct and improve the generated text.
[0145] Knowledge Constraint: In the process of LLM text generation, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results.
[0146] The Prompt design paradigm of the above RPA process knowledge graph enhanced LLM is as follows:
[0147] ## Task goal: {Use concise language to describe the automation goal that the user wants to achieve}
[0148] ## Constraints:
[0149] * Process name: {optional, user-specified process name}
[0150] * System: {optional, user-specified target system}
[0151] * Data source: {optional, user-specified data source}
[0152] * Other constraints: {optional, other constraints specified by the user}
[0153] ## Related knowledge:
[0154] * Process steps:
[0155] * {Step 1 Name}: {Step 1 Description}
[0156] * {Step 2 Name}: {Step 2 Description}
[0157] * ...
[0158] * operate:
[0159] * {Operation 1 Name}: {Operation 1 Description}
[0160] * {Operation 2 Name}: {Operation 2 Description}
[0161] * ...
[0162] * data:
[0163] * {data1 name}: {data1 description}
[0164] * {data2 name}: {data2 description}
[0165] * ...
[0166] * rule:
[0167] * {Rule 1 Description}
[0168] * {Rule 2 Description}
[0169] * ...
[0170] ## Generate content:
[0171] Generate a detailed RPA process design document, including the following:
[0172] 1. Process name:
[0173] 2. Process objectives:
[0174] 3. Process steps:
[0175] * Step 1: {Detailed description of step 1, including input, output, operations, etc.}
[0176] * Step 2: {Detailed description of step 2, including input, output, operations, etc.}
[0177] * ...
[0178] 4. Exception handling: {Describe how to handle exceptions during process execution}
[0179] When generating RPA process steps based on the knowledge graph, it includes process retrieval, process standardization, and operation refinement. Among them, process retrieval is to retrieve the matching business process in the knowledge graph according to the task objectives described by the user, and usually uses semantic similarity calculation, graph matching algorithm and other technologies for process retrieval. Process standardization is to generate standardized RPA process steps based on the retrieved business process, according to the step sequence and rule constraints defined in the knowledge graph, and usually uses process mining, process modeling and other technologies for process standardization. Operation refinement: For each process step, the large language model uses text generation and code generation to further refine the specific operations to be performed, and usually uses text generation, code generation and other technologies for operation refinement.
[0180] Example 2
[0181] like Figure 1 and Figure 2 As shown, this embodiment is a method for implementing an AI Agent based on a large language model collaborative knowledge graph. The method uses the above-mentioned AI Agent based on a large language model collaborative knowledge graph. The method includes the following implementation steps:
[0182] In the first step, the user inputs natural language into the natural language dialogue module and puts forward natural language requirements in the form of natural language;
[0183] In the second step, the natural language dialogue module parses the input natural language requirements and generates structured query statements with context information. The purpose is to generate structured queries from the parsed requirements to the large language model.
[0184] The third step is to input the generated structured query statement together with the context information into the large language model. The large language model retrieves the knowledge graph according to the input query. The knowledge graph is stored in the graph database, which is stored in the RPA SOP process knowledge graph model. The constructed RPA SOP process knowledge graph model stores the standard SOP knowledge of vertical businesses in a specific industry. The professional knowledge graph provides the professional knowledge and normative constraints required for semantic understanding and generation for the large language model. The RPA SOP process knowledge graph model provides knowledge query and simple reasoning services.
[0185] The fourth step is to determine whether relevant knowledge can be retrieved from the knowledge graph. If relevant knowledge can be retrieved, it means whether a matching process can be found. If relevant knowledge can be retrieved, the matching process is found, and the fifth step is executed. If relevant knowledge cannot be retrieved, that is, the matching process cannot be found, the large language model guides the user to improve the demand, and return to the first step to re-enter the natural language demand;
[0186] In the fifth step, the large language model module uses relevant knowledge retrieval to enhance the generation of RPA process steps. The user confirms the generated RPA process and arranges the execution of the RPA process.
[0187] Step 6: Deploy the generated RPA process to the RPA execution engine, use the RPA execution engine to execute the RPA process and feedback the execution results;
[0188] Step 7: The large language model verifies the process execution results and dynamically adjusts the priority of the execution steps;
[0189] In the eighth step, the RPA execution engine executes all steps to obtain the final result.
[0190] The formation process of the RPA SOP process knowledge graph in the third step includes knowledge construction, knowledge representation and implementation, and the implementation includes knowledge extraction, knowledge fusion and knowledge storage.
[0191] In the third and fourth steps, the purpose is to perform knowledge enhancement based on the large model of the RPA process knowledge graph, and convert the user's natural language questions into structured query statements that can be executed on the knowledge graph. Specifically, the natural language questions are encoded into semantic vectors using the encoder-decoder model, and then decoded into structured query statements. Retrieve relevant entity, relationship, and attribute information from the knowledge graph based on the structured query statement; integrate the retrieved knowledge information into the input or output of the large language model module. The input or output is because the large language model may be iterated multiple times, guiding the large language model to generate more accurate text that conforms to the knowledge graph.
[0192] When enhancing knowledge, it includes knowledge injection, knowledge editing and knowledge constraints. Knowledge injection is to use knowledge information as the input of the large language model, and add relevant entity, relationship and attribute information to the prompt based on the Prompt construction paradigm; knowledge editing is to use the large language model to generate text, and then use the knowledge graph to correct and improve the generated text; in the process of generating text with the large language model, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results.
[0193] The RPA process generation includes the following implementation process:
[0194] Process retrieval: retrieve matching business processes in the knowledge graph based on the task objectives described by the user;
[0195] Process normalization: Generate normalized RPA process steps based on the retrieved business process and the step sequence and rule constraints defined in the knowledge graph;
[0196] Operation refinement,For each process step, LLM can further refine the specific operations that need to be performed, including the operation object, input data, and output data.
[0197] Undoubtedly, the above is only a limited implementation case of the AI Agent based on a large language model collaborative knowledge graph and its implementation method of the present invention, and other methods, steps and system architectures that can be implemented are also included. In short, the protection scope of the present invention also includes other obvious changes and substitutions for those skilled in the art.< / followedby> < / hasinput> < / hasinput> < / operateon> < / operateon> < / followedby> < / followedby> < / hasstep> < / hasstep> < / hasstep>
Claims
1. An AI Agent based on a large language model and collaborative knowledge graph, characterized in that: It includes a natural language dialogue module, a large language model module, an RPA SOP process knowledge graph module, and an RPA execution engine, among which: The natural language dialogue module is used to receive the natural language input by the user and parse the input natural language requirements to convert the natural language into a structured query statement; The large language model module interacts with the natural language dialogue module and the RPA SOP process knowledge graph module respectively. The large language model module uses structured query statements and context information to understand user needs, retrieves the knowledge graph according to the structured query statements, and then generates RPA process steps according to the knowledge graph. The RPA SOP process knowledge graph module stores standard SOP knowledge of specific industry vertical businesses, including process steps, operation rules and data dictionaries, providing the semantic understanding and generation required professional knowledge and normative constraints for the large language model module, and providing knowledge query and reasoning services; the RPA SOP process knowledge graph module is constructed in an ontology manner to define concepts, entities, attributes and relationships in the field, providing a basis for knowledge representation and reasoning; based on the RPA SOP process knowledge graph module, the large language model module is enhanced in knowledge, including semantic understanding, knowledge retrieval and knowledge enhancement operations; the natural language dialogue module converts the user's natural language questions into structured query statements that can be executed on the knowledge graph; knowledge retrieval is to query based on the structured query statement, retrieve the corresponding entity, relationship and attribute information from the knowledge graph, and use the query engine provided by the graph database to execute SPARQL queries; knowledge enhancement is to integrate the retrieved knowledge information into the input or output of the large language model module, and guide the large language model module to generate more accurate text that conforms to the knowledge graph; The RPA execution engine is responsible for executing the RPA process steps generated by the large language model module and interacting with the target system.
2. According to claim 1, an AI Agent based on a large language model collaborative knowledge graph is characterized in that: When constructing the ontology, a combination of top-down and bottom-up approaches is adopted. Top-down refers to referring to industry standards and domain expert knowledge to define core concepts and relationships including business processes, process steps, operations, data, and rules. Bottom-up refers to analyzing data sources including RPA process scripts and business process diagrams, extracting entities, attributes, and relationships, and mapping them to predefined ontology concepts.
3. The AI Agent based on a large language model collaborative knowledge graph according to claim 1, characterized in that: Based on the defined ontology, the entities, relationships and attributes in the knowledge graph are represented in the form of RDF triples. The entities are the basic elements in the knowledge graph and represent things or concepts in the real world. URI is used to uniquely identify each entity. The types of entities include business processes, process steps, operations, data and rules. Predefined relationship types are used to connect entities to indicate the relationship between them. The six relationship types defined are inclusion, sequential execution, conditional execution, operation object, input and output. The attributes are used to describe the characteristics of entities or relationships and provide more detailed information. Attributes are divided into entity attributes and relationship attributes.
4. According to claim 1, an AI Agent based on a large language model collaborative knowledge graph is characterized in that: When the RPA SOP process knowledge graph module is implemented, it includes knowledge extraction, knowledge fusion and knowledge storage. Knowledge is extracted from data sources including industry standard documents, RPA process scripts, business process diagrams and system logs. Knowledge fusion is to identify different expressions of the same entity in different data sources, map them to a unified entity identifier to achieve entity alignment, and merge knowledge fragments from different data sources into a unified knowledge graph to achieve knowledge merging. The data that has completed knowledge fusion is stored in a graph database to complete the knowledge storage of the RPA process knowledge graph.
5. The AI Agent based on a large language model collaborative knowledge graph according to claim 1, characterized in that: The knowledge enhancement operation includes knowledge injection, knowledge editing and knowledge constraint. Knowledge injection is to use knowledge information as the input of the large language model, and add relevant entity, relationship and attribute information to the prompt based on the Prompt construction paradigm. Knowledge editing is to use the large language model to generate text, and use the knowledge graph to correct and improve the generated text. In the process of generating text with the large language model, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results.
6. The AI Agent based on a large language model collaborative knowledge graph according to claim 5, characterized in that: When generating RPA process steps based on the knowledge graph, the matching business processes in the knowledge graph are retrieved according to the task objectives described by the user. Based on the retrieved business processes, the standardized RPA process steps are generated according to the step sequence and rule constraints defined in the knowledge graph. For each process step, the large language model uses text generation and code generation to further refine the specific operations that need to be performed.
7. A method for implementing the AI Agent based on a large language model collaborative knowledge graph as described in any one of claims 1 to 6, characterized in that: The method includes the following implementation steps: In the first step, the user inputs the natural language requirements; The second step is to parse the input natural language requirements and generate structured query statements; The third step is to input the generated structured query statements and context information into the large language model. The large language model retrieves the knowledge graph according to the query. The knowledge graph is stored in the graph database, which is stored in the RPA SOP process knowledge graph model. The constructed RPA SOP process knowledge graph model stores standard SOP knowledge of vertical businesses in specific industries, provides the professional knowledge and normative constraints required for semantic understanding and generation for the large language model, and provides knowledge query and reasoning services. The fourth step is to determine whether relevant knowledge can be retrieved from the knowledge graph, that is, whether a matching process can be found. If a matching process can be found, the fifth step is executed; if a matching process cannot be found, the large language model guides the user to improve the demand and return to the first step to re-enter the natural language demand; In the fifth step, the large language model module uses relevant knowledge retrieval to enhance the generation of RPA process steps. The user confirms the generated RPA process and arranges the execution of the RPA process. Step 6: Deploy the generated RPA process to the RPA execution engine, use the RPA execution engine to execute the RPA process and feedback the execution results; Step 7: The large language model verifies the process execution results and dynamically adjusts the priority of the execution steps; In the eighth step, the RPA execution engine executes all steps to obtain the final result.
8. The method for implementing an AI Agent based on a large language model and collaborative knowledge graph according to claim 7 is characterized in that: The formation process of the RPA SOP process knowledge graph in the third step includes knowledge construction, knowledge representation and implementation, and the implementation includes knowledge extraction, knowledge fusion and knowledge storage.
9. The method for implementing an AI Agent based on a large language model and collaborative knowledge graph according to claim 7 is characterized in that: The fifth step is to perform knowledge enhancement based on the big language model of the RPA process knowledge graph, convert the user's natural language questions into structured query statements that can be executed on the knowledge graph, and use the encoder-decoder model to encode the natural language questions into semantic vectors, which are then decoded into structured query statements; retrieve relevant entity, relationship, and attribute information from the knowledge graph based on the structured query statements; integrate the retrieved knowledge information into the input or output of the big language model module, and guide the big language model to generate more accurate text that conforms to the knowledge graph.
10. The method for implementing an AI Agent based on a large language model collaborative knowledge graph according to claim 7, characterized in that: In knowledge enhancement operate When the prompt is used, it includes knowledge injection, knowledge editing and knowledge constraint. Knowledge injection is to use knowledge information as the input of the large language model and add relevant entity, relationship and attribute information to the prompt based on the prompt construction paradigm. Knowledge editing is to use a large language model to generate text, and then use the knowledge graph to correct and improve the generated text; in the process of generating text with a large language model, the constraints of the knowledge graph are added to ensure the accuracy and consistency of the generated results.
11. The method for implementing an AI Agent based on a large language model collaborative knowledge graph according to claim 7, characterized in that: When the RPA process is generated, the following implementation process is included: Process retrieval: retrieve matching business processes in the knowledge graph based on the task objectives described by the user; Process normalization: Generate normalized RPA process steps based on the retrieved business process and the step sequence and rule constraints defined in the knowledge graph; Operation refinement,For each process step, LLM further refines the specific operations that need to be performed, including the operation object, input data, and output data.
Citation Information
Patent Citations
Method, device, equipment and medium for generating RPA process based on AI
CN112070487B
Auxiliary retrieval method fusing knowledge graph and large language model
CN117633252A
Cited By
RPA method based on natural language and electronic equipment
CN122488967A
Carbon energy intelligent analysis method and system based on AI agent and dynamic data access
CN122797567A