Multi-agent-based official document approval method
By adopting a multi-agent architecture in the official document approval system, including semantic understanding, classification analysis, opinion generation and distribution of candidate agents, the problems of insufficient semantic understanding capabilities and low approval efficiency in the existing system are solved, and a more efficient and accurate official document approval process is achieved.
Patent Information
- Application Number
- CN202411826233.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-05-02
AI Technical Summary
The existing digital official document approval system lacks intelligent semantic understanding capabilities, has a single processing method, and insufficient scientific nature of distribution decisions, resulting in inefficient approval efficiency.
Using the official document approval method based on multi-agents, we will work together to improve the quality and efficiency of official document approval by creating semantic understanding agents, official document category analysis agents, opinion generation agents, distribution candidate agents and result summary agents.
Through the collaborative work of multi-agent architecture, accurate semantic understanding of official document data, dynamic classification, reasonable approval opinion generation and optimization distribution paths are achieved, significantly improving the quality and efficiency of official document approval.
Smart Images

Figure CN119919074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of official document examination and approval, and in particular to an official document examination and approval method based on multi-agents. Background Art
[0002] With the development of information technology and the popularization of digital office, document approval has gradually shifted from the traditional paper processing mode to a digital process. However, the existing digital document approval system usually completes document classification and approval opinion generation based on fixed rules or simple machine learning models, such as distributing documents to specific reviewers through keyword matching or template-based classification methods, which has the following limitations:
[0003] 1. Lack of intelligent semantic understanding capabilities: It is difficult to deeply understand the contextual information of official documents, especially in complex official document scenarios, such as documents involving multiple departments or cross-professional fields, the accuracy of classification and opinion generation is low. 2. Single processing method: Relying on predefined rules or historical data, lacking flexibility, and difficult to handle unstructured official document content or new types of official documents that have never been seen. 3. Insufficient scientificity of distribution decisions: Distributing official documents based on manually set rules fails to effectively use historical data and approval experience for dynamic optimization, which may result in official documents being distributed to unsuitable approval personnel, thereby increasing approval time and communication costs. 4. Low approval efficiency: The official document approval process involves the collaboration of multiple roles and tasks, and it is impossible to achieve information sharing and efficient collaboration between tasks, affecting approval efficiency.
[0004] In recent years, with the rapid development of natural language processing technology and deep learning models, especially the advent of large language models (LLMs), the field of document review and approval has ushered in new opportunities for intelligence. Large language models have powerful semantic understanding and generation capabilities, and can deeply analyze the content of official documents and generate reasonable approval opinions. However, large language model solutions that rely solely on a single intelligent agent cannot completely solve the above problems.
[0005] Therefore, how to provide a document approval method based on multi-agents to improve the quality and efficiency of document approval has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a document approval method based on multi-agents to improve the quality and efficiency of document approval.
[0007] The present invention is implemented as follows: a document approval method based on multi-agents, comprising the following steps:
[0008] Step S1, creating a semantic understanding agent, a document category analysis agent, an opinion generation agent, a candidate distribution agent, and a result summary agent;
[0009] Step S2: obtaining input document data, and performing preprocessing and format checking on the document data;
[0010] Step S3, parsing the official document data by the semantic understanding agent, and outputting the semantic information of the official document data;
[0011] Step S4, the official document category analysis agent classifies the official document data based on semantic information and outputs a classification label of the official document data;
[0012] Step S5, the opinion generation agent outputs the initial approval opinion of the official document data based on the classification label; the distribution candidate agent outputs the distribution candidate list of the official document data based on the classification label;
[0013] Step S6: the result summary agent generates an approval opinion and a distribution list based on semantic information, classification labels, initial approval opinions, and distribution candidate lists;
[0014] Step S7: display the approval opinions and distribution list through a visual interface.
[0015] Furthermore, in step S1, the semantic understanding agent, document category analysis agent, opinion generation agent, candidate distribution agent and result aggregation agent work together through shared context and interaction mechanism.
[0016] Furthermore, in step S2, the official document data at least includes the account name, official document title, body, source unit and official document type.
[0017] Furthermore, the step S3 is specifically as follows:
[0018] The first large language model is trained by using the Few-shot learning technology. The semantic understanding agent extracts semantic basic information from the official document data by using the Prompt technology of the first large language model. The semantic basic information is iteratively optimized by using thought chains and multiple rounds of dialogue. The iteratively optimized semantic basic information is corrected and enhanced, and then the semantic information of the official document data in the JSON format is output.
[0019] Furthermore, the step S4 is specifically as follows:
[0020] The second large language model is trained by the Few-shot learning technology to enhance the classification Prompt template preset by the second large language model. The second large language model performs multiple rounds of enhancement operations on the classification Prompt template through a self-verification mechanism. The official document category analysis agent matches similar historical official document data based on the semantic information through the classification Prompt template of the second large language model to classify the official document data, output the classification label of the official document data in JSON format, calculate the confidence of the classification label, and dynamically update the classification label based on the confidence.
[0021] Furthermore, in step S4, the classification label at least includes application, notification, request and report; the classification label also carries confidence and classification basis.
[0022] Furthermore, in step S5, the opinion generating agent outputs the initial approval opinion of the document data based on the classification label, specifically:
[0023] The historical approval opinions of the current account name are obtained through the Tools class API, and an opinion Prompt template of the third large language model is dynamically generated based on the historical approval opinions. The third large language model performs multiple rounds of enhancement operations on the opinion Prompt template through a self-verification mechanism. During the multiple rounds of enhancement operations, the approval rules of the official document data are combined for optimization. The opinion generation agent outputs the initial approval opinion of the official document data in the form of natural language based on the classification label through the opinion Prompt template of the third large language model, and the initial approval opinion carries the approval basis.
[0024] Furthermore, in step S5, the distribution candidate agent outputs the distribution candidate list of the official document data based on the classification label, specifically:
[0025] Through the Tools class API, historical distribution records similar to the official document data are obtained, and a distribution Prompt template of a fourth large language model is dynamically generated based on the historical distribution records. The fourth large language model performs multiple rounds of enhancement operations on the distribution Prompt template through a self-verification mechanism, and the distribution rules of the official document data are optimized during the multiple rounds of enhancement operations. The distribution candidate agent outputs a distribution candidate list of the official document data in the form of natural language based on the classification label through the distribution Prompt template of the fourth large language model, and the distribution candidate list carries the distribution basis.
[0026] Furthermore, the step S6 is specifically as follows:
[0027] The result aggregation agent integrates the semantic information, classification labels, initial approval opinions and distribution candidate lists, performs consistency check on the integrated semantic information, classification labels, initial approval opinions and distribution candidate lists, optimizes the semantic information, classification labels, initial approval opinions and distribution candidate lists based on weight scoring and optimization mechanisms, and performs secondary optimization on the optimized semantic information, classification labels, initial approval opinions and distribution candidate lists based on a dynamic adjustment mechanism, thereby generating approval opinions and distribution lists.
[0028] Furthermore, the step S7 is specifically as follows:
[0029] The approval opinion, the distribution list, the approval basis corresponding to the approval opinion, the distribution basis corresponding to the distribution list and metadata are displayed through a visual interface; the metadata at least includes the generation time, confidence level, and association rule terms; the distribution list at least includes the approver, the copy recipient, the contact information and the department information;
[0030] The visual interface exports the approval opinions and distribution list in PDF format, Excel format or JSON format based on the input export instruction, and outputs the approval opinions and distribution list based on the call instruction input by the API interface;
[0031] The visual interface performs editing operations on the approval opinions and the distribution list based on the input editing instructions.
[0032] The advantages of the present invention are:
[0033] By creating a semantic understanding agent, a document category analysis agent, an opinion generation agent, a distribution candidate agent and a result summary agent; then obtaining the input document data and performing preprocessing and format verification, parsing the document data through the semantic understanding agent, and outputting the semantic information of the document data; the document category analysis agent classifies the document data based on the semantic information and outputs the classification label of the document data; the opinion generation agent outputs the initial approval opinion of the document data based on the classification label; the distribution candidate agent outputs the distribution candidate list of the document data based on the classification label; then the result summary agent generates the approval opinion and the distribution list based on the semantic information, classification label, the initial approval opinion and the distribution candidate list, and finally displays the approval opinion and the distribution list through a visual interface; that is, through the combination of the semantic understanding agent and the large language model, the accurate understanding of the document data, including at least the document title, body and other contents, is achieved to output semantic information, so as to improve the semantic understanding ability; the document category analysis agent is used to perform dynamic classification through the Prompt technology of the large language model, and guide the subsequent approval process according to the classification label; the opinion generation agent calls the Tools class API, combined with the history Approval opinions and approval rules generate reasonable and explainable initial approval opinions; the candidate distribution agent predicts the appropriate candidate list (approving personnel or departments), and then the result summary agent outputs the final approval opinion and distribution list; through the collaboration of the semantic understanding agent and the official document category analysis agent, a large language model is used to deeply analyze the official document data, and the accurate extraction and dynamic classification of official document elements are realized without relying on fixed rules or templates, which significantly improves the flexibility and accuracy of classification; the opinion generation agent combines historical approval opinions and approval rules, and by calling the Tools class API, it integrates multi-dimensional information to generate rule-based and context-based initial approval opinions, provides detailed approval basis (reasons and explanations), and enhances the scientificity and transparency of approval decisions; through the distribution candidate agent predicts the appropriate candidate list, combined with the correction and optimization mechanism of the result summary agent, ensures that the distribution path is reasonable, reduces unnecessary approval links, and significantly improves approval efficiency; through the modular design of the multi-agent architecture, the system is easy to expand and upgrade, can flexibly respond to dynamic needs, and the information sharing and efficient collaboration between agents further improve the overall performance, and ultimately greatly improves the quality and efficiency of official document approval. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0035] Figure 1 It is a flow chart of a document approval method based on multi-agents of the present invention. DETAILED DESCRIPTION
[0036] The technical solution in the embodiments of the present application has the following overall idea: through the collaboration of the semantic understanding agent and the document category analysis agent, a large language model is used to deeply analyze the document data, so as to realize the accurate extraction and dynamic classification of document elements, without relying on fixed rules or templates, and significantly improve the flexibility and accuracy of classification; the opinion generation agent combines historical approval opinions and approval rules, and by calling the Tools class API, integrates multi-dimensional information to generate initial approval opinions based on rules and contexts, provides detailed approval basis, and enhances the scientificity and transparency of approval decisions; through the distribution candidate agent predicts a suitable distribution candidate list, combined with the correction and optimization mechanism of the result summary agent, ensures that the distribution path is reasonable, reduces unnecessary approval links, and significantly improves approval efficiency; through the modular design of the multi-agent architecture, the system is easy to expand and upgrade, and can flexibly respond to dynamic needs, and the information sharing and efficient collaboration between agents further improve the overall performance, thereby improving the quality and efficiency of document approval.
[0037] Please refer to Figure 1 As shown, a preferred embodiment of the document approval method based on multi-agents of the present invention comprises the following steps:
[0038] Step S1, creating a semantic understanding agent, a document category analysis agent, an opinion generation agent, a candidate distribution agent, and a result summary agent;
[0039] The semantic understanding agent is used to parse and extract the core elements of official document data, providing clear semantic information for subsequent agents; the official document category analysis agent is used to utilize the second large language model to dynamically classify official document data through Prompt technology to guide approval path planning; the opinion generation agent is used to combine historical approval opinions and approval rules to generate explanatory initial approval opinions; the distribution candidate agent is used to predict suitable approval personnel or departments and generate a distribution candidate list; the result aggregation agent is used to integrate the results output by all agents, perform corrections and optimizations, and form the final approval opinions and distribution list.
[0040] Step S2: obtaining input document data, preprocessing and format checking the document data to ensure the integrity and consistency of the content, and provide a reliable data basis for subsequent processing;
[0041] Step S3, parsing the official document data through the semantic understanding agent, and outputting the semantic information of the official document data;
[0042] Step S4, the official document category analysis agent classifies the official document data based on semantic information and outputs a classification label of the official document data;
[0043] Step S5, the opinion generation agent outputs the initial approval opinion of the official document data based on the classification label; the distribution candidate agent outputs the distribution candidate list of the official document data based on the classification label;
[0044] Step S6, the result summary agent generates an approval opinion and a distribution list based on the semantic information, classification labels, initial approval opinions, and distribution candidate lists;
[0045] Step S7: display the approval opinions and distribution list through a visual interface.
[0046] In the step S1, the semantic understanding agent, the official document category analysis agent, the opinion generation agent, the candidate distribution agent and the result aggregation agent work together through a shared context and an interaction mechanism.
[0047] An agent is an agent that can perceive the environment and take actions to achieve specific goals. It can be software, hardware or a system with autonomy, adaptability and interaction. Through the division of labor and collaboration of multiple agents, complex tasks can be broken down into multiple simple tasks, which are completed by different agents respectively, and the overall goal can be achieved through interaction and information sharing. Each agent can be optimized based on specific responsibilities, such as classification, opinion generation, distribution decision-making, etc., thereby improving overall efficiency and reliability; in addition, the modular characteristics of the agent also make the system have good scalability and can flexibly adapt to the diverse needs of corporate document approval processes.
[0048] In step S2, the official document data at least includes the account name, the official document title, the body, the source unit and the official document type.
[0049] The step S3 is specifically as follows:
[0050] The first large language model is trained by using the Few-shot learning technology. The semantic understanding agent extracts semantic basic information from the official document data by using the Prompt (keyword) technology of the first large language model. The semantic basic information is iteratively optimized through thought chains and multiple rounds of dialogue. The iteratively optimized semantic basic information is corrected and enhanced, and then the semantic information of the official document data in the JSON format is output.
[0051] The semantic understanding agent is a core basic module, focusing on extracting core elements from official document data, generating structured data (semantic information), and providing standardized input for subsequent agent operations; through the powerful natural language processing capabilities of the first large language model, the semantic understanding agent can accurately parse fields such as official document titles, texts, letter units, and document types, extract core topics and key information fields (such as time, amount, target object, business project, etc.), and organize them into a structured format to ensure the efficiency and accuracy of subsequent processing.
[0052] The extraction of semantic basic information from the official document data is, for example:
[0053] You are a document semantic parsing system. Please extract key information from the following document content:
[0054] Title: {Title}
[0055] Body: {Body}
[0056] Sender: {sender}
[0057] Document type: {document type}
[0058] Output format:
[0059] -Core Themes:
[0060] -Key information fields (time, amount, target object, etc.):
[0061] The Few-shot learning technology is used to provide multiple sets of examples to the first large language model, thereby enhancing the first large language model's ability to understand and process official document data. For example:
[0062] Example 1:
[0063] Title: 2024 Budget Approval Application
[0064] Text: Our unit applies for an annual budget of 5 million yuan, please approve it.
[0065] Output: Core topic: Annual budget application; Key information fields: Time: 2024; Amount: 5 million yuan.
[0066] Example 2:
[0067] Title: Report on Personnel Transfers
[0068] Text: It is now proposed to transfer Zhang San to the Human Resources Department as a manager.
[0069] Output: Core topic: Personnel transfer; Key information field: Target object: Zhang San.
[0070] The chain of thought and multi-round dialogue format, that is, to design a complex prompt word strategy for the document processing scenario through prompt word enhancement technology, ensures the accuracy and richness of the analysis results.
[0071] The thought chain is used to guide the model to analyze step by step and gradually extract key information. For example:
[0072] Please complete the following tasks step by step:
[0073] Step 1: Summarize the core theme of the document.
[0074] Step 2: Extract specific time, amount and other key information fields from the text.
[0075] Step 3: Organize all the information into a structured format.
[0076] The multi-round dialogue form is to use the dialogue form to allow the model to iteratively optimize the output. For example:
[0077] Please check the following extraction results for accuracy:
[0078] Core theme: {theme}
[0079] Key information fields: {field list}
[0080] If there are any errors, please point them out and correct them.
[0081] The correction and enhancement of the semantic basic information after iterative optimization specifically includes:
[0082] Verify against preset rules: After the model is output, the results are verified again in combination with predefined rules (such as time format, amount unit). For example, "500" may lack units and be inferred as "5 million yuan" through the template.
[0083] Contextual supplementation: Using few-shot examples or dynamic context, the first large language model can identify similar scenarios and generate more complete results. For example, infer information missing from the main text from the title "2024 Budget Request".
[0084] The output semantic information is exemplified as follows:
[0085] {
[0086] "Subject":"Annual Budget Application",
[0087] "Time":"2024",
[0088] "Amount":"5 million yuan",
[0089] "Source Unit":"Finance Department",
[0090] "Document Type":"Application"
[0091] }
[0092] The collaborative relationship between the semantic understanding agent and other agents is specifically as follows:
[0093] As the entry module, the semantic understanding agent's parsing results (semantic information) directly affect the performance of the subsequent document category analysis agent and opinion generation agent; through refined prompt design and multi-round parsing strategies, a solid semantic understanding foundation is laid for the entire document approval process.
[0094] The step S4 is specifically as follows:
[0095] The second large language model is trained by the Few-shot learning technology to enhance the classification Prompt template preset by the second large language model. The second large language model performs multiple rounds of enhancement operations on the classification Prompt template through a self-verification mechanism. The official document category analysis agent matches similar historical official document data based on the semantic information through the classification Prompt template of the second large language model to classify the official document data, output the classification label of the official document data in JSON format, calculate the confidence of the classification label, and dynamically update the classification label based on the confidence.
[0096] The official document category analysis agent is the core module for official document classification. Its main task is to determine the classification label to which the official document data belongs based on the official document title and text content of the official document data, and provide a basic basis for the subsequent approval opinion generation and distribution path planning (distribution list) of the agent. The official document category analysis agent extracts semantically similar few-shot examples from historical official document data by combining the dynamically adjusted prompt technology and the semantic vector retrieval mechanism, thereby achieving accurate classification of complex official document scenarios. The official document category analysis agent has dynamic adaptation capabilities and can handle a variety of official document types. In particular, when the official document language expression is diverse and the context is complex, it can automatically select examples that are semantically close to the current official document through semantic vector retrieval, significantly improving the accuracy and adaptability of classification.
[0097] The classification of official document data relies on the powerful semantic understanding ability of the second largest language model, and the classification tasks and goals are clarified through the classification prompt template. For example:
[0098] You are an expert in document classification. Please judge the type of the following document based on its content:
[0099] Title: {Title}
[0100] Body: {Body}
[0101] Output category: Application / Notice / Request / Report / Other
[0102] Please explain the basis for your judgment.
[0103] The design of the classification prompt template is as general as possible, suitable for preliminary classification tasks, and allows subsequent improvement of classification accuracy through few-shot enhancement.
[0104] By using the Few-shot learning technology, examples with similar semantics in historical document data are added to the classification prompt template, so that the second large language model can make judgments based on real cases. For example:
[0105] Example 1:
[0106] Title: 2024 Budget Request
[0107] Text: Our unit applies for an annual budget of 5 million yuan, please approve it.
[0108] Output Category: Application
[0109] Example 2:
[0110] Title: Request for equipment purchase
[0111] Text: In order to improve production efficiency, I would like to apply for the purchase of new equipment. Please approve it.
[0112] Output type: Request
[0113] Current documents:
[0114] Title: {Title}
[0115] Body: {Body}
[0116] Output category:
[0117] Few-shot examples are generated through dynamic retrieval and maintain high semantic similarity with the content of current official document data, ensuring that classification is more targeted and accurate.
[0118] The multiple rounds of enhancement operations are to enhance the credibility of the classification labels by guiding the second large language model to perform self-verification after the initial classification. For example:
[0119] You have classified the current document as "{category}". Please answer the following questions:
[0120] - Is the basis for classification sufficient?
[0121] -Is there a more appropriate category?
[0122] If there are any errors, please correct them and explain why.
[0123] The matching of similar historical document data based on the semantic information, i.e., assisting the few-shot selection through semantic information (semantic vector) retrieval:
[0124] Vector generation: The title and body of the document are encoded into semantic vectors through a pre-trained model (such as Sentence-BERT) to capture the deep semantic information of the document content.
[0125] Similarity retrieval: Based on the cosine similarity of the semantic vector, retrieve the historical document data that is closest to the current document.
[0126] Dynamic example generation: The retrieved semantically similar official documents are dynamically inserted into the prompt as few-shot examples. Through this mechanism, the agent can flexibly select reference cases based on the characteristics of the official document content, rather than relying on a fixed static set of examples.
[0127] After outputting the classification label, a confidence level is generated by appending a prompt to evaluate the credibility of the classification label; if the confidence level is lower than the set threshold, the document category analysis agent will automatically call more semantically similar examples for reclassification to ensure the reliability of the final result.
[0128] The output classification labels are exemplified as follows:
[0129] {
[0130] "Document Type":"Application",
[0131] "Confidence score": 0.92,
[0132] "Classification basis": "The title contains 'application', and the content describes the budget application items, which is highly consistent with the historical 'application' category."
[0133] }
[0134] The collaborative relationship between the document category analysis agent and other agents is specifically as follows:
[0135] Collaborate with semantic understanding agents: The document category analysis agent relies on the structured document data (such as core topics and key information fields) provided by the semantic understanding agent to ensure that the classification task has accurate contextual input; Collaborate with opinion generation agents: Classification labels directly affect the strategy for generating initial approval opinions. For example, "application" type documents usually require detailed approval opinions to be generated, while "notice" type documents may only need to mark the distribution path.
[0136] In step S4, the classification label at least includes application, notification, request and report; the classification label also carries confidence and classification basis.
[0137] In step S5, the opinion generating agent outputs the initial approval opinion of the document data based on the classification label, specifically:
[0138] The historical approval opinions of the current account name are obtained through the Tools class API (tool class API), and an opinion Prompt template of the third large language model is dynamically generated based on the historical approval opinions. The third large language model performs multiple rounds of enhancement operations on the opinion Prompt template through a self-verification mechanism. During the multiple rounds of enhancement operations, the approval rules of the official document data are combined for optimization. The opinion generation agent outputs the initial approval opinion of the official document data in the form of natural language based on the classification label through the opinion Prompt template of the third large language model, and the initial approval opinion carries the approval basis.
[0139] The opinion generation agent is responsible for the core module of generating approval opinions for official document data. The opinion generation agent integrates the official document content, historical approval opinions and approval rules, and uses the natural language generation capabilities of the third large language model to generate reasonable and explanatory initial approval opinions for each official document data; by calling the Tools class API, the historical approval opinions of the current account name are obtained, and this is used as a reference to generate initial approval opinions with contextual coherence and scenario adaptability.
[0140] Use the Tools class API to call historical approval opinions for reference when generating prompts. For example:
[0141] Query conditions: Match historical opinions that are semantically similar to the current document title or body content.
[0142] Return result: a set of historical approval opinions and their background information (such as document type, keywords, etc.).
[0143] Sample output:
[0144]
[0145]
[0146] Use historical approval opinions to enhance prompts, so that the third largest language model can fully refer to historical cases when generating. For example:
[0147] Current document content:
[0148] Title: {Title}
[0149] Body: {Body}
[0150] Document type: {Classification result}
[0151] Historical approval opinions:
[0152] 1. Agree to the budget application, but specific instructions for use are required. (Budget 5 million yuan, related to annual planning)
[0153] 2. It is recommended to further improve the data support before submitting for approval.
[0154] Please generate reasonable approval opinions based on the above information and explain the reasons.
[0155] After generating the initial approval opinion, the model is guided to self-check and adjust to ensure the high quality of the generated results. For example:
[0156] Initial opinions generated:
[0157] “Agree with the budget request, but detailed project information is required.”
[0158] Please answer the following questions:
[0159] 1. Does the opinion fully cover the key information of the official document?
[0160] 2. Are additional conditions required?
[0161] If necessary, please correct your comments and explain why.
[0162] During multiple rounds of optimization, content enhancement was performed based on historical approval opinions and approval rules. For example, if the approval rules stipulate that additional approval conditions are required for certain types of official documents, relevant clauses will be automatically added when generating the initial approval opinion.
[0163] In order to enhance the interpretability of the initial approval opinion, the approval basis is included in the output. For example:
[0164] Reference to historical opinions;
[0165] Specific rule base terms;
[0166] The core elements of the official document content (such as amount, target object).
[0167] Sample output:
[0168]
[0169] An example of the output of the initial approval opinion is:
[0170] {
[0171] "Approval Opinion": "Agree with the budget application, but need to provide detailed project information and submit an annual plan.",
[0172] "Additional conditions": ["Detailed description of the project", "Annual plan"],
[0173] "Approval result":"Agree",
[0174] "Remarks": "Generated based on historical approval data and enterprise rule base."
[0175] }
[0176] The collaborative relationship between the opinion generating agent and other agents is specifically as follows:
[0177] Collaborate with the document category analysis agent: adjust the prompt generation strategy according to the document label of the document category analysis agent. For example, the approval opinions of "application" type document data usually include conditional consent, while the opinions of "notification" type documents are mainly based on receipt confirmation; Collaborate with the distribution candidate agent: the generated initial approval opinions may include a list of suggestions that need to be forwarded or copied, which are directly passed to the distribution candidate agent for further optimization.
[0178] In step S5, the distribution candidate agent outputs the distribution candidate list of the official document data based on the classification label, specifically:
[0179] Through the Tools class API, historical distribution records similar to the official document data are obtained, and a distribution Prompt template of a fourth large language model is dynamically generated based on the historical distribution records. The fourth large language model performs multiple rounds of enhancement operations on the distribution Prompt template through a self-verification mechanism, and the distribution rules of the official document data are optimized during the multiple rounds of enhancement operations. The distribution candidate agent outputs a distribution candidate list of the official document data in the form of natural language based on the classification label through the distribution Prompt template of the fourth large language model, and the distribution candidate list carries the distribution basis.
[0180] The candidate distribution agent is a key module responsible for predicting the document distribution path and recommending candidates. Its main task is to generate a list of suitable approvers and copy recipients based on the document content, historical circulation records, and internal corporate rules. By calling the Tools class API to obtain historical distribution records and rule base information, combined with the generation capabilities of the fourth large language model, the optimal distribution suggestion (distribution candidate list) is dynamically generated.
[0181] Through the Tools API, historical distribution records similar to the current document data are retrieved in real time to provide context support for the fourth large language model to generate distribution prompt templates. For example:
[0182] Search conditions: Match document type, source unit or key fields.
[0183] Return result: distribution list of similar documents and their approval chain.
[0184] Example API output:
[0185]
[0186]
[0187] During multiple rounds of enhanced operations, optimization is performed based on the distribution rules of official document data. For example, if the distribution rule stipulates that "budget application amounts exceeding a certain amount must be submitted to a senior approver", relevant personnel will be dynamically added to the distribution candidate list.
[0188] The prompt technology guides the fourth large language model to generate distribution suggestions by integrating the official document content, historical distribution records and distribution rules. For example:
[0189] Current document information:
[0190] Title: {Title}
[0191] Body: {Body}
[0192] Document type: {Classification result}
[0193] Sender: {sender}
[0194] Budget amount: {amount}
[0195] Historical distribution records:
[0196] 1. Document type: application; Historical distribution: department manager, financial director; Cc: administrative director.
[0197] 2. Document type: request for instructions; Historical distribution: Human Resources Manager; Cc: General Manager.
[0198] Distribution rules:
[0199] -Budget amounts exceeding RMB 5 million must be submitted to a senior approver.
[0200] - Personnel changes must be reported step by step.
[0201] Please generate a distribution candidate list based on the above information:
[0202] 1. Approver: {Approver list}
[0203] 2. Cc list: {Cc list}
[0204] 3. Generation basis: {rules or historical data}
[0205] Through multiple rounds of generation optimization, the candidate list can be adjusted based on confidence and rule verification. For example, if an approver does not meet the rule requirements, the system will automatically readjust the list.
[0206] Perform multiple rounds of verification on the initially generated distribution candidate list to ensure that it complies with the company's internal distribution rules and actual needs:
[0207] Rule verification: Verify item by item whether the distribution candidate list meets the conditions of the distribution rule. For example, whether the approval chain meets the hierarchical requirements.
[0208] Contextual verification: Let the fourth large language model self-review the distribution candidate list by adding prompts. For example:
[0209] Initial distribution candidate list generated:
[0210] -Approver: Department Manager, Financial Supervisor
[0211] -Cc: Administrative Director
[0212] Please answer the following questions:
[0213] 1. Does the distribution path cover all necessary personnel? 2. Are there any approval links that are missed?
[0214] If there are any problems, please correct them and explain why.
[0215] In order to enhance the user's confidence in the distribution candidate list, the distribution basis is attached when output. For example:
[0216] Based on historical distribution records;
[0217] The triggering rule clause;
[0218] Confidence score.
[0219] Sample output:
[0220]
[0221]
[0222] The collaborative relationship between the candidate distribution agent and other agents is specifically as follows:
[0223] Collaborate with the document category analysis agent: dynamically adjust the distribution path according to the classification labels output by the document category analysis agent. For example, "application" type documents usually involve the approval of the finance department, while "request" type documents are more likely to involve the personnel department; Collaborate with the opinion generation agent: adjust the distribution candidate list according to the initial approval suggestions of the opinion generation agent. For example, if the initial approval opinion mentions that specific personnel are required to participate, they will be dynamically added to the distribution candidate list.
[0224] The step S6 is specifically as follows:
[0225] The result aggregation agent integrates the semantic information, classification labels, initial approval opinions and distribution candidate lists, performs consistency check on the integrated semantic information, classification labels, initial approval opinions and distribution candidate lists, optimizes the semantic information, classification labels, initial approval opinions and distribution candidate lists based on weight scoring and optimization mechanisms, and performs secondary optimization on the optimized semantic information, classification labels, initial approval opinions and distribution candidate lists based on a dynamic adjustment mechanism, thereby generating approval opinions and distribution lists.
[0226] The result summary agent is the final decision-making module, which is responsible for integrating the outputs of the semantic understanding agent, the official document category analysis agent, the opinion generation agent and the distribution candidate agent to generate the final approval opinion and distribution list. Through the correction and optimization mechanism, it ensures the consistency, rationality and efficiency of the generated results, and outputs them in a structured form to provide users with approval plans that can be directly adopted.
[0227] An example of integrating the semantic information, classification labels, initial approval opinions, and distribution candidate lists is as follows:
[0228]
[0229] Perform consistency checks to avoid conflicts or logical errors. For example:
[0230] Verify whether the initial approval opinion matches the classification label. For example, if the initial approval opinion of the "application" document data mentions "no need to process", it is judged to be unreasonable.
[0231] Verify the completeness of the distribution candidate list to ensure that key approval links are not missed.
[0232] Verify the logical consistency of all generated bases to avoid contradictory decisions caused by historical data or rule conflicts.
[0233] Example of multiple verification prompts:
[0234] The following is a preliminary integrated approval plan:
[0235] - Document type: Application
[0236] -Approval opinion: Agree with the budget application, but detailed project description is required.
[0237] -Distribution list: Approver: Department Manager, Financial Supervisor; Cc: Administrative Supervisor
[0238] Please check: 1. Does the approval opinion meet the characteristics of an "application" document? 2. Does the distribution list include all necessary approval personnel? 3. Is the basis for generation sufficient?
[0239] If you find any problems, please correct them and explain why.
[0240] The weighted scoring and optimization mechanism is to assign weights to the output results of each agent, and select the best solution after comprehensive scoring. For example:
[0241] For the distribution candidate list output by the distribution candidate agent, the priority is dynamically adjusted according to the confidence and rule coverage.
[0242] The initial approval opinion output by the opinion generation agent is confidence-weighted based on the source (such as approval history data, approval rules).
[0243] Example weight distribution: historical data weight is 0.4; enterprise rule base weight is 0.4; model generation weight is 0.2.
[0244] The dynamic adjustment mechanism further optimizes the generated results after the initial results are integrated:
[0245] Supplement and revision of approval opinions: If there is any inconsistency between the initial approval opinion and the distribution candidate list (for example, the initial approval opinion mentions "need to be submitted for senior approval", but the distribution candidate list is missing relevant personnel), the distribution candidate list will be automatically updated.
[0246] Conflict resolution: Conflicts between multiple agent outputs are automatically resolved through rule priority and context supplementation. For example, if the distribution candidate agent suggestion is different from the distribution rule, the distribution rule is preferred.
[0247] Examples of the generated approval opinions and distribution lists are as follows:
[0248]
[0249]
[0250] The specific collaborative relationship between the result aggregation agent and other agents is:
[0251] Integration role: Collaborate with all other intelligent agents. Its responsibility is to integrate analysis, classification, approval opinions and distribution lists into one to form a final decision-making plan. Conflict resolution role: Resolve possible conflicts between other intelligent agents through verification, weight scoring and optimization mechanisms to ensure the logical integrity of the output results. Feedback and optimization: Provide feedback on the performance of the intelligent agent based on the output results and record potential problems for subsequent improvements.
[0252] The step S7 is specifically as follows:
[0253] The approval opinion, the distribution list, the approval basis corresponding to the approval opinion, the distribution basis corresponding to the distribution list and metadata are displayed through a visual interface; the metadata at least includes the generation time, confidence level, and association rule terms; the distribution list at least includes the approver, the copy recipient, the contact information and the department information;
[0254] The visual interface exports the approval opinions and distribution list in PDF format, Excel format or JSON format based on the input export instruction, and outputs the approval opinions and distribution list based on the call instruction input by the API interface;
[0255] The visual interface performs editing operations on the approval opinions and the distribution list based on the input editing instructions.
[0256] The output of the approval opinions and distribution lists is the last link, which is responsible for displaying the approval opinions and distribution lists generated by the result aggregation agent in a user-friendly and operable manner, and supporting subsequent interaction and processing, that is, presenting all generated content in a structured manner, while providing flexible formatting and interaction functions to adapt to a variety of business scenarios and user needs.
[0257] Examples of the contents displayed on the visualization interface are:
[0258]
[0259] During specific implementation, the results can be displayed in a graphic and textual manner: the approval opinions are highlighted separately; the distribution list lists the approvers and cc persons in a table format, with additional contact information and department information; the generation basis is presented in a list format, and supports clicking to expand the detailed content.
[0260] During specific implementation, the editing operation supports modification and supplementation of approval opinions and distribution lists, and supports direct addition, deletion or adjustment of personnel in the distribution list. The modifications will be fed back in real time and recorded as reference data for optimizing subsequent generation logic.
[0261] Sample interaction: After the user adjusts the distribution list, the system will prompt: "You have modified the distribution list, do you want to update the historical reference record?"
[0262] After user confirmation, the approval opinion can be automatically submitted to the next approval node or relevant personnel can be notified for execution.
[0263] In summary, the advantages of the present invention are:
[0264] By creating a semantic understanding agent, a document category analysis agent, an opinion generation agent, a distribution candidate agent and a result summary agent; then obtaining the input document data and performing preprocessing and format verification, parsing the document data through the semantic understanding agent, and outputting the semantic information of the document data; the document category analysis agent classifies the document data based on the semantic information and outputs the classification label of the document data; the opinion generation agent outputs the initial approval opinion of the document data based on the classification label; the distribution candidate agent outputs the distribution candidate list of the document data based on the classification label; then the result summary agent generates the approval opinion and the distribution list based on the semantic information, classification label, the initial approval opinion and the distribution candidate list, and finally displays the approval opinion and the distribution list through a visual interface; that is, through the combination of the semantic understanding agent and the large language model, the accurate understanding of the document data, including at least the document title, body and other contents, is achieved to output semantic information, so as to improve the semantic understanding ability; the document category analysis agent is used to perform dynamic classification through the Prompt technology of the large language model, and guide the subsequent approval process according to the classification label; the opinion generation agent calls the Tools class API, combined with the history Approval opinions and approval rules generate reasonable and explainable initial approval opinions; the candidate distribution agent predicts the appropriate candidate list (approving personnel or departments), and then the result summary agent outputs the final approval opinion and distribution list; through the collaboration of the semantic understanding agent and the official document category analysis agent, a large language model is used to deeply analyze the official document data, and the accurate extraction and dynamic classification of official document elements are realized without relying on fixed rules or templates, which significantly improves the flexibility and accuracy of classification; the opinion generation agent combines historical approval opinions and approval rules, and by calling the Tools class API, it integrates multi-dimensional information to generate rule-based and context-based initial approval opinions, provides detailed approval basis (reasons and explanations), and enhances the scientificity and transparency of approval decisions; through the distribution candidate agent predicts the appropriate candidate list, combined with the correction and optimization mechanism of the result summary agent, ensures that the distribution path is reasonable, reduces unnecessary approval links, and significantly improves approval efficiency; through the modular design of the multi-agent architecture, the system is easy to expand and upgrade, can flexibly respond to dynamic needs, and the information sharing and efficient collaboration between agents further improve the overall performance, and ultimately greatly improves the quality and efficiency of official document approval.
[0265] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A document approval method based on multi-agent, characterized by: The steps include: Step S1, creating a semantic understanding agent, a document category analysis agent, an opinion generation agent, a candidate distribution agent, and a result summary agent; Step S2: obtaining input document data, and performing preprocessing and format verification on the document data; Step S3, parsing the official document data through the semantic understanding agent, and outputting the semantic information of the official document data; Step S4, the official document category analysis agent classifies the official document data based on semantic information and outputs a classification label of the official document data; Step S5: the opinion generating agent outputs the initial approval opinion of the document data based on the classification label; The distribution candidate agent outputs a distribution candidate list of the official document data based on the classification label; Step S6, the result summary agent generates an approval opinion and a distribution list based on the semantic information, classification labels, initial approval opinions, and distribution candidate lists; Step S7: display the approval opinions and distribution list through a visual interface.
2. A multi-agent-based document approval method as claimed in claim 1, characterized in that: In the step S1, the semantic understanding agent, the official document category analysis agent, the opinion generation agent, the candidate distribution agent and the result aggregation agent work together through a shared context and an interaction mechanism.
3. A multi-agent-based document approval method as claimed in claim 1, characterized in that: In step S2, the official document data at least includes the account name, the official document title, the body, the source unit and the official document type.
4. A multi-agent-based document approval method as claimed in claim 1, characterized in that: The step S3 is specifically as follows: The first large language model is trained by using the Few-shot learning technology. The semantic understanding agent extracts semantic basic information from the official document data by using the Prompt technology of the first large language model. The semantic basic information is iteratively optimized by using thought chains and multiple rounds of dialogue. The iteratively optimized semantic basic information is corrected and enhanced, and then the semantic information of the official document data in the JSON format is output.
5. The document approval method based on multi-agent as claimed in claim 1, characterized in that: The step S4 is specifically as follows: The second large language model is trained by the Few-shot learning technology to enhance the classification Prompt template preset by the second large language model. The second large language model performs multiple rounds of enhancement operations on the classification Prompt template through a self-verification mechanism. The official document category analysis agent matches similar historical official document data based on the semantic information through the classification Prompt template of the second large language model to classify the official document data, output the classification label of the official document data in JSON format, calculate the confidence of the classification label, and dynamically update the classification label based on the confidence.
6. A multi-agent-based document approval method as claimed in claim 1, characterized in that: In step S4, the classification label at least includes application, notification, request and report; the classification label also carries confidence and classification basis.
7. A multi-agent-based document approval method as claimed in claim 1, characterized in that: In step S5, the opinion generating agent outputs the initial approval opinion of the document data based on the classification label, specifically: The historical approval opinions of the current account name are obtained through the Tools class API, and an opinion Prompt template of the third large language model is dynamically generated based on the historical approval opinions. The third large language model performs multiple rounds of enhancement operations on the opinion Prompt template through a self-verification mechanism. During the multiple rounds of enhancement operations, the approval rules of the official document data are combined for optimization. The opinion generation agent outputs the initial approval opinion of the official document data in the form of natural language based on the classification label through the opinion Prompt template of the third large language model, and the initial approval opinion carries the approval basis.
8. A multi-agent-based document approval method as claimed in claim 1, characterized in that: In step S5, the distribution candidate agent outputs the distribution candidate list of the official document data based on the classification label, specifically: Through the Tools class API, historical distribution records similar to the official document data are obtained, and a distribution Prompt template of a fourth large language model is dynamically generated based on the historical distribution records. The fourth large language model performs multiple rounds of enhancement operations on the distribution Prompt template through a self-verification mechanism, and the distribution rules of the official document data are optimized during the multiple rounds of enhancement operations. The distribution candidate agent outputs a distribution candidate list of the official document data in the form of natural language based on the classification label through the distribution Prompt template of the fourth large language model, and the distribution candidate list carries the distribution basis.
9. A multi-agent-based document approval method as claimed in claim 1, characterized in that: The step S6 is specifically as follows: The result aggregation agent integrates the semantic information, classification labels, initial approval opinions and distribution candidate lists, performs consistency check on the integrated semantic information, classification labels, initial approval opinions and distribution candidate lists, optimizes the semantic information, classification labels, initial approval opinions and distribution candidate lists based on weight scoring and optimization mechanisms, and performs secondary optimization on the optimized semantic information, classification labels, initial approval opinions and distribution candidate lists based on a dynamic adjustment mechanism, thereby generating approval opinions and distribution lists.
10. The document approval method based on multi-agent as claimed in claim 1, characterized in that: The step S7 is specifically as follows: The approval opinion, the distribution list, the approval basis corresponding to the approval opinion, the distribution basis corresponding to the distribution list and metadata are displayed through a visual interface; the metadata at least includes the generation time, confidence level, and association rule terms; the distribution list at least includes the approver, the copy recipient, the contact information and the department information; The visual interface exports the approval opinions and distribution list in PDF format, Excel format or JSON format based on the input export instruction, and outputs the approval opinions and distribution list based on the call instruction input by the API interface; The visual interface performs editing operations on the approval opinions and the distribution list based on the input editing instructions.
Citation Information
Cited By
AI-based countersigning process differentiation form verification method and related equipment
CN120687461A
Government affair application platform based on artificial intelligence model
CN120707082A