Contract compliance examination method and platform based on multi-agent cooperation

Through the contract compliance review method of multi-agent collaboration, a large language model is used to conduct contract compliance review, solving the problems of low efficiency and insufficient security of traditional manual compliance review, and achieving efficient and safe contract compliance review.

CN120337880AInactive Publication Date: 2025-07-18XIDIAN UNIV

Patent Information

Application Number
CN202510820492.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-07-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional manual compliance review is inefficient, has poor consistency in relying on manual experience, cannot respond to changes in regulations in a timely manner, and existing automation tools have data security risks and insufficient accuracy.

Method used

Adopt a contract compliance review method based on multi-agent collaboration, including data collection, data construction, document analysis, compliance review and risk control agents, use large language models for configuration operations, and support local or private cloud deployment to ensure data security and accuracy.

Benefits of technology

The security and accuracy of contract compliance review have been improved, and the review efficiency has been improved through multi-agent collaboration, supporting flexible expansion and rapid response to regulatory changes, and reducing manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337880A_ABST
    Figure CN120337880A_ABST
Patent Text Reader

Abstract

The invention discloses a contract compliance examination method and platform based on multi-agent cooperation, relates to the field of artificial intelligence, and is used for improving the safety and accuracy of contract examination. The method comprises the following steps: acquiring latest rule data by a data collection agent; the data construction agent constructs retrieval data and a rule knowledge graph based on the rule data; the document analysis agent extracts key information of the target contract and retrieves related rules from the retrieval data according to the key information; the compliance review agent performs risk item assessment on the target contract according to the related rules and the rule knowledge graph; the risk management and control agent generates a response measure of the risk item based on the retrieval data; the report generation agent generates a compliance review report based at least on the evaluated risk items and corresponding countermeasures. According to the invention, the security, accuracy and efficiency of contract review are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a contract compliance review method and platform based on multi-agent collaboration. Background Art

[0002] With the increasing complexity of enterprise business activities, the compliance review of contracts has become a key link in enterprise risk management. Compliance review not only needs to check the compliance of contract terms with the enterprise's internal rules and regulations (internal rules), but also needs to ensure that it keeps up with the requirements of the latest external laws and regulations (external rules).

[0003] Traditional manual compliance review is inefficient and has significant limitations: First, the workload is large and time-consuming. Especially when facing complex contracts, the process of clause analysis and regulation comparison is lengthy. Second, the review results rely on the subjective experience and judgment of reviewers, with low consistency, increasing compliance risks. Third, it is difficult for manual methods to respond to regulatory changes in a timely manner, resulting in contract terms that may not conform to the latest regulations, further increasing enterprise risks.

[0004] Some automated compliance review tools have emerged in the prior art. However, these tools still have obvious limitations: First, most tools rely on external cloud services or third-party APIs for data processing, which requires transmitting sensitive data such as contract texts and internal rules to external servers for processing. Although this method improves the review efficiency, it also brings serious privacy and security risks. Especially in the legal industry, where the requirement for data privacy is relatively high, enterprises are often reluctant to hand over sensitive data to external platforms for processing. Second, the existing tools lag behind in regulatory updates and cannot obtain and apply the latest laws and regulations in a timely manner, resulting in review results that may be based on outdated regulations, affecting the accuracy of the review. Summary of the Invention

[0005] The object of the present invention is to provide a contract compliance review method and platform based on multi-agent collaboration to improve the security and accuracy of contract review for all or part of the above problems.

[0006] The technical solution adopted by the present invention is as follows: A contract compliance review method based on multi-agent collaboration, which includes: A data collection agent obtains the latest rule data; A data construction agent constructs retrieval data and a rule knowledge graph based on the rule data; A document parsing agent extracts key information of the target contract and retrieves relevant rules from the retrieval data according to the key information; A compliance review agent evaluates risk items of the target contract according to the relevant rules and the rule knowledge graph; The risk control agent generates countermeasures for risk items based on the retrieved data; The report generation agent generates a compliance review report based on at least the evaluated risk items and corresponding countermeasures; All agents perform configuration operations based on the large language model.

[0007] On the other hand, the present application also provides a contract compliance review platform based on multi-agent collaboration, which includes: A data collection agent, configured to: obtain the latest rule data; A data construction agent, configured to: construct retrieved data and a rule knowledge graph based on the rule data; A document parsing agent, configured to: extract key information of the target contract and retrieve relevant rules from the retrieved data according to the key information; A compliance review agent, configured to: evaluate risk items of the target contract according to the relevant rules and the rule knowledge graph; A risk control agent, configured to: generate countermeasures for risk items based on the retrieved data; A report generation agent, configured to: generate a compliance review report based on at least the evaluated risk items and corresponding countermeasures; All agents perform configuration operations based on the large language model.

[0008] In summary, due to the adoption of the above technical solutions, the beneficial effects of the present invention are: The contract compliance review method provided by the present application, based on the collaboration of multiple agents such as the data collection agent, data construction agent, and document parsing agent, realizes the compliance review of contracts based on the latest rule data, avoiding the influence of lagging rule data on the accuracy of review results. The agents involved in the contract review tasks in the present application all support local offline deployment or private cloud deployment, ensuring that sensitive data such as contracts and internal rules are always stored and processed within the internal network, avoiding the risk of data leakage and enhancing the security of contract review. In addition, multiple agents in the present application allow parallel processing of tasks such as rule data update, contract parsing, and internal rule comparison, further improving the efficiency of compliance review. Moreover, in the present application, the roles and actions of the agents are decoupled, allowing different agents to independently execute specific tasks and flexibly adjust roles and functions according to business needs, improving the scalability and adaptability of the solution and enabling rapid deployment to different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The present invention will be described by way of examples with reference to the accompanying drawings, where: Figure 1It is a flowchart of a contract compliance review method based on multi-agent collaboration in an embodiment.

[0010] Figure 2 It is a data flow diagram of each agent in an embodiment.

[0011] Figure 3 It is a structural diagram of a contract compliance review platform based on multi-agent collaboration in an embodiment. Detailed implementation manners

[0012] All features disclosed in this specification, or steps in all methods or processes disclosed, except for mutually exclusive features and / or steps, can be combined in any manner.

[0013] Any feature disclosed in this specification (including any additional claims, abstract) can be replaced by other equivalent or similar-purpose alternative features unless specifically stated. That is, unless specifically stated, each feature is just an example in a series of equivalent or similar features.

[0014] Aiming at the problems of low efficiency and serious subjective influence in manual contract review, and low security and poor accuracy of existing automated compliance review tools, the embodiments of this application provide a contract compliance review method and platform based on multi-agent collaboration, aiming to improve the security of data and the accuracy of review on the basis of realizing automated contract compliance review.

[0015] The contract compliance review method provided by the embodiments of this application is as Figure 1 shown, which is completed based on multi-agent collaboration. These agents include: data collection agent, data construction agent, document parsing agent, compliance review agent, risk control agent, and report generation agent. All agents perform configuration operations based on large language models, that is, all agents guide the large language model LLM (Large Language Model) to complete tasks or operations with specific functions by defining Prompts (prompt words). These agents support local offline deployment or deployment on a private cloud to fully ensure the security of data such as contracts and internal rules. The data flow of these agents is as Figure 2 shown.

[0016] In addition, the roles and actions defined by each agent are decoupled from each other. Among them, the role defines the task of the agent, and the action defines the behavior of the agent to execute the task. Through this design, the functions of each agent can be flexibly expanded according to requirements, improving the flexibility and scalability of the overall work process.

[0017] (1) Data collection agent.

[0018] The data collection agent is responsible for obtaining the latest rule data.

[0019] The so-called rule data refers to the rules based on which compliance reviews are conducted. Rule data can include two aspects. One is called external rules, which refer to the regulations that are not formulated by the enterprise but need to be complied with, such as laws, regulations, and administrative norms. The other is called internal rules, which refer to the regulations formulated by the enterprise itself and need to be complied with, such as enterprise rules and regulations. The latest rule data is the latest version of the rules. Generally speaking, the update frequency of internal rules is relatively low. Therefore, to a certain extent, it can be considered that the updated rule data is the updated external rules.

[0020] As an alternative implementation, external rules are obtained by subscribing to and crawling laws, regulations, etc. published on public websites / databases, such as crawling structured data from official web pages to obtain external rules. Internal rules are obtained by enterprise users uploading them themselves. After the data collection agent obtains the latest rule data each time, it will deliver the obtained rule data to the data construction agent.

[0021] In addition, in some feasible implementations, the data collection agent is designed to passively obtain rule data. For example, the data collection agent obtains rule data triggered by a rule change monitoring agent (which also implements configuration functions based on LLM). The rule change monitoring agent sends a trigger signal when it detects an update in the rule database (such as a laws and regulations database), to trigger the data collection agent to obtain the latest rule data. If the rule database has not been updated, the data collection agent remains unchanged.

[0022] For the rule change monitoring agent, in some feasible implementation manners, it is responsible for continuously monitoring the rule database (such as the official web pages of laws and regulations, etc.), and detecting whether there is a new external rule published or a change in the existing external rules. Once an update of the external rules is detected, the rule change monitoring agent will send a message to the data collection agent to trigger the data collection agent to further crawl and update the latest external rules. Specifically, for the monitoring task, the rule change monitoring agent uses the content hash (Hash) monitoring method of the rule database to identify changes in the database content. Hash monitoring is a commonly used web page change detection technology. The rule change monitoring agent will regularly crawl the HTML structure of the target web page and generate a hash value (Hash value), which is the unique identifier of the web page content. When the web page content changes, its hash value will change. The rule change monitoring agent determines whether the web page has been updated by comparing the currently calculated hash value with the hash value calculated in the previous cycle. For the updated web page, the rule change monitoring agent can further check the specific content of the update to confirm whether there is a new external rule published or a change in the existing rule terms. When an update of the external rules is detected, the rule change monitoring agent will send an update notification to the data collection agent through RabbitMQ. The message usually contains information indicating a change in the rule database, or information containing the content of the change in the rule database, such as the rule name, publication time, changed part, and the URL of the web page where it is located.

[0023] In some alternative implementation manners, the behaviors of the rule change monitoring agent for performing tasks include: 1) Crawling data: Crawl the content of the target web page every 12 hours (or other time). In some specific embodiments, the time.sleep(12×60×60) function can be used to control the interval of the task, and the requests.get(url) function is used to obtain the content of the target web page, where url represents the url of the monitored target website.

[0024] 2) Hash value comparison: Compare the hash value of the crawled web page content with the hash value stored in the previous cycle. The hashlib.md5(content.encode('utf-8')).hexdigest() function can be used to calculate the hash value of the web page content and compare it with the historical hash value.

[0025] 3) Hash value update: If the compared hash values are the same, no operation is performed; if the compared hash values are different, the stored hash value is updated.

[0026] 4) Message passing: Generate a trigger signal indicating an update of the rule database and pass it to the data collection agent through RabbitMQ.

[0027] For example, the behaviors performed by the data collection agent in carrying out tasks include: 1) Message reception: Receive a trigger signal from the rule change monitoring agent.

[0028] 2) Crawl external rules: In the case of receiving a trigger signal, use a crawler tool, etc. to crawl laws and regulations from the target web page / database. The content crawled is in the JSON format of the web page / database, and the included tags are, for example, rule name (such as law name), release date, update date, clause number, clause content, etc.

[0029] 3) Receive internal rules: Receive the enterprise rules and regulations uploaded by the user, which include file name (such as production operation manual, etc.), upload date, clause number, clause content, etc.

[0030] 4) Data transfer: After the data collection agent completes the rule data collection task, send the rule data in the JSON format, etc. to the data construction agent. For example, if the agents transfer the agent work results and the trigger signals for triggering the execution of the next agent through the message queue RabbitMQ, then the data collection agent uses RabbitMQ to send the rule data in the JSON format to the data construction agent. The structure of this JSON data includes the tag type (indicating whether it is an internal rule or an external rule), and the information massage (indicating the rule name / file name, date information, URL, etc.). This JSON data will be transferred to the data construction agent to trigger it to start executing tasks.

[0031] (2) Data construction agent.

[0032] The data construction agent is responsible for constructing retrieval data and rule knowledge graphs based on the rule data.

[0033] The so-called retrieval data is the basic data for retrieving relevant rules during compliance review, covering all rules or key rules that may be involved in contract review.

[0034] As an alternative implementation, the retrieved data includes two parts. One part is the internal rule retrieval library (i.e., the database for retrieving internal rules) for retrieving internal rules, and the other part is the external rule retrieval library (i.e., the database for retrieving external rules) for retrieving external rules. Since the agent is not completely intelligent, the rule data obtained by the data collection agent usually contains irrelevant information, which has no positive meaning or even adverse effects on rule retrieval. Therefore, when constructing the retrieved data, the rule data will be preprocessed, such as data cleaning, structuring, etc. For example, for the external rules in the rule data, the rule name, clause number, and clause content are extracted and written into the external rule retrieval library (ES). For the internal rules in the rule data, the clause number and clause content are extracted and written into the internal rule retrieval library (MongoDB).

[0035] For the rule knowledge graph, it is used to associate the clauses in each rule data to facilitate in-depth reasoning along the entity chain in the rule knowledge graph.

[0036] As an alternative implementation, the ways for the data construction agent to construct the rule knowledge graph include: Perform entity recognition on each rule data respectively to identify the rule entity node and the clause entity node. A so-called rule data can be understood as a law, a set of implementation rules, a guidebook, etc. Taking a law as an example, a rule data will contain multiple legal clauses, such as "Chapter 1", "Article 1", etc., and each legal clause records detailed content requirements.

[0037] Traverse each rule data and create the relationships between the rule entity node and the clause entity node. These relationships include the inclusion relationship and the reference relationship.

[0038] For example, the behaviors of the data construction agent performing tasks include: 1) Message reception: Receive the rule data transmitted from the data collection agent.

[0039] 2) Data preprocessing: For the crawled external rules, which contain unnecessary metadata, data cleaning and formatting are performed on the external rules. For example, extract the rule name, clause number, and clause content. In some specific embodiments, the preprocess_external_law() function is designed to extract the rule name, etc., an empty list processed_data is initialized to store the extracted data, and the append method of the list is used to store the corresponding extracted fields into the list, thus completing the preprocessing of the external rules. For the uploaded internal rules, irrelevant information such as headers and footers needs to be removed. For example, extract the clause number and clause content. In some specific embodiments, the preprocess_internal_policy() function is designed to extract the clause number, etc., where the content of the rules and regulations starting with the clause number in the form of "Article 1" is extracted through the regular expression re.match(), completing the preprocessing of the internal rules.

[0040] 3) Retrieval library construction: Store the preprocessed external rules in the database ES (full-text retrieval database). In addition, call build_elasticsearch_index() to establish a full-text retrieval index. Store the preprocessed internal rules in the database MongoDB (document database), and store the data of the database MongoDB by calling MongoClient(mongo_uri), where mongo_uri fills in the local database connection uri.

[0041] 4) Rule knowledge graph construction: Based on the rule data, construct the semantic relationship between rule clauses, and store the graph data in the database Neo4j (knowledge graph database) to form a queryable rule knowledge graph. In the construction of the rule knowledge graph, the data format stored is nodes (entities) and edges (relationships), thus constituting the entire knowledge graph. The entity nodes in the embodiments of this application include rule entity nodes and clause entity nodes, and the relationships include the inclusion relationship that a certain rule contains a certain clause, as well as the reference relationships between clauses, between clauses and rules. In some specific embodiments, use the third-party library Graph of python to connect to the local database Neo4j, then traverse the preprocessed rule data, create corresponding entity nodes for each rule and clause, the rule entity node contains the rule name and update date, and the clause entity node includes the clause number and clause content. Next, traverse the rules and clauses, and use the Graph.run() function to create the inclusion relationship between the rule entity node and the clause entity node, as well as create the reference relationship between clause entity nodes, or between clause entity nodes and rule entity nodes.

[0042] 5) Message passing: After the retrieval data and the rule knowledge graph are constructed, other agents are notified via RabbitMQ, and a message indicating the completion of the construction of the retrieval data and the rule knowledge graph is sent.

[0043] (3) Document parsing agent.

[0044] The document parsing agent is responsible for extracting the key information of the target contract and retrieving relevant rules from the retrieval data based on the key information.

[0045] The target contract is the contract to be reviewed. The target contract includes several contract terms, and each contract term needs to be reviewed for compliance. The relevant rules are the rule terms that the contract terms in the target contract may involve, and are retrieved from the constructed retrieval data using the key information as the keyword.

[0046] In some feasible implementation manners, the document parsing agent parses the target contract, parses out the contract terms, and uses natural language processing technology to extract the key information. For example, the document parsing agent uses the named entity recognition (NER) technology to extract the key entities in the contract terms. For example, for the parsed transaction information, key information such as Party A, Party B, transaction amount, and effective date is extracted.

[0047] In addition, the document parsing agent also retrieves the rules involved in the target contract. Based on the key information, internal retrieval rules are retrieved in the internal regulation retrieval library (MongoDB), such as the internal constraints on the contract content of the enterprise. External retrieval rules can also be retrieved in the external regulation retrieval library (ES), such as the legal terms involved in the contract content. For example, if the key information contains transaction amount information, internal rules or external rules related to the transaction amount are retrieved separately in the internal regulation retrieval library and the external regulation retrieval library, which is automatically completed by the agent according to its derivation ability.

[0048] As a feasible implementation manner, the actions performed by the document parsing agent to carry out tasks include: 1) Contract text parsing: Parse the text of the target contract. In a specific embodiment, the key information in the contract text can be extracted using natural language processing technology (such as NER) through the DocumentParser.extract_entities() function. For example, as mentioned above, for the transaction information in the contract, the key information parsed includes Party A, Party B, transaction amount, effective date, etc.

[0049] 2) Message rule retrieval: For the regulations, systems, operations, etc. involved in the contract, retrieve them in the internal regulation retrieval library to retrieve the internal regulations and systems of the enterprise regarding the constraints in the contract for subsequent contract review. Additionally, the database ES can be used to retrieve the external rules involved in the contract through the DocumentParser.search_relevant_laws() function.

[0050] 3) Message passing: Pass the parsed key information and the retrieved relevant rules to RabbitMQ in JSON format, and then pass them to the compliance review agent to trigger its work.

[0051] (4) Compliance review agent.

[0052] The compliance review agent is responsible for evaluating the risk items of the target contract based on the relevant rules and the rule knowledge graph.

[0053] In some alternative implementation manners, the compliance review agent evaluates the risk items of the target contract according to the following configuration: Perform semantic-level risk assessment on each contract clause based on the internal retrieval rules to identify potential risk items; Perform semantic-level risk assessment on the potential risk items based on the entity chain associated with the internal retrieval rules in the rule knowledge graph, and finally determine the risk items.

[0054] Specifically, for the identification of potential risk items, the compliance review agent uses an LLM (such as Qwen2LLM) to perform semantic comparison between each contract clause of the target contract and the internal retrieval rules, marks the contract clauses whose semantics do not match the internal retrieval rules, and identifies the potential risks existing in the contract clauses. For example, if the contract clause stipulates that the mid-term collection is 30%, while the corresponding internal retrieval rule requires that the mid-term collection is not less than 40%, the identified potential risk may be "the agreed mid-term collection is too low".

[0055] For the identified potential risk items, use the rule knowledge graph to conduct a deeper risk analysis and expand the risk identification scope. Specifically, based on the internal retrieval rules, query the associated context knowledge from the rule knowledge graph, that is, the associated entity chain (the knowledge chain composed of rule entities, clause entities, and inclusion or reference relationships), and further use the knowledge of this entity chain as background knowledge to use the LLM to identify the risks existing in the marked contract clauses relative to this background knowledge, so as to more deeply identify the risks existing in the contract clauses based on more rules.

[0056] In some alternative implementation manners, the actions performed by the compliance review agent when carrying out tasks include: 1) Potential risk identification: Use the LLM to semantically compare each contract clause with relevant internal retrieval rules, determine whether it conforms to the internal retrieval rules, and identify potential risks existing in the contract clause. In a specific embodiment, the semantic_analysis_with_llm() function can be used for potential risk identification. Since the LLM requires special role definitions for different fields, the LLM needs to define a Prompt to identify potential risks. The Prompt defined in the embodiment of this application is: "You are now a mature compliance risk review expert. Please think step by step and complete my requirements: You need to carefully analyze the contract clause and the internal retrieval rules, and identify and reason about the possible risks in the contract clause according to the internal retrieval rules. The following is the contract clause: {contract_clause}, and the following is the internal retrieval rule: {policy_clause}. Please analyze whether there are compliance risks in this contract clause? If so, please list the reasons." contract_clause refers to the contract clause, and policy_clause refers to the internal retrieval rule.

[0057] 2) LLM reasoning: Use pipeline("risk", model="Qwen-2") to load the model, where risk is the model name and Qwen-2 is the model type. Next, use the qa_pipeline(prompt, max_length=200) function to input the LLM, where prompt fills in the content defined above, and max_length specifies the function to limit the text length, and the function returns the model analysis result.

[0058] 3) Knowledge graph reasoning: Use the context information provided by the rule knowledge graph to verify the semantic analysis result of the LLM and expand the ability to identify implicit risks. The main operation is to query the associated context knowledge by the rule knowledge graph based on the internal retrieval rules. In a specific embodiment, the query_graph_rag() function is used for enhanced reasoning, and its operation process is as follows: Define the request Query: "MATCH(n:Internal retrieval rule{content:$content})-[:Associated]->(related); RETURN related.Background knowledge AS context".

[0059] Enhanced reasoning: Use the graph.run(query, content=policy_clause).data() function to perform further enhanced reasoning based on the rule knowledge graph, where query is the request defined above, and content fills in the policy_clause as the internal retrieval rule.

[0060] 4) Message passing: Send the identified risk items (including contract terms, identified risks, and corresponding internal retrieval rules) to RabbitMQ to trigger the risk control agent to perform tasks.

[0061] (5) Risk control agent.

[0062] The risk control agent is responsible for generating countermeasures for risk items based on the retrieved data.

[0063] The so-called countermeasures can be suggestions for modifying contract terms, supplementary terms formulated to reduce the risks of contract terms, or remedial measures after the occurrence of risks, etc. The risk control agent uses the risk items passed by the compliance review agent as the basis for reasoning and generates countermeasures for risk items. The risk control agent combines the reasoning ability of the LLM through external retrieval rules to generate corresponding risk countermeasures. After formulating the countermeasures, the countermeasures, risk items, and external retrieval rules are passed to the report generation agent through RabbitMQ. The asynchronous message passing mechanism enables each agent to immediately start reviewing the next contract after processing one contract, thereby improving the overall review efficiency.

[0064] In some alternative embodiments, the risk control agent generates countermeasures for risk items according to the following configurations: Generate countermeasures to improve the risks of risk items based on external retrieval rules. The external retrieval rules are retrieved from the external rule retrieval library based on the content of the risk items.

[0065] Specifically, the method for generating countermeasures includes: Construct a query statement based on the keywords, context, and content of the contract terms indicated by the risk items, and retrieve external retrieval rules related to these risk items in the database ES. Combine the LLM to deeply understand the actual meaning of the contract terms (i.e., semantic understanding). Based on the external retrieval rules as background knowledge, judge the severity of the risks of this contract term and speculate on potential legal consequences; based on the reasoning results, the LLM generates corresponding countermeasures. These countermeasures may include, but are not limited to: how to adjust contract terms to avoid legal disputes, how to modify risk terms to meet the requirements of external rules, and specific suggestions for preventing contract risks.

[0066] In some feasible embodiments, the actions performed by the risk control agent when performing tasks include: 1) Message reception: Obtain data from RabbitMQ to construct the data written by the agent into the database ES (i.e., the external rule database), as well as the risk items identified by the compliance review.

[0067] 2) Risk control: Based on contract terms, external retrieval rules, and risk items, use an LLM to generate countermeasures for each risk item. In a specific embodiment, the generate_risk_mitigation() function is used to generate risk control suggestions, and its main steps are as follows: Define the prompt: prompt = "Contract terms: {contract_clause}, internal regulations: {internal_policy}, external regulations: {external_policy}, risk prompt: {risk_tip}, question: Generate countermeasures for this risk item according to internal and external retrieval rules".

[0068] Generate a report: Call the pipeline("risk", model = "Qwen-2") function to load the model, and use the text_generation(prompt, max_length = 200) function for model input. The model output result returned by this function is the countermeasure.

[0069] 3) Message passing: Send the countermeasures to RabbitMQ for subsequent agent processing.

[0070] (6) Report generation agent.

[0071] The report generation agent is responsible for generating a compliance review report based at least on the evaluated risk items and corresponding countermeasures.

[0072] The compliance review report reflects the review results of the contract compliance review as a whole, including the discovered risks, the basis for determining the risks, and corresponding countermeasure suggestions, etc., to form a comprehensive review report. The report generation agent can also push the generated compliance review report to the corresponding users.

[0073] In some alternative embodiments, the report generation agent evaluates the compliance and risk status of the entire target contract and generates a comprehensive compliance review report. This compliance review report not only includes the detailed content of risk items but also combines the work results of the compliance review agent and the risk control agent, and uses the LLM to comprehensively evaluate the target contract and the overall workflow. After the report is generated, it can be pushed to the designated user. During the push process, the report generation agent can select different channels, including email and the enterprise internal messaging system, to ensure that the report can be quickly delivered to the relevant personnel. Specifically, for the task of generating the report, the report generation agent obtains the processing results of all upstream agents from RabbitMQ, including the risk items evaluated by the compliance review agent and the countermeasures generated by the risk control agent. The report generation agent uses the LLM to summarize and analyze this acquired data to ensure that each risk item, countermeasure, and related rule can be accurately recorded and presented. In this process, the report generation agent comprehensively considers all contract terms, uses the LLM to horizontally compare the risk levels and compliance of each contract term to ensure the comprehensiveness of the report.

[0074] In some feasible embodiments, the actions performed by the report generation agent for carrying out the task include: 1) Message reception: Receive the work results of all upstream agents from RabbitMQ and classify the acquired data according to its source for subsequent analysis. In a specific embodiment, the connection to RabbitMQ is initialized with the pika.BlockingConnection(pika.ConnectionParameters('localhost')) function, where 'localhost' is filled with the URL of the local RabbitMQ, and the receive_from_queue(channel, queue_name) function is used to receive data from the specified queue, where 'channel' is the connection channel and 'queue_name' is the name of the connected RabbitMQ.

[0075] 2) Comprehensive analysis: Use the LLM to comprehensively analyze the received data, including analyzing contract terms, risk analysis, and the overall workflow. The main steps are as follows: Define the prompt: "You are now going to comprehensively analyze the contract as a whole by integrating the contract terms: {contract_clause}, internal regulations: {internal_policy}, external regulations: {external_policy}, risk tips: {risk_tip}, and risk control measures: {risk_measure} for all the above information."

[0076] LLM Analysis: Call the LLM for further analysis. In a specific embodiment, the call_large_model(prompt) function is used for analysis, and the prompt is filled with the prompt words defined in the previous step.

[0077] 3) Summary Report: Integrate the results generated by the LLM into a complete compliance review report. The main contents include the original contract terms, the risk items and control measures in the risk analysis, the analysis of unresolved issues, and the performance evaluation of the execution tasks of each agent in the overall workflow. The main steps are as follows: Define the prompt: "Please generate a comprehensive and highly readable evaluation report from a global perspective based on the comprehensive analysis results obtained in the previous step, including a summary of the contract content, a summary of the risk analysis, and a summary of the overall workflow."

[0078] Generate the report: Use the generate_final_report(analysis_results) function to further generate the LLM report. Among them, analysis_results is the comprehensive analysis result obtained in the previous step.

[0079] 4) Push the report: Push it to the system interface or the account of the specified user. For example, use the requests.post(system_url,data=json.dumps(report),headers=headers) function to push to the system platform. Fill in the system_url with the url of the system, headers with the request header configuration of the web page, and data=json.dumps(report) to convert the dictionary-type data (dict) into a JSON-formatted string for sending to the target system or interface via an HTTP request; use the push_report(final_report,method="email",customer_email="customer@example.com",sender_email="your-email@example.com",sender_password="your-email-password") function to push to the user's email. final_report represents the generated report file, method specifies the email form, fill in the customer_email with the email of the specified user, fill in the sender_email with the sender's email, and configure the sender_password for sending the email.

[0080] Through the independent division of labor and collaborative work of multiple agents constructed in the embodiments of the present application, a full-process closed-loop from data collection, analysis and processing to result generation and notification is formed. The agents adopt a combination of asynchronous communication and distributed architecture, which not only realizes the efficient allocation and dynamic response of tasks, but also ensures the stability and scalability of tasks in a complex and changeable task environment. The present application transforms the traditional linear review process into a dynamic and intelligent review workflow through a multi-agent collaboration mechanism. Each agent can independently complete tasks and interact in real time, significantly improving the efficiency, accuracy and automation level of compliance review, and reducing the dependence on manual intervention. The present application can not only adapt to the complex requirements of multiple scenarios, but also has high flexibility and expansion ability, providing a new solution for the intelligentization of the compliance review process, and having important technical value and application prospects.

[0081] According to the idea of the present application, embodiments of the present application also provide a contract compliance review platform based on multi-agent collaboration, as Figure 3 shown, which includes a data collection agent, a data construction agent, a document parsing agent, a compliance review agent, a risk control agent and a report generation agent. All agents perform configuration operations based on large language models.

[0082] The data collection agent is configured to: obtain the latest rule data.

[0083] The data construction agent is configured to: construct retrieval data and a rule knowledge graph based on the rule data.

[0084] The document parsing agent is configured to: extract the key information of the target contract and retrieve relevant rules from the retrieval data according to the key information.

[0085] The compliance review agent is configured to: evaluate the risk items of the target contract according to the relevant rules and the rule knowledge graph.

[0086] The risk control agent is configured to: generate countermeasures for risk items based on the retrieval data.

[0087] The report generation agent is configured to: generate a compliance review report based on at least the evaluated risk items and the corresponding countermeasures.

[0088] In addition, the platform may further include a rule change monitoring agent, which is responsible for monitoring the rule database and sending a trigger signal when it detects an update of the rule database to trigger the data collection agent to obtain the latest rule data.

[0089] Each agent has been introduced in detail in the foregoing method embodiments, and each agent in the platform embodiments here can be configured with reference to the features introduced in the foregoing embodiments.

[0090] The present invention is not limited to the specific embodiments described above. The present invention extends to any new feature or any new combination disclosed in this specification, as well as to any new method or process step or any new combination disclosed.

Claims

1. A contract compliance review method based on multi-agent collaboration, characterized in that, including: The data collection agent obtains the latest rule data; The data construction agent constructs retrieval data and a rule knowledge graph based on the rule data; The document parsing agent extracts the key information of the target contract and retrieves relevant rules from the retrieval data according to the key information; The compliance review agent evaluates the risk items of the target contract according to the relevant rules and the rule knowledge graph; The risk control agent generates countermeasures for the risk items based on the retrieval data; The report generation agent generates a compliance review report based at least on the evaluated risk items and the corresponding countermeasures; All agents perform configuration operations based on a large language model.

2. The method for contract compliance review based on multi-agent collaboration according to claim 1, wherein The data collection agent obtains the rule data triggered by the rule change monitoring agent; the rule change monitoring agent issues a trigger signal when it monitors that the rule database is updated.

3. The method for contract compliance review based on multi-agent collaboration according to claim 1, wherein The data construction agent constructs the rule knowledge graph according to the following configuration: Perform entity recognition on each rule data respectively to identify rule entity nodes and clause entity nodes; Traverse each rule data and create relationships between rule entity nodes and clause entity nodes, and the relationships include inclusion relationships and reference relationships.

4. The method for contract compliance review based on multi-agent collaboration according to claim 1, wherein The data construction agent constructs the retrieval data according to the following configuration: For the external rules in the rule data, extract the rule name, clause number and clause content and write them into the external rule retrieval library; For the internal rules in the rule data, extract the clause number and clause content and write them into the internal rule retrieval library.

5. The method for contract compliance review based on multi-agent collaboration according to claim 4, wherein The relevant rules include internal retrieval rules retrieved from the internal rule retrieval library; The risk item evaluation of the target contract includes: Performing semantic-level risk assessment on each contract clause based on the internal retrieval rules to identify potential risk items; Performing semantic-level risk assessment on the potential risk items based on the entity chain associated with the internal retrieval rules in the rule knowledge graph, and finally determining the risk items.

6. The method for contract compliance review based on multi-agent collaboration according to claim 5, wherein The risk control agent generates countermeasures for the risk items according to the following configuration: Generating countermeasures to improve the risk of the risk items based on external retrieval rules; the external retrieval rules are retrieved from the external rule retrieval library based on the risk item content.

7. The method for contract compliance review based on multi-agent collaboration according to claim 2, characterized in that, The rule change monitoring agent generates a trigger signal according to the following configuration: Regularly grab the content in the rule database and calculate the hash value; Compare the latest calculated hash value with the hash value calculated in the previous cycle. If the comparison result is different, generate a trigger signal; the trigger signal contains information indicating that the rule database has changed or information indicating the content of the rule database change.

8. The contract compliance review method based on multi-agent collaboration according to any one of claims 1-7, characterized in that, Among the agents, the work results of the agents and the trigger signals for triggering the next agent to execute tasks are passed through a message queue.

9. The contract compliance review method based on multi-agent collaboration according to any one of claims 1-7, characterized in that The roles and actions defined by each agent are decoupled from each other. Among them, the role defines the task of the agent, and the action defines the behavior of the agent to execute the task.

10. A contract compliance review platform based on multi-agent collaboration, characterized in that, including: A data collection agent, configured to: obtain the latest rule data; A data construction agent, configured to: construct retrieval data and a rule knowledge graph based on the rule data; A document parsing agent, configured to: extract key information of a target contract and retrieve relevant rules from the retrieved data based on the key information; A compliance review agent, configured to: evaluate risk items of the target contract based on the relevant rules and the rule knowledge graph; A risk control agent, configured to: generate countermeasures for risk items based on the retrieved data; A report generation agent, configured to: generate a compliance review report based at least on the evaluated risk items and corresponding countermeasures; All agents perform configuration operations based on a large language model.

Citation Information

Patent Citations

  • A method for perceive network information

    CN109299411A

  • Contract evaluation method, system and equipment based on large model and medium

    CN119149742A

  • Contract risk assessment and compliance check method, system and equipment based on large language model, and medium

    CN119863119A

  • Using machine learning models to analyze contractual terms and clauses in a legal contract, to recommend edits, and to make changes to a workflow

    US20240086651A1

Cited By

  • Automatic electronic chart document review method and device based on multi-modal large model, medium and equipment

    CN120764536A

  • Complete-flow customs clearance cooperation method and system for generating intelligent customs declaration form of comprehensive service

    CN120806886A

  • Risk review method and device for contract terms and electronic equipment

    CN120911982A

  • Enterprise financing compliance auditing method and device and storage medium

    CN121052714A

  • Database automatic updating method and system based on large language model

    CN121166925A