CN-121980022-A - Document generation system and method based on multi-agent cooperation
Abstract
A document generation system and method based on multi-agent cooperation includes understanding and extracting high-level semantic information of text input by user and dynamically generating problem to guide user to definitely demand for forming detailed document demand, identifying theme and key element of document from detailed document demand, determining optimal sequence of task execution based on shortest path algorithm, predicting and resolving potential conflict in task execution by parallel processing and searching algorithm, forming optimal task plan by feedback loop, generating document outline according to user demand and searching associated content of document chapter for writing chapter content, forming preliminary document by grammar and format check, defining document quality evaluation index according to user demand and industry standard and feeding back document quality evaluation to user, generating complete final document and presenting to user. The invention improves the quality of document generation.
Inventors
- YANG HUAFENG
- WANG DONG
- GUO RUIFENG
- LIU JINGQIAN
- LIU SHIWEI
- CHEN YUANBAO
Assignees
- 中国电信股份有限公司
- 中电福富信息科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251202
- Priority Date
- 20250711
Claims (10)
- 1. A document generation method based on multi-agent cooperation is characterized by comprising the following steps: Step 1, user interaction and demand analysis, namely understanding and extracting high-level semantic information of a text input by a user through a deep learning model, and dynamically generating a problem to guide the user to clearly demand so as to form detailed document demands; Determining the optimal sequence of task execution based on a shortest path algorithm, predicting and solving potential conflict in task execution through parallel processing and searching algorithm, and forming an optimal task plan through feedback loop; Step 3, task arrangement and execution, namely generating a document outline according to the requirements of a user, and retrieving the associated content of a document chapter based on the document outline so as to compose chapter content; Step 4, monitoring feedback and self-adjustment, namely defining a document quality evaluation index according to user requirements and industry standards, and evaluating the document quality of the preliminary document, feeding back the document to the user when the evaluation is passed, and executing step 2 to regenerate the document content after the parameter self-adjustment is performed when the evaluation is not passed; and 5, generating and outputting the document, namely generating a complete final document and presenting the complete final document to a user to finish document generation.
- 2. The document generation method based on multi-agent collaboration according to claim 1, wherein the step 1 specifically comprises the following steps: step 1-1, selecting a corresponding preset problem template to generate a targeted problem according to the primary requirement input by a user through keyword matching and semantic analysis, wherein the preset problem template comprises a theme, a content range, a format requirement and word number limiting information; Step 1-2, the questions are refined step by step according to the answers of the user, and the user is guided to clearly define the document content requirements through multiple rounds of conversations until the complete document requirements are obtained.
- 3. The document generating method based on multi-agent collaboration according to claim 1, wherein the determining of the optimal order of task execution in step 2 comprises the following specific steps: Step 2-1-1, decomposing a document generation task into a plurality of subtasks, and representing the subtasks as nodes in the graph; Step 2-1-2, defining the state of each subtask, including not started, in progress and completed; step 2-1-3, setting a reward value according to the quality and efficiency of task completion, wherein the reward value is adjusted according to the importance and difficulty of the task; step 2-1-4, calculating state transition probability based on historical task data and task dependency relationship; and 2-1-5, calculating an optimal path from the beginning to the end of the task by using a graph theory algorithm in combination with rewards and state transition probabilities to form an optimal sequence of task execution, wherein a calculation formula of the optimal path is as follows: Where V(s) is the cost function of the state, R (s, a) is the reward of executing action a in state s, P (s ′ |s, a) is the state transition probability, γ is the discount factor, and s ′ is the next state after the action is executed.
- 4. The method for generating documents based on multi-agent collaboration according to claim 1, wherein the specific steps of predicting and resolving potential conflicts in task execution in step 2 are as follows: step 2-2-1, conflict detection, namely monitoring conflict situations of resource competition and data dependence among the intelligent agents in real time in the task execution process; Step 2-2-2, designing a heuristic function, namely defining a heuristic function h (n) for estimating the cost from the current node n to the target node, namely designing the heuristic function according to the priority of the task and the residual workload so as to solve the conflict of the task with high priority preferentially; step 2-2-3, cost calculation, namely calculating total estimated cost f (n) =g (n) +h (n) of the node, wherein g (n) is the actual cost from the starting point to the node n, and h (n) is the heuristic estimated cost from the node n to the target; Step 2-2-4, searching a conflict resolution path, namely searching an optimal path from a current conflict state to a conflict-free state according to the total estimated cost f (n) by utilizing an A * algorithm; And 2-2-5, executing the conflict resolution strategy, namely executing the conflict resolution strategy according to the searched optimal path, and ensuring that the task is smoothly carried out.
- 5. The method for generating documents based on multi-agent collaboration according to claim 1, wherein the step 3 comprises the following steps: Step 3-1, generating a document outline according to the user demand by adopting a graph neural network model; step 3-2, searching data and information related to the document theme by using a search engine algorithm in combination with a data mining technology, and measuring the similarity between the required content and the query data by using cosine similarity; Step 3-3, screening out data most relevant to the user demand according to the similarity calculation result, and integrating and preprocessing the data so as to write chapters for direct use; Step 3-4, writing the content of the section of the document by adopting a GPT model and combining the searched most relevant data on the basis of the outline of the document; And 3-5, checking grammar, format and content of the generated document outline and chapter content, adjusting model parameters according to the checking result to regenerate the document, and forming a preliminary document after ensuring that the document meets the requirements of users and industry standards.
- 6. The method for generating documents based on multi-agent collaboration according to claim 5, wherein the steps 3-5 specifically comprise the steps of: step 3-5-1, feedback collection, namely collecting grammar and format check results and sorting to form feedback information; 3-5-2, online learning and updating, namely updating model parameters of each agent in real time by utilizing FTRL online learning algorithm according to feedback information; and 3-5-3, regenerating the content by each agent according to the updated model parameters, checking again, and gradually improving the quality of the document content through repeated iterative optimization until the user requirements and industry standards are met.
- 7. The method for generating documents based on multi-agent collaboration according to claim 1, wherein the step 4 specifically comprises the following steps: step 4-1, defining a quality assessment index, namely defining a document quality assessment index according to user requirements and industry standards; step 4-2, constructing an evaluation model, namely constructing a document quality evaluation model by utilizing a machine learning algorithm SVM, and automatically evaluating the document content according to defined quality evaluation indexes by training the evaluation model; Step 4-3, model evaluation, namely inputting the generated document content into an evaluation model, and judging whether the document meets the quality requirement according to the output result of the evaluation model; And 4-4, feeding back and adjusting, namely adjusting the task planning strategy according to feedback information formed by the evaluation result so as to regenerate the document content when the evaluation result does not pass, and feeding back the document result to the user when the evaluation result passes.
- 8. A document generation system based on multi-agent cooperation according to any one of claims 1 to 7, characterized in that the system comprises the following modules: The task planning coordination module is used for forming detailed document requirements according to requirements, converting the document requirements into task steps, and formulating corresponding execution strategies and arranging tasks; the task arrangement execution module is used for calling an association tool to generate a document outline according to the task arrangement, and retrieving association content required by writing the chapter content of the document; The monitoring feedback module is used for defining a document quality evaluation index according to the user requirements and the industry standards and evaluating the document quality of the preliminary document, feeding back the document to the user when the evaluation is passed, and regenerating the document content after the parameter self-adjustment when the evaluation is not passed until the user requirements and the industry standards are met; and the document generation and output module is used for generating a complete final document and presenting the complete final document to a user.
- 9. The document generation system based on multi-agent collaboration of claim 8, wherein the task planning coordination module comprises a user interaction agent, a task planning agent, a strategy collaboration agent and a task intelligent manager, wherein the user interaction agent is used for understanding and extracting high-level semantic information of user input text through a deep learning model and dynamically generating questions to guide the user to clearly demand so as to form detailed document demands; The task orchestration execution module comprises a demand analysis agent, a outline writing agent, a chapter writing agent, a data searching agent and a content checking agent; the outline writing agent adopts a graph neural network model to generate a document outline according to the user demand; the system comprises a data search agent, a chapter writing agent, a content verification agent and a user demand and industry standard, wherein the data search agent is used for searching data and information related to a document theme by using a search engine algorithm in combination with a data mining technology, and measuring similarity between document demand content and query data by using cosine similarity to obtain most relevant related content; The monitoring feedback module comprises an evaluation and feedback agent and a monitoring module, wherein the feedback agent adopts an online learning strategy to automatically return a verification result to each agent of the task arrangement execution module to continuously optimize the content of the agent until the document content is completely output, and the monitoring module is used for acquiring the execution state of each task and maintaining the execution state to a task intelligent manager of the task arrangement coordination module.
- 10. The document generation system based on multi-agent collaboration of claim 8, wherein the system further comprises an atomic tool layer and a data layer, the atomic tool layer comprises a knowledge base recall tool, a word analysis tool and a third party API interface tool, and the data layer is responsible for storing, managing and retrieving data and information required for document generation and ensuring availability and consistency of the data.
Description
Document generation system and method based on multi-agent cooperation Technical Field The invention relates to the technical field of artificial intelligence and automatic document generation, in particular to a document generation system and method based on multi-agent cooperation. Background In conventional document generation processes, often relying on manual writing or simple template filling, these methods have significant limitations. The manual writing is time-consuming and labor-consuming, and consistency and quality in large-scale generation are difficult to ensure. While simple template filling can quickly generate documents, the generated documents often lack flexibility and depth and cannot meet complex and variable business requirements. With the development of artificial intelligence technology, particularly the appearance of large model technology, a new opportunity is brought to the field of document generation. The large model has the ability of understanding and generating natural language through deep learning and massive data training. Large models in the prior art typically require a large amount of context information to generate high quality documents, but often only provide limited information input in practical applications. The generated document lacks clear structure and logic, is difficult to meet the format requirement of the professional document, and the generated document content is often disjointed from the actual service requirement, and lacks practicality and pertinence. Disclosure of Invention The invention aims to provide a document generation system and method based on multi-Agent cooperation, which are used for arranging a large model at a proper position by combining the actual service condition and the large model capacity and utilizing a multi-Agent (Agent) cooperation mode so as to improve the document generation quality. The technical scheme adopted by the invention is as follows: A document generation method based on multi-agent cooperation comprises the following steps: Step 1, user interaction and demand analysis, namely understanding and extracting high-level semantic information of a text input by a user through a deep learning model, and dynamically generating a problem to guide the user to clearly demand so as to form detailed document demands; Specifically, the user interaction agent employs a deep learning model, such as BERT or GPT, to understand and extract high-level semantic information in the user input. Problems are dynamically generated to guide users through a sequence-to-sequence (Seq 2 Seq) model to explicitly demand and integrate into detailed document requirements. Determining the optimal sequence of task execution based on a shortest path algorithm, predicting and solving potential conflict in task execution through parallel processing and searching algorithm, and forming an optimal task plan through feedback loop; Specifically, the mission planning agent identifies topics and key elements of the demand document using text analysis techniques, such as an LDA topic model. And determining the optimal sequence of task execution by applying a shortest path algorithm in graph theory. The strategy collaborative agent solves potential conflict in task execution through parallel processing and searching algorithm, and optimizes task planning through feedback loop. Step 3, task arrangement and execution, namely generating a document outline according to the requirements of a user, and retrieving the associated content of a document chapter based on the document outline so as to compose chapter content; Specifically, the task orchestration execution module dynamically mobilizes demand analysis agents, outline composition agents, chapter composition agents, data search agents, and content inspection agents. Outline writing agent generates a document outline using a Graph Neural Network (GNN) model. Chapter composition agent in combination with the outline and the results of the data search agent, the chapter content is composed using the Seq2Seq model. The data search agent retrieves relevant information using search engine algorithms and data mining techniques. The content verification agent uses a BERT-based model for syntax, format, and content verification. Step 4, monitoring feedback and self-adjustment, namely defining a document quality evaluation index according to user requirements and industry standards, and evaluating the document quality of the preliminary document, feeding back the document to the user when the evaluation is passed, and executing step 2 to regenerate the document content after the parameter self-adjustment is performed when the evaluation is not passed; Specifically, the monitoring feedback module automatically evaluates the task execution result through the evaluation and feedback agent. And if the evaluation is passed, feeding back the document to the user through the user interaction intelligent agent. If the evaluatio