A large model super-long document collaborative inference method based on a hybrid driving architecture

CN122927495APending Publication Date: 2026-10-16BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610799872.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]本发明的目的是为了解决现有大模型在处理超长文档时面临的上下文窗口限制、计算复杂度高、长距离依赖捕捉困难、精准定位能力不足的技术问题,提出一种基于混合驱动架构的大模型超长文档协同推理方法

Benefits of technology

[0058] 1. This invention addresses the limitations of single-technology approaches in processing ultra-long documents by constructing a hybrid-driven architecture of a rule engine and a large model. The rule engine provides deterministic structured parsing capabilities, ensuring the accuracy and interpretability of document element identification; the large model provides powerful semantic understanding and generalization capabilities, enabling the capture of complex semantic relationships. Both work collaboratively through a feature fusion layer and a conflict resolution mechanism, maintaining the accuracy of rule-based methods while leveraging the flexibility of model-based methods, thereby improving overall inference accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927495A_ABST
    Figure CN122927495A_ABST
Patent Text Reader

Abstract

The application discloses a kind of big model super-long document collaborative inference method based on hybrid drive architecture, belong to artificial intelligence and natural language processing technical field.The application implementation method is:1, construct context association knowledge base and rule model mixed feature extraction and annotation knowledge base;2, construct and train the multi-agent collaborative inference model based on hybrid drive architecture;The multi-agent collaborative inference model includes coordination distribution agent, preface summary agent, long-term memory agent, analysis and reasoning agent;3, based on the hybrid drive multi-agent collaborative inference model trained, real-time collaborative inference and accurate positioning are carried out to super-long document, and the final report containing inference conclusion and original text quotation position is generated;Compared with prior art, the application solves the technical problems of context window limit, high computational complexity, long distance dependence capture difficulty and insufficient accurate positioning capability faced by existing big model when processing super-long document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a collaborative reasoning method for large-scale, ultra-long documents based on a hybrid-driven architecture, belonging to the field of artificial intelligence and natural language processing technology, and applied to scenarios of structured parsing, key information extraction, and deep semantic understanding of ultra-long documents. Background Technology

[0002] With the rapid development of Large Language Models (LLMs), they have demonstrated powerful capabilities in tasks such as document understanding, information extraction, and question answering systems. However, when faced with extremely long documents of hundreds or even thousands of pages, existing technical solutions still face the following core challenges:

[0003] First, there's the issue of context window limitations. Current mainstream large-scale models typically have a context window between 4K and 128K tokens, while a complete project management document, legal contract, or technical manual often contains hundreds of thousands or even millions of tokens, far exceeding the processing capacity of a single model. Existing solutions mainly employ simple document slicing strategies, dividing long documents into multiple segments for separate processing. However, this method disrupts the global semantic coherence of the document, making it impossible to effectively capture long-distance dependencies across paragraphs and chapters. Second, there's the issue of computational complexity and inference efficiency. The self-attention mechanism of the Transformer architecture has a computational complexity of O(n²), and the computational resource consumption increases quadratically with increasing document length. Although optimization strategies such as sparse attention and sliding windows alleviate this problem to some extent, they still face challenges of slow inference speed and high memory consumption when processing extremely long documents. Third, there's the issue of accurate localization and traceability. In critical scenarios such as project management and legal review, it's not only necessary for the model to understand the document content but also to accurately locate the specific position of the original document (such as page number, paragraph, and line number). While existing vector retrieval (RAG) methods can return relevant fragments, they often lose the structured coordinate information of the original document, making it impossible to trace the inference results back to a specific location, thus reducing the system's reliability and practicality. Finally, there are limitations to single-technology approaches. Pure rule-based methods, while deterministic and interpretable, lack semantic understanding capabilities; pure large-model methods, while possessing strong generalization capabilities, are unstable in handling structured tasks and precise localization. Current technologies lack a hybrid-driven architecture that effectively integrates the deterministic advantages of rule engines with the semantic generalization capabilities of large models.

[0004] Therefore, how to solve the problems faced by existing large models in processing ultra-long documents, such as context window limitations, high computational complexity, difficulty in capturing long-distance dependencies, and insufficient precise localization capabilities, and how to build an ultra-long document processing method that can break through context window limitations, achieve efficient and accurate inference, and support fine-grained tracing, has become an urgent technical problem to be solved. Summary of the Invention

[0005] The purpose of this invention is to address the technical problems faced by existing large models when processing ultra-long documents, such as context window limitations, high computational complexity, difficulty in capturing long-distance dependencies, and insufficient precise positioning capabilities. This invention proposes a collaborative reasoning method for ultra-long documents based on a hybrid-driven architecture.

[0006] The objective of this invention is achieved through the following technical solution:

[0007] In a first aspect, the present invention discloses a collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture, comprising the following steps:

[0008] Step 1: Perform structured preprocessing on the extremely long document to build a feature extraction and annotation knowledge base that combines contextual knowledge base and rule model;

[0009] Step 1.1: Standardize the format of the long document and identify the document structure based on regular expressions to generate a document structure index table containing the document hierarchy and element coordinate information;

[0010] Step 1.1.1: Standardize the format of the input long document, unify the encoding format, remove invisible control characters, and use regular expressions to identify the document directory tree, paragraph boundaries and table areas in the document structure to extract the hierarchical structured elements of the document containing titles, paragraphs, tables, headers and footers.

[0011] Step 1.1.2: Create a unique element ID for each structured element, and record the coordinate information of the page number, starting character offset, ending character offset, and line number in the original document. Then, use the document directory tree and element coordinate information to build a document structure index table and form a structured mapping knowledge base.

[0012] Step 1.2: Based on semantic slicing, the document is semantically segmented using chapter or paragraph boundaries as segmentation points, and an inter-block association graph is constructed using the similarity between adjacent semantic blocks. Semantic blocks, block identifiers, and inter-block associations are stored in a vector database to form a context association knowledge base.

[0013] Step 1.2.1: Based on the document structure index table, using chapter or paragraph boundaries as segmentation points, the document is segmented into semantic blocks using a semantic similarity-based segmentation method. Each semantic block contains complete semantic information.

[0014] Step 1.2.2: Use TF-IDF or Sentence-BERT to extract feature vectors for each semantic block, and calculate the cosine similarity between the feature vectors of any two adjacent semantic blocks in the manner shown in Equation (1). Establish an edge of the inter-block association graph for two semantic blocks with similarity higher than a preset threshold. Further, the inter-block association graph is stored in the graph database Neo4j or adjacency list.

[0015] similarity = cos(θ) = (A·B) / (||A|| × ||B||) (1)

[0016] Where A and B are the feature vectors of two semantic blocks, respectively; the preset threshold is set to 0.6;

[0017] Step 1.2.3: Store semantic blocks, block identifiers, and inter-block relationships in a vector database to form a context-related knowledge base; furthermore, Milvus or FAISS is used as the vector database; the embedding vector of each semantic block is stored in the vector index, and metadata is also stored, including chunk_id, page range, and element list; the vector index uses the IVF_FLAT or HNSW algorithm to support efficient approximate nearest neighbor search;

[0018] Step 1.3: Construct a feature extraction and annotation knowledge base that integrates rule-based models;

[0019] Step 1.3.1: Extract structured features from the document using a rule engine; the structured features include entities such as date, amount, person's name, and organization's name;

[0020] Step 1.3.2: Extract semantic entities from the document using a pre-trained Named Entity Recognition (NER) model; further, the pre-trained NER model is a pre-trained NER model of spaCy or HanLP;

[0021] Step 1.3.3: Merge the rule extraction results with the model extraction results to form a hybrid labeled knowledge base;

[0022] Step 1.3.3.1: If both the rule and the model identify the same entity, and the overlap between the text content and the location is >80%, then the result of the rule shall prevail;

[0023] Step 1.3.3.2: If only the rule identifies the entity, then retain the rule result;

[0024] Step 1.3.3.3: If only the model identifies entities, retain the model results and mark them as having low confidence.

[0025] Step 1.3.3.4: The final result is stored in JSON format, containing entity text, type, location, source, and confidence fields;

[0026] Step 2: Construct and train a multi-agent collaborative reasoning model based on a hybrid-driven architecture; the multi-agent collaborative reasoning model includes a coordination and distribution agent responsible for receiving user query tasks, parsing task types, and decomposing tasks into sub-tasks and allocating them to other agents; a contextual summary agent responsible for compressing and summarizing document history content and maintaining contextual coherence; a long-term memory agent responsible for persistent storage and retrieval of knowledge across paragraphs and chapters; and an analytical reasoning agent responsible for deep semantic understanding and logical deduction.

[0027] Step 2.1: In the deployment of the coordinated distribution agent, BERT or RoBERTa intent recognition models are used to classify user queries by intent. The query types are identified as fact retrieval, logical reasoning, document generation, and consistency verification. Keywords are extracted based on the query type, and full-text search is performed in the document structure index table to obtain semantic blocks containing keywords. Semantic similarity search is performed using a vector database to obtain the Top-K most relevant semantic blocks. At the same time, Celery or RabbitMQ is used to implement the task queue, and the scheduler determines the task execution order based on the subtask priority and dependency.

[0028] Step 2.2: Building upon the agent deployment summarized above, hierarchical summarization is employed for extracting and generating summaries. For extractive summarization, TextRank or BERTScore is used to extract important sentences from the original text. For generative summarization, a large language model is used to rewrite and compress the extracted sentences, generating block-level summaries for each semantic block and chapter-level summaries for each chapter. A pre-trained large language model is then used to fuse extractive and generative summarization through Prompt Engineering. An inverse index is established between the summarization results and the original document coordinates to support tracing the source from the summary to the original text.

[0029] Step 2.3: In the deployment of long-term memory agents, provide a mixed inspection of semantic block embedding representation stored in the vector database with TOP-K filtering based on Elasticsearch keywords and Milvus semantics for RRF fusion and mixed inspection. When the document content changes, incremental updates are performed on the affected semantic blocks and corresponding indexes.

[0030] Step 2.4: In the deployment of the analytical reasoning agent, a large language model is used as the reasoning engine, and multi-step reasoning is achieved through chain-of-thought prompts; a rule verification module is introduced to check the logical consistency of the reasoning results; and a multi-round iterative mechanism is implemented to gradually optimize the reasoning results through feedback loops.

[0031] Step 2.4.1: Perform format compliance, logical coherence, data accuracy, and reference integrity checks through the rule verification module, and generate a verification report containing error type, error location, and correction suggestions;

[0032] Step 2.4.2: If the verification passes, output the final result; if the verification fails, send the verification report back to the analysis and reasoning agent for iterative reasoning until the reasoning result is obtained.

[0033] Step 2.5: Construct a hybrid-driven feature fusion and decision-making mechanism;

[0034] Step 2.5.1: Establish a rule model feature fusion layer for the feature vector of the entity recognition task, concatenate the structured features extracted by the rule engine, the semantic features extracted by the large model, and the context features containing the semantic vector, and dynamically adjust the weights of the rule features and model features according to the task type for attention weighting;

[0035] Step 2.5.2: Use confidence scores to resolve conflicts between rule results and model results. When rule results and model results are inconsistent, use confidence score voting or manual intervention mechanisms.

[0036] Step 2.6: During the reasoning process, record the semantic block identifiers referenced for each reasoning step; trace back to the coordinate information of the original document through the mapping relationship between semantic block identifiers and element identifiers; generate a reasoning report containing the original document reference location, allowing users to click and jump to the corresponding location in the original document;

[0037] Step 3: Based on the trained hybrid-driven multi-agent collaborative reasoning model, perform real-time collaborative reasoning and precise localization on ultra-long documents, and generate a final report containing reasoning conclusions and original text citation locations;

[0038] Step 3.1: Receive the user's input of a very long document and query task, and call the rule engine to preprocess the document and build a structured mapping knowledge base;

[0039] Step 3.2: Coordinate and distribute intelligent agents to parse query tasks, perform task deconstruction, and formulate multi-agent collaborative scheduling strategies;

[0040] Step 3.2.1: The coordination and distribution agent receives the query task input by the user, calls the intent recognition model to classify the query intent, and extracts the key entities, time span, and logical constraints in the query task as anchor points for retrieval and inference.

[0041] Step 3.2.2: For complex long-range query tasks, the coordination and distribution agent deconstructs the main query task into several independent sub-tasks or sub-tasks with temporal dependencies, and constructs a directed acyclic dependency graph (DAG) for the execution of sub-tasks based on business logic.

[0042] Step 3.2.3: Determine the processing strategy and execution priority of each subtask based on the dependency graph, clarify the execution order and input / output interface of the long-term memory agent, the previous summary agent, and the analysis and reasoning agent in each subtask, and distribute the split subtasks to the corresponding agents through the task queue routing.

[0043] Step 3.2.4: Establish a global collaborative state monitoring mechanism to track the processing progress, data flow status and anomaly feedback of each agent during subsequent multi-agent collaborative execution, and provide global scheduling support for context relay between agents;

[0044] Step 3.3: Multi-agent collaboratively execute reasoning tasks;

[0045] Step 3.3.1: The long-term memory agent retrieves relevant semantic blocks from the vector database based on the query content;

[0046] Step 3.3.2: As summarized above, the agent summarizes the retrieved semantic blocks to generate a contextual summary;

[0047] Step 3.3.3: Analyze the reasoning agent to perform deep reasoning by combining contextual summaries and original semantic blocks;

[0048] Step 3.3.4: The rule verification module performs a consistency check on the inference results;

[0049] Step 3.3.5: If the check result fails, return to step 3.4.3 for iterative optimization until the maximum number of iterations is reached or the check result passes;

[0050] Step 3.4: The precise positioning module maps the inference results back to the original document coordinates;

[0051] Step 3.5: Generate a final report containing the reasoning conclusions and the original text citations;

[0052] Secondly, the present invention discloses a large-model ultra-long document collaborative reasoning system based on a hybrid-driven architecture, used to implement the above method, including a document preprocessing module, a hybrid feature extraction module, a multi-agent collaborative reasoning module, a precise positioning module, and a knowledge storage module;

[0053] The document preprocessing module is used to perform format standardization, structure recognition, and semantic segmentation on the input long documents. The document preprocessing module includes a format standardization unit, a structure recognition unit, and a semantic segmentation unit. The format standardization unit is used to unify the document encoding format and remove invisible control characters. The structure recognition unit is used to extract structured elements such as hierarchical headings, paragraphs, and tables from the document using regular expression-based rules, and to establish a unique identifier and coordinate information for each element. The semantic segmentation unit is used to segment the long document into multiple semantic blocks according to the document structure and to calculate the semantic similarity between blocks to construct a relational graph. The hybrid feature extraction module is used to combine a rule engine and a large model to extract the document's structured and semantic features. The hybrid feature extraction module includes a rule feature extraction unit, a model feature extraction unit, and a feature fusion unit. The rule feature extraction unit is used to extract structured entities such as dates, amounts, and names using regular expressions and heuristic rules. The model feature extraction unit is used to extract semantic entities and contextual features using a pre-trained named entity recognition model and a large language model. The feature fusion unit is used to concatenate rule features and model features and dynamically adjust the weights through an attention mechanism.

[0054] The multi-agent collaborative reasoning module is used to complete deep reasoning of ultra-long documents through the collaboration of multiple specialized agents. This module includes a coordination and distribution agent, a context summarization agent, a long-term memory agent, and an analytical reasoning agent. The coordination and distribution agent receives user query tasks, parses the task type, and decomposes the task into sub-tasks to distribute to other agents. The context summarization agent compresses and summarizes the document's historical content to maintain contextual coherence. The long-term memory agent is responsible for persistent storage and retrieval of knowledge across paragraphs and chapters. The analytical reasoning agent is responsible for deep semantic understanding and logical deduction, and supports multiple rounds of iterative optimization.

[0055] The precise positioning module is used to map the reasoning result back to the specific location of the original document; the precise positioning module includes a coordinate mapping unit and a source tracing report generation unit; the coordinate mapping unit is used to trace the coordinate information such as page number and character offset of the original document through the mapping relationship between semantic block identifiers and element identifiers; the source tracing report generation unit is used to generate a report containing the reasoning conclusion and the original text reference location, which supports user click to jump;

[0056] The knowledge storage module is used to store a structured mapping knowledge base, a context-related knowledge base, and a hybrid annotation knowledge base; the knowledge storage module includes a relational database, a vector database, and a document database; the relational database is used to store structured data such as document structure index tables and element coordinate information; the vector database is used to store the embedding representation of semantic blocks and the inter-block relationships; the document database is used to store the original documents and reasoning reports;

[0057] Compared with the prior art, the present invention has the following beneficial effects:

[0058] 1. This invention addresses the limitations of single-technology approaches in processing ultra-long documents by constructing a hybrid-driven architecture of a rule engine and a large model. The rule engine provides deterministic structured parsing capabilities, ensuring the accuracy and interpretability of document element identification; the large model provides powerful semantic understanding and generalization capabilities, enabling the capture of complex semantic relationships. Both work collaboratively through a feature fusion layer and a conflict resolution mechanism, maintaining the accuracy of rule-based methods while leveraging the flexibility of model-based methods, thereby improving overall inference accuracy and robustness.

[0059] 2. This invention addresses the problem of insufficient long document processing capability caused by the context window limitation of large models through a multi-agent collaborative reasoning mechanism. The coordinating and distributing agent is responsible for task decomposition and scheduling, the summarizing agent is responsible for context compression and summarization, the long-term memory agent is responsible for cross-paragraph knowledge retrieval, and the analytical reasoning agent is responsible for deep semantic derivation. Each agent achieves knowledge sharing and state synchronization through a two-way information interaction mechanism, forming a "divide and conquer, collaborative operation" processing mode. This breaks through the processing boundaries of a single model and achieves efficient processing of hundreds of pages of extremely long documents.

[0060] 3. This invention addresses the lack of precise location capabilities in existing long document processing methods through a structured mapping and coordinate tracing mechanism. In the preprocessing stage, a unique identifier is established for each document element, and its page number, character offset, and other coordinate information in the original document are recorded. During inference, the semantic block identifiers referenced in each inference step are recorded. In the output stage, the inference results are traced back to their specific locations in the original document through identifier mapping relationships. This fine-grained tracing capability allows the system to not only provide inference conclusions but also the original textual evidence supporting those conclusions, thereby enhancing the system's credibility and usability.

[0061] 4. This invention addresses the issues of unstable inference results and logical inconsistencies in large-scale model reasoning through a multi-round iteration and rule verification mechanism. After the reasoning agent generates preliminary reasoning results, the rule verification module performs consistency checks, including dimensions such as format compliance, logical coherence, and data accuracy. If the check fails, the system returns feedback information to the reasoning agent for correction, forming a closed-loop optimization process of "reasoning-verification-correction." This iterative mechanism significantly improves the accuracy and reliability of the reasoning results, achieving a reduction in the error rate.

[0062] 5. This invention addresses the issues of computational complexity and retrieval efficiency in processing ultra-long documents through a hierarchical summarization and hybrid retrieval mechanism. The preceding summary agent employs a hierarchical summarization strategy, generating block-level summaries for each semantic block and chapter-level summaries for each chapter, significantly compressing the context length. The long-term memory agent utilizes a hybrid retrieval mechanism, combining keyword retrieval (BM25) and semantic retrieval (Dense Retrieval), improving retrieval speed while maintaining retrieval accuracy. These optimization strategies enable the system to efficiently process ultra-long documents with limited computing resources, achieving the effect of reducing inference latency and memory consumption. Attached Figure Description

[0063] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0064] Figure 2 This is a schematic diagram of the hybrid-driven multi-agent collaborative reasoning architecture of the present invention;

[0065] Figure 3 This is a schematic diagram of the precise positioning and traceability mechanism of the present invention. Detailed Implementation

[0066] To better illustrate the purpose and advantages of this invention, the invention will be further described below with reference to the accompanying drawings and examples. It should be noted that the implementation of this invention is not limited to the following embodiments, and any modifications or alterations made to this invention will fall within the scope of protection of this invention.

[0067] Example

[0068] like Figure 1 As shown, in the first aspect, the specific implementation steps of the large-model, ultra-long document collaborative reasoning method based on a hybrid-driven architecture in this embodiment are as follows:

[0069] Step 1: Perform structured preprocessing on the extremely long document to build a feature extraction and annotation knowledge base that combines contextual knowledge base and rule model;

[0070] Step 1.1: Standardize the format of the long document and identify the document structure based on regular expressions to generate a document structure index table containing the document hierarchy and element coordinate information;

[0071] Step 1.1.1: Standardize the format of the input long document, unify the encoding format, remove invisible control characters, and use regular expressions to identify the document directory tree, paragraph boundaries and table areas in the document structure to extract the hierarchical structured elements of the document containing titles, paragraphs, tables, headers and footers.

[0072] In this embodiment, multiple document formats such as PDF, DOCX, and TXT are supported for input. For PDF documents, the PyMuPDF or PDFPlumber library is used to extract text content while preserving page layout information; for DOCX documents, the python-docx library is used to extract text and style information. All documents are uniformly converted to UTF-8 encoding, and invisible characters such as BOM tags, zero-width spaces, and control characters (ASCII codes 0-31, excluding newline and tab characters) are removed. Style features such as font size, bolding, and centering are used for auxiliary judgment. For example, in DOCX documents, titles typically have larger font sizes (e.g., 12pt, 3pt), bolding, and larger spacing before and after paragraphs. By combining text content and style features, a hierarchical directory tree structure for the document is constructed. The following regular expression rules are defined:

[0073] First-level heading: r'^Chapter [01234567890 ...

[0074] Second-level heading: r'^\d+\.\d+\s+'

[0075] Third-level heading: r'^\d+\.\d+\.\d+\s+'

[0076] Level 4 heading: r'^\d+\.\d+\.\d+\.\d+\s+'

[0077] In this embodiment, for Markdown format tables, the vertical line separator (|) is used for identification; for plain text documents, the tab character (\t) or the alignment mode of multiple spaces is used for identification; for PDF documents, the coordinate position of text blocks is used to determine whether a row and column structure is formed. The identified table areas are individually marked, and metadata such as cell content and row and column numbers are extracted. Paragraph identification rules include:

[0078] Hard line break: Two consecutive newline characters (\n\n) usually indicate a paragraph boundary;

[0079] First-line indentation: In Chinese documents, the first line of a paragraph is usually indented by 2 characters;

[0080] Punctuation features: Paragraphs usually end with punctuation marks such as periods, question marks, and exclamation marks;

[0081] Length threshold: Lines that are too short (e.g., less than 10 characters) are likely to be headings or list items, rather than paragraphs.

[0082] Step 1.1.2: Create a unique element ID for each structured element, and record the coordinate information of the page number, starting character offset, ending character offset, and line number in the original document. Then, use the document directory tree and element coordinate information to build a document structure index table and form a structured mapping knowledge base.

[0083] In this embodiment, the element identifier adopts the following format: DOC{document ID}_P{page number}_E{element sequence number}. For example, DOC001_P5_E23 represents the 23rd element on page 5 of document 001. Coordinate information records include:

[0084] page_number: Page number (starting from 1);

[0085] start_char_offset: The starting character offset in the entire text (starting from 0);

[0086] end_char_offset: The offset of the end character in the entire text (excluding the end character);

[0087] start_line: The starting line number within the page (starting from 1);

[0088] end_line: The end line number within the page;

[0089] bbox: The bounding box coordinates in the PDF (top left x, y, bottom right x, y).

[0090] In this embodiment, the document structure index table is stored in JSON format, with the following structure:

[0091] json 1234567891011121314151617181920212223242526272829303132

[0093] { "document_id": "DOC001", "total_pages": 156, "total_elements":1247, "table_of_contents": [ { "element_id": "DOC001_P1_E1", "title": "Chapter 1 Project Overview", "level": 1, "page": 1, "children": [ { "element_id": "DOC001_P2_E5", "title": "1.1 Project Background", "level": 2, "page": 2} ]} ], "element_index":[ { "element_id": "DOC001_P1_E1", "type": "heading_1", "content": "Chapter 1 Project Overview", "page": 1, "start_char_offset": 0, "end_char_offset": 12, "parent_id": null} ]}

[0094] Step 1.2: Based on semantic slicing, the document is semantically segmented using chapter or paragraph boundaries as segmentation points, and an inter-block association graph is constructed using the similarity between adjacent semantic blocks. Semantic blocks, block identifiers, and inter-block associations are stored in a vector database to form a context association knowledge base.

[0095] Step 1.2.1: Based on the document structure index table, using chapter or paragraph boundaries as segmentation points, the document is segmented into semantic blocks using a semantic similarity-based segmentation method. Each semantic block contains complete semantic information.

[0096] In this embodiment, a pre-trained Sentence-BERT model (such as paraphrase-multilingual-MiniLM-L12-v2) is used to extract the embedding representation of semantic blocks. This model supports multiple languages ​​and can map text to a 384-dimensional vector space. For each semantic block, the average of the embedding vectors of all its paragraphs is taken as the final representation of the block.

[0097] Step 1.2.2: Use TF-IDF or Sentence-BERT to extract feature vectors for each semantic block, and calculate the cosine similarity between the feature vectors of any two adjacent semantic blocks in the manner shown in Equation (1). Establish an edge of the inter-block association graph for two semantic blocks with similarity higher than a preset threshold. Further, the inter-block association graph is stored in the graph database Neo4j or adjacency list.

[0098] similarity = cos(θ) = (A·B) / (||A|| × ||B||) (1)

[0099] Where A and B are the feature vectors of two semantic blocks, respectively; the preset threshold is set to 0.6;

[0100] Step 1.2.3: Store semantic blocks, block identifiers, and inter-block relationships in a vector database to form a context-related knowledge base; furthermore, Milvus or FAISS is used as the vector database; the embedding vector of each semantic block is stored in the vector index, and metadata is also stored, including chunk_id, page range, and element list; the vector index uses the IVF_FLAT or HNSW algorithm to support efficient approximate nearest neighbor search;

[0101] In this embodiment, the document directory tree is traversed, using first-level or second-level headings as segmentation boundaries. For example, "Chapter 1 Project Overview" and all its sub-chapters (1.1, 1.2, etc.) are treated as a semantic block. This ensures a high degree of thematic consistency within the semantic block. A preset threshold is set to 5000 characters (approximately 1000-1500 Chinese characters). When the length of a chapter exceeds this threshold, a sliding window strategy is used for secondary segmentation: the window size is 4000 characters, and the overlapping area is 500 characters. The overlapping area is designed to maintain contextual continuity and prevent critical information from being cut off.

[0102] In this embodiment, the block identifier adopts the following format:

[0103] DOC{document ID}_C{block number}. For example, DOC001_C5 represents the 5th semantic block of document 001.

[0104] Establish a mapping table to record the list of element identifiers contained in each semantic block:

[0105] { "chunk_id": "DOC001_C5", "element_ids": ["DOC001_P12_E45", "DOC001_P12_E46", "DOC001_P13_E1", ...], "start_page": 12, "end_page": 15,"total_chars": 4523}

[0106] Step 1.3: Construct a feature extraction and annotation knowledge base that integrates rule-based models;

[0107] Step 1.3.1: Extract structured features from the document using a rule engine; the structured features include entities such as date, amount, person's name, and organization's name;

[0108] Step 1.3.2: Extract semantic entities from the document using a pre-trained Named Entity Recognition (NER) model; further, the pre-trained NER model is a pre-trained NER model of spaCy or HanLP;

[0109] Step 1.3.3: Merge the rule extraction results with the model extraction results to form a hybrid labeled knowledge base;

[0110] Step 1.3.3.1: If both the rule and the model identify the same entity, and the overlap between the text content and the location is >80%, then the result of the rule shall prevail;

[0111] Step 1.3.3.2: If only the rule identifies the entity, then retain the rule result;

[0112] Step 1.3.3.3: If only the model identifies entities, retain the model results and mark them as having low confidence.

[0113] Step 1.3.3.4: The final result is stored in JSON format, containing entity text, type, location, source, and confidence fields;

[0114] In this embodiment, the following regular expression rules are defined:

[0115] Date: r'\d{4}year\d{1,2}month\d{1,2}day' or r'\d{4}-\d{2}-\d{2}'

[0116] Amount: r'RMB\s*[\d,]+(?:\.\d+)?yuan' or r'¥\s*[\d,]+(?:\.\d+)?'

[0117] Project ID: r'[AZ]{2,4}-\d{4}-\d{3}'

[0118] In this embodiment, a pre-trained NER model using spaCy or HanLP is used to identify the following entity types:

[0119] PERSON (person's name) ORG (organization's name) GPE (location) DATE (date) MONEY (amount)

[0120] Step 2: Construct and train a multi-agent collaborative reasoning model based on a hybrid-driven architecture; the multi-agent collaborative reasoning model includes a coordination and distribution agent responsible for receiving user query tasks, parsing task types, and decomposing tasks into sub-tasks and allocating them to other agents; a contextual summary agent responsible for compressing and summarizing document history content and maintaining contextual coherence; a long-term memory agent responsible for persistent storage and retrieval of knowledge across paragraphs and chapters; and an analytical reasoning agent responsible for deep semantic understanding and logical deduction.

[0121] Step 2.1: In the deployment of the coordinated distribution agent, BERT or RoBERTa intent recognition models are used to classify user queries by intent. The query types are identified as fact retrieval, logical reasoning, document generation, and consistency verification. Keywords are extracted based on the query type, and full-text search is performed in the document structure index table to obtain semantic blocks containing keywords. Semantic similarity search is performed using a vector database to obtain the Top-K most relevant semantic blocks. At the same time, Celery or RabbitMQ is used to implement the task queue, and the scheduler determines the task execution order based on the subtask priority and dependency.

[0122] In the embodiments, such as Figure 2 As shown, the multi-agent collaborative reasoning architecture comprises four core agents: a coordination and distribution agent, a context summarization agent, a long-term memory agent, and an analytical reasoning agent. The model training employs the cross-entropy loss function, achieving an accuracy of over 92% on the validation set.

[0123] In this embodiment, the training dataset includes the following categories:

[0124] Fact retrieval: such as "What is the total budget for the project?", "When did the project start?"

[0125] Logical reasoning: such as "Is the project schedule behind schedule?" and "Is the resource allocation reasonable?"

[0126] Document generation: such as "Generate Project Weekly Report" and "Draft Acceptance Report".

[0127] Consistency checks: such as "checking if the dates in the documents are consistent" or "verifying the amount data".

[0128] In this embodiment, each subtask includes the following information:

[0129] task_id: Unique task identifier

[0130] task_type: Task type (summary, retrieval, reasoning, etc.)

[0131] priority: Priority (1-5, 1 is the highest)

[0132] dependencies: A list of prerequisite task IDs

[0133] payload: Task parameters (such as a list of chunk_ids, query text, etc.)

[0134] The scheduler determines the execution order of tasks based on priority and dependencies. If task A depends on the result of task B, then task B must be completed first.

[0135] Step 2.2: Building upon the agent deployment summarized above, hierarchical summarization is employed for extracting and generating summaries. For extractive summarization, TextRank or BERTScore is used to extract important sentences from the original text. For generative summarization, a large language model is used to rewrite and compress the extracted sentences, generating block-level summaries for each semantic block and chapter-level summaries for each chapter. A pre-trained large language model is then used to fuse extractive and generative summarization through Prompt Engineering. An inverse index is established between the summarization results and the original document coordinates to support tracing the source from the summary to the original text.

[0136] In this embodiment, the length of block-level summaries is controlled between 200-300 words, and the length of chapter-level summaries is controlled between 500-800 words. A hybrid extractive + abstractive strategy is used for summary generation: extractive summarization: using TextRank or BERTScore algorithms to select the most important sentences from the original text; generative summarization: using large language models (such as ChatGLM, Qwen) to rewrite and compress the extracted sentences. In this embodiment, the following Prompt template is designed:

[0137] "You are a professional document summarization assistant. Please generate a concise and accurate summary based on the following: [Original Content] {extracted_sentences} [Requirements] 1. The summary length should be limited to {max_length} words. 2. Retain key data (such as dates, amounts, names). 3. Maintain objectivity and neutrality; do not add subjective evaluations. 4. Use fluent Chinese expression. [Summary]"

[0138] In this embodiment, the position (element_id or character offset) of each summary sentence in the original text is recorded. When a user views the summary, they can click on a sentence in the summary, and the system will automatically jump to the corresponding position in the original document.

[0139] Step 2.3: In the deployment of long-term memory agents, provide a mixed inspection of semantic block embedding representation stored in the vector database with TOP-K filtering based on Elasticsearch keywords and Milvus semantics for RRF fusion and mixed inspection. When the document content changes, incremental updates are performed on the affected semantic blocks and corresponding indexes.

[0140] In this example, Milvus version 2.3 is used, and the configuration is as follows:

[0141] Vector dimension: 384 (consistent with Sentence-BERT)

[0142] Index type: HNSW (Hierarchical Navigable Small World)

[0143] HNSW parameters: M=16, efConstruction=200

[0144] Similarity metric: Cosine similarity

[0145] Elasticsearch is used to implement BM25 keyword retrieval, while Milvus is used for semantic retrieval. The retrieval process is as follows:

[0146] Segment the user query into words and extract keywords;

[0147] Perform a BM25 search in Elasticsearch to retrieve the top 50 document blocks;

[0148] The query text is encoded into a vector, and semantic retrieval is performed in Milvus to obtain the top-50 document blocks.

[0149] The two result sets are merged using the Reciprocal Rank Fusion (RRF) algorithm: score = 1 / (k + rank_bm25) + 1 / (k + rank_dense), where k = 60 and rank is the document's ranking in its respective search result. The top-10 document blocks with the highest scores after fusion are taken as the final search results.

[0150] In this embodiment, document change events (such as a user uploading a new version of a document) are monitored, and the document structure index tables of the old and new versions are compared to identify newly added, modified, or deleted semantic blocks. For modified semantic blocks, the embedding vector is recalculated and the vector database is updated; for deleted semantic blocks, they are removed from the index; and for newly added semantic blocks, they are added to the index.

[0151] Step 2.4: In the deployment of the analytical reasoning agent, a large language model is used as the reasoning engine, and multi-step reasoning is achieved through chain-of-thought prompts; a rule verification module is introduced to check the logical consistency of the reasoning results; and a multi-round iterative mechanism is implemented to gradually optimize the reasoning results through feedback loops.

[0152] Step 2.4.1: Perform format compliance, logical coherence, data accuracy, and reference integrity checks through the rule verification module, and generate a verification report containing error type, error location, and correction suggestions;

[0153] Step 2.4.2: If the verification passes, output the final result; if the verification fails, send the verification report back to the analysis and reasoning agent for iterative reasoning until the reasoning result is obtained.

[0154] In this embodiment, Qwen-14B or ChatGLM3-6B is used as the inference engine. The CoT Prompt template is designed as follows:

[0155] "You are a professional project management expert. Please answer the questions based on the following document. [Document Content] {retrieved_chunks} [Question] {question} [Reasoning Steps] Please follow these steps to reason: 1. Extract key information from the question. 2. Find relevant facts and data from the document content. 3. Perform logical analysis and deduction. 4. Draw a conclusion. [Answer]"

[0156] In this embodiment, rule validation includes the following dimensions:

[0157] Format compliance: Check whether the date format and amount format comply with the specifications;

[0158] Logical coherence: Check for logical contradictions between reasoning steps (e.g., "the project started in 2023" and "the project started in 2024" appearing simultaneously).

[0159] Data accuracy: Check whether the numerical calculations are correct (e.g., "total budget = sum of individual budget items").

[0160] Citation integrity: Check whether the reasoning conclusion has sufficient original text support.

[0161] In this embodiment, the maximum number of iterations is set to 3. The process of each iteration is as follows: the analysis and reasoning agent generates preliminary reasoning results; the rule verification module checks the results and generates a verification report (including error type, error location, and correction suggestions); if the verification passes, the final result is output; if the verification fails, the verification report is fed back to the analysis and reasoning agent, requesting it to make corrections; the analysis and reasoning agent re-reasons based on the feedback and enters the next iteration.

[0162] Step 2.5: Construct a hybrid-driven feature fusion and decision-making mechanism;

[0163] Step 2.5.1: Establish a rule model feature fusion layer for the feature vector of the entity recognition task, concatenate the structured features extracted by the rule engine, the semantic features extracted by the large model, and the context features containing the semantic vector, and dynamically adjust the weights of the rule features and model features according to the task type for attention weighting;

[0164] In this embodiment, for each entity recognition task, the feature vector is represented as:

[0165] feature_vector = concat(rule_features, model_features, context_features)

[0166] in:

[0167] rule_features: Features extracted from rules (such as regular expression matching score, format compliance score);

[0168] model_features: Features extracted by the model (such as the confidence score and embedding vector of the NER model);

[0169] context_features: Contextual features (such as semantic vectors of the preceding and following text).

[0170] In this embodiment, a self-attention mechanism is used to calculate the weights:

[0171] attention_score = softmax(W_q · feature_vector^T)weighted_feature =attention_score · feature_vector

[0172] For tasks with strong structure (such as date and amount extraction), the weight of rule features will be automatically increased; for tasks with strong semantic understanding (such as sentiment analysis and intent recognition), the weight of model features will be automatically increased.

[0173] Step 2.5.2: Use confidence scores to resolve conflicts between rule results and model results. When rule results and model results are inconsistent, use confidence score voting or manual intervention mechanisms.

[0174] In this embodiment, the conflict resolution strategy is as follows:

[0175] If the rule confidence is greater than 0.9 and the model confidence is less than 0.6, then the rule result is adopted.

[0176] If the rule confidence is <0.6 and the model confidence is >0.9, then the model result is adopted;

[0177] If both confidence levels are >0.8 but the results are inconsistent, they are marked as "conflicting" and both results are recorded for manual review.

[0178] If both confidence levels are <0.6, they are marked as "uncertain" and require manual intervention.

[0179] Step 2.6: During the reasoning process, record the semantic block identifiers referenced for each reasoning step; trace back to the coordinate information of the original document through the mapping relationship between semantic block identifiers and element identifiers; generate a reasoning report containing the original document reference location, allowing users to click and jump to the corresponding location in the original document;

[0180] Step 3: Based on the trained hybrid-driven multi-agent collaborative reasoning model, perform real-time collaborative reasoning and precise localization on ultra-long documents, and generate a final report containing reasoning conclusions and original text citation locations;

[0181] Step 3.1: Receive the user's input of a very long document and query task, and call the rule engine to preprocess the document and build a structured mapping knowledge base;

[0182] In the embodiments, such as Figure 3 As shown, the analytical reasoning agent outputs citation information simultaneously when generating the reasoning conclusion:

[0183] json

[0184] { "conclusion": "The total budget for this project is 50 million yuan", "citations": [ { "chunk_id":"DOC001_C5", "element_id": "DOC001_P12_E45", "quote": "The total budget for this project is 50 million yuan"} ]}

[0185] Step 3.2: Coordinate and distribute intelligent agents to parse query tasks, perform task deconstruction, and formulate multi-agent collaborative scheduling strategies;

[0186] Step 3.2.1: The coordination and distribution agent receives the query task input by the user, calls the intent recognition model to classify the query intent, and extracts the key entities, time span, and logical constraints in the query task as anchor points for retrieval and inference.

[0187] Step 3.2.2: For complex long-range query tasks, the coordination and distribution agent deconstructs the main query task into several independent sub-tasks or sub-tasks with temporal dependencies, and constructs a directed acyclic dependency graph (DAG) for the execution of sub-tasks based on business logic.

[0188] Step 3.2.3: Determine the processing strategy and execution priority of each subtask based on the dependency graph, clarify the execution order and input / output interface of the long-term memory agent, the previous summary agent, and the analysis and reasoning agent in each subtask, and distribute the split subtasks to the corresponding agents through the task queue routing.

[0189] Step 3.2.4: Establish a global collaborative state monitoring mechanism to track the processing progress, data flow status and anomaly feedback of each agent during subsequent multi-agent collaborative execution, and provide global scheduling support for context relay between agents;

[0190] In this example, the mapping table is queried:

[0191] chunk_id "DOC001_C5" → element_ids ["DOC001_P12_E45", ...]element_id "DOC001_P12_E45" → {page: 12, start_offset: 3456, end_offset: 3489}

[0192] In this example, the precise location of the original document is obtained: page 12, character offset 3456-3489. The inference report is in HTML format and includes the following functions:

[0193] The textual presentation of the reasoning conclusion;

[0194] The original text is highlighted;

[0195] Clicking on the quote will automatically jump to the corresponding page number and location in the PDF viewer;

[0196] It supports exporting to PDF or Word format.

[0197] In this embodiment, users upload documents (supporting PDF and DOCX formats) and enter query text via a web interface or API. The system assigns a unique ID to the document and initiates an asynchronous processing flow. The preprocessing flow includes steps such as format standardization, structure recognition, semantic segmentation, and feature extraction, with the expected time being proportional to the document length. For a 100-page PDF document, the preprocessing time is approximately 30-60 seconds. The intent recognition model completes classification within 50ms, determining the task type as "fact retrieval." The coordinating and distributing agent selects the appropriate processing strategy based on the task type: for fact retrieval, a hybrid retrieval mechanism is prioritized; for logical reasoning, an analytical reasoning agent is invoked.

[0198] Step 3.3: Multi-agent collaboratively execute reasoning tasks;

[0199] Step 3.3.1: The long-term memory agent retrieves relevant semantic blocks from the vector database based on the query content;

[0200] Step 3.3.2: As summarized above, the agent summarizes the retrieved semantic blocks to generate a contextual summary;

[0201] Step 3.3.3: Analyze the reasoning agent to perform deep reasoning by combining contextual summaries and original semantic blocks;

[0202] Step 3.3.4: The rule verification module performs a consistency check on the inference results;

[0203] Step 3.3.5: If the check result fails, return to step 3.4.3 for iterative optimization until the maximum number of iterations is reached or the check result passes;

[0204] Step 3.4: The precise positioning module maps the inference results back to the original document coordinates;

[0205] Step 3.5: Generate a final report containing the reasoning conclusions and the original text citations;

[0206] In this embodiment, the hybrid retrieval mechanism returns the top-10 relevant semantic blocks within 100ms, with a total character count of approximately 10,000-15,000 characters. These 10 semantic blocks are compressed into a 1,000-1,500-character summary, retaining key information and data. Summary generation takes approximately 2-3 seconds. The summary and original semantic blocks are concatenated into a prompt, which is then input into the large language model. The model generates inference results and citation information within 3-5 seconds. Rule validation is completed within 500ms. Checks include date format, amount format, numerical calculations, logical contradictions, etc. 90% of the inference results pass the first validation; of the remaining 10%, most pass in the second iteration; very few require a third iteration. Using the chunk_id and element_id of the citation information, the page number and character offset are retrieved from the mapping table. The mapping process is completed within 10ms. The final report is returned to the front-end in JSON format, which renders it as an HTML page, supporting interactive viewing and navigation. The entire reasoning process, from receiving the query to returning the result, takes approximately 5-10 seconds.

Claims

1. A collaborative reasoning method for large-scale, ultra-long documents based on a hybrid-driven architecture, characterized in that: Includes the following steps, Step 1: Perform structured preprocessing on the extremely long document to build a feature extraction and annotation knowledge base that combines contextual knowledge base and rule model; Step 1.1: Standardize the format of the long document and identify the document structure based on regular expressions to generate a document structure index table containing the document hierarchy and element coordinate information; Step 1.2: Based on semantic slicing, the document is semantically segmented using chapter or paragraph boundaries as segmentation points, and an inter-block association graph is constructed using the similarity between adjacent semantic blocks. Semantic blocks, block identifiers, and inter-block associations are stored in a vector database to form a context association knowledge base. Step 1.3: Construct a feature extraction and annotation knowledge base that integrates rule-based models; Step 2: Construct and train a multi-agent collaborative reasoning model based on a hybrid-driven architecture; the multi-agent collaborative reasoning model includes a coordination and distribution agent responsible for receiving user query tasks, parsing task types, and decomposing tasks into sub-tasks and allocating them to other agents; a contextual summary agent responsible for compressing and summarizing document history content and maintaining contextual coherence; a long-term memory agent responsible for persistent storage and retrieval of knowledge across paragraphs and chapters; and an analytical reasoning agent responsible for deep semantic understanding and logical deduction. Step 2.1: In the deployment of the coordinated distribution agent, BERT or RoBERTa intent recognition models are used to classify user queries by intent. The query types are identified as fact retrieval, logical reasoning, document generation, and consistency verification. Keywords are extracted based on the query type, and full-text search is performed in the document structure index table to obtain semantic blocks containing keywords. Semantic similarity search is performed using a vector database to obtain the Top-K most relevant semantic blocks. At the same time, Celery or RabbitMQ is used to implement the task queue, and the scheduler determines the task execution order based on the subtask priority and dependency. Step 2.2: Building upon the agent deployment summarized above, hierarchical summarization is employed for extracting and generating summaries. For extractive summarization, TextRank or BERTScore is used to extract important sentences from the original text. For generative summarization, a large language model is used to rewrite and compress the extracted sentences, generating block-level summaries for each semantic block and chapter-level summaries for each chapter. A pre-trained large language model is then used to fuse extractive and generative summarization through Prompt Engineering. An inverse index is established between the summarization results and the original document coordinates to support tracing the source from the summary to the original text. Step 2.3: In the deployment of long-term memory agents, provide a mixed inspection of semantic block embedding representation stored in the vector database with TOP-K filtering based on Elasticsearch keywords and Milvus semantics for RRF fusion and mixed inspection. When the document content changes, incremental updates are performed on the affected semantic blocks and corresponding indexes. Step 2.4: In the deployment of the analytical reasoning agent, a large language model is used as the reasoning engine, and multi-step reasoning is achieved through chain-of-thought prompts; a rule verification module is introduced to check the logical consistency of the reasoning results; and a multi-round iterative mechanism is implemented to gradually optimize the reasoning results through feedback loops. Step 2.5: Construct a hybrid-driven feature fusion and decision-making mechanism; Step 2.6: During the reasoning process, record the semantic block identifiers referenced for each reasoning step; trace back to the coordinate information of the original document through the mapping relationship between semantic block identifiers and element identifiers; generate a reasoning report containing the original document reference location, allowing users to click and jump to the corresponding location in the original document; Step 3: Based on the trained hybrid-driven multi-agent collaborative reasoning model, perform real-time collaborative reasoning and precise localization on ultra-long documents, and generate a final report containing reasoning conclusions and original text citation locations; Step 3.1: Receive the user's input of a very long document and query task, and call the rule engine to preprocess the document and build a structured mapping knowledge base; Step 3.2: Coordinate and distribute intelligent agents to parse query tasks, perform task deconstruction, and formulate multi-agent collaborative scheduling strategies; Step 3.3: Multi-agent collaboratively execute reasoning tasks; Step 3.4: The precise positioning module maps the inference results back to the original document coordinates; Step 3.5: Generate a final report containing the reasoning conclusions and the original text citations.

2. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 1.1 is implemented as follows: Step 1.1.1: Standardize the format of the input long document, unify the encoding format, remove invisible control characters, and use regular expressions to identify the document directory tree, paragraph boundaries and table areas in the document structure to extract the hierarchical structured elements of the document containing titles, paragraphs, tables, headers and footers. Step 1.1.2: Create a unique element identifier (Element ID) for each structured element, and record the coordinate information of the page number, starting character offset, ending character offset, and line number in the original document. Then, use the document directory tree and element coordinate information to build a document structure index table and form a structured mapping knowledge base.

3. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 1.2 is implemented as follows: Step 1.2.1: Based on the document structure index table, using chapter or paragraph boundaries as segmentation points, the document is segmented into semantic blocks using a semantic similarity-based segmentation method. Each semantic block contains complete semantic information. Step 1.2.2: Use TF-IDF or Sentence-BERT to extract feature vectors for each semantic block, and calculate the cosine similarity between the feature vectors of any two adjacent semantic blocks in the manner shown in Equation (1). Establish an edge of the inter-block association graph for two semantic blocks with similarity higher than a preset threshold. Further, the inter-block association graph is stored in the graph database Neo4j or adjacency list. similarity = cos(θ) = (A·B) / (||A|| × ||B||) (1) Where A and B are the feature vectors of two semantic blocks, respectively; the preset threshold is set to 0.6; Step 1.2.3: Store semantic blocks, block identifiers, and inter-block relationships in a vector database to form a context-related knowledge base; furthermore, Milvus or FAISS is used as the vector database; the embedding vector of each semantic block is stored in the vector index, and metadata is also stored, including chunk_id, page range, and element list; the vector index uses the IVF_FLAT or HNSW algorithm to support efficient approximate nearest neighbor search.

4. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 1.3 is implemented as follows: Step 1.3.1: Extract structured features from the document using a rule engine; the structured features include entities such as date, amount, person's name, and organization's name; Step 1.3.2: Extract semantic entities from the document using a pre-trained Named Entity Recognition (NER) model; further, the pre-trained NER model is a pre-trained NER model of spaCy or HanLP; Step 1.3.3: Merge the rule extraction results with the model extraction results to form a hybrid labeled knowledge base.

5. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 4, characterized in that: The implementation method for step 1.3.3 is as follows: Step 1.3.3.1: If both the rule and the model identify the same entity, and the overlap between the text content and the location is > 80%, then the rule result shall prevail; Step 1.3.3.2: If only the rule identifies the entity, then retain the rule result; Step 1.3.3.3: If only the model identifies entities, retain the model results and mark them as having low confidence. Step 1.3.3.4: The final result is stored in JSON format, containing entity text, type, location, source, and confidence fields.

6. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 2.4 is implemented as follows: Step 2.4.1: Perform format compliance, logical coherence, data accuracy, and reference integrity checks through the rule verification module, and generate a verification report containing error type, error location, and correction suggestions; Step 2.4.2: If the verification passes, output the final result; If the verification fails, the verification report will be fed back to the analysis and reasoning agent for iterative reasoning until the reasoning result is obtained.

7. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 2.5 is implemented as follows: Step 2.5.1: Establish a rule model feature fusion layer for the feature vector of the entity recognition task, concatenate the structured features extracted by the rule engine, the semantic features extracted by the large model, and the context features containing the semantic vector, and dynamically adjust the weights of the rule features and model features according to the task type for attention weighting; Step 2.5.2: Use confidence to resolve conflicts between rule results and model results. When rule results and model results are inconsistent, use confidence voting or manual intervention mechanisms.

8. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 3.2 is implemented as follows: Step 3.2.1: The coordination and distribution agent receives the query task input by the user, calls the intent recognition model to classify the query intent, and extracts the key entities, time span, and logical constraints in the query task as anchor points for retrieval and inference. Step 3.2.2: For complex long-range query tasks, the coordination and distribution agent deconstructs the main query task into several independent sub-tasks or sub-tasks with temporal dependencies, and constructs a directed acyclic dependency graph (DAG) for the execution of sub-tasks based on business logic. Step 3.2.3: Determine the processing strategy and execution priority of each subtask based on the dependency graph, clarify the execution order and input / output interface of the long-term memory agent, the previous summary agent, and the analysis and reasoning agent in each subtask, and distribute the split subtasks to the corresponding agents through the task queue routing. Step 3.2.4: Establish a global collaborative state monitoring mechanism to track the processing progress, data flow status and anomaly feedback of each agent during subsequent multi-agent collaborative execution, and provide global scheduling support for context relay between agents.

9. The collaborative reasoning method for large-model, ultra-long documents based on a hybrid-driven architecture as described in claim 1, characterized in that: Step 3.3 is implemented as follows: Step 3.3.1: The long-term memory agent retrieves relevant semantic blocks from the vector database based on the query content; Step 3.3.2: As summarized above, the agent summarizes the retrieved semantic blocks to generate a contextual summary; Step 3.3.3: Analyze the reasoning agent to perform deep reasoning by combining contextual summaries and original semantic blocks; Step 3.3.4: The rule verification module performs a consistency check on the inference results; Step 3.3.5: If the check result fails, return to step 3.4.3 for iterative optimization until the maximum number of iterations is reached or the check result passes.

10. A collaborative reasoning system for large-model, ultra-long documents based on a hybrid-driven architecture, as described in claim 1, characterized in that: It includes a document preprocessing module, a hybrid feature extraction module, a multi-agent collaborative reasoning module, a precise localization module, and a knowledge storage module; The document preprocessing module is used to perform format standardization, structure recognition, and semantic segmentation on the input long document; the document preprocessing module includes a format standardization unit, a structure recognition unit, and a semantic segmentation unit; The format standardization unit is used to unify document encoding format and remove invisible control characters; The structure recognition unit is used to extract structured elements such as hierarchical headings, paragraphs, and tables from a document using rules based on regular expressions, and to establish a unique identifier and coordinate information for each element. The semantic segmentation unit is used to segment a very long document into multiple semantic blocks according to the document structure, and to calculate the semantic similarity between blocks to construct an association graph; The hybrid feature extraction module is used to extract the structural and semantic features of a document by combining a rule engine and a large model; the hybrid feature extraction module includes a rule feature extraction unit, a model feature extraction unit, and a feature fusion unit; The rule feature extraction unit is used to extract structured entities such as dates, amounts, and names using regular expressions and heuristic rules; The model feature extraction unit is used to extract semantic entities and contextual features using a pre-trained named entity recognition model and a large language model. The feature fusion unit is used to concatenate rule features and model features, and dynamically adjust the weights through an attention mechanism; The multi-agent collaborative reasoning module is used to complete deep reasoning of ultra-long documents through the collaboration of multiple specialized agents; the multi-agent collaborative reasoning module includes a coordination and distribution agent, a previous text summarization agent, a long-term memory agent, and an analysis and reasoning agent; The coordination and distribution agent is used to receive user query tasks, parse task types, and decompose tasks into subtasks and distribute them to other agents. The aforementioned intelligent agent is used to compress and summarize the historical content of documents, maintaining contextual coherence. The long-term memory agent is responsible for the persistent storage and retrieval of knowledge across paragraphs and chapters; The analytical reasoning agent is responsible for deep semantic understanding and logical deduction, and supports multiple rounds of iterative optimization; The precise positioning module is used to map the reasoning result back to the specific location of the original document; the precise positioning module includes a coordinate mapping unit and a source tracing report generation unit; The coordinate mapping unit is used to trace the coordinate information of the original document, such as page number and character offset, through the mapping relationship between semantic block identifiers and element identifiers. The source tracing report generation unit is used to generate a report that includes the reasoning conclusion and the original text citation location, and supports users to click to jump to it; The knowledge storage module is used to store a structured mapping knowledge base, a context-related knowledge base, and a hybrid annotation knowledge base; the knowledge storage module includes a relational database, a vector database, and a document database; The relational database is used to store structured data such as document structure index tables and element coordinate information; The vector database is used to store the embedded representations of semantic blocks and the relationships between blocks; The document database is used to store source documents and reasoning reports.