A long text writing generation method and system based on multi-agent cooperation

By using a multi-agent collaboration mechanism, the topic is decomposed, professional data is collected, and the logic is evaluated to generate long texts. This solves the problem of the lack of a structured system in the generation of long texts by large language models, and realizes the generation of long texts with rigorous logic and clear hierarchy, thereby improving the application effect in professional fields.

CN120911415BActive Publication Date: 2026-06-09MILITARY SCI INFORMATION RES CENT ACAD OF MILITARY SCI OF THE CHINESE PEOPLES LIBERATION ARMY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MILITARY SCI INFORMATION RES CENT ACAD OF MILITARY SCI OF THE CHINESE PEOPLES LIBERATION ARMY
Filing Date
2025-07-14
Publication Date
2026-06-09

Smart Images

  • Figure CN120911415B_ABST
    Figure CN120911415B_ABST
Patent Text Reader

Abstract

The application belongs to the field of natural language processing and artificial intelligence, and particularly relates to a long text writing generation method and system based on multi-agent cooperation. The method comprises the following steps: receiving a text theme input by a user, completing complex theme decoupling, and outputting an outline directory; collecting keywords according to the text theme and the outline directory, obtaining retrieval results by retrieving the Internet, a domain database and network resources, and obtaining reference literature with uniform formats through preprocessing; systematically evaluating the reference literature from the aspects of domain matching degree and logical correlation, grading processing the reference literature, and obtaining high-quality reference literature; and generating long text content based on the text theme and the high-quality reference literature according to an established logical structure and writing specifications. The application effectively avoids the problem of fragmented expression, significantly improves the academic value and reading experience of the text, and effectively solves the inherent defects of traditional long text generation technology, thereby providing an efficient solution for professional field text creation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing and artificial intelligence, and in particular relates to a method and system for generating long text writing based on multi-agent collaboration. Background Technology

[0002] The primary goal of text generation is to automatically learn the input-output mapping from data to construct end-to-end solutions, minimizing human intervention. This mapping function allows the generation system to generalize across a wider range of domains and generate free text under given conditions. Today, Large Language Models (LLMs) address text-to-text problems, capable of receiving input and responding in natural, fluent, and convincing language. The complex domain of long text generation involves numerous challenging tasks, with open-domain text generation, summarization, machine translation, paraphrasing, and question-answering systems being particularly prominent. These tasks not only severely test the flexibility and accuracy of language models but also place stringent demands on their ability to handle long, coherent texts. Modern language models, leveraging prompts, generate text covering multiple topics, domains, or text output formats. Their open-domain functionality is achieved through pre-training on massive amounts of diverse data and tasks, especially utilizing vast amounts of data scraped from the web. This enables them to generate text covering a wide range of topics, different domains, and diverse text output formats based on prompts, laying a solid foundation for cross-domain generalization.

[0003] Currently, traditional long-text generation technologies heavily rely on large language models, but this approach still has significant limitations. Due to the significant differences in structural paradigms across different text genres, existing language models generally lack a deep understanding and accurate modeling ability of the text's structural system. This results in generated content often exhibiting fragmented, piecemeal, and linear narrative characteristics, making it difficult to construct a well-structured and logically consistent knowledge graph. This technological bottleneck not only limits the breadth and depth of application of large language models in the field of professional knowledge dissemination but also causes the output texts to fail to meet practical application needs in terms of content coherence, academic rigor, and readability, urgently requiring breakthroughs through technological innovation. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and propose a long text writing generation method and system based on multi-agent collaboration.

[0005] In view of this, the present invention proposes a long text writing generation method based on multi-agent collaboration, comprising:

[0006] Step 1: Receive the text topic input by the user, decouple complex topics, and output an outline / table of contents;

[0007] Step 2: Based on the text topic and outline, collect keywords, search the Internet, domain databases and online resources to obtain search results, and preprocess them to obtain a standardized bibliography;

[0008] Step 3: Systematically evaluate the references based on their relevance to the field and logical connections, and classify the references to obtain high-quality references;

[0009] Step 4: Based on the text topic and high-quality references, generate long text content according to the established logical structure and writing standards.

[0010] Preferably, step 1 includes:

[0011] Based on the text topic entered by the user, preliminary relevant information is collected;

[0012] Semantic analysis is used to deeply decouple the collected information and uncover key elements;

[0013] Based on the semantic analysis results and preliminary collected relevant information, a data document set S was obtained. A large language model was used to perform deep processing on S, and an outline structure was constructed by maximizing the semantic similarity between subtopics at each level and the text topics.

[0014] Max sub-topic∈S Sim(sub-topic,T)

[0015] Here, sub-topic represents any subtopic in set S, and Sim(sub-topic,T) represents the similarity between subtopic and core topic T. By calculating the similarity between all subtopics and core topic, the subtopic with the highest similarity is selected to clarify the hierarchical relationship of each subtopic in the outline, and then the outline directory O is output.

[0016] Preferably, step 2 includes:

[0017] Based on the core topic T and the outline O, generate the structured search expression Query:

[0018] Query = GenerateQuery(T, O)

[0019] The GenerateQuery function is used to generate a compound search query containing subject keywords and logical operators by parsing the semantic relationships of outline nodes.

[0020] The search result R is obtained by searching the Internet and domain-specific knowledge bases;

[0021] For the search result R, the BGE model is used to match the top k paragraphs with the highest semantic matching degree to the topic and subtopics at all levels. These paragraphs are then sorted from high to low according to their similarity scores with the topic and subtopics to obtain candidate paragraphs. The similarity score Score(d,T,O) is used to obtain the candidate paragraphs. j )for:

[0022]

[0023] Wherein, Score(d,T,O) j () represents document f relative to the core topic T and subheading O. j The overall matching score, where α and β are weighting coefficients, O j,k As keywords, w k It is O j,k The weights, Sim BGE (d,O j,k This involves using the BGE model to calculate the relationship between document d and keywords O. j,k Semantic similarity; Embedding is a vector representation obtained by converting text through the BGE model;

[0024] Using prompts and a large language model, abstracts are generated for candidate paragraphs, and references with a uniform format are produced.

[0025] Preferably, the domain fit in step 3 includes: determining whether the discipline and industry to which the references belong meet the requirements of the target domain; the logical relevance includes: analyzing the degree of fit between the arguments of the references and the core logical framework of the theme, and eliminating content that is contradictory or obviously deviates.

[0026] Preferably, the hierarchical processing in step 3 includes:

[0027] For completely irrelevant references, generate a feedback report, including specific reasons for exclusion and optimization suggestions;

[0028] For the references that meet the requirements, create a structured index, organize them according to relevance and importance, and briefly answer the questions.

[0029] Preferably, step 4 includes:

[0030] For ordinary sequential text, the method, through a large language model (LLM), is based on narrative style prompts N. P Reconstruct the reference S into plain text T x :

[0031] T x =LLM(N P ,S)

[0032] For content with temporal characteristics, the ExtractTime function is used to extract time information, based on customized prompts T. P Extract a set of all key time nodes and their corresponding event information, TimeEvents, from the input document S: TimeEvents = ExtractTime(S, T P )

[0033] Where ExtractTime is the time information extraction function;

[0034] By generating the expanded problem Expand Q The function generates supplementary data New from TimeEvents. data :

[0035] New data =Retrieve(Expand) Q (TimeEvents)

[0036] Where Retrieve represents the information retrieval function;

[0037] The IntegrateTime function, which integrates the timelines, is derived from TimeEvents and New. data To obtain timeline T t :

[0038] T t =IntegrateTime(TimeEvents,New data )

[0039] For data-intensive and specialized literature, the SelectForm information presentation function selects the optimal information presentation format F from the input literature S based on user preferences.

[0040] F=SelectForm(S,UserPreference)F∈{F t ,F C}

[0041] Among them, F t For table output format, F C The output is in slice-style summary format, and the extracted information T is obtained through a large language model (LLM). c :

[0042] T c =LLM((F t ∪F C ),S)

[0043] Based on ordered fusion operations, ordinary text T is fused together. x Timeline T t and extracting information T c The data is then integrated to obtain the long text content.

[0044] Preferably, the method further includes, when no references are obtained in step 2, generating a new structured search expression based on the topic background, core elements and potential related concept information, re-searching the Internet, domain databases and network resources to obtain search results, and obtaining references with uniform format after preprocessing.

[0045] On the other hand, the present invention provides a long text writing generation system based on multi-agent collaboration, comprising:

[0046] The topic decoupling agent is used to receive text topics or writing requirements input by users, complete complex topic decoupling, and output an outline.

[0047] The data acquisition agent is used to collect keywords based on text topics and outlines, retrieve search results from the Internet, domain databases and online resources, and obtain standardized references after preprocessing.

[0048] A reflective agent is used to systematically evaluate references based on domain relevance and logical coherence, classify references, and obtain high-quality references.

[0049] The planning and generation agent is used to generate long text content based on text topics and high-quality references, in accordance with a predetermined logical structure and writing style.

[0050] Compared with the prior art, the advantages of the present invention are:

[0051] 1. This invention achieves automated and parallel processing of long text generation through a multi-agent collaborative mechanism. Specifically, the topic decoupling agent can break down complex topics into several sub-modules, while the data acquisition agent specifically captures data from professional fields. Compared to traditional manual creation or single-model generation modes, this technical solution can significantly compress the content production cycle, while relying on professional data support to ensure the accuracy of knowledge in the output text. The specially designed reflective agent has multi-dimensional content evaluation capabilities, which can dynamically identify and correct logical loopholes and knowledge blind spots, ensuring that the generated long text maintains rigorous logical coherence in the process of hierarchical structure construction and argumentation, effectively avoiding fragmented expression problems, significantly improving the academic value and reading experience of the text, and effectively solving the inherent defects of traditional long text generation technology in terms of content depth and structural rationality, providing a high-efficiency solution for professional field text creation.

[0052] 2. This invention plans and generates an intelligent agent based on a mapping relationship of "topic-type-processing flow," automatically matching the best presentation method for different writing needs. Whether it is ordinary narrative text, structured timelines, or data extraction content, it can flexibly cope with diverse application scenarios. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the agent-based long text writing generation method of the present invention;

[0054] Figure 2 This is a detailed flowchart of the long text writing generation method of the present invention;

[0055] Figure 3 This is a diagram illustrating the data correlation ranking. Detailed Implementation

[0056] The purpose of this invention is to overcome the shortcomings of existing long text generation technologies in terms of structured construction and professional knowledge expression. By integrating large language models and multi-agent collaborative mechanisms, a highly efficient and intelligent method for generating long text writing is constructed. This method aims to achieve automated, in-depth mining and correlation analysis of the hierarchical relationships of product components in the industrial chain of a specific technical field, thereby generating logically rigorous, clearly structured, and detailed long texts. This effectively improves the readability, authority, and practicality of encyclopedic texts and professional knowledge content, breaks through the technical bottleneck of large language models in professional fields, and provides innovative solutions for knowledge dissemination and information processing.

[0057] To overcome the technical constraints of traditional long-text generation, this paper deeply integrates cutting-edge artificial intelligence technologies, using a large language model as the core driving engine and organically integrating an intelligent agent collaborative interaction mechanism. It innovatively proposes a multi-agent-based long-text writing generation method. By constructing an intelligent agent collaborative network, it achieves efficient processing and semantic parsing of massive heterogeneous data, accurately uncovering the inherent logical relationships within specific domain knowledge systems, and automatically generating well-structured and logically rigorous long-text content. This provides a novel solution for the systematic presentation and in-depth dissemination of professional domain knowledge.

[0058] To achieve its innovation goals, this invention deeply integrates cutting-edge artificial intelligence technologies, constructing a hierarchical and highly modular intelligent agent collaborative architecture, and proposes an agent-based long text writing generation method. This method consists of four core modules: a topic decoupling agent, a data acquisition agent, a reflective agent, and a planning and generation agent. Each module performs its specific function while working closely together. The specific implementation process is as follows: Figure 1 As shown, it includes:

[0059] Step 1: Receive the text topic or writing requirements input by the user, and break down and refine complex topics. The specific execution flow is as follows:

[0060] 101) Based on the user's input topic, collect preliminary relevant information to build a basic understanding of the topic;

[0061] 102) Use semantic analysis to deeply deconstruct the collected information and accurately extract its key elements;

[0062] 103) Based on the analysis results, a preliminary search is conducted to generate a structured writing outline, breaking down complex topics into logically rigorous sub-topics and hierarchical frameworks, laying a clear structural foundation for subsequent writing.

[0063] Step 2: Collect topic keywords, search the internet and relevant databases, and preprocess the search results, including formatting constraints. Detailed steps are as follows:

[0064] 201) Extract keywords from the topic and headings at all levels, and conduct a comprehensive search on the Internet and in the domain's professional knowledge base;

[0065] 202) Based on the relevance of the search information to the keywords, the search results are reordered, and candidate paragraphs are obtained in descending order;

[0066] 203) Perform deduplication filtering on the candidate information and perform format parsing to finally generate search information with a uniform format, ensuring the accuracy and standardization of the data.

[0067] Step 3: Systematically evaluate the retrieved literature based on dimensions such as accuracy, completeness, logical coherence, and relevance to the target field, thereby driving dynamic revision and improvement of the writing process. The specific steps are as follows:

[0068] 301) Compare and analyze the information retrieved by the data collection agent one by one, accurately judge the degree of fit between each piece of information and the theme and headings at all levels, and select the content that truly meets the writing requirements;

[0069] 302) Feed back the information adaptability assessment results to the data collection agent in real time so that it can further optimize the data collection work.

[0070] Step 4: Based on the topic and references, plan and design the content, and using the text generation capabilities of the large language model, generate long text content hierarchically and modularly according to the established logical structure and writing conventions. The specific implementation steps are as follows:

[0071] 401) Establish a mapping relationship of "topic-type-processing flow" to provide differentiated guidance for the generation of different types of content;

[0072] 402) Based on the constructed mapping relationship, the filtered and sorted information is classified and different processing methods are adopted to ensure the professionalism and efficiency of long text generation.

[0073] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0074] Example 1

[0075] like Figure 1 As shown, Embodiment 1 of this invention proposes a long text writing generation method based on multi-agent collaboration. Through four core steps—topic deconstruction and framework construction, multi-source data collection and preprocessing, content filtering and quality verification, and intelligent planning and text generation—it achieves intelligent creation throughout the entire process: The topic decoupling agent, based on semantic analysis, deeply deconstructs the user-input topic. By identifying key semantic elements and associating domain knowledge, it breaks down complex topics into logically clear hierarchical structures, generating a structured outline and constructing a systematic content framework for the long text; The data collection agent, based on topic keywords and the outline, searches multiple data sources in parallel, including internet resources and professional databases. By intelligently filtering duplicate information, parsing unstructured data, and reordering the search results according to relevance, it forms a standardized and rich reference library, providing ample material support for subsequent creation; The reflection agent employs a multi-dimensional evaluation mechanism to finely screen references based on content accuracy, logical coherence, and domain relevance. Through intelligent comparison and analysis, redundant information irrelevant to the topic is eliminated, ensuring that the retained materials highly match the writing needs and laying the foundation for high-quality text generation. The planning and generation agent, based on a "topic-type-processing flow" mapping model, classifies the selected references. Targeting the characteristics of different types of documents and writing needs, it automatically selects the optimal presentation format, such as ordinary text narration, timeline organization, and extractive information refinement. Combining the text generation capabilities of a large language model, it generates complete long text content in a hierarchical and modular manner according to a predetermined logical structure and writing standards.

[0076] For detailed procedures, please refer to [link / reference]. Figure 2 The main steps include:

[0077] Step 1) For a given topic T, a preliminary search is initiated, traversing relevant knowledge bases K, literature databases D, and online resources W to extensively capture information related to the topic, forming a retrieval data document set S. This set contains a rich variety of texts and document fragments obtained from various data sources, providing a sufficient data foundation for subsequent analysis. Subsequently, a large language model is used to perform semantic analysis on S, mining key elements related to the topic. Based on prompts, the large language model utilizes the mined elements to identify the inherent logical relationships between different text fragments to decouple the topic. By maximizing the semantic similarity between sub-topics at each level and the main topic, an outline structure is constructed:

[0078] Max sub-topic∈S Sim(sub-topic,T)

[0079] Here, `sub-topic` represents any sub-topic in set `S`, and `Sim(sub-topic, T)` is used to measure the similarity between the sub-topic and the core topic `T`. By calculating the similarity between all sub-topics and the core topic, the sub-topic with the highest similarity (Max) is selected to clarify the hierarchical relationship of each sub-topic in the outline, i.e., the sub-topic with the higher similarity. Taking the topic "Ba Jin" as an example, when searching the knowledge base, various information including Ba Jin's biography, literary reviews, and related news reports will be collected. After analysis, the large model generates an outline with the following structure:

[0080] [“Biography”: {“Early Years”: [], “Middle Age”: []}, “Works”: {“Novels”: [], “Novemberpieces”: [], …]

[0081] Step 2) Deep retrieval and data preprocessing based on topics and outlines: After completing topic decoupling and generating hierarchical outlines, the data acquisition agent initiates a deep retrieval and preprocessing process for multi-source heterogeneous data. This stage utilizes a semantic matching model and a large language model in collaboration to build an efficient and accurate data acquisition system, laying the foundation for subsequent content generation.

[0082] The data acquisition agent constructs a unified retrieval interface for multi-source datasets, including professional literature databases, academic databases, and authoritative encyclopedia platforms. Based on topic T and outline O, it generates structured retrieval expressions.

[0083] Query = GenerateQuery(T, O)

[0084] The `GenerateQuery` function parses the semantic relationships between outline nodes to generate a compound search expression containing subject keywords and logical operators. For example, when the subject is "Ba Jin" and the subheading is "Biography," the search expression would be:

[0085] Query = "Ba Jin" ∧ ("Life Story" ∨ "Family Background" ∨ "Creative Journey")

[0086] For the search result R, the BGE model was used to intelligently identify the top k paragraphs with the highest semantic matching degree to the topic and subheadings at all levels. These paragraphs were then precisely ranked from highest to lowest according to their similarity scores with the topic and subheadings, providing candidate data for subsequent data filtering and processing. Figure 3 As shown. For document d∈R, its matching score formula is:

[0087]

[0088] Score(d,T,O j () represents document d relative to topic T and subheading O j The overall relevance score. α and β are weighting coefficients used to adjust the relevance between the document and the topic T, and between the document and the subheading O. j Each keyword O j,k The relative importance of matching degree in the overall score, w k The keyword is O j,k The weights of Sim. BGE (d,O j,k This involves using the BGE model to calculate the relationship between document d and keyword O. j,k Semantic similarity, Embedding is a vector representation obtained by converting text through the BGE model.

[0089] The index structure of each document obtained is shown in Table 1.

[0090] Table 1. Document Index Example

[0091]

[0092]

[0093] After the above processing, a structured candidate retrieval dataset is formed. Using prompts and a large language model, a refined abstract is generated for each document, preserving core information while improving subsequent processing efficiency. Taking "Ba Jin" as the subject and "biography" as the title, during the search process, highly relevant keywords such as "Ba Jin's life and deeds," "Ba Jin's family background," and "Ba Jin's literary career" are prioritized. Document content is then read and abstracts are extracted. Refined abstract output:

[0094] [“Ba Jin (November 25, 1904 – October 17, 2005), whose real name was Li Yaotang, courtesy name Feigan, pen name besides Ba Jin…”, “Han Chinese, whose representative works include the Trilogy of Torrents and the Trilogy of Love, and the essay collection Random Thoughts. His ancestral home was Jiaxing, Zhejiang…”.]

[0095] Step 3) Based on the reflective agent-based dynamic evaluation and optimization mechanism for literature, this step is led by the reflective agent and achieves dynamic control of literature quality through the construction of a two-way feedback mechanism, specifically in two scenarios:

[0096] Scenario 1: Handling No Literature Search Results

[0097] When the data acquisition agent completes the retrieval process but fails to obtain valid documents, the reflection agent immediately initiates an intelligent guidance strategy. First, based on a built-in prompt template, it automatically generates guidance instructions containing topic background, core elements, and potential related concepts. These instructions aim to guide the large language model to conduct in-depth analysis of the topic, such as uncovering implicit keywords and deconstructing complex topic structures. Subsequently, the instructions are input into the large language model, leveraging its powerful reasoning capabilities to reconstruct and restructure the topic, thereby generating entirely new retrieval questions. Finally, the reflection agent encapsulates the optimized retrieval requirements into a standardized format and feeds them back to the data acquisition agent, re-executing step 2) to trigger a new round of retrieval until valid document data is obtained. A typical feedback format is as follows:

[0098] {"reason":"No relevant references found","information":"Search optimization problem based on topic reconstruction","choice":[0]}

[0099] Scenario 2: Literature Relevance Assessment and Screening

[0100] If literature resources are retrieved, the reflective agent will conduct a systematic evaluation from two core dimensions: domain relevance and logical coherence. Regarding domain relevance, it accurately determines whether the discipline and industry to which the literature belongs meet the requirements of the target domain; regarding logical coherence, it deeply analyzes the degree of fit between the literature's arguments and the core logical framework of the theme, eliminating content that is contradictory or significantly deviates from the intended purpose.

[0101] After the evaluation is completed, the reflective agent classifies the literature according to the evaluation results:

[0102] For completely irrelevant literature, a detailed feedback report is generated, including specific reasons for exclusion and optimization suggestions, to guide the data collection agent in adjusting search parameters and improving the accuracy of subsequent searches. Example of feedback data structure:

[0103] {"reason":"The relevance assessment of the literature to the topic did not meet the standard, and the search strategy needs to be optimized","information":"Key areas for data screening","choice":[List of specific index parameters to be adjusted]}

[0104] For relevant literature that meets the requirements, the reflective agent will create a structured index and organize it according to relevance and importance. Simultaneously, through literature analysis, it will briefly answer questions, providing solid data support for subsequent text creation by the agent, ensuring the accuracy and professionalism of the final generated text. The data output format is as follows:

[0105] {"reason":"Based on literature screening and organization","answer":"Answer the question briefly in a few words","reference":[Sorted list of literature indexes]}

[0106] Step 4) Differentiated processing and creation planning of document content based on the planning-generated agent. After completing document screening and quality optimization, the planning-generated agent, based on the outline framework generated by the previous topic decoupling, performs refined and differentiated processing planning for high-quality documents, specifically in three types:

[0107] (1) Ordinary narrative texts

[0108] For thematic works that emphasize plot, such as historical events and biographies, a generative agent is planned to reconstruct the document S into plain text T using a large language model. x .

[0109] T x =LLM(N P ,S)

[0110] Where, N P It provides narrative style prompts and improves text readability by adding background information and optimizing transitions;

[0111] (2) Structured timeline

[0112] For content with chronological characteristics such as development history and project progress, given that conventional summaries cannot fully present the details, the planning and generation agent adopts a progressive processing strategy:

[0113] First, the full text of the document is segmented and input into the large language model, and then customized prompts T are used to generate the text. P Extract all key time points and their corresponding event information from the input document S to quickly locate the timeline within the content, providing foundational data for subsequent processing.

[0114] TimeEvents = ExtractTime((S,T)P )

[0115] ExtractTime is a function for extracting time information, which receives an input document S and a prompt instruction T. P As a parameter, it returns a collection of TimeEvents containing time nodes and their corresponding events.

[0116] After extracting key time nodes and events, TimeEvents may contain missing information or insufficient details. In this case, a series of extended questions need to be generated to fill in the information gaps and uncover deeper details. For example, if TimeEvents only record the release date of a product, extended questions might include "What was the market background at the time of the product release?" and "What market reactions occurred after the release?" The data collection agent uses these extended questions as the basis for retrieval and continues to reflect on the agent's dynamic feedback to ultimately return supplementary data, New. data This process, based on existing clues, delves deeper into the truth, making the originally thin timeline of events much richer and more three-dimensional. Among these, Expand... Q The function generates extended questions based on TimeEvents.

[0117] New data =Retrieve(Expand) Q (TimeEvents)

[0118] Obtain the initial time event set TimeEvents and supplementary data New data Then, the two need to be organically integrated to form a complete and coherent structured timeline.

[0119] T t =IntegrateTime(TimeEvents,New data )

[0120] The `IntegrateTime` function performs this core task, merging and organizing time nodes, events, and supplementary data. During integration, the function reorders all information according to chronological order, while handling potential contradictions or duplicate data to ensure the logical consistency and accuracy of the timeline. For example, when supplementary data contains information related to the original events but with slightly different chronological sequences, the `IntegrateTime` function uses an algorithm to make appropriate adjustments. Finally, the processed information is output as a structured timeline `T`. t :

[0121] T t =IntegrateTime(TimeEvents,Newdata )

[0122] This timeline presents chronological content in a clear and orderly manner, providing an intuitive and comprehensive reference whether used for reviewing historical events, tracking project progress, or outlining the timeline in academic research.

[0123] (3) Extracted information

[0124] For data-intensive, professional knowledge-based literature, the extractive information method achieves efficient extraction of key information through a three-step process: dynamic format adaptation, semantically precise filtering, and multi-dimensional information extraction. First, it analyzes the core theme, data type, and application scenario of the literature, and then, based on user needs and preferences, automatically matches the optimal information presentation format using a selection model.

[0125] F=SelectForm(S,UserPreference)F∈{F t ,F C}

[0126] Here, UserPreference represents the user's defined preferences (such as concise summaries or detailed analyses). UserPreference and the document S are used as input parameters, and the SelectForm function outputs the appropriate information presentation format. If the document contains structured content such as multi-dimensional comparative data or time-series statistical indicators, a tabular output format F will be prioritized. t Through rigorous row and column design and data alignment, the logical relationships between data are clearly presented; if the literature focuses on fragmented knowledge points or theoretical viewpoints, then the "slice-style abstract" mode is used. C The core conclusions are extracted in paragraph form to ensure the content is intuitive, easy to understand, and highlights key points. The document content is divided into multiple semantic units u, and the relevance to the topic T is determined using Rel(u,T), ensuring that the retained text fragments closely revolve around the core topic and eliminating redundant or off-topic information. For highly relevant texts that pass the screening, key elements such as engineering positioning data, formulas, and conclusions are provided as prompts. For numerical data, numerical values, units, and statistical indicators are automatically identified and extracted; for opinion-based content, core arguments and supporting evidence are extracted. Finally, the extracted information is logically reorganized and output in the form of structured lists, comparison tables, or key point cards, significantly improving the retrieval efficiency and application value of professional information, and ultimately returning the extracted information T. c :

[0127] T c =LLM((F t ∪F C ),S)

[0128] For different thematic outline hierarchical structures, prompts employ a tiered design strategy to accurately guide the generated content. The tiered prompt mechanism is implemented through an outline hierarchy parsing algorithm and a dynamic parameter binding model: identifying the hierarchical structure of the thematic outline (e.g., Level 1 outline → Level 2 outline → Level 3 outline) and generating hierarchical path vectors. Based on the hierarchical path, parameters such as references, topics, and outline nodes are dynamically injected into the prompt word template. For example, when a second-level outline is detected, a two-parameter template containing both {first-level outline} and {second-level outline} is automatically activated.

[0129] In the final text integration stage, a specific fusion strategy is employed. The text is divided into three types for comprehensive integration: ordinary text (T) and general text (T). x Timeline T t and extracted information T c Integration will be carried out in the following ways:

[0130]

[0131] symbol This represents an orderly fusion operation that organically combines different types of text content to form a logically coherent and well-structured complete text. This integration method fully leverages the strengths of various text types, ensuring that the final generated text not only meets the requirements of logical outline formatting and detailed content, but also possesses a rigorous structural system to satisfy diverse application needs.

[0132] Example 2

[0133] Embodiment 2 of the present invention provides a long text writing generation system based on multi-agent collaboration, implemented based on the method of Embodiment 1, including:

[0134] The topic decoupling agent is used to receive text topics or writing requirements input by users, complete complex topic decoupling, and output an outline.

[0135] The data acquisition agent is used to collect keywords based on text topics and outlines, retrieve search results from the Internet, domain databases and online resources, and obtain standardized references after preprocessing.

[0136] A reflective agent is used to systematically evaluate references based on domain relevance and logical coherence, classify references, and obtain high-quality references.

[0137] The planning and generation agent is used to generate long text content based on text topics and high-quality references, in accordance with a predetermined logical structure and writing style.

[0138] It is worth noting that in the embodiments of the above system, the modules included are divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional module are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0139] This invention proposes a long text writing generation method based on intelligent agents, breaking through the functional limitations of traditional single models and constructing a hierarchical and modular intelligent agent collaborative architecture. Through the full-process collaboration of four core modules—topic decoupling agent, data acquisition agent, reflection agent, and planning and generation agent—end-to-end automated and intelligent processing is achieved from topic decomposition, data acquisition, content evaluation to text generation, providing a new technical path for multi-agent collaborative driving in the field of long text generation.

[0140] The innovation of this method lies in:

[0141] 1. Full-process intelligentization: Through the professional division of labor of four modules (such as the topic decoupling agent to realize the hierarchical deconstruction of complex topics, and the reflection agent to complete the dynamic evaluation of content adaptability), it breaks through the limitations of the traditional model's "single internal loop" and forms a closed-loop intelligent collaboration system of "deconstruction-collection-evaluation-generation".

[0142] 2. Multi-mode output capability: For different topic types (such as academic papers, industry reports, popular science copy, etc.), it automatically matches ordinary text, timelines, and extracted information in a variety of presentation formats, supports structured content output in multiple scenarios, and significantly improves the flexibility, practicality and scenario adaptability of long text generation.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A long text writing generation method based on multi-agent collaboration, comprising: Step 1: Receive the text topic input by the user, decouple complex topics, and output an outline / table of contents; Step 2: Based on the core theme and outline Generate structured search expressions : in, The function is used to generate a compound search query containing subject keywords and logical operators by parsing the semantic relationships of outline nodes; Search results were obtained by searching the internet and domain-specific knowledge bases. ; Regarding the search results ,use The model matching has the highest semantic matching degree with the topic and subtopics at all levels. Each paragraph is ranked according to its similarity score with the topic and subtopics, and then sorted from highest to lowest to obtain candidate paragraphs for retrieval. for: in, Representative document Compared to the core theme and subheadings The overall matching score, and These are weighting coefficients. As keywords, yes The weight, It is to utilize Model Calculation Document With keywords semantic similarity, Through The model converts text into a vector representation; Using prompts and a large language model, abstracts are generated for candidate paragraphs, and references with a uniform format are produced. Step 3: Systematically evaluate the references based on their domain relevance and logical connection, and classify the references to obtain high-quality references. The classification process includes: generating a feedback report for completely irrelevant references, including specific reasons for exclusion and optimization suggestions; and creating a structured index for references that meet the requirements, organizing them according to relevance and importance, and briefly answering questions. Step 4: For ordinary sequential text, use a large language model (LLM) to provide instructions based on narrative style. References Reconstructed into plain text : For content with temporal characteristics, a time information extraction function is used. According to customized prompts From the input literature Extract the set of all key time nodes and their corresponding event information. : in, This is a function for extracting time information. By generating extended problems The function is Generate supplementary data : in, This represents an information retrieval function; The timeline is obtained through integration. The function is and Obtain the timeline : For data-intensive and specialized literature, information presentation functions are used. Based on user needs and preferences From the input literature Choose the optimal information presentation format : in, Output in tabular format. The output is in slice-style summary format, and the extracted information is obtained through a large language model (LLM). : Based on ordered fusion operations, ordinary text is fused together. Timeline and extracting information By integrating the data, we obtain the long text content. .

2. The long text writing generation method based on multi-agent collaboration according to claim 1, characterized in that, Step 1 includes: Based on the text topic entered by the user, preliminary relevant information is collected; Semantic analysis is used to deeply decouple the collected information and uncover key elements; Based on the semantic analysis results and the preliminary collected relevant information, a data document set was obtained. Using a large language model Deep processing is performed to construct an outline structure by maximizing the semantic similarity between subtopics at each level and the text topic: in, Represents a set Any subtopic in, Indicates a subtopic With core theme The similarity between subtopics is calculated by comparing all subtopics with the core topic, and the subtopic with the highest similarity is selected. This determines the hierarchical relationship of each subtopic in the outline, and then outputs the outline table of contents. .

3. The long text writing generation method based on multi-agent collaboration according to claim 1, characterized in that, The domain fit in step 3 includes: determining whether the discipline and industry of the references meet the requirements of the target domain; the logical relevance includes: analyzing the degree of fit between the arguments of the references and the core logical framework of the theme, and eliminating content that is contradictory or obviously deviates.

4. The long text writing generation method based on multi-agent collaboration according to claim 1, characterized in that, The method further includes, when no references are obtained in step 2, generating a new structured search expression based on the topic background, core elements and potential related concept information, re-searching the Internet, domain databases and network resources to obtain search results, and obtaining references with uniform format after preprocessing.

5. A system based on the multi-agent collaborative long text writing generation method of claim 1, characterized in that, include: The topic decoupling agent is used to receive text topics or writing requirements input by users, complete complex topic decoupling, and output an outline. The data acquisition agent is used to collect keywords based on text topics and outlines, retrieve search results from the Internet, domain databases and online resources, and obtain standardized references after preprocessing. A reflective agent is used to systematically evaluate references based on domain relevance and logical coherence, classify references, and obtain high-quality references. and The planning and generation agent is used to generate long text content based on text topics and high-quality references, in accordance with a predetermined logical structure and writing style.