Document generation method and device, electronic equipment and storage medium
By orchestrating an agent-driven multi-tool module architecture, tool modules corresponding to subtasks are dynamically generated, which solves the shortcomings of existing intelligent document generation systems in terms of professionalism, logical rigor, and scalability, and realizes high-quality and flexible automated document generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-27
AI Technical Summary
Existing intelligent document generation systems struggle to achieve high-quality automated generation in terms of professionalism, logical rigor, and consistency. In particular, when generating long documents, they are prone to issues such as unstable output, inconsistencies, and inconsistent terminology. Furthermore, their system flexibility and scalability are limited, making it difficult to adapt to rapidly changing business needs.
A multi-tool module architecture driven by orchestration agents is adopted. By dynamically generating tool modules corresponding to sub-tasks, including sub-agents and code tools, dynamic task decomposition and planning are achieved, ensuring that each sub-task provides customized professional processing capabilities. By using a unified data format and quality detection mechanism, the technical accuracy, logical rigor and consistency of the target document are ensured.
It improves the output quality and automated generation efficiency of target documents, enhances the system's flexibility and scalability, can quickly adapt to complex document generation needs, and ensures that the generated documents meet high quality and consistency requirements.
Smart Images

Figure CN121745299A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular to the technical field of artificial intelligence, deep learning, large model, natural language processing and the like, and specifically relates to a document generation method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the advent of the information age, the writing of technical documents has become a key link for enterprise innovation, product development and project delivery, and the rapid development of technology and the continuous subdivision of professional fields have further exacerbated the urgent demand for high-quality technical documents in the market. SUMMARY
[0003] The present disclosure provides a document generation method and device, an electronic device and a storage medium.
[0004] According to a first aspect of the present disclosure, a document generation method is provided, comprising: obtaining a document generation request; obtaining a task planning result based on the document generation request by using an arrangement agent, wherein the task planning result comprises a plurality of subtasks; for each subtask in the plurality of subtasks, generating a tool module corresponding to the subtask by using the arrangement agent to obtain a plurality of tool modules corresponding one-to-one to the plurality of subtasks; executing the plurality of subtasks by using the plurality of tool modules to generate a target document.
[0005] According to a second aspect of the present disclosure, a document generation device is provided, comprising: a request obtaining unit configured to obtain a document generation request; a task planning unit configured to obtain a task planning result based on the document generation request by using an arrangement agent, wherein the task planning result comprises a plurality of subtasks; a tool module generating unit configured to, for each subtask in the plurality of subtasks, generate a tool module corresponding to the subtask by using the arrangement agent to obtain a plurality of tool modules corresponding one-to-one to the plurality of subtasks; a document generating unit configured to execute the plurality of subtasks by using the plurality of tool modules to generate a target document.
[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect of the present disclosure.
[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided; wherein the computer instructions are used to make a computer execute the method provided in the first aspect of the present disclosure.
[0008] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program; wherein the computer program, when executed by a processor, can implement the method provided in the first aspect of the present disclosure.
[0009] The present disclosure can improve the output quality of the target document.
[0010] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0011] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them: Figure 1 A flowchart of a document generation method provided by an embodiment of the present disclosure; Figure 2 An architecture diagram of an intelligent document generation system provided by an embodiment of the present disclosure; Figure 3 An exemplary flowchart of a document generation method provided by an embodiment of the present disclosure; Figure 4 An application scenario diagram of a document generation method provided by an embodiment of the present disclosure; Figure 5 A schematic structural block diagram of a document generation apparatus provided by an embodiment of the present disclosure; Figure 6 A schematic structural block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0012] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to help understanding. They should be considered only as exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.
[0013] With the advent of the information age, the writing of technical documents has become a key link for enterprise innovation, product development, and project delivery. The rapid development of technology and the continuous subdivision of professional fields have further exacerbated the urgent demand for high-quality technical documents. Currently, whether it is technical solution design, system architecture description, or project delivery documents, professional, accurate, and standardized technical content is needed to support technical innovation and business applications. However, traditional manual writing methods are limited by low efficiency, unstable quality, and high dependence on individual professional knowledge, making it difficult to meet this requirement and unable to meet the dual expectations of document quality and delivery speed for modern enterprises.
[0014] In this case, with the rapid development of artificial intelligence technology, natural language processing and intelligent writing based on intelligent document generation systems have made some progress. However, when faced with the demand for technical document generation, traditional intelligent document generation systems still face fundamental challenges in terms of professionalism, logical rigor, and quality consistency, making it difficult to achieve high-quality automated generation.
[0015] Specifically, the current mainstream intelligent document generation systems mainly rely on the following three technical paths, but each has its own limitations: Solution one: end-to-end generation based on a single model Implementation principle: Based on pre-trained models such as Generative Pre-trained Transformer (GPT), an encoder-decoder architecture is adopted to learn language patterns through massive text data, so that after receiving user input document generation requirements, technical documents can be generated through a self-recursive approach.
[0016] Limitations: Although the knowledge depth of pre-trained models is large, the professional depth is insufficient, making it difficult to accurately control complex technical logic and domain terminology. Moreover, due to the limitation of the length of a single generation, it is easy to cause output instability, contradictions, and inconsistent terminology when generating long documents, and there is a lack of effective quality control.
[0017] Solution two: structured filling based on templates and rules Implementation principle: The intelligent document generation system pre-designs corresponding structure templates for various document types, including chapter structure, content elements, format specifications, etc. After receiving user input document generation requirements, key information and structured data are extracted, and the matching structure template is determined. The extracted key information and structured data are filled into the corresponding positions in the matching structure template to generate technical documents.
[0018] Limitations: The generation of technical documents highly depends on preset structure templates, with poor flexibility and innovation. When facing new scenarios, the system lacks scalability and needs manual addition of structure templates, making it difficult to adapt to rapidly changing business needs.
[0019] Scheme Three: Distributed Document Processing System Based on Cloud Collaboration Environment Implementation Principle: The distributed document processing system provides a cloud workstation integrating tool modules such as editing, retrieval, and collaboration, supporting online collaborative creation and resource sharing behaviors of users to complete the generation of technical documents.
[0020] Limitations: The distributed document processing system essentially provides a combination of tool modules and process support, rather than real intelligent document generation. Its document generation capability is limited by the integrated tool modules, lacking depth understanding and autonomous creation ability, making it difficult to automatically produce high-quality technical documents.
[0021] In summary, the limitations of the above intelligent document generation systems are: (1) Lack of professional depth and credibility: The technical documents generated by Scheme One and Scheme Two often fail to meet professional requirements in terms of technical accuracy, innovation, and logical rigor, thus failing to ensure the output quality of technical documents; (2) Poor quality controllability and consistency: Especially in Scheme One, due to the lack of a global quality control node, the output quality fluctuates greatly, and the style, terminology, and logic within long documents are difficult to unify, which also negatively impacts the output quality of technical documents; (3) Limited system flexibility and scalability: The architectures of Scheme Two and Scheme Three are rigid, making it difficult to quickly adapt to unforeseen document types or deep customization needs in specific fields, with high evolution costs.
[0022] To address at least some of the above problems, the present disclosure provides a document generation method which can be applied to an electronic device. The electronic device can be a server or a terminal device. Here, the terminal device can be a workstation, a mainframe computer, a regular computer (e.g., a desktop computer), or other similar computing devices. Below, a document generation method provided by the present disclosure will be described in conjunction with the flowchart shown in Figure 1 It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described in the flowchart can be performed in other orders.
[0023] Step S101, obtain a document generation request.
[0024] The document generation request can carry a document generation requirement and reference content.
[0025] In the embodiments of the present disclosure, the document generation requirement can include a generation requirement for a document type (for example, which of the technical scheme, system architecture description, project delivery document, and the like needs to be generated), a generation requirement for a document format (for example, font size, color scheme, layout style, output format, and the like), a constraint condition, and the like; and the reference content can be a document draft, a set of data, or other content capable of providing original materials for the target document to be generated.
[0026] In step S102, an orchestration agent is used to obtain a task planning result based on the document generation request.
[0027] In the embodiments of the present disclosure, the "agent" can be understood as an autonomous task execution entity with role definition and specific target, which belongs to a reasoning and decision engine relying on a bottom strategy large model as a core. The bottom strategy large model can be, but is not limited to, a large language model (LLM). Here, the LLM can be a pre-trained neural network model (for example, a self-recurrent generation model of the Transformer architecture), which has a large amount of internal knowledge, such as language knowledge, world knowledge, and professional knowledge in various fields.
[0028] In addition, it should be noted that in the embodiments of the present disclosure, the orchestration agent (also referred to as a "meta-agent") as an agent with a long life cycle in the intelligent document generation system can have the capabilities of request analysis, task planning, tool module generation, and global state management. For example, in the embodiments of the present disclosure, the orchestration agent can analyze the document generation request to obtain a request analysis result, and plan a task based on the request analysis result to obtain a task planning result. Specifically, the document generation requirement carried by the document generation request can be analyzed to obtain a request analysis result, and a task can be planned based on the request analysis result to obtain a task planning result. The task planning result can include a plurality of sub-tasks, and the plurality of sub-tasks have a clear execution order. Here, the plurality of sub-tasks can include at least one of an input analysis task, a research analysis task, an outline generation task, a content writing task, a chart generation task, and a document merging task.
[0029] In step S103, for each sub-task in the plurality of sub-tasks, an orchestration agent is used to generate a tool module corresponding to the sub-task, to obtain a plurality of tool modules corresponding to the plurality of sub-tasks one by one.
[0030] In the embodiments of the present disclosure, for each of the plurality of sub-tasks, the tool module corresponding thereto can be a sub-agent, can also be a code tool (Tool), and can also simultaneously include a sub-agent and a code tool. The sub-agent can realize relevant processing of the sub-task based on the massive internal knowledge possessed by the sub-agent. The code tool can realize relevant processing of the sub-task through a pre-written code segment. Here, the code tool can be used to execute a certain sub-task, or can be called by the sub-agent in the process of executing the sub-task by the sub-agent.
[0031] In step S104, the plurality of sub-tasks are executed by using the plurality of tool modules to generate the target document.
[0032] In the embodiments of the present disclosure, the orchestration agent can execute the plurality of sub-tasks by calling the plurality of tool modules to generate the target document. Specifically, the orchestration agent can call the plurality of tool modules according to the execution order of the plurality of sub-tasks, execute the plurality of sub-tasks, and generate the target document.
[0033] By using the document generation method provided in the embodiments of the present disclosure, the document generation request can be obtained, and the orchestration agent can be used to obtain the task planning result (the task planning result includes the plurality of sub-tasks) based on the document generation request. Then, for each of the plurality of sub-tasks, the orchestration agent is used to generate the tool module corresponding to the sub-task, so as to obtain the plurality of tool modules corresponding to the plurality of sub-tasks one by one. Then, the plurality of tool modules are used to execute the plurality of sub-tasks to generate the target document. That is, in the embodiments of the present disclosure, the orchestration agent is used to dynamically decompose and plan the document generation request, obtain the task planning result including the plurality of sub-tasks, and generate the special tool module corresponding to each of the plurality of sub-tasks in real time, so as to execute the sub-task. This "on-demand generation and precise configuration" mechanism provides customized professional processing capability for each sub-task, ensures the technical accuracy, logical rigor and consistency of the target document, and thus improves the output quality of the target document. At the same time, based on the mechanism of dynamically generating tool modules, the intelligent document generation system does not need to rely on pre-solidified structural templates or tool modules, and has strong flexibility and expansibility to cope with complex document generation requirements and quickly adapt to new scenarios. Therefore, the automatic generation efficiency of the target document can be significantly improved while ensuring high output quality of the target document, and the applicable range of the intelligent document generation system is improved.
[0034] In some optional embodiments, the "generating the tool module corresponding to the sub-task" in step S103 can include: determining a tool type corresponding to the sub-task; In a case where the tool type corresponding to the subtask includes the agent type, a subagent corresponding to the subtask is generated as the tool module; and / or, in a case where the tool type corresponding to the subtask includes the code type, a code tool corresponding to the subtask is generated as the tool module.
[0035] The tool type corresponding to the subtask can include at least one of the agent type and the code type.
[0036] For example, in a case where the tool type corresponding to the subtask only includes the agent type, a subagent corresponding to the subtask can be generated as the tool module; for another example, in a case where the tool type corresponding to the subtask only includes the code type, a code tool corresponding to the subtask can be generated as the tool module; for yet another example, in a case where the tool type corresponding to the subtask includes both the agent type and the code type, a subagent corresponding to the subtask can be generated, and a code tool corresponding to the subtask can be generated, together as the tool module.
[0037] In addition, as described above, in the embodiments of the present disclosure, the task planning result can include a plurality of subtasks, and the plurality of subtasks explicitly have an execution order. In this regard, in the embodiments of the present disclosure, description information of each subtask in the plurality of subtasks can also be generated in the task planning result, that is, the task planning result can also include the description information of each subtask in the plurality of subtasks.
[0038] The description information can include input description, output description, and execution condition description of the subtask, so as to cover the basic functional requirements of the subtask and explain the expected output result of the subtask. In an example, the input description can include the type, format, source, and the like of the input data; the output description can explicitly indicate the expected output result; and the execution condition description can include the prerequisite conditions required for the execution of the subtask, such as system environment, resource occupation, and the like. These description information not only can provide comprehensive and accurate guidance for subsequent generation of the corresponding tool module, but also can ensure that the generated subagent or code tool accurately completes the respective subtask, so that the subagent or code tool efficiently cooperates in the entire task chain, thereby ensuring the efficiency, accuracy, and continuity of the entire generation process of the target document.
[0039] Based on the above, in the embodiments of the present disclosure, the determination of the tool type corresponding to the subtask can include: obtaining description information of the subtask; in a case where it is determined based on the description information of the subtask that the execution of the subtask needs to rely on cognitive and decision-making capabilities, determining the agent type as the tool type corresponding to the subtask; And / or, in the case of determining, based on the description information of the subtask, that the execution of the subtask involves a predefined external operation process, determining the code type as the tool type corresponding to the subtask.
[0040] Wherein, the cognitive and decision-making ability can be the ability to understand, analyze, and reason about input data, and make reasonable judgments and decisions based on the processing results; the predefined external operation process can include calling a retrieval interface, executing a specific algorithm, accessing an internal system, etc.
[0041] In the above manner, in the embodiments of the present disclosure, the distinction of "tool type" (agent type and / or code type) can be introduced, so that the intelligent document generation system can accurately match the most effective implementation mode according to the internal requirements of the subtask (for example, whether cognitive and decision-making or deterministic functional operation). This dynamic selection mechanism can fully utilize the advantages of agents in complex problem understanding and creative work, while fully utilizing the efficiency and reliability of code tools in executing deterministic and high-precision external operation processes, thereby realizing the optimal configuration of tool resources and the maximization of task execution efficiency in the entire generation process of the target document.
[0042] Moreover, in the embodiments of the present disclosure, when determining the tool type corresponding to the subtask, the essence of the capability requirement of the subtask is accurately identified by analyzing the description information of the subtask, thereby realizing accurate automatic mapping from subtask description to technical implementation form. This not only can effectively reduce the dependence on predefined rules, significantly improve the intelligent level and adaptability of the document generation system, but also can ensure that the generated tool modules (whether sub-agents or code tools) accurately match the specific goals of the subtasks, thereby ensuring the effectiveness and professionalism of subsequent execution links from the source.
[0043] Further, in the embodiments of the present disclosure, "generating a sub-agent corresponding to the subtask" can include: obtaining the description information of the subtask; generating an agent definition based on the description information of the subtask; generating a sub-agent corresponding to the subtask based on the agent definition.
[0044] Wherein, the agent definition includes at least one of the following: Role: definition of the role of the sub-agent (i.e., definition of the identity of the agent) and definition of the specific goal (i.e., definition of the type of task to be executed by the sub-agent), such as "technical document polishing expert", "patent searcher", "outline generation agent", etc., which determines the professional perspective and thinking mode of the sub-agent; Capability boundary: to delineate the "working authority" and "field of vision" of a sub-agent, so as to clarify what the sub-agent can do (for example, which code tools can be called) and what information can be seen (for example, only the chapter data responsible for can be processed), to prevent overreach or information overload; First data structure definition: to specify the standard "data interface" of the sub-agent, that is, to clearly define the format of the input data that the sub-agent can receive and the format of the results that must be output, to ensure seamless connection between different tool modules; Specification requirements: built-in "quality check list" for the format, terminology, style and minimum quality standards that the sub-agent must comply with, to ensure that the output results of the sub-agent meet the unified requirements of the final target document from the beginning; Interaction rules: to set the "collaboration rules" of the sub-agent in multiple tool modules, specifically, to clarify who the sub-agent needs to wait for to complete the work (dependency relationship) and how to communicate with other tool modules (interaction protocol).
[0045] In the embodiment of the present disclosure, after obtaining the description information of the subtask and generating the agent definition based on the description information of the subtask, the underlying strategy model can be instantiated based on the agent definition to obtain an agent instance as a sub-agent corresponding to the subtask, and the state of the sub-agent is marked as "registered" in the agent registration center. The sub-agent and other sub-agents are logically independent and are uniformly scheduled by the arrangement agent.
[0046] In the embodiment of the present disclosure, the standardized and automated definition and generation of sub-agents can be realized in the above manner. Specifically, in the embodiment of the present disclosure, the structured agent definition (including at least one of role description, capability boundary, first data structure definition, specification requirements and interaction rules) can be generated to ensure that each sub-agent has clear and explicit responsibility boundaries and behavior standards. This not only enables the generated sub-agents to be highly specialized, but also establishes clear contracts for the collaborative work of multiple sub-agents, greatly reducing the complexity of communication and collaboration between sub-agents, and ensuring the orderly and efficient operation of complex document generation task flows.
[0047] In the embodiment of the present disclosure, "generating a code tool corresponding to the subtask" can include: Obtaining the description information of the subtask; Generating a code definition based on the description information of the subtask; Generating a code tool corresponding to the subtask based on the code definition.
[0048] The code definition can include at least one of the following: Function signature: the "call format" of a code tool, which can include the function name and parameter list, to define how to call this code tool.
[0049] Second data structure definition: the standard "data interface" of a code tool, that is, to explicitly define what format of input data the code tool can receive and what format of results must be output, to ensure seamless integration between different tool modules.
[0050] In the embodiments of the present disclosure, after generating the code tool corresponding to the subtask based on the code definition, the code tool can be registered in the corresponding running environment for calling by the partial tool module (for example, the sub-agent).
[0051] In an example, "generating the code tool corresponding to the subtask based on the code definition" can include: generating a code segment based on the code definition; testing the code segment to obtain a test result; generating the code tool corresponding to the subtask based on the code segment in a case where the test result represents that the code segment is available.
[0052] The code segment can be, but is not limited to, a tool function (for example, a Python function), an Application Programming Interface (API) encapsulation module, and a script program, which encapsulates the functional logic required to implement the subtask; the automatic writing of the implementation logic of the code segment can include Hyper Text Transfer Protocol (Http) requests, database queries, algorithm calculations, file reading and writing, and the like.
[0053] In the embodiments of the present disclosure, after generating the code segment based on the code definition, the test cases can be constructed by using the orchestration agent to test the code segment to obtain the test result. These test cases can be integrated into an automatically executable test script, which runs the code segment in a test environment and compares the actual output result with the expected output result to obtain the test result. For example, in a case where the actual output result is consistent with the expected output result, the test result representing that the code segment is available is obtained; in a case where the actual output result is inconsistent with the expected output result, the test result representing that the code segment is unavailable is obtained.
[0054] By the above manner, in the embodiment of the disclosure, the code definition including the function signature and the second data structure definition is generated in advance, which lays a solid foundation for the automatic generation of the code tool. The function signature realizes the standardized declaration of the code tool, and the second data structure definition ensures that the internal logic of the code tool can correctly process the formatted input data. This manner makes the generated code tool interface clear, type-safe, easy to integrate and call, and thus can significantly improve the usability, reliability and interoperability with other tool modules of the code tool.
[0055] Moreover, in the embodiment of the disclosure, when the code tool corresponding to the subtask is generated based on the code definition, a post-generation verification step is introduced, specifically, the code segment with syntax errors, logic defects or runtime exceptions can be effectively intercepted by automatically generating test cases and testing the generated code segment, so that only the code segment that passes the test will be used to generate the code tool corresponding to the subtask and put into use, so as to avoid the participation of the defective code tool and cause the failure of the document generation task flow, and improve the success rate of generating the target document.
[0056] In some optional embodiments, the step S104, "generating the target document by executing a plurality of subtasks by using a plurality of tool modules" can include: determining a current module from the plurality of tool modules according to an execution order of the plurality of subtasks; determining a current task corresponding to the current module from the plurality of subtasks; executing the current task by calling the current module to obtain an intermediate result; generating the target document based on the intermediate result.
[0057] In the embodiment of the disclosure, when the current module is called to execute the current task, it can depend on the reference content carried by the document generation request or the output result of another tool module (at this time, the current module and the another tool module have a dependency relationship, specifically, the execution of the current module needs to depend on the output result of the another tool module).
[0058] In an example, "executing the current task by calling the current module to obtain an intermediate result" can include: executing the current task by calling the current module to obtain an initial result; determining a unified data format requirement; performing format conversion on the initial result according to the unified data format requirement to obtain the intermediate result.
[0059] The unified data format requirement can be a first lightweight markup language format (JavaScript Object Notation, JSON) or a second lightweight markup language format (for example, Markdown), and the embodiments of the present disclosure do not make any limitation in this regard.
[0060] In addition, it should be noted that in the embodiments of the present disclosure, the intermediate results can be stored in the data management layer of the intelligent document generation system through the data bus. Based on this, in the embodiments of the present disclosure, when all intermediate results required for generating the target document are obtained and the intermediate results are merged to obtain the target document, a document merging agent (which belongs to a sub-agent) can be called to read the intermediate results from the data management layer and merge the intermediate results to obtain the target document.
[0061] In the above manner, it is clear in the embodiments of the present disclosure that the driving logic of the intelligent document generation system is based on the serial or controlled parallel execution of the planning of the orchestration agent. This "step-by-step advancement according to the plan" ensures that the intelligent document generation system has strict logicality and timing, and is particularly suitable for document generation tasks with strong stage-to-stage dependency. It avoids the confusion of task execution, so that the output results of the upstream tool modules can be passed to the downstream tool modules as clear and reliable input data, ensuring the ordered and accurate transmission of intermediate results in the processing chain, and finally ensuring the key process guarantee of generating a logically coherent and complete target document.
[0062] Moreover, in the embodiments of the present disclosure, when the intermediate results are obtained by calling the current module to execute the current task, a unified data format requirement (for example, JSON, Markdown, etc.) is enforced to establish a common data exchange language within the intelligent document generation system. In this way, the problem of heterogeneous data formats between different modules can be solved, and the standardization of intermediate results in form is achieved. The standardized intermediate results are not only easy to be accurately parsed and used by downstream tool modules, but also greatly facilitate the orchestration agent to monitor the document generation task flow, check the data consistency, and rearrange the tasks, thereby further improving the final generation quality of the target document.
[0063] Further, the document generation method provided by the embodiments of the present disclosure can further include: performing quality detection on the target document to obtain a detection result; destroying the plurality of tool modules in a case where the detection result represents that the target document is available.
[0064] The detection result can be a quality score in a numerical interval [0, 1].
[0065] Based on this, in the embodiments of the present disclosure, in the case that the detection result is less than the preset score threshold, it can be determined that the target document is unavailable, and a new document generation task flow is executed to obtain a new target document; in the case that the detection result is greater than or equal to the preset score threshold, it is determined that the target document is available. The preset score threshold can be set according to application requirements, and the embodiments of the present disclosure do not limit this.
[0066] In addition, it needs to be explained that in the embodiments of the present disclosure, the quality of the target document can be detected from multiple detection dimensions. The multiple detection dimensions can be determined based on the document type of the target document to be generated. For example, when the document type of the target document to be generated is a technical scheme, the multiple detection dimensions can include: Utilization completeness of input sources: whether all reference contents are included in the target document; Technical accuracy: whether the use of core terms is consistent, whether the technical parameters and logical descriptions are accurate and correct, and whether the retrieved authoritative materials are contradictory; Structure and integrity: whether the target document completely follows the outline structure generated by the outline generation instead (belongs to a sub-agent), whether all required chapters, tables, and references are complete, and whether there is content missing or redundancy; Format and standardization: whether the output format of the target document meets the generation requirements of the document format provided by the document generation requirements, and whether it meets the relevant type standards of the target document; Language and readability: through natural language processing technology, the fluency of the target document, the appropriateness of professional terms, and whether there are ambiguities or grammatical errors are evaluated.
[0067] Each detection dimension corresponds to a single detection score, that is, multiple single detection scores corresponding to multiple detection dimensions can be obtained. Based on this, in the embodiments of the present disclosure, in the case that the multiple single detection scores all meet the respective minimum single score requirements, the multiple single detection scores can be weighted to obtain the detection result. The minimum single score requirement corresponding to each single detection score in the multiple single detection scores can be set according to application requirements, and the embodiments of the present disclosure do not limit this.
[0068] In the embodiments of the present disclosure, in the case that the detection result indicates that the target document is available, the multiple tool modules can be destroyed. The destruction of the multiple tool modules can be regarded as a systematic resource recycling and cleaning process, which is initiated and monitored by the orchestration agent. Specifically, it can include: Deregistration of sub-agents: for sub-agents, the intelligent document generation system can send a termination instruction to them, end their background processes or sessions, and mark their states as "destroyed" in the agent registry, releasing the model computing resources and context memory they occupy; Execution environment cleanup: for code tools, the intelligent document generation system can remove their definitions from the runtime environment in which they are registered, dereference them so that they can be recycled by the garbage collection mechanism; at the same time, clean up temporary files or caches that may be generated during their execution; Permission and interface recycling: simultaneously, the permissions and interface bindings of multiple tool modules that are called by the intelligent document generation system are synchronized and released, ensuring that subsequent tasks do not incorrectly call destroyed tool modules.
[0069] In this way, in the embodiments of the present disclosure, the closed-loop management of the task life cycle can be achieved, the quality assurance of the finally generated target document is provided, and the graceful release of the resources of the intelligent document generation system is taken into account, which embodies the resource management awareness of the intelligent document generation system, avoids resource leakage caused by the constant presence of temporarily generated and task-specific computing entities in memory, improves data security, ensures that the intelligent document generation system can run stably and efficiently for a long time, and is ready to process new document generation requests at any time, which has good engineering practice value; moreover, before destroying the multiple tool modules, a quality detection step for the target document is introduced to ensure that the finally produced target document meets the preset standards, improving the direct usability of the target document and reducing the cost of manual review.
[0070] In the following, the document generation method provided by the embodiments of the present disclosure will be further described in three parts.
[0071] I. Scheme overview The intelligent document generation system takes an orchestration agent (also known as a meta-agent) as the core, and completes the whole process from the document generation request to the output of the target document through the dynamic generation, configuration and orchestration of multiple tool modules (including sub-agents and code tools).
[0072] Core idea: at the engineering implementation level, only one orchestration agent with a long life cycle (i.e., always present) is retained, and other sub-agents and code tools are automatically generated, registered and destroyed by the orchestration agent on demand at runtime. That is, the intelligent document generation system logically represents a multi-agent collaboration, but in implementation it is essentially a "evolvable multi-agent system driven by an orchestration agent".
[0073] Basic flow: (1) Obtain the document generation request sent by the user.
[0074] (2) The scheduling agent parses the document generation request to obtain a request analysis result, and plans a task based on the request analysis result to obtain a task planning result (i.e., a scheduling plan), including a plurality of subtasks and the plurality of subtasks having a clear execution order.
[0075] (3) The scheduling agent automatically generates a plurality of tool modules corresponding to the plurality of subtasks based on the task planning result. The plurality of tool modules can include subagents and / or code tools, and the plurality of tool modules have respective targets and dependency relationships. Here, the code tools can be used to execute a certain subtask, or can be called by a subagent during execution of the subtask by the subagent.
[0076] (4) The scheduling agent coordinates the execution order and concurrency relationship of the plurality of tool modules according to the clear execution order of the plurality of subtasks, uniformly manages the format and state of intermediate results, and drives the tool modules to complete input analysis, technical research, outline design, content writing, chart generation, and document merging.
[0077] (5) The scheduling agent performs quality inspection and adjustment on the intermediate results and the target document based on a preset quality inspection strategy, to ensure that the finally generated target document meets the target format and quality requirements.
[0078] Through the above design, in the embodiment of the disclosure, the "multi-tool module scheduling" and "multi-tool module generation" capabilities are introduced without increasing the number of underlying models, so that the intelligent document generation system is significantly superior to the traditional scheme in terms of professional depth, flexibility, and scalability.
[0079] Core technical features: (1) Multi-tool module scheduling architecture with a scheduling agent as the core The embodiment of the disclosure introduces a long-life scheduling agent, which has the capabilities of request analysis, task planning, tool module generation, and global state management. Its core responsibilities include: Analyzing the document generation request sent by the user, i.e., task-level understanding and decomposition; Planning a plurality of subtasks (i.e., multi-tool modules) for collaboration topology (including execution order, parallel relationship, and dependency relationship); Defining the responsibilities, input-output contracts, and constraint conditions of each subagent; Deciding the calling strategy of the code tool and the binding mode of the code tool and the subagent; Uniformly monitoring the execution progress and output quality of the tool modules, and dynamically rearranging when necessary.
[0080] In the embodiments of the present disclosure, the orchestration agent is not only responsible for scheduling, but also responsible for "defining" and "evolving" multi-tool modules, realizing the upgrade from "multi-agent cooperation" to "orchestrable multi-tool modules (including sub-agents)".
[0081] (2) Automatic generation mechanism of sub-agents and code tools (driven by orchestration agent and based on code implementation) Key points: The orchestration agent automatically generates sub-agents and code tools at runtime, rather than relying on manual pre-writing and static registration. Specifically, it includes: Generation of sub-agents: The orchestration agent generates corresponding sub-agents for sub-tasks that need to be executed by sub-agents based on task planning results. Specifically, the description information of the sub-task can be obtained, and based on the description information of the sub-task, an agent definition is generated, and based on the agent definition, a sub-agent corresponding to the sub-task is generated. The agent definition includes at least one of the following: Role description: Definition of the role of the sub-agent (i.e., definition of the identity of the agent) and the definition of a specific goal (i.e., definition of the type of task to be executed by the sub-agent), such as "technical document polishing expert", "patent searcher", "outline generation agent", etc., which determines the professional perspective and thinking mode of the sub-agent; Capability boundary: Define the "work authority" and "field of view" of the sub-agent to clearly define what the sub-agent can do (e.g., which code tools can be called) and what information can be seen (e.g., only the chapter data it is responsible for can be processed), to prevent overreach or information overload; First data structure definition: Define the standard "data interface" of the sub-agent, i.e., clearly define what format of input data the sub-agent can receive and what format of results it must output, to ensure seamless integration between different tool modules; Specification requirements: Built-in "quality check list" that represents the format, terminology, style, and minimum quality standards that the sub-agent must comply with to ensure that the output of the sub-agent meets the unified requirements of the final target document from the beginning; Interaction rules: Set "collaboration rules" for sub-agents in multiple tool modules. Specifically, it can be clear who the sub-agent needs to wait for to complete the work (dependency relationship) and how to communicate with other tool modules (interaction protocol).
[0082] After obtaining the description information of the subtask and generating the agent definition based on the description information of the subtask, the underlying policy large model can be instantiated based on the agent definition to obtain an agent instance as a sub-agent corresponding to the subtask, and the state thereof is marked as "registered" in the agent registration center. The sub-agent and other sub-agents are logically independent and are uniformly scheduled by the arrangement agent.
[0083] Generation of code tools: The arrangement agent generates corresponding code tools for subtasks involving predefined external operation processes based on the task planning result. Specifically, the description information of the subtask can be obtained, and the code definition can be generated based on the description information of the subtask. Then, the code segment can be generated based on the code definition, and the code segment can be tested to obtain the test result. If the test result indicates that the code segment is available, the code tool corresponding to the subtask can be generated based on the code segment. The code definition includes at least one of the following: The code definition can include at least one of the following: Function signature: The "call format" of the code tool, which can include the function name and the parameter list, is used to define how to call this code tool.
[0084] Second data structure definition: The standard "data interface" of the code tool is specified, that is, it is clearly defined that the code tool can receive input data in what format and must output results in what format, to ensure that different tool modules can be seamlessly connected.
[0085] After generating the code tool corresponding to the subtask based on the code definition, the code tool can be registered in the corresponding running environment for calling by part of the tool modules (for example, sub-agents) Through the above design, in the embodiment of the disclosure, the technical implementation is "only one arrangement agent + a set of automatically generated sub-agents and / or tool codes", and the essence is to realize the construction of a self-booting multi-tool module system.
[0086] (3) Standardized arrangement process and structured data transmission mechanism On the basis of multi-tool module arrangement, the disclosure HIA defines a unified arrangement process and data interface specification, including: Phased arrangement process: document generation request addition, task planning, generation and registration of sub-agents, generation and registration of code tools, collaborative execution, quality detection, and achievement delivery, etc. Unified intermediate result model: The intermediate results such as technical elements, literature analysis results, outline structure, paragraph content, and chart description are output in a unified data format (for example, JSON, Markdown, etc.). Central "data bus" mechanism: All tool modules can read and write intermediate results at the data management layer through standardized data structures, and the orchestration agent is responsible for consistency maintenance and version management.
[0087] Unlike the traditional "point-to-point data transmission" approach, this embodiment improves the efficiency and traceability of data transmission under the arrangement of multiple tool modules by superimposing a "unified intermediate result model" with a "central 'data bus' mechanism".
[0088] II. Detailed Explanation of the Plan Intelligent Proxy Architecture Design Please combine Figure 2 In this embodiment of the disclosure, the intelligent document generation system includes an orchestration agent.
[0089] In one example, the sub-intelligents dynamically instantiated by the orchestration agent include an input parsing agent, a research analysis agent, an outline generation agent, a summary writing agent, a content writing agent, a chart generation agent, and a document merging agent.
[0090] Among them, the orchestration agent is the core component of the intelligent document generation system. It has a global perspective and self-description capability. Its main functions include parsing document generation requests, task planning, generating multiple tool modules (including sub-agents and / or code tools), scheduling tool modules to execute corresponding sub-tasks and quality checks. For details, please refer to the relevant descriptions above, which will not be repeated here.
[0091] For example, multiple tool modules include the following sub-agents: (1) Input parsing proxy The input parsing agent is automatically generated by the orchestration agent, and its definition (agent definition) and the code tools to be invoked are configured by the orchestration agent.
[0092] The input parsing agent serves as the entry point for the entire intelligent document generation system. It is responsible for performing deeper parsing and structured processing of user-provided document generation requests (including document generation requirements and reference content). The input parsing agent employs multi-layered text analysis techniques, including advanced methods such as syntax analysis, semantic understanding, entity recognition, and relation extraction, to extract key technical information from the reference content. Specifically, the input parsing agent utilizes a first-level deep learning model (hereinafter referred to as the understanding model) to identify core elements such as technical concepts, innovations, application scenarios, and technological advantages, constructing a complete technical information graph.
[0093] The core processing flow of the input analysis agent includes: preprocessing the document generation requirements and reference content, including text cleaning, format standardization, language detection and other basic operations; using an encoder model (for example, a Transformer architecture encoder model) to perform deep semantic understanding on the document generation requirements and reference content, identify technical entities and concepts therein; through a relation extraction algorithm, establish logical relationships between technical concepts, construct a technical knowledge graph as the analysis result; structure the analysis result according to a predefined data model, generate a standardized first intermediate result, and store it in the data management layer to provide a basis for the processing of subsequent other agents.
[0094] In addition, in the embodiments of the present disclosure, the input analysis agent is designed with a customized understanding model tailored to the characteristics of technical documents. The understanding model is pre-trained on large-scale technical document data and has strong technical concept recognition and professional understanding capabilities. At the same time, the input analysis agent also integrates an adaptive learning mechanism that can continuously optimize the understanding effect based on user feedback.
[0095] (2) Research and analysis agent The research and analysis agent is automatically generated by the orchestration agent, and its definition (agent definition) and the code tools to be called are configured by the orchestration agent.
[0096] The research and analysis agent focuses on the retrieval, analysis and summary of related technical literature, providing professional technical background and theoretical support for the generation of target documents as a second intermediate result. The research and analysis agent integrates multiple search engines and professional database interfaces, and can automatically retrieve relevant patent documents, academic papers, technical reports and industry standards based on the first intermediate result provided by the input analysis agent. During the retrieval process, intelligent keyword expansion and semantic matching techniques can be used to ensure the comprehensiveness and accuracy of the retrieval results.
[0097] The core functions of the research and analysis agent include: intelligent retrieval strategy generation, literature relevance analysis and key technology point extraction. In terms of retrieval strategy generation, the research and analysis agent can automatically construct multi-dimensional retrieval expressions based on the technical keywords obtained from the input analysis, including synonym expansion, hyponym retrieval, technical field limitation and other strategies; in terms of literature relevance analysis, the research and analysis agent can use a second deep learning model to score the semantic relevance of the retrieved literature and select the most relevant high-quality materials; in terms of technology point extraction, the research and analysis agent can extract key technical information from relevant literature through natural language processing techniques, including technical principles, implementation methods, application effects and other important content.
[0098] The technical feature of the research and analysis agent lies in the establishment of an analysis model specially for technical literature, which can accurately understand the professional content and logical structure of technical literature, extract the most valuable information for document generation, and at the same time support the processing of multilingual literature and cross-language information integration, and can obtain valuable information from global technical resources.
[0099] (3) Outline generation agent The outline generation agent is automatically generated by the orchestration agent, and its definition (agent definition) and the code tools to be called are configured by the orchestration agent.
[0100] The outline generation agent is responsible for designing the overall structural framework of the target document, ensuring the logical hierarchy of technical content is clear and the chapter arrangement is reasonable. Based on the first intermediate file and the second intermediate result, the outline generation agent automatically designs an outline structure that conforms to the technical document specification as the third intermediate result. The outline generation agent has a built-in template library for multiple document types, including standard templates for technical solution design, system architecture description, project delivery document, etc., and can select the most suitable document structure according to the technical characteristics. The design principles of the outline generation agent include logical integrity, hierarchical clarity, content balance, and compliance with specifications. In terms of logical integrity, the outline generation agent can ensure that the outline covers all important technical elements without missing key content; in terms of hierarchical clarity, the outline generation agent can design a reasonable chapter hierarchy to ensure the orderly unfolding of technical content; in terms of content balance, the outline generation agent can reasonably allocate the content proportion of each chapter to avoid some chapters being too long or too brief; and in terms of compliance with specifications, the outline generation agent can strictly follow the standard formats and industry conventions of relevant document types.
[0101] The technical innovation of the outline generation agent lies in the use of a structure design algorithm based on graph neural networks, which can analyze the logical relationships between technical elements and automatically generate the optimal document structure. The agent also supports personalized customization, allowing users to adjust the outline structure and content distribution according to specific needs.
[0102] (4) Abstract writing agent The abstract writing agent is automatically generated by the orchestration agent, and its definition (agent definition) and the code tools to be called are configured by the orchestration agent.
[0103] The abstract writing agent focuses on condensing the core content and innovation points of technical documents and generating concise and accurate technical abstracts. Based on the first intermediate result and the second intermediate result, the agent identifies the core points, main technical advantages, and important application values of the reference content, uses highly condensed language to express professional technical abstracts, and generates a fourth intermediate result. The abstract writing agent pays special attention to the professionalism, accuracy, and conciseness of the abstract, ensuring that the core value of the technical solution is fully conveyed within a limited space.
[0104] The writing strategy of the abstract writing agent includes the innovation point priority principle, the technical logic clarity principle, and the professional term specification principle. In terms of innovation point priority, the abstract writing agent highlights the innovation and breakthrough of the technical solution and its advantages over existing technology; in terms of technical logic clarity, the abstract writing agent ensures that the logical hierarchy of the abstract content is clear, making it easy for readers to quickly understand the technical solution; in terms of professional term specification, the abstract writing agent uses standardized professional terms to ensure the accuracy and professionalism of the expression.
[0105] The technical feature of the abstract writing agent is to establish a special technical abstract generation model, which is trained on a large amount of high-quality technical abstract data and has strong content condensation and expression capabilities. At the same time, the abstract writing agent also integrates a consistency checking mechanism to ensure the consistency of the abstract content with the main text content.
[0106] (5) Content writing agent The content writing agent is automatically generated by the arrangement intelligent agent, and its definition (intelligent agent definition) and code tools to be called are configured by the arrangement intelligent agent.
[0107] The content writing agent is the core content generation module of the intelligent document generation system, responsible for writing detailed technical document content based on the second intermediate result and the third intermediate result. Based on the technical information obtained through input analysis, research and analysis of the second intermediate result and the third intermediate result, the content writing agent generates complete, professional, and standardized technical document content as the fifth intermediate result. The content writing agent pays special attention to the accuracy, completeness, and professionalism of technical description, ensuring that the generated fifth intermediate result meets the professional standards of technical documents.
[0108] The writing strategy of the content writing agent includes technical detail expansion, logical structure development, professional term unification, and content quality assurance. In terms of technical detail expansion, the content writing agent can supplement the reference content provided by the user with reasonable details based on technical logic and industry common sense, making the technical content more complete and perfect. In terms of logical structure development, the content writing agent can develop the content according to the logical hierarchy of the outline design, ensuring the organic connection between chapters. In terms of professional term unification, the content writing agent can ensure the consistent use of professional terms throughout the text to avoid conceptual confusion. In terms of content quality assurance, the content writing agent can ensure the technical accuracy and logical consistency of the generated content through multiple verification mechanisms.
[0109] The content writing agent is implemented based on a generation model specifically designed for technical documents, which deeply integrates natural language generation technology and professional knowledge graph, and can generate technical content that is both professional and accurate and logically clear. The content writing agent can also support the generation of multiple types of technical documents, including technical solution design, system architecture description, and project delivery documents.
[0110] (6) Chart generation agent The chart generation agent is automatically generated by the orchestration agent, and its definition (agent definition) and the code tools to be called are configured by the orchestration agent.
[0111] The chart generation agent is responsible for creating professional technical architecture diagrams, flowcharts, and schematics to provide intuitive visual support for the target document. Based on the fifth intermediate result, the chart generation agent automatically designs and generates corresponding technical charts (including system architecture diagrams, workflow diagrams, module relationship diagrams, data flow diagrams, etc.) as the sixth intermediate content. The chart generation agent places special emphasis on the professionalism, clarity, and aesthetics of the charts, ensuring that the generated charts can accurately convey the architecture and flow of the technical solution.
[0112] The chart generation process of the chart generation agent includes chart type identification, chart structure design, graphical element drawing, and chart beautification optimization. In terms of chart type identification, the chart generation agent can automatically select the most suitable chart type based on the characteristics of the technical content. In terms of chart structure design, the chart generation agent can design a reasonable chart layout and element arrangement. In terms of graphical element drawing, the agent uses standardized graphical symbols and connection lines to draw the chart. In terms of chart beautification optimization, the chart generation agent can adjust the color, font, and layout of the chart to improve its aesthetics and readability.
[0113] The chart generation agent can generate technical charts that meet professional standards by establishing a specialized technical chart design knowledge base that contains a large number of standardized chart templates and design specifications. The agent can support chart output in chart drawing languages (e.g., Mermaid) format, facilitating direct use and editing in target documents (e.g., target documents in Markdown format).
[0114] (7) Document merging agent The document merging sub-intelligent is automatically generated by the orchestration intelligent agent, and the definition (intelligent agent definition) and code tools that need to be called are configured by the orchestration intelligent agent.
[0115] The document merging agent is the final processing module of the intelligent document generation system, responsible for integrating the output content of each agent (i.e., each intermediate result) to generate a complete target document. The document merging agent receives the first intermediate result (the parsing result provided by the input parsing agent), the second intermediate result (the technical background and theoretical support provided by the research analysis agent), the third intermediate result (the outline structure provided by the outline generation agent), the fourth intermediate result (the technical abstract provided by the abstract writing agent), the fifth intermediate result (the technical document content provided by the content writing agent), and the sixth intermediate result (the technical chart provided by the chart generation agent), and integrates these intermediate results according to self-determination, or according to pre-defined templates and formats, to generate the target document.
[0116] The merging process of the document merging agent includes content integration, format standardization, term unification, quality inspection, and output optimization. In terms of content integration, the document merging agent can organically integrate the output content of each module according to the outline structure; in terms of format standardization, the document merging agent can adjust the format according to the format requirements of the target document type; in terms of term unification, the document merging agent can check and unify the use of professional terms throughout the text; in terms of quality inspection, the document merging agent can perform multi-level quality verification, including content integrity, logical consistency, format specification, etc.; in terms of output optimization, the document merging agent can perform final optimization adjustment on the document to ensure the professionalism and aesthetics of the output document.
[0117] The document merging agent can effectively guarantee the quality and consistency of the output document due to the establishment of a specialized quality control mechanism and term management system. The document merging agent can also support multiple output formats (including Markdown, Word, PDF) to meet the needs of different users.
[0118] Please refer to Figure 3 The document generation method provided by the embodiments of the present disclosure can include the following relatively complete process: (1) Obtain a document generation request.
[0119] The document generation request can carry a document generation requirement and reference content.
[0120] (2) Task planning The task planning result is obtained based on the document generation request by using the arrangement agent.
[0121] The task planning result can include a plurality of subtasks, and the plurality of subtasks have a clear execution order.
[0122] (3) For each subtask in the plurality of subtasks, a tool module corresponding to the subtask is generated by using the arrangement agent, to obtain a plurality of tool modules corresponding to the plurality of subtasks one by one.
[0123] It is detected whether the plurality of tool modules are generated, and in a case where the plurality of tool modules are generated within a preset waiting time, process (4) is entered; in a case where the plurality of tool modules are not generated within the preset waiting time, the user is returned or manual intervention is triggered. The preset waiting time can be set according to application requirements, and the embodiments of the present disclosure do not limit this.
[0124] (4) Environment preparation For example, a work target and a log are created, and a data bus and a configuration file are initialized.
[0125] (5) Enter the execution phase of the tool module Exemplarily, the plurality of tool modules include an input analysis agent, a research analysis agent, an outline generation agent, an abstract writing agent, a content writing agent, a chart generation agent, and a document merging agent.
[0126] The input analysis agent is the entrance of the entire intelligent document generation system, which is responsible for deeper analysis and structured processing of the document generation request (including a document generation requirement and reference content) provided by the user, to obtain a first intermediate result.
[0127] The research analysis agent focuses on retrieval, analysis and summary of related technical literature, and provides professional technical background and theoretical support for generation of the target document as a second intermediate result.
[0128] The outline generation agent is responsible for designing the overall structure framework of the target document, ensuring that the logical level of technical content is clear and the chapter arrangement is reasonable. The outline generation agent automatically designs an outline structure conforming to the technical document specification based on the first intermediate file and the second intermediate result, as a third intermediate result.
[0129] The abstract writing agent focuses on condensing the core content and innovation points of the technical document and generating a concise and accurate technical abstract. Based on the first intermediate result and the second intermediate result, the agent identifies the core points, main technical advantages, and important application values of the reference content, and generates a professional technical abstract using highly condensed language as the fourth intermediate result.
[0130] The content writing agent is the core content generation module of the intelligent document generation system, responsible for writing detailed technical document content based on the second intermediate result and the third intermediate result. Based on the technical information obtained through input analysis, the agent analyzes the second intermediate result and the third intermediate result to generate complete, professional, and standardized technical document content as the fifth intermediate result.
[0131] The chart generation agent is responsible for creating professional technical architecture diagrams, flowcharts, and schematics to provide intuitive visual support for the target document. Based on the fifth intermediate result, the agent automatically designs and generates corresponding technical charts (including system architecture diagrams, workflow diagrams, module relationship diagrams, data flow diagrams, etc.) as the sixth intermediate content.
[0132] The document merging agent is the final processing module of the intelligent document generation system, responsible for integrating the output content of each agent (i.e., each intermediate result) to generate a complete target document. The document merging agent receives the first intermediate result (the analysis result provided by the input analysis agent), the second intermediate result (the technical background and theoretical support provided by the research analysis agent), the third intermediate result (the outline structure provided by the outline generation agent), the fourth intermediate result (the technical abstract provided by the abstract writing agent), the fifth intermediate result (the technical document content provided by the content writing agent), and the sixth intermediate result (the technical charts provided by the chart generation agent), and integrates these intermediate results according to self-determined or pre-defined templates and formats to generate the target document.
[0133] (6) Document inspection After the execution of multiple tool modules is completed, quality detection is performed on the target document to obtain a detection result.
[0134] Among them, in the case of passing the inspection result, i.e., indicating that the target document is usable, the achievement delivery process is entered; in the case of passing the inspection result, i.e., indicating that the target document is not usable, the error handling and rearrangement process is entered.
[0135] (7) Achievement delivery process That is, the target document is output.
[0136] (8) Error handling and rearrangement process In the error handling and rearrangement process, problem localization analysis, redefinition or structural adjustment of sub-agents, repair or regeneration of tool code, etc. operations can be performed. These operations can be performed by the arrangement agent.
[0137] III. Technical Effects: Effect 1: Significantly improve the quality of target document generation Technical advantages: The embodiments of the present disclosure realize a significant improvement in the quality of technical documents through the division of labor of specialized agents. Each tool module (e.g., sub-agent) focuses on a specific processing link, ensuring that each intermediate result has sufficient professional depth and technical accuracy. Compared with the end-to-end generation method based on a single model in the traditional solution, specialized tool modules can achieve higher professional standards in their respective fields, thereby ensuring the overall quality of the target document generation.
[0138] Implementation: The embodiments of the present disclosure solve the quality instability problem through the division of labor of specialized agents. Specifically, the input analysis agent is responsible for technical understanding, ensuring accurate understanding of user input; the research analysis agent focuses on technical literature retrieval, providing professional technical background and theoretical support; the content writing agent is responsible for technical content generation, ensuring the accuracy and professionalism of technical description. Through this specialized division of labor, each processing link reaches an expert-level professional standard.
[0139] Effect 2: Significantly improve document generation efficiency Technical advantages: The embodiments of the present disclosure realize a significant improvement in document generation efficiency through the collaborative work of tool modules. Compared with the manual writing method in the traditional solution, the intelligent document generation system can complete the writing of technical documents that would take days or even weeks in a few hours. At the same time, through standardized processes and automated processing, the need for human intervention is greatly reduced, improving overall work efficiency.
[0140] Implementation: The embodiments of the present disclosure improve document generation efficiency through multi-tool module (e.g., sub-agent) parallel processing and intelligent workflow management. Each tool module can work in a pipeline manner in parallel, for example, after input analysis is completed, research analysis and outline design can be performed in parallel, and content writing and chart generation can also be performed in parallel. The intelligent document generation system also integrates intelligent progress management and error handling mechanisms, which can automatically monitor the execution status of each tool module, timely detect and handle problems, and avoid the workload of manual monitoring.
[0141] Effect 3: Ensure document format specification Technical advantages: The embodiments of the present disclosure can ensure the format specification and structure rationality of the generated document through standardized templates and specification processing. The intelligent document generation system has built-in standard templates for various technical document types, strictly follows industry specifications and format requirements, and ensures that the generated document meets the standards of formal documents.
[0142] Implementation: The embodiments of the present disclosure ensure document specification through template driving and format standardization. The outline generation agent designs the document structure based on standard templates, ensuring that the chapter division and content arrangement meet the specifications; the document merging agent performs format standardization and standardization processing, including title format, paragraph indentation, chart numbering, reference literature, and other element standardization processing. The intelligent document generation system also integrates an automated format checking mechanism to ensure that the output document fully meets the predefined format standards.
[0143] Effect four: support content intelligent extension Technical advantages: The embodiments of the present disclosure can generate detailed and complete technical documents based on the concise technical description provided by the user through intelligent content understanding and extension mechanism. The intelligent document generation system has strong technical background knowledge and reasoning ability, and can reasonably extend and supplement based on technical logic, ensuring the richness and completeness of the generated content.
[0144] Implementation: The embodiments of the present disclosure realize content extension through multi-level intelligent processing. For example, the input analysis agent deeply understands the technical concepts and innovation points of the user input; the research analysis agent provides relevant technical background and best practices; the content writing agent reasonably supplements details based on technical logic and industry common sense. The intelligent document generation system also establishes a special knowledge base and reasoning engine, which can generate extension content consistent with technical logic based on existing information.
[0145] Summary of comprehensive effects In summary, the document generation method provided by the embodiments of the present disclosure can realize significant technical progress in document generation quality, efficiency, specification, and intelligence through professional agent collaboration, standardized workflow, intelligent content extension, and multi-level quality control, effectively solving the problems of insufficient professional depth, low collaboration efficiency, non-standard format, and limited content extension capability in traditional solutions, providing strong technical support for enterprise technical innovation and document writing.
[0146] Please refer to Figure 4 , an application scenario diagram of a document generation method provided by the embodiments of the present disclosure.
[0147] The document generation method provided by the embodiments of the present disclosure is applied to an electronic device. The electronic device can be a server or a terminal device. Here, the terminal device can be a workstation, a large computer, a general computer or other similar computing devices.
[0148] Here, the electronic device is configured to: obtain a document generation request; obtain a task planning result based on the document generation request by using an orchestration agent. The task planning result includes a plurality of sub-tasks; for each sub-task in the plurality of sub-tasks, generate a tool module corresponding to the sub-task by using the orchestration agent, to obtain a plurality of tool modules corresponding to the plurality of sub-tasks one by one; execute the plurality of sub-tasks by using the plurality of tool modules, and generate a target document.
[0149] It should be noted that in the embodiments of the present disclosure, Figure 4 the application scenario diagram shown is only illustrative and not limiting, and those skilled in the art can make various obvious changes and / or replacements based on the examples, and the technical solutions obtained still belong to the disclosure range of the embodiments of the present disclosure. Figure 4
[0150] In order to better implement the foregoing document generation method, the embodiments of the present disclosure further provide a document generation device which can be integrated into an electronic device. The electronic device can be a server or a terminal device. Here, the terminal device can be a workstation, a large computer, a general computer or other similar computing devices. In the following, a document generation device 500 provided by the embodiments of the present disclosure will be described in conjunction with the illustrative structure block diagram shown in the accompanying drawings. Figure 5
[0151] The document generation device 500 comprises: a request obtaining unit 501 configured to obtain a document generation request; a task planning unit 502 configured to obtain a task planning result based on the document generation request by using an orchestration agent. The task planning result includes a plurality of sub-tasks; a tool module generating unit 503 configured to, for each sub-task in the plurality of sub-tasks, generate a tool module corresponding to the sub-task by using the orchestration agent, to obtain a plurality of tool modules corresponding to the plurality of sub-tasks one by one; a document generating unit 504 configured to execute the plurality of sub-tasks by using the plurality of tool modules, and generate a target document.
[0152] In some optional embodiments, the tool module generating unit 503 is configured to: determine a tool type corresponding to the subtask; wherein the tool type is an agent type or a code type; in a case where the tool type corresponding to the subtask is the agent type, generate a sub-agent corresponding to the subtask as the tool module; and / or, in a case where the tool type corresponding to the subtask is the code type, generate a code tool corresponding to the subtask as the tool module.
[0153] In some optional embodiments, the tool module generation unit 503 is configured to: obtain description information of the subtask; in a case where it is determined, based on the description information of the subtask, that the execution of the subtask needs to rely on cognitive and decision-making capabilities, determine the agent type as the tool type corresponding to the subtask; and / or, in a case where it is determined, based on the description information of the subtask, that the execution of the subtask involves a pre-defined external operation process, determine the code type as the tool type corresponding to the subtask.
[0154] In some optional embodiments, the tool module generation unit 503 is configured to: obtain description information of the subtask; generate an agent definition based on the description information of the subtask; wherein the agent definition comprises at least one of a role description, a capability boundary, a first data structure definition, a normative requirement, and an interaction rule; generate a sub-agent corresponding to the subtask based on the agent definition.
[0155] In some optional embodiments, the tool module generation unit 503 is configured to: obtain description information of the subtask; generate a code definition based on the description information of the subtask; wherein the code definition comprises at least one of a function signature and a second data structure definition; generate a code tool corresponding to the subtask based on the code definition.
[0156] In some optional embodiments, the tool module generation unit 503 is configured to: generate a code segment based on the code definition; wherein the code segment encapsulates a functional logic required to implement the subtask; test the code segment to obtain a test result; in a case where the test result represents that the code segment is available, generate a code tool corresponding to the subtask based on the code segment.
[0157] In some optional embodiments, the document generation unit 504 is configured to: determine a current module from the plurality of tool modules according to an execution order of the plurality of subtasks; determine a current task corresponding to the current module from the plurality of sub-tasks; execute the current task by invoking the current module to obtain an intermediate result; generate the target document based on the intermediate result.
[0158] In some optional embodiments, the document generation unit 504 is configured to: execute the current task by invoking the current module to obtain an initial result; determine a unified data format requirement; perform format conversion on the initial result according to the unified data format requirement to obtain the intermediate result.
[0159] In some optional embodiments, the document generation apparatus 500 further includes: a quality detection unit configured to perform quality detection on the target document to obtain a detection result; a tool destruction unit configured to destroy the plurality of tool modules in a case where the detection result indicates that the target document is available.
[0160] In the embodiments of the present disclosure, the specific functions and examples of each unit in the document generation apparatus 500 can be referred to the related descriptions of the corresponding steps in the foregoing document generation method embodiments, which will not be described here.
[0161] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information involved comply with relevant laws and regulations and do not violate public order and good customs.
[0162] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.
[0163] Figure 6 A schematic structural block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device 600 is intended to represent various forms of digital computers, such as a vehicle-mounted computing device, a laptop computer, a desktop computer, a workstation, a personal digital assistant, a server, a blade server, a mainframe computer, and other appropriate computing devices. The electronic device 600 can also represent various forms of mobile devices, such as a personal digital assistant, a cellular telephone, a smart phone, a wearable device, and other similar computing devices. The components shown here, their connections, and their functions, as well as their relationships with one another, are merely examples and are not intended to limit the implementations of the present disclosure described and / or claimed herein.
[0164] As Figure 6As shown, the electronic device 600 includes a computing unit 601 that can perform various appropriate actions and processes in accordance with a computer program stored in a Read-Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An Input / Output (I / O) interface 605 is also connected to the bus 604.
[0165] A plurality of components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, e.g., a keyboard, a mouse, etc., an output unit 607, e.g., various types of renderers, speakers, etc., a storage unit 608, e.g., a magnetic disk, an optical disk, etc., and a communication unit 609, e.g., a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0166] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various special-purpose Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Process (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the methods and processes described above, e.g., the document generation method. For example, in some embodiments, the document generation method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, e.g., the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the document generation method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured as the document generation method by any other appropriate means, e.g., by means of firmware.
[0167] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a System on Chip (SOC), a Complex Programmable Logic Device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0168] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general or special purpose computer, or other programmable data processing apparatus, to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as part of a separate software package, and partially on a remote machine or server.
[0169] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0170] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a rendering device (e.g., a Cathode Ray Tube (CRT) or a Liquid Crystal Display (LCD) monitor for
[0171] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0172] The computer system can include a user terminal and a server. The user terminal and the server are generally remote from each other and typically interact through a communication network. The relationship of user terminal and server is formed by the computer programs running on the respective computers and having a user terminal-server relationship with each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0173] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the document generation method.
[0174] The embodiments of the present disclosure further provide a computer program product comprising a computer program, which, when executed by a processor, implements the document generation method.
[0175] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, the steps described in the present disclosure can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, which is not limited herein. In addition, in the present disclosure, relationship terms such as "first", "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. In addition, in the present disclosure, "a plurality of" can be understood as at least two.
[0176] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A document generation method, comprising: Get the document generation request; Using an orchestration agent, a task planning result is obtained based on the document generation request; wherein, the task planning result includes multiple sub-tasks; For each of the multiple subtasks, the orchestration agent is used to generate a tool module corresponding to the subtask, so as to obtain multiple tool modules that correspond one-to-one with the multiple subtasks. The multiple tool modules are used to execute the multiple sub-tasks and generate the target document.
2. The method according to claim 1, wherein, The tool module for generating the subtask includes: Determine the tool type corresponding to the subtask; wherein the tool type includes at least one of agent type and code type; If the tool type corresponding to the subtask includes the agent type, a sub-agent corresponding to the subtask is generated as the tool module; And / or, if the tool type corresponding to the subtask includes the code type, generate a code tool corresponding to the subtask as the tool module.
3. The method according to claim 2, wherein, Determining the tool type corresponding to the subtask includes: Obtain the description information of the subtask; Based on the description information of the sub-task, if it is determined that the execution of the sub-task requires cognitive and decision-making abilities, the agent type is determined to be the tool type corresponding to the sub-task; And / or, if, based on the description information of the subtask, it is determined that the execution of the subtask involves a predefined external operation process, the code type is determined to be the tool type corresponding to the subtask.
4. The method according to claim 2, wherein, The generation of the sub-agent corresponding to the sub-task includes: Obtain the description information of the subtask; Based on the description information of the sub-task, an agent definition is generated; wherein, the agent definition includes at least one of role description, capability boundary, first data structure definition, normative requirements, and interaction rules; Based on the agent definition, the sub-agent corresponding to the sub-task is generated.
5. The method according to claim 2, wherein, The tool for generating code corresponding to the subtask includes: Obtain the description information of the subtask; Based on the description information of the subtask, a code definition is generated; wherein the code definition includes at least one of a function signature and a second data structure definition; Based on the code definition, generate the code tool corresponding to the subtask.
6. The method according to claim 5, wherein, The method for generating the code tool corresponding to the subtask based on the code definition includes: Based on the code definition, a code segment is generated; wherein the code segment encapsulates the functional logic required to implement the subtask; The code segment was tested, and the test results were obtained. If the test results indicate that the code segment is usable, the code tool corresponding to the subtask is generated based on the code segment.
7. The method according to any one of claims 1 to 6, wherein, The process of using the multiple tool modules to execute the multiple sub-tasks and generate the target document includes: The current module is determined from the multiple tool modules according to the execution order of the multiple sub-tasks; Determine the current task corresponding to the current module from the plurality of subtasks; By invoking the current module, the current task is executed, and intermediate results are obtained. Based on the intermediate results, the target document is generated.
8. The method according to claim 7, wherein, The process of calling the current module to execute the current task and obtain intermediate results includes: By invoking the current module, the current task is executed, and an initial result is obtained; Define standardized data format requirements; The initial result is converted according to the unified data format requirements to obtain the intermediate result.
9. The method according to claim 7, further comprising: The target document is subjected to quality inspection to obtain the inspection results; If the detection results indicate that the target document is usable, the plurality of tool modules are destroyed.
10. A document generation apparatus, comprising: The request retrieval unit is used to retrieve document generation requests; The task planning unit is used to obtain task planning results based on the document generation request using an orchestration agent; wherein the task planning results include multiple sub-tasks. The tool module generation unit is used to generate a tool module corresponding to each of the multiple subtasks using the orchestration agent, so as to obtain multiple tool modules that correspond one-to-one with the multiple subtasks. The document generation unit is used to execute the multiple sub-tasks using the multiple tool modules to generate the target document.
11. An electronic device, comprising: At least one processor; A memory that is communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method according to any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program; wherein, When the computer program is executed by a processor, it can implement the method of any one of claims 1 to 9.