Document review method based on multi-agent cooperation and retrieval enhancement generation
The document review method that enhances document generation through multi-agent collaboration and retrieval solves the problems of inflexible rule input, insufficient knowledge enhancement, and low matching efficiency in existing document review methods. It achieves automated, intelligent, and interpretable document review, improving review efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-20
AI Technical Summary
Existing document review methods suffer from problems such as inflexible rule input, lack of knowledge enhancement capabilities, low efficiency in matching rules with content, and lack of autonomous reasoning and dynamic workflow capabilities, resulting in a large workload, long review time, and a high risk of errors.
We adopt a method based on multi-agent collaboration and retrieval enhancement. We use natural language processing to parse rules and expand the knowledge base to perform multimodal document parsing and chapter segmentation. We combine a multi-agent collaboration mechanism to perform rule parsing, document segmentation, knowledge retrieval, matching and comparison and report generation. We introduce a RAG module to supplement external evidence to improve the accuracy of review.
It enables flexible rule input, multimodal content processing, and external knowledge enhancement, improving the efficiency, accuracy, and authority of review, and possesses good scalability and application prospects.
Smart Images

Figure CN121706760A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of document processing and artificial intelligence application technology, and in particular to an automated document review method based on multi-agent collaboration and retrieval enhancement. Background Technology
[0002] Document review is a crucial task in the compilation and processing of various normative documents, widely applied in patent applications, legal contracts, standard setting, and internal corporate documents. Traditional document review relies primarily on manual labor, requiring reviewers to meticulously verify the document content against established review rules. This method is not only labor-intensive and time-consuming but also prone to omissions and errors.
[0003] With the development of artificial intelligence, some researchers have attempted to automate the initial processing of documents using Natural Language Processing (NLP) and text analysis techniques. However, existing technologies still have the following shortcomings: Inflexible rule input: Existing document review systems typically require rules to be written using fixed templates or scripts, making it difficult for reviewers to directly input rules in natural language, resulting in a high barrier to entry; Lack of knowledge enhancement capabilities: Many rules rely on external knowledge (such as legal provisions and industry standards), and existing methods struggle to dynamically call external knowledge bases for comparison and verification during document review; Low efficiency in rule-content matching: Existing systems mostly use keyword matching, which cannot achieve accurate comparison across chapters and multimodal (text, tables, images) conditions, making it difficult to guarantee review quality; Lack of autonomous reasoning and dynamic workflow capabilities: Current automated document processing methods mostly rely on fixed processes, lacking the ability for intelligent agents to make autonomous decisions and dynamically schedule, making it difficult to adapt to complex and ever-changing document scenarios.
[0004] Therefore, there is an urgent need for a document review method that combines intelligent agent workflow with RAG technology, which can not only achieve flexible rule input and multimodal parsing, but also call on external knowledge to enhance review capabilities and generate interpretable and traceable review results, thereby achieving intelligent and more authoritative document review. Summary of the Invention
[0005] To overcome the shortcomings of existing document review methods, this invention proposes a document review method based on multi-agent collaboration and retrieval enhancement.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] A document review method based on multi-agent collaboration and retrieval enhancement, the method comprising the following steps:
[0008] 1) Rule Input and Knowledge Expansion: The natural language rules input by the user are parsed and extracted into structured fields (the relevant chapter / element, predicate type, constraints, required evidence type, etc.), and a unique identifier and version are generated for each rule. Based on this, the RAG knowledge base is queried to supplement relevant clauses / standards, and the rules are compared with existing templates to mark reuse / inheritance relationships. The resulting rule cards are written into the Blackboard sharing module (BB), and the above methods are encapsulated into a rule agent.
[0009] 2) Document content input and segmentation: Receive documents to be reviewed, complete preprocessing such as format / encoding recognition, noise reduction and layout OCR; construct a chapter tree of "document → chapter → subsection → element" based on this, normalize the aliases of chapter titles, establish a unified cross-text search index for each element and write it into BB, and encapsulate the above methods into a segmentation agent.
[0010] 3) Multimodal content processing: perform structured parsing of tables (table headers, cells, and merge relationships, etc.), perform OCR and visual concept extraction on images, and recognize and standardize the expression of formulas; encapsulate text, tables, images, and formulas into evidence units with location information and incorporate them into full-text indexes and black-and-white (BB); finally, encapsulate the above methods into a multimodal processing agent.
[0011] 4) Matching Review: Read the rule cards and evidence index in BB, and first recall candidate evidence based on the full-text index; when the matching information is insufficient or ambiguous, the built-in RAG knowledge base of Dify is called to supplement external evidence; calculate the matching degree between the rules and candidate evidence and compare it with the preset threshold, and output conclusions such as "pass / fail / need to be revised". At the same time, the interpretability traceability information is recorded and written back to BB. Finally, the above methods are encapsulated into a matching review agent.
[0012] 5) Review report generation: Gather the conclusions of each rule and the corresponding evidence, generate document-level results based on business weights and thresholds, form a review report containing the traceability chain, export it in editable and non-editable formats, write the report object and index back to BB, and finally encapsulate the above methods into a report generation agent.
[0013] Furthermore, the rule input and knowledge expansion in step 1) are executed by the Dify rule agent. This rule agent is encapsulated as a tool within the Dify workflow and provided externally. Its invocation strategy is a function-calling strategy, sequentially calling tools A, B, and C in a predetermined order to complete the processing. Specifically, this includes:
[0014] Step 101, Rule Semantic Parsing and Intermediate Representation Construction: The rule agent receives natural language rule text, performs word segmentation, part-of-speech tagging, named entity recognition, and semantic dependency parsing, extracts rule elements, and maps them into quadruple intermediate representations.
[0015] R =<scope,predicatie,constraint,evidence_need>
[0016] Wherein, scope is the set of chapters or elements to which the rule applies, predicate is the semantic predicate, constraint is the constraint condition corresponding to the predicate, and evidence_need is the type of evidence required to complete the judgment; the steps are encapsulated in the Dify workflow as "Tool A (Rule-Parse & Sign)".
[0017] Step 102, Rule Templating and Versioning: Map R to the system's internal rule template library and assign a unique identifier, rule_, to each rule. id and version number v, denoted as rule_ id @v, and generate the rule signature sig(R).
[0018] =hash(normalize(scope)||normalize(predicate)||normalize(constraint))
[0019] Where hash(·) is the hash function, normalize(·) is the field normalization function, and "||" is the string concatenation function; and reuse / inheritance is determined based on semantic similarity, if the following conditions are met:
[0020] sim(R_ new ,R_ ref )≥τ_ reuse
[0021] The suggestion is to reuse / inherit and record the differences, denoted as Δ = diff(R_ new ,R_ ref ); where sim(·,·) represents the pair
[0022] <scope,predicate,constraint> The cosine similarity τ_ is calculated from the combined embedded vectors. reuse The reuse threshold is used, and `diff(·,·)` is the rule field-level difference calculation function, which outputs a set of difference fields. The phrase "prompt reuse / inherit and record differences" means: setting a reuse flag for new rules with semantic similarity to existing templates and outputting a set of difference fields Δ for traceability; this step is incorporated into "Tool A" and provided externally.
[0023] Step 103, Construction of retrieval enhancement and expansion rule set: Two-stage retrieval enhancement is triggered by R's scope, predicate, and constraint: 1) In the fast retrieval stage, sparse and dense joint recall is performed based on key phrases;
[0024] 2) In the rearrangement and evidence extraction stage, the candidates are rearranged and fragments aligned with the key points of the rules are extracted to form an expanded rule set.
[0025] R + ={(d_k,fragment_k,score_k)}_(k=1..K)
[0026] Where, d k For identifying the source document of evidence, fragment_ k To align the segments, score_ k ∈[0,1] represents the matching confidence level; the search results are distributed according to the confidence level {score}. r Merge if the following conditions are met:
[0027] max(score_r)<τ_expand
[0028] The report will then indicate "[Insufficient external evidence]", where τ_ expand The evidence threshold is used; the steps are encapsulated in the Dify workflow as "Tool B (Rule-RAG)".
[0029] Step 104, Rule Alignment and Conflict Detection: Align and detect conflicts between rules with overlapping or mutually constraining scopes within the rule base. If mutual exclusion or contradiction exists, resolve it according to a priority strategy. The priority score P is calculated using the following formula:
[0030] P(R) = α·src_ weight +β·version_ score ;
[0031] Among them, src_ weight As the source credibility weight for the rule, version_ score For version / timeliness scoring, α and β are non-negative weighting coefficients, and preferably α+β=1; conflict solutions and their reasons are recorded on a blackboard for evidence preservation and traceability; the steps are encapsulated in the Dify workflow as "Tool C (Rule-Align & Conflict)".
[0032] The calling strategy between the rule agent and the tools is a fixed strategy: only a function calling strategy is used, calling tools in the order of "tool A → tool B → tool C" to achieve rule parsing, retrieval enhancement, and conflict handling; tool selection and parameters are preset and not dynamically changed according to runtime conditions; at the end of the steps, the rule agent publishes the RuleCard in the form of blackboard entries, containing rule_ id v, sig(R), R, R + The system collects conflict pre-detection results and audit information, and then transmits these results to the next process or a designated collaborative agent.
[0033] Furthermore, step 2) "Document content input and segmentation" is executed by the Dify document segmentation agent. This agent is provided externally as a tool encapsulated within the Dify workflow, and its invocation strategy is the ReAct strategy. It selects and executes tools from the pre-registered tool set based on a preset scoring function, completing document preprocessing, hierarchical structure construction, chapter alias normalization, and fine-grained index construction. Specifically, this includes:
[0034] Step 201, Document Format Recognition and Preprocessing: The system receives the document to be reviewed, performs format detection and character encoding recognition, and preprocesses it using noise reduction, OCR text enhancement, and layout parsing; it parses the PDF document page by page and saves the layout layer and text layer for subsequent location; this step is encapsulated in the Dify workflow as "Tool D (Doc-Preprocess-OCR)", in which the OCR engine, layout parser, and enhancement model are selected as candidate sub-tools by the ReAct strategy from the toolset.
[0035] Step 202, Hierarchical Chapter Tree Construction: Construct a four-layer chapter tree based on the table of contents, layout, and semantic clues.
[0036] HTP={Document→Chapter→Section→Element};
[0037] Here, "Element" represents a paragraph, table, image, or formula; "Document" represents the root node of the document; "Chapter" represents a collection of first-level chapters; "Section" represents a collection of second-level or more detailed sub-chapters; "Element" represents the smallest unit of retrieval and comparison (which can be a text paragraph / table / image / formula, etc.); the parent-child relationship is determined by a combination of page numbers / hierarchical numbering / heading styles / semantic hints, etc.; this step is encapsulated in the Dify workflow as "Tool E (HTP-Build)".
[0038] Step 203: Perform aliasing normalization between the document chapter titles and the scope in the rule base: using vector similarity mapping.
[0039] map(t)=argmax_{s∈S_scope}cos(v_ t ,v_ s );
[0040] Where t is the extracted chapter title text from the document; S_ scope The standard chapter / element names and their synonym sets in the rule base; v_ t v_ is the text embedding vector for the title t; s Let be the text embedding vector of the scope candidates s; cos(·,·) is the cosine similarity; if the following conditions are met:
[0041] max_{s∈S_scope}cos(v_ t ,v_ s )<θ_alias,
[0042] The title will then be marked as "[Non-standard Chapter]" and submitted to the document segmentation AI or for manual review; where θ_ alias The alias normalization threshold, with a value range of [0,1], is used to control the strictness of alias convergence; this step is encapsulated in the Dify workflow as "Tool F (Scope-AliasMap)".
[0043] Step 204, Fine-grained unitization segmentation and indexing: Number each Element in the chapter tree and build a full-text index, recording location information for rapid retrieval and evidence binding; the "full-text index" refers to a globally unified index across the entire document (as opposed to a local index within a single chapter), and its entries include at least: document ID doc_ id Page ID page_ id Element ID element_ id The coordinates (bbox), character offset (char_offset), hash signature, and parent path (Document / Chapter / Section) are used. This step is encapsulated in the Dify workflow as "Tool G (Element-Seg & Index)".
[0044] The invocation strategy between the document segmentation agent and the tool is a fixed strategy: only the ReAct strategy is used to select from the candidate sub-tool set, and the selection proceeds according to the predetermined framework of "tool D → tool E → tool F → tool G"; the scoring function for sub-tool selection is...
[0045] U(tool|X)=γ·compat(tool,X)+δ·perf(tool)-η·cost(tool)
[0046] Where X is the context of the current subtask (including document modality, layout signal and evidence_need); compat(tool,X) is the fit (normalized to [0,1]); perf(tool) is the historical performance score (normalized to [0,1]); cost(tool) is the call cost (normalized to [0,1]); γ, δ, and η are non-negative weights and preferably satisfy γ+δ+η=1; the selection result and reason are written to the blackboard audit field, and the chapter tree HTP, alias mapping result and full-text index are published to the blackboard for subsequent consumption by the intelligent agent.
[0047] Furthermore, step 3) "multimodal content processing" is executed by the Dify multimodal processing agent. This agent is provided externally as a tool encapsulated within the Dify workflow, and its invocation strategy is the ReAct strategy: within a pre-registered set of sub-tools, the sub-tools are selected and executed in series according to a preset scoring function to complete table parsing and vectorization, image OCR and visual semantic extraction, formula parsing and symbol standardization, and element-level unified representation and indexing. Specifically, this includes:
[0048] Step 301, Table Parsing and Structured Representation: The table parsing module is invoked on the detected table to extract the table header, row and column cells, and merging information, generating a structured table object.
[0049] T = {headers, rows, types}
[0050] Here, `headers` is a header array (containing header text and hierarchical information stored in column order), `rows` is a two-dimensional cell array (containing the text, position, and row / column span of each cell), and `types` is a set of column or cell types and unit / format patterns (also recording the structural relationships of merged cells). A table vector representation is then constructed based on this.
[0051] v_ T =λ·mean({v_ h |v_ h =emb(h),h∈headers})+(1-λ)·mean({v_ c |v_ c =emb(c),c∈cells(rows)}),
[0052] Among them, v_ h With v_ cThese are the embedding vectors for the header text and cell text, respectively; `emb(·)` is the text embedding function; `cells(rows)` is the set of cells after flattening `rows`; `mean(·)` is the mean aggregation; and `λ∈[0,1]` is the weighting coefficient for the header and content. The process is encapsulated in the Dify workflow as "Tool H (Table-Parse & Vector)".
[0053] Step 302, Image OCR and Visual Semantic Extraction: The OCR engine is used to extract text from the image, and at the same time, the image recognition / classification model is used to extract visual concepts and generate visual evidence objects.
[0054] I = {ocr_text, concepts, v_ I},
[0055] Among them, ocr_ text The text string obtained from OCR recognition (can be concatenated sequentially by section or detection box), concepts is a set of visual concepts (including but not limited to object categories, scene labels, detection box attributes and confidence scores), v_ I The visual embedding vectors for the images (generated by the image encoder) are used for cross-modal similarity calculation. The OCR text is incorporated into a full-text index for cross-modal retrieval binding. This process is encapsulated in the Dify workflow as "Tool I (Image-OCR & Vision)".
[0056] Step 303, Formula Parsing and Symbol Recognition: The formula recognition engine is invoked to restore the image form or embedded object into a structured mathematical expression.
[0057] Φ=(Tokens,Operators,Structure),
[0058] Here, Tokens represent the sequence of symbols in the formula, including variable names, constants, and function notations; Operators represent the set of operators that participate in the calculation; Structure represents the hierarchical / tree structure information of the formula, which is used to describe the operational relationships between the symbols;
[0059] The system performs named entity recognition and standardization on the symbols and parameters in the expression, establishes a symbol vocabulary Σ and a unit / dimension mapping table U, and outputs the normalized expression Φ_norm and its vector representation.
[0060] v_Φ = emb_math(Φ_norm)
[0061] The process is encapsulated in the Dify workflow as "Tool J (Formula-Parse & NER)".
[0062] Step 304, Element-level unified representation: Unify the representation of text paragraphs, tables, images, and formulas into evidence units.
[0063] E_ i = <t_ i ,c_ i ,v_ i meta_ i >, i = 1..N,
[0064] Among them, t_ i For element types (text / table / image / formula), c_ i For element content (text paragraphs or structured objects T, I, Φ_) norm ), where v_i is the element representation vector (text uses emb(·), tables use v_i). T The image uses v_ I The formula uses v_ Φ ), meta_ i For location and structure metadata (at least including doc_ id page_ id bbox / coordinates, element_ id (Row and column indexes / hierarchical paths, character offsets, and hash signatures). All E_ i A full-text index and blackboard are added for other agents to retrieve and compare. This process is encapsulated in the Dify workflow as "Tool K (Unified-Evidence-Index)".
[0065] Meanwhile, the invocation strategy between the multimodal processing agent and the sub-tools is a fixed strategy: only the ReAct strategy is used to select from the candidate sub-tool set, and the selection proceeds according to the established framework of "tool H → tool I → tool J → tool K"; the scoring function for sub-tool selection is...
[0066] U(tool|X)=γ·compat(tool,X)+δ·perf(tool)-η·cost(tool)
[0067] Where X is the current subtask context (including document modality, layout signals, and evidence_). need ); compat(tool,X) is the fit (normalized to [0,1]), perf(tool) is the historical performance score (normalized to [0,1]), cost(tool) is the call cost (normalized to [0,1]); γ, δ, η are non-negative weights and preferably satisfy γ+δ+η=1. Select the results and reasons and write them into the blackboard audit field, and set T, I, Φ_ norm With {E_ iThe index entries of} are also published to the blackboard for downstream intelligent agents to consume.
[0068] Furthermore, step 4) "match review" is executed by the Dify match review agent. This agent is provided externally as a tool encapsulated within the Dify workflow, and its invocation strategy is a function calling strategy. It is invoked sequentially in the predetermined order of "Tool M (candidate recall) → Knowledge Base (DifyRAG) → Tool N (similarity calculation) → Tool O (decision and write-back)" to complete the processing. Specifically, this includes:
[0069] Step 401, Definition and Fixed Strategy of Matching Review Agent: The matching review agent is defined as an Agent node in the Dify platform and is fixedly bound to the tools M / N / O and the Dify built-in RAG knowledge base; its input is the RuleCard published on the Blackboard (BB) (see the output of Step 1) and the document chapter tree HTP and full-text index (see the output of Steps 2 and 3), and its output is the matching entries and decision entries (written back to BB); this step does not change the strategy and does not adaptively switch according to the runtime situation.
[0070] Step 402, Blackboard reading and result writing back: The matching review agent reads from BB
[0071] <rule_id@v,R,sig(R),R+> and <doc_ id ,HTP,{E_ i}>
[0072] Where R is a rule quadruple<scope,predicate,constraint,evidence_need> ;R + To expand the rule set; {E_ i} represents the set of element-level evidence units (see definition in step 304); after processing, the matching results will be:
[0073] BB_MATCH = <bb_id,bb_type=MATCH,ref,{m_ i},trace,ts>
[0074] Judgment result:
[0075] BB_DECISION= <bb_id,bb_type=DECISION,ref,S(R),{w_i},{Ξ_i},
[0076] note,ts>
[0077] Write back to BB; where bb_id is the unique identifier of the blackboard entry, bb_type is the type of the blackboard entry, and ref is rule_ id Combined reference of @v and doc_id; m_ i For a single piece of evidence matching score, the trace records the tool call chain and time consumption, ts is the timestamp, S(R) is the rule evidence support score, and w_ i For aggregate weights, Ξ_ i The evidence triple (defined in step 405 below); note is the remarks information for the determination of this rule, used to record manual review suggestions, exceptions or special explanations.
[0078] Step 403, Candidate Recall and Similarity Calculation: The tool M performs candidate recall on the evidence unit {E_i} based on the full-text index, and regularly calls the Dify built-in RAG knowledge base to supplement the rule elements with external evidence, thus obtaining a set of external fragments.
[0079] K={(d_ k fragment_ k ,v_k)}_(k=1..K)
[0080] Among them, d_ k For identifying knowledge base documents, fragment_ k To align fragments, v_ k Its vector representation is then used; subsequently, the tool N calculates the multimodal matching score of the rule and evidence using the following steps:
[0081] Regular representation vector:
[0082] v_R = emb_rule(R)(by<scope,predicate,constraint> (obtained by combination embedding);
[0083] Evidence representation vector:
[0084] v_i = emb_ev(E_ i (Text / tables / images / formulas are represented by emb / v_ respectively) T / v_ I / v_ Φ );
[0085] Evidence-rule matching score:
[0086] m_i=cos(v_ R ,v_ i (cosine similarity, m_) i ∈[-1,1]); and will {m_ i The external evidence K is associated with and stored in BB_MATCH.
[0087] Step 404, Judgment Criteria and Threshold: The tool O determines the matching subset {m_ under the same rule. i The aggregation is performed and compared with the judgment threshold to obtain the final conclusion; the judgment threshold is denoted as τ_dec∈[-1,1]. When S(R)≥τ_dec, the output is "satisfied / passed", otherwise the output is "not satisfied / not passed"; the calculation of S(R) is shown in step 405; the threshold τ_dec is a preset constant or a fixed parameter configured according to the business scenario.
[0088] Step 405, Evidence Aggregation and Interpretability Recording: Evidence aggregation is performed using a softmax weighted and approximate maximization strategy.
[0089] w_i=exp(β·m_ i ) / ∑jexp(β·m_ j )
[0090] Where β≥0 is the polymerization temperature, β→∞ is approximately the maximum value, and β=0 is the equal-weighted average; the rule evidence support degree is defined as:
[0091] S(R)=∑ i w_ i ·m_ i
[0092] Among them, m_ i ∈[-1,1] represents the matching score (cosine similarity) between a single piece of evidence and the rule, w_ i >=0 and
[0093] ∑ i w_ i=1 Therefore, S(R) is a weighted average of the matching scores of all evidence, and its value still falls within [-1, 1]. When there is strong positive evidence and β is large, S(R) approaches the score of that strong evidence; when there is disagreement on the evidence or when there is negative evidence, S(R) will be lowered accordingly, reflecting the effect of rebuttal evidence.
[0094] Simultaneously record the evidence triplet:
[0095] Ξ_i= <doc_id_ i ,loc_ i ,source_ i >
[0096] Among them, doc_id_ i loc_ is the document identifier for the source of evidence. i For location information (page number, bounding box / coordinates, element_id and parent path), source_ iFor the retrieval source (a specific entry identifier in the full-text index or DifyRAG knowledge base). The {Ξ_ i} and S(R), {m_ i}、{w_ i This information is also written to BB_DECISION to ensure that each decision can be traced back to the specific text / table / image / formula fragment and its source.
[0097] The calling strategy between the matching review agent and the tool is a fixed strategy: only the function calling strategy is used, and the execution is strictly in the order of "tool M → (fixed call) DifyRAG knowledge base → tool N → tool O"; the tool set and parameters are preset configurations and do not change due to runtime conditions.
[0098] Furthermore, step 5) "Review Report Generation" is executed by the Dify review report generation agent. This agent is provided externally as a tool encapsulated within the Dify workflow, and its calling strategy is a function-calling strategy. It is called sequentially in the predetermined order of "Tool P (Result Aggregation) → Tool Q (Interpretability and Source Tracing Arrangement) → Tool R (Formatting Export and Signature)," specifically including:
[0099] Step 501, Agent Input and Fixed Strategy: The agent generating the review report is defined as an Agent node in the Dify platform and fixedly bound to the tool P / Q / R; its input is the blackboard (BB).
[0100] match:
[0101] BB_MATCH = <bb_id,bb_type=MATCH,ref,{m_ i},trace,ts>
[0102] Related to decision items:
[0103] BB_DECISION=<bb_id,bb_type=DECISION,ref,S(R),{w_i},{Ξ_i},note,ts>
[0104] And the RuleCard (rule quadruple) output from step 1, i.e., R:
[0105] R =<scope,predicate,constraint,evidence_need>
[0106] This step outputs the HTP and full-text index, along with the results from steps 2 and 3. The strategy or tool order will not be changed depending on the runtime conditions.
[0107] Step 502, Result Aggregation (Tool P): Aggregate the judgment results of all rules under the same document to form a result table "by rule" and a result table "by chapter / element"; for each rule R, record: (1) final evidence support S(R) (see definition in Step 4); (2) the set of evidence that hit {E_i} and its matching score {m_i}. i}, weights {w_ i};(3) Basic elements from RuleCard<scope,predicate,constraint> With extended evidence R + (If applicable). Simultaneously establish the rule weight vector {w_ R}(Normalized to ∑ R w_ R =1), specifically, the weight represents the relative importance of each rule in document evaluation. Simultaneously, a severity coefficient α_R∈[0,1] (representing the priority of the rule) is introduced, based on which the document-level comprehensive score is calculated:
[0108] S_doc=∑ R w_ R ·(S(R)-α_R·(1-S(R)))
[0109] Where S(R)∈[-1,1]; when the output domain needs to be unified to [0,1], it can be linearly mapped to [0,1] and then aggregated.
[0110] Step 503, Explanability and Source Tracing Orchestration (Tool Q): Generate an interpretability section for each rule, including: (a) the decision conclusion and S(R); (b) a list of key evidence and their weights; (c) conflict / exception explanations (such as the conflict pre-detection in Step 1 and the decision notes in Step 4); and output a set of evidence triples:
[0111] Ξ_i= <doc_id_ i ,loc_ i ,source_ i >
[0112] Wherein, doc_id_i is the document identifier of the evidence source; loc_i is the location information (page number, bounding box / coordinates, element_id, and parent path); source_i is the retrieval source (full-text index or Dify RAG knowledge base entry identifier). The above {Ξ_ i} and {m_ i}、{w_ i}、R + The references are written back to BB to form
[0113] BB_EXPL= <bb_id,bb_type=EXPL,ref,{Ξ_i},{m_i},{w_i},R + The `<ts>` tag is used to record detailed information about evidence interpretation and matching distribution, ensuring that each conclusion can be traced back to specific text / table / image / formula fragments and their sources.
[0114] Step 504, Determine the threshold and output the level (tool Q): Output the level based on the document-level comprehensive score S_doc and the double threshold strategy: Let τ_pass∈[-1,1], τ_warn∈[-1,1] and τ_warn<τ_pass. If S_doc≥τ_pass, output "compliant / passed"; if τ_warn≤S_doc<τ_pass, output "requires revision / warning"; if S_doc<τ_warn, output "non-compliant / not passed".
[0115] Thresholds τ_pass and τ_warn are preset constants or fixed configurations based on business scenarios; if chapter-level prompts are required, the scores and levels of the {S(R)} subset are recalculated according to the Chapter / Section dimension.
[0116] Step 505, Formatting, Exporting, and Signing (Tool R): Generate the final review report object: REPORT=<report_id,meta,summary,per_rule,per_section,S_doc,level,attachments,sig_report,ts> ,
[0117] Where: report_id is the unique identifier for the report; meta includes the document ID (doc_id), report version, creator, and time; summary contains the overall conclusions and key metrics; per_rule specifies the rule-based subsections (including S(R), {Ξ_i}, {m_i}, {w_i}, R...). + (References and explanations); per_section is for chapters / sections (optional); attachments must include at least a list of evidence and a blackboard reference index; sig_report is the report signature:
[0118] sig_report=hash(normalize(REPORT_content))
[0119] In this context, REPORT_content is the set of report content fields that participate in the signature calculation; normalize(·) is a function that normalizes the format and order of the report content to ensure that the same content has a consistent representation; and hash(·) is a hash function (SHA256) executed on the normalized content to generate the report signature sig_report for integrity verification and tamper prevention.
[0120] Export formats include editable documents and non-editable versions (such as PDF), and a blackboard trace report will be provided.
[0121] BB_REPORT =<bb_id,bb_type=REPORT,ref=doc_id,REPORT,ts>
[0122] Write-back to BB is used for record keeping and downstream archiving. The calling strategy between the review report generating agent and the tools is a fixed strategy: only function calling is used, strictly following the order of "tool P → tool Q → tool R"; the tool set and parameters are preset and do not change due to runtime conditions; all citations of evidence and conclusions in the report originate from BB (including citations of external evidence K generated in step 4 by the Dify built-in RAG knowledge base), and no new retrieval process is triggered in this step.
[0123] The technical concept of this invention is to propose a document review method based on multi-agent collaboration and retrieval-enhanced generation. This method first uses natural language processing technology to parse the user-input document review rules into an intermediate semantic representation of the rules, and then calls the retrieval-enhanced generation (RAG) module to expand relevant knowledge, forming a structured rule base. Second, it performs multimodal parsing and chapter segmentation on the document to be reviewed, unifying the representation of elements such as text, tables, images, and formulas. Then, through a multi-agent collaboration mechanism, it completes tasks such as rule parsing, document segmentation, knowledge retrieval, matching and comparison, and report generation. Finally, when there is ambiguity in the matching between rules and documents, the RAG module is introduced to retrieve supplementary evidence from an external knowledge base, and combined with the generative model for explanatory comparison, improving the accuracy and authority of the judgment.
[0124] The beneficial effects of this invention are mainly reflected in the following aspects: It establishes a multi-agent collaborative framework that combines natural language rule parsing, multimodal document processing, and RAG enhancement, achieving automation, intelligence, and interpretability in document review. This method can flexibly receive natural language rules, covering multimodal content such as text, tables, images, and formulas. When ambiguity exists, it introduces external knowledge to enhance and support the review results. Compared to traditional manual or single-automation review methods, it improves the efficiency, accuracy, and authority of the review process, and has good scalability and application prospects. Attached Figure Description
[0125] Figure 1 This is a flowchart of the method of the present invention;
[0126] Figure 2 This is a diagram of the structure for multi-agent collaborative document review. Detailed Implementation
[0127] The invention will be further described below with reference to the accompanying drawings.
[0128] Reference Figure 1 A document review method based on multi-agent collaboration and retrieval enhancement, the method comprising the following steps:
[0129] This embodiment selects the "Feasibility Study Report on the Construction Project of Smart Study Room of Changning Intangible Cultural Heritage Center" (hereinafter referred to as the "Target Report") published on the Changning District Government Information Disclosure Website as the document to be reviewed; the "General Outline for Writing Feasibility Study Reports for Government Investment Projects (2023 Edition)" and "Reference Outline for Writing Feasibility Study Reports for Enterprise Investment Projects (2023 Edition)" and their writing instructions published by the National Development and Reform Commission are used as the source of review rules. The system runs on the Dify platform with a fixed strategy, and the blackboard (referred to as "BB", used for sharing data and recording the trajectory at each stage) is used throughout. The three types of result items generated during the review process are: Matching Record (BB_MATCH, used to save the matching score and call trajectory of each piece of evidence), Decision Record (BB_DECISION, used to save the comprehensive score and conclusion of each rule), and Explanation Record (BB_EXPL, used to save the traceable evidence location and explanation).
[0130] Step 1) Rule Set Determination and Registration. First, the "General Outline (2023)" target-oriented report is broken down into several inspection points and registered as a rule set. Each rule clearly defines the "inspection scope" (e.g., project overview, basis for preparation, construction content and scale, technical and digital solutions, operation and management, investment estimation and funding sources, risks and control, economic and social benefits, etc.), the "required statements or data," and the "types of evidence to be reviewed" (text paragraphs, table entries, table units, signature page text, etc.). The system generates rule cards from these rules, assigning each rule a unique number and version, and retaining the correspondence between the rule card and the "General Outline" clause number for easy reference in the report.
[0131] Step 2) Document Structuring and Full-Text Indexing. The system performs structured parsing of the target report, forming a hierarchical tree (HTP) of "document—chapter—section—element". The document is divided into its smallest elements by page and paragraph, table rows and columns, and text blocks in diagrams, and a full-text index is created. The index stores information such as page position, rectangular coordinates within the page, start and end positions of text within elements, and the path to the relevant chapter. This index is used to quickly and accurately locate the matched evidence back to the specific page and paragraph (or table cell) in the original document.
[0132] Step 3) Multimodal Evidence Unification. The system extracts content from scanned text in main paragraphs, table of contents, table cells, and signature areas, and transforms different types of content into unified "evidence units." Each evidence unit, in addition to the original text content, also carries its location information in the document and semantic representations for comparison. The purpose of this process is to ensure that content from different sources, such as text, tables, and layout OCR, can be understood and compared by the same matching algorithm.
[0133] Step 401) Matching and reviewing agent input and policy are fixed. The matching and reviewing agent, as a node in the workflow, reads the rule card, chapter tree and evidence unit from the blackboard, and performs candidate recall, similarity calculation, threshold determination and result writing back in a fixed order. No runtime policy switching is performed during the entire process.
[0134] Step 402) Blackboard Reading and Result Writing. When processing each rule, the matching review agent first reads the scope and requirements of the rule, as well as the structure of the document and the evidence set, from the blackboard. After comparison, it writes the matching score and call trajectory of each piece of evidence into the matching record (BB_MATCH), the comprehensive score (see next step for explanation), the judgment conclusion, and the location and source of the main evidence into the judgment record (BB_DECISION), and writes it into the explanation record (BB_EXPL) for the purpose of explanation. These three types of records all contain the corresponding identifiers of rules and documents, which facilitates backtracking.
[0135] Step 403) Candidate Recall and Similarity Calculation. The system recalls the most relevant paragraphs and table cells from the full-text index based on the rule's "scope of inspection," and performs a semantic similarity comparison between the rule requirements and these contents. The result of the similarity comparison is a "match score," ranging from -1 to 1; a higher score indicates a better fit to the rule's description. For example, regarding the rule "Complete Project Overview Elements," the system matches fields such as "Project Name, Project Unit and Compilation Unit, Construction Period, Total Investment and Funding Sources" in Chapter 1; regarding "Complete Compilation Basis," the system matches a list of national and local policies and standards in the "Compilation Basis" section; regarding "Construction Content and Scale," the system matches the overall layout and phased goals in "Construction Content" and "Schedule"; regarding "Technology and Digital Solutions," the system matches core module descriptions such as "Data Platform, Smart Devices, and Application Mini-Programs" in the Solutions section; regarding "Investment Estimation and Funding Sources," the system matches the specific description of "Total Investment Composition and Funding Sources"; regarding "Risks and Controls," the system matches external, internal, and operational risks and control strategies in the corresponding sections; and regarding "Economic and Social Benefits," the system matches qualitative and available quantitative analyses in the Benefits section. Each match will generate a matching score and be saved in the matching record along with the corresponding page number and paragraph position.
[0136] Step 404) Threshold Comparison and Conclusion. The system summarizes the matching scores of multiple pieces of evidence under the same rule to obtain the "overall score" for that rule. The overall score can be understood as the "average score after weighting all relevant evidence according to importance," and its value is still between -1 and 1. The system uses a fixed judgment threshold (e.g., an equivalent positive threshold of 0.70). When the overall score is not lower than this threshold, it is judged as "passed"; otherwise, it is judged as "failed." For cases where the content is basically complete but still needs to be refined, it is recorded as "requires supplementary explanation," and a clear prompt is given in the remarks of the judgment record: "what to supplement and where to supplement it." For example, in the "Operations and Management" section, a quantifiable description of "operational organization and performance management indicators" can be added.
[0137] Step 405) Evidence Aggregation and Interpretability Recording. The system weights and summarizes the matching scores of multiple pieces of evidence under the same rule to obtain a comprehensive score. A fixed "focus parameter" is used for weighting; the larger the parameter, the more the system focuses on the evidence with the highest score; when set to zero, it approximates an equal-weighted average. The system simultaneously saves the weight, score, and location information of each piece of evidence in the interpretation record, so that any judgment can be traced back to the specific page number, paragraph, or table cell in the final report, and can explain "why this piece of evidence is more important".
[0138] Step 501) Report generation agent input. The report generation agent reads matching records, decision records, interpretation records, rule cards, and full-text indexes from the blackboard and enters them into aggregation and arrangement in a fixed order.
[0139] Step 502) Results Aggregation and Document-Level Overall Score. The report first lists the overall score, conclusion, and key evidence anchors for each rule from a "rule perspective." Simultaneously, it categorizes the relevant evidence according to the document structure from a "chapter / element perspective," facilitating chapter-by-chapter revisions by the author. To provide clear and consistent conclusions, the system assigns preset "importance weights" and "severity coefficients" to each rule, and calculates the overall score for the entire document based on these. This step can be understood as multiplying the overall score of each rule by the impact of its importance and severity, then summing the results. The results are used for the "Pass / Warning / Fail" prompts on the report's homepage. Outline clause numbers are displayed back in the results table for easy manual review.
[0140] Step 503) Explanability and Source Tracing Arrangement. The main body of the report generates an "Explanable Section" for each rule, stating the conclusion and overall score, extracting or quoting the key points of the original text of the main evidence, marking the page number and paragraph position, listing the influence weight of each piece of evidence, and providing precise modification suggestions and the suggested points (specific chapters and paragraphs) for items that are "not passed" or "require further explanation".
[0141] Step 504) Grade Output. The system uses a dual-threshold strategy to give the final grade. When the document's overall score is higher than the "Pass Threshold," it outputs "Pass"; when it is between the "Warning Threshold" and the "Pass Threshold," it outputs "Warning / Needs Supplementation"; when it is lower than the "Warning Threshold," it outputs "Fail." The report homepage synchronously displays the overall score, major non-compliance items, and rectification priority.
[0142] Step 505) Formatting, Exporting, and Archiving. The system generates a review report, including document identifier, generation time, version information, overall score and grade, rule-by-rule conclusions, chapter-by-chapter evidence list, and location index. The report provides both editable and non-editable formats for submission and archiving. The electronic and paper versions must be consistent in content, and the signature page content and elements must be verified according to management requirements.
[0143] Upon completion of this embodiment, the system outputs a review report containing a comprehensive document score, tiered conclusions, rule-by-rule evidence chains and location information, and chapter / element-level hit details. Any conclusion can be reproduced through the matching, judgment, and explanation records on the blackboard, demonstrating the experimental process and evidence chain. For items requiring supplementation or rectification, the report provides clear directions for modification and recommended locations, facilitating rapid revision and re-verification. This invention proposes a document review method based on multi-agent collaboration and enhanced retrieval generation. It designs a multi-agent collaborative document review framework, calls the RAG module to expand relevant knowledge, forms a structured rule base, and generates a traceable review report. Compared to traditional document review methods, this improves the efficiency, accuracy, and authority of the review. This method belongs to the field of artificial intelligence application technology and successfully achieves automatic review of standardized documents.
[0144] The embodiments described in this specification are merely examples of implementations of the inventive concept. The scope of protection of this invention should not be considered as limited to the specific forms stated in the embodiments. The scope of protection of this invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A document review method based on multi-agent collaboration and retrieval enhancement, characterized in that, Includes the following steps: 1) Rule Input and Knowledge Expansion: Parse the natural language rules input by the user, extract them into structured fields, and generate a unique identifier and version for each rule; query the RAG knowledge base to obtain relevant clauses / standards and supplement the rules; compare the supplemented rules with existing templates and mark the reuse or inheritance relationships between them; write the resulting rule cards into the blackboard sharing module BB and encapsulate them into a rule agent; 2) Document content input and segmentation: Receive documents to be reviewed, complete format / encoding recognition, noise reduction, OCR and layout preprocessing; construct a chapter tree of document → chapter → subsection → element, normalize the aliases of chapter titles, establish a unified cross-text search index for each element and write it into BB, and encapsulate it into a segmentation agent; 3) Multimodal content processing: Structured parsing of tables, OCR and visual concept extraction of images, recognition and standardized expression of formulas; text, tables, images and formulas are uniformly encapsulated into evidence units with location information, and incorporated into full-text index and BB, and finally encapsulated into a multimodal processing intelligent agent; 4) Matching and review: Read the rule cards and evidence index in BB, and first recall candidate evidence based on the full-text index; when the matching information is insufficient or ambiguous, the built-in RAG knowledge base of Dify is called to supplement external evidence; calculate the matching degree between the rules and candidate evidence and compare it with the preset threshold, output the conclusion of pass / fail / need to be revised, record the interpretability traceability information and write it back to BB, and finally encapsulate it into a matching and review agent; 5) Review report generation: Gather the conclusions of each rule and the corresponding evidence, generate document-level results based on business weights and thresholds, form a review report containing the traceability chain, export it in editable and non-editable formats, write the report object and index back to BB, and finally encapsulate it into a report generation agent.
2. The document review method based on multi-agent collaboration and retrieval enhancement as described in claim 1, characterized in that, Step 1) specifically includes: Step 101, Rule Semantic Parsing and Intermediate Representation Construction: Receive natural language rule text, perform word segmentation, part-of-speech tagging, named entity recognition, and semantic dependency parsing, extract rule elements, and map them into quadruple intermediate representations: R =<scope,predicatie,constraint,evidence_need> Where scope is the set of chapters or elements in which the rule applies, predicate is the semantic predicate, constraint is the constraint condition corresponding to the predicate, and evidence_need is the type of evidence required to complete the judgment; Step 102, Rule Templating and Versioning: Map R to the rule template library, assign a unique identifier rule_id and version number v to each rule, denoted as rule_id@v, and generate a rule signature: sig(R) =hash(normalize(scope)||normalzie(predicate)||normalize(constraint)) Where hash(·) is the hash function, normalize(·) is the field normalization function, and || is the string concatenation function; and reuse / inheritance is determined based on semantic similarity, if the following conditions are met: sim(R_new,R_ref)≥τ_reuse The suggestion is to reuse / inherit and record the differences, denoted as Δ = diff(R_new, R_ref); where sim(·,·) represents the difference between the two methods.<scope,predicate,constraint> The cosine similarity is calculated from the combined embedded vectors, τ_reuse is the reuse threshold, diff(·,·) is the rule field level difference calculation function, and the output is the set of difference fields. R_new represents the intermediate representation of the rule obtained by parsing the current new input, and R ref represents the existing reference rule used for comparison in the rule template library. The prompt reuses / inherits and records the difference representation: a reuse flag is set for new rules that are semantically similar to existing templates, and a set of difference fields Δ is output for traceability; Step 103, Retrieval Enhancement and Construction of the Extended Rule Set: Two-stage retrieval enhancement triggered by R's scope, predicate, and constraint: a) Fast retrieval stage: Perform sparse and dense joint recall based on key phrases; b) Rearrangement and evidence extraction stage: Rearrange candidates and extract fragments aligned with the key points of the rules to form an extended rule set. R + ={(d_k,fragment_k,score_k)}_(k=1..K) Where d_k is the document identifier of the evidence source, fragment_k is the aligned fragment, and score_k∈[0,1] is the matching confidence score; the search results are merged according to the confidence distribution {scorer}, if the following conditions are met: max(score_r)<τ_expand The report will then be marked with "[Insufficient external evidence]", where τ_expand is the evidence threshold. Step 104, Rule Alignment and Conflict Detection: Align and detect conflicts between rules with overlapping or mutually constraining scopes within the rule base. If mutual exclusion or contradiction exists, resolve it according to a priority strategy. The priority score P is calculated using the following formula: P(R)=α·src_weight+β·version_score; Wherein, src_weight is the credibility weight of the rule source, version_score is the version / timeliness score, α and β are non-negative weighting coefficients and preferably satisfy α+β=1; conflict solutions and their reasons are recorded on a blackboard for evidence preservation and traceability; At the end of the step, the rule agent publishes the RuleCard as a blackboard entry, containing rule_id, v, sig(R), R, R + The results of conflict pre-detection and audit information are then passed on to the next step.
3. The document review method based on multi-agent collaboration and retrieval enhancement as described in claim 1, characterized in that, Step 2) specifically includes: Step 201, Document Format Recognition and Preprocessing: Receive the document to be reviewed, perform format detection and character encoding recognition, and preprocess it using noise reduction, OCR text enhancement, and layout parsing; parse the PDF document page by page and save the layout layer and text layer for subsequent location. Step 202, Hierarchical Chapter Tree Construction: Construct a four-layer chapter tree based on the table of contents, layout, and semantic clues. HTP={Document→Chapter→Section→Element}; Where Document represents the root node of the document; Chapter represents the set of first-level chapters; Section represents the set of second-level or more detailed sub-chaps; Element is the smallest unit for retrieval and comparison; Step 203: Perform aliasing normalization between the document chapter titles and the scope in the rule base: using vector similarity mapping. map(t)=argmax_{s∈S_scope}cos(v_t,v_s); Where t is the extracted chapter title text from the document; S_scope is the standard chapter / element name and its synonym set in the rule base; v_t is the text embedding vector of title t; v_s is the text embedding vector of scope candidate s; cos(·,·) is the cosine similarity; if the following conditions are met: max_{s∈S_scope}cos(v_t,v_s)<θ_alias, The title will then be marked as [Non-standard Chapter] and submitted to the segmentation agent or human review; where θ_alias is the alias normalization threshold, with a value range of [0,1]. Step 204, fine-grained unit segmentation and indexing: number each element in the chapter tree and build a full-text index, and record the location information for rapid retrieval and evidence binding; The full-text index refers to a globally unified index covering the entire document, and its entries include at least: document ID doc_id, page ID page_id, element ID element_id, coordinate bbox, character offset char_offset, hash signature, and parent path.
4. The document review method based on multi-agent collaboration and retrieval enhancement as described in claim 1, characterized in that, Step 3) specifically includes: Step 301, Table Parsing and Structured Representation: The table parsing module is invoked on the detected table to automatically identify and parse the table area, extract the table header, row and column cells, and merge information, and generate a structured table object. T = {headers, rows, types} Here, headers is a header array, rows is a two-dimensional cell array, and types is a set of column or cell types and unit / format patterns; Constructing a table vector representation: v_T=λ·mean({v_h|v_h=emb(h),h∈headers})+(1-λ)·mean({v_c| v_c=emb(c),c∈cells(rows)}), Where v_h and v_c are the embedding vectors of the header text and cell text, respectively; emb(·) is the text embedding function; cells(rows) is the set of cells after flattening rows; mean(·) is the mean aggregation; λ∈[0,1] is the weighting coefficient of the header and content; Step 302, Image OCR and Visual Semantic Extraction: The OCR engine is used to extract text from the image, and at the same time, the image recognition / classification model is used to extract visual concepts and generate visual evidence objects. I={ocr_text,concepts,v_I}, Wherein, ocr_text is the text string obtained by OCR recognition, concepts is the set of visual concepts, v_I is the visual embedding vector of the image and is used for cross-modal similarity calculation; the text string obtained by OCR recognition is included in the full-text index for cross-modal retrieval binding; Step 303, Formula Parsing and Symbol Recognition: The formula recognition engine is invoked to restore the image form or embedded object into a structured mathematical expression. Φ=(Tokens,Operators,Structure), Here, Tokens represent the sequence of symbols in the formula; Operators represent the set of operators participating in the operation; Structure represents the hierarchical / tree structure information of the formula; The expression undergoes named entity recognition and standardization on its symbols and parameters, establishing a symbol vocabulary Σ and a unit / dimension mapping table U, and outputting the normalized expression Φ_norm and its vector representation v_Φ: v_Φ = emb_math(Φ_norm) Step 304, Element-level unified representation: Unify the representation of text paragraphs, tables, images, and formulas into evidence units: E_i =<t_i,c_i,v_i,meta_i> , i = 1..N, Where t_i is the element type, c_i is the element content, v_i is the element representation vector, and meta_i is the location and structure metadata; All E_i values are added to the full-text index and blackboard for retrieval and comparison by other agents.
5. The document review method based on multi-agent collaboration and retrieval enhancement as described in claim 1, characterized in that, Step 4) specifically includes: Step 401, Blackboard Read and Result Write Back: Read from BB <rule_id@v,R,sig(R),R + >and<doc_id,HTP,{E_i}> Where R is a rule quadruple<scope,predicate,constraint,evidence_need> ;R + To extend the rule set; {E_i} is the set of element-level evidence units; where rule_id@v is the unique identifier of the rule and its version number combination, doc_id is the unique identifier of the document to be reviewed, and HTP is the hierarchical chapter tree structure corresponding to the document; After processing, the matching results will be: BB_MATCH =<bb_id,bb_type=MATCH,ref,{m_i},trace,ts> Judgment result: BB_DECISION=<bb_id,bb_type=DECISION,ref,S(R),{w_i},{Ξ_i},note,ts> Write back to BB; where bb_id is the unique identifier of the blackboard entry, bb_type is the type of the blackboard entry, ref is a combined reference of rule_id@v and doc_id; m_i is the single evidence matching score, trace is the record tool call chain and time consumption, ts is the timestamp, S(R) is the rule evidence support, w_i is the aggregation weight, Ξ_i is the evidence triple, and note is the note information for the rule judgment; Step 403, Candidate Recall and Similarity Calculation: Based on the full-text index, candidate recall is performed on the evidence unit {E_i}, and the Dify built-in RAG knowledge base is consistently called to supplement the rule elements with external evidence, resulting in a set of external fragments: K={(d_k, fragment_k, v_k)}_(k=1..K) Where d_k is the knowledge base document identifier, fragment_k is the aligned fragment, and v_k is its vector representation; then the multimodal matching score of the rule and evidence is calculated: v_R = emb_rule(R); v_i = emb_ev(E_i); m_i = cos(v_R, v_i); and associate {m_i} with external evidence K and store it in BB_MATCH; Step 404, Judgment Criteria and Threshold: Aggregate the matching subsets {m_i} under the same rule and compare them with the judgment threshold to obtain the final conclusion; the judgment threshold is denoted as τ_dec∈[-1,1]. When S(R)≥τ_dec, the output satisfies / passes; otherwise, the output does not satisfy / passes. The threshold τ_dec is a preset constant or a fixed parameter configured according to the business scenario. Step 405, Evidence Aggregation and Interpretability Recording: Evidence aggregation is performed using a softmax weighted and approximate maximization strategy. w_i=exp(β·m_i) / ∑jexp(β·m_j) Where β≥0 is the polymerization temperature, β→∞ is approximately the maximum value, and β=0 is the equal-weighted average; the rule evidence support degree is defined as: S(R)=∑iw_i·m_i Where m_i∈[-1,1] is the matching score of a single piece of evidence and the rule, w_i>=0 and ∑iw_i=1, Simultaneously record the evidence triplet: Ξ_i=<doc_id_i,loc_i,source_i> Where doc_id_i is the document identifier of the evidence source, loc_i is the location information, and source_i is the retrieval source; The {Ξ_i}, S(R), {m_i}, and {w_i} are written together into BB_DECISION to ensure that each judgment can be traced back to the specific text / table / image / formula fragment and its source.
6. The document review method based on multi-agent collaboration and retrieval enhancement as described in claim 1, characterized in that, Step 5) specifically includes: Step 501, Result Aggregation: Aggregate the judgment results of all rules under the same document to form a result table by rule and a result table by chapter / element; for each rule R, record: a) final evidence support S(R); b) the set of evidence that hit {E_i} and its matching score {m_i} and weight {w_i}; c) basic elements from RuleCard.<scope,predicate,constraint> With extended evidence R + Simultaneously, a rule weight vector {w_R} is established, and a severity coefficient α_R∈[0,1] is introduced, based on which the document-level comprehensive score is calculated: S_doc=∑Rw_R·(S(R)-α_R·(1-S(R))) Where S(R)∈[-1,1]; when the output domain needs to be unified to [0,1], it can be linearly mapped to [0,1] and then aggregated; Step 503, Interpretability and Source Tracing: Generate an interpretability section for each rule, including: a) the decision conclusion and S(R); b) a list of key evidence and their weights; c) conflict / exception explanations; and output a set of evidence triples: Ξ_i=<doc_id_i,loc_i,source_i> Where doc_id_i is the document identifier of the evidence source; loc_i is the location information; and source_i is the retrieval source. The above {Ξ_i} and {m_i}, {w_i}, R + The references are written back to BB to form: BB_EXPL= <bb_id,bb_type=EXPL,ref,{Ξ_i},{m_i},{w_i},R + ,ts> is used to record detailed information on evidence interpretation and matching distribution, so as to ensure that each conclusion can be traced back to specific text / table / image / formula fragments and their sources; Step 504, Determine the threshold and output the level: Output the level based on the document-level comprehensive score S_doc and the double threshold strategy: Let τ_pass∈[-1,1], τ_warn∈[-1,1] and τ_warn<τ_pass, If S_doc ≥ τ_pass, output "compliant / passed"; if τ_warn ≤ S_doc < τ_pass, output "requires revision / warning"; if S_doc < τ_warn, output "non-compliant / failed". Thresholds τ_pass and τ_warn are preset constants or fixed configurations based on business scenarios; if chapter-level prompts are required, the scores and levels of the {S(R)} subset are recalculated according to the Chapter / Section dimension; Step 505, Formatting, Exporting, and Signing: Generate the final review report object. REPORT =<report_id,meta,summary,per_rule,per_section,S_doc,level,attachments,sig_report,ts> , Where: report_id is the unique identifier of the report; meta includes the document ID (doc_id), report version, generator, and time; summary is the overall conclusion and key indicators; per_rule is the rule-based section; per_section is the chapter-based section; attachments at least include a list of evidence and a blackboard reference index; sig_report is the report signature; S_doc is the document-level comprehensive score; level is the compliance level or review conclusion obtained based on S_doc and preset thresholds; ts is the timestamp of the report object being generated. sig_report=hash(normalize(REPORT_content)) Where REPORT_content is the set of report content fields that participate in the signature calculation, normalize(·) is the function that normalizes the format and order of the report content, and hash(·) is the hash function that is applied to the normalized content; Export formats include both editable and non-editable versions, and a blackboard trace report will be provided. BB_REPORT =<bb_id,bb_type=REPORT,ref=doc_id,REPORT,ts> Write back to BB for record keeping and downstream archiving.
Citation Information
Cited By
Target file header and multi-file header similarity identification and associated data filling method based on large model
CN122065785A
Method for automatically generating intelligent consulting report based on RAG technology
CN122263841A
Method for automatically generating intelligent consulting report based on RAG technology
CN122263841B