Multi-Agent collaborative building material classification and extraction method and system
By employing a multi-agent collaborative method for classifying and extracting building materials, utilizing semantic cleansing and multi-path fusion retrieval, and combining a large language model and a multi-source knowledge base, the problem of fuzzy input and continuous optimization in the standardized management of building material data is solved, achieving efficient and accurate material classification and structured extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-04
- Publication Date
- 2026-04-03
AI Technical Summary
In the construction industry, the standardized management of material data suffers from problems such as low standardization, high data processing costs, limited effectiveness of traditional methods, and constraints on the development of intelligent applications. Existing technologies struggle to handle fuzzy inputs and lack continuous optimization capabilities.
A multi-agent collaborative method for classifying and extracting building materials is adopted. Through semantic cleansing, multi-path fusion retrieval, adversarial intent analysis, and iterative decision-making, combined with a large language model and a multi-source knowledge base, the method achieves accurate classification and structured extraction of building materials.
It enables accurate determination of standard material names from chaotic non-standard inputs, outputs structured results, and automatically completes data processing, improving classification accuracy and system robustness, and supporting intelligent decision-making and continuous optimization.
Smart Images

Figure CN121786201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology in construction engineering, specifically to a method and system for classifying and extracting construction materials using a multi-agent collaborative approach. Background Technology
[0002] In the process of digital transformation in the construction industry, the standardized management of material data has long been a bottleneck. Specifically, this manifests as follows: 1) Low standardization: The industry is generally plagued by the phenomenon of "one item, multiple codes" and "one code, multiple items". The same material may have multiple different text identifiers in different systems, and different materials may be confused because of the same abbreviation, which makes data statistics and analysis difficult.
[0003] 2) High data processing costs: Currently, data specialists mainly rely on experience to manually check, judge, and rename massive amounts of data. This work is tedious, time-consuming, and the quality is difficult to guarantee, making it impossible to cope with the continuous generation of new data.
[0004] 3) Traditional methods have limited effectiveness: Traditional methods based on "IF-ELSE" rules or simple keyword matching cannot effectively handle complex and combined material descriptions. For example, they cannot intelligently determine whether "bagged cement" should be classified under the "cement" category or as an independent category.
[0005] 4) Restricting the development of intelligent applications: The confusion of underlying material names makes it impossible for enterprises to conduct effective data mining, trend analysis and cost control, which hinders the realization of advanced AI applications based on accurate data (such as intelligent procurement forecasting, automatic pricing, etc.).
[0006] Existing technologies, such as the patent with publication number CN119378553B, provide a material classification method based on Large Language Model (LLM) and Retrieval Enhanced Generation (RAG). However, it relies heavily on a pre-set, static multi-level classification system, making it difficult to handle a large number of unclassifiable "non-standard" materials. Furthermore, it lacks the ability to understand the intent of fuzzy inputs and a closed-loop self-optimization mechanism. Another type of existing technology, such as the patent with publication number CN118394904A, involves a multi-agent dialogue system. However, it is geared towards general dialogue scenarios and is not optimized for the specialized and structured extraction needs of materials in the construction industry. It also lacks domain knowledge fusion and anti-illusion design.
[0007] Therefore, how to build a dedicated system that can understand fuzzy intentions, integrate multi-source knowledge, make iterative decisions, and have self-learning capabilities has become a technical challenge that urgently needs to be solved in this field. Summary of the Invention
[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for classifying and extracting building materials based on multi-agent collaboration, so as to solve the problems of weak processing capability for fuzzy input, classification accuracy limited by static knowledge base, lack of continuous optimization capability, and easy generation of illusions in attribute extraction.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, a multi-agent collaborative method for classifying and extracting building materials is provided, including the following steps: Receive user-input text describing building materials; The input building material description text is preprocessed with semantic purification, and non-material descriptive interference information is identified and filtered based on a preset industry interference semantic rule library. Multi-path fusion retrieval is performed on the purified text to obtain a preliminary set of candidate materials from the constructed vector database and relational database; Based on the preliminary candidate material set, the material definition and sample knowledge are obtained from the relational database, and historical correction knowledge is obtained by matching from the pre-set Badcase case knowledge base; External knowledge is acquired as supplementary knowledge through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification. Perform confidence-driven iterative decision-making, based on the candidate material set, material definition and sample knowledge, historical correction knowledge and supplementary knowledge, to determine the final material classification; Based on the final material classification, the corresponding attribute extraction rules are obtained from the relational database; the attribute extraction rules are applied to perform field matching and attribute extraction on the building material description text to generate structured material attribute data; The output includes structured processing results of the final material classification, confidence assessment, and material attribute data. Furthermore, based on a pre-defined industry interference semantic rule base, non-material descriptive interference information is identified and filtered, specifically including: Extract core material name entities from the input building material description text using natural language processing techniques or large language models; Based on a predefined industry interference semantic pattern library, the extracted core material name entities or input text are analyzed and identified. The pattern library defines strong interference semantic patterns that represent price information, transaction behavior or operation instructions. If content matching a strong interference semantic pattern is identified, the input is deemed invalid and all subsequent processing steps are terminated; otherwise, the core material name entity is passed as the purified text to the subsequent processing steps.
[0010] Furthermore, the multi-path fusion retrieval performed on the purified text includes the following retrieval paths executed in parallel: First search path: In the vector database, perform vector semantic similarity retrieval based on the cleaned text; Second search path: In a relational database, hierarchical matching search is performed based on the purified text in a multi-level classification system; The third search path: supplementing the search by extracting keywords from the input building material description text in vector databases and / or relational databases; The search results from each path are integrated using a pre-defined fusion and sorting algorithm to generate a preliminary set of candidate materials.
[0011] Furthermore, semantic similarity in vector semantic similarity retrieval is calculated in two stages: Phase 1: Based on the first vector transformed from the purified text and the standard material name vectors in the vector database, calculate the cosine similarity and Jaccard similarity, and then perform a weighted fusion to obtain the combined similarity. ; Phase Two: Based on the L2 Euclidean distance between the first vector and the standard material name vector ,judge The relationship with the preset threshold, if If the threshold is less than or equal to the preset threshold, then... and The final similarity is obtained by weighted fusion. ;like >Preset threshold, then Directly used as the final similarity .
[0012] Furthermore, historical corrective knowledge is retrieved from a pre-defined Badcase knowledge base, specifically including: The semantic features of the preliminary candidate material set are matched with the failure mode features of historical misjudgment cases stored in the Badcase case knowledge base. If a match is successful, the corrective knowledge and the mapping relationship between the correct material and the historical misjudgment case are returned as historical corrective knowledge.
[0013] Furthermore, network retrieval is conducted through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification, specifically including: Adversarial intent analysis phase: The attacker model generates diverse and ambiguous questions, the defender model infers the user's intent and outputs a confidence score, and after multiple rounds of iteration, a high-confidence intent description is generated; Adaptive query generation and retrieval execution phase: Based on high-confidence intent descriptions, a set of search queries is generated and parallel retrieval is performed to obtain preliminary retrieval results; Multi-stage reflection verification and closed-loop optimization stage: Based on the preliminary search results, a preliminary answer is generated by the large language model; the preliminary answer is evaluated and reflected upon, and a diagnostic result containing the reasons for failure is output; and the search strategy is dynamically adjusted according to the diagnostic result until a final answer that meets the preset quality standard is generated as supplementary knowledge.
[0014] Furthermore, confidence-driven iterative decision-making is performed, specifically including: Preliminary Judgment Stage: Integrate the preliminary candidate material set, definition and sample knowledge, historical correction knowledge and supplementary knowledge as the judgment context, and use the large language model to make a preliminary judgment and output the corresponding judgment result as the preliminary judgment result and the first confidence level. First-level decision stage: If the first confidence level is higher than the first threshold, and the preliminary judgment result belongs to the valid result set consisting of the preliminary candidate material set and the unmatched state, then the preliminary judgment result is accepted as the final material classification; otherwise, a self-correction loop is triggered. Self-correcting loop phase: In the loop, the large language model first performs source analysis on the uncertainty of the preliminary judgment result based on the judgment context, then compares and infers each candidate material in the preliminary candidate material set based on the source analysis, and finally outputs the updated judgment result and the second confidence level. Secondary decision stage: If the second confidence level is higher than the second threshold, the updated judgment result is accepted as the final material classification; if it is less than or equal to the second threshold and the number of cycles has not exceeded the preset limit, self-correction continues; if the number of cycles has reached the preset limit, the final decision is triggered. Final Decision Stage: When the final decision is triggered, the large language model makes a final decision based on all historical reasoning paths generated in the initial decision stage and the self-correction loop stage, and combines the similarity ranking of the preliminary candidate material set to determine the final material classification.
[0015] Furthermore, the update of the second confidence level in the self-correcting loop phase employs a calibration method based on Bayesian inference: In each self-correcting loop, the second confidence level output from the previous round is used as the current confidence level. ; Calculate the posterior probability that the large language model makes a correct judgment at the current confidence level. ; According to the formula Calculate the updated confidence level ,in This is a preset adjustment factor; If the number of self-correction loops exceeds the preset limit, and the updated confidence of all rounds of output is lower than the second threshold, the loop will terminate and the final decision will be triggered.
[0016] Secondly, a multi-agent collaborative material data processing system for the construction industry is provided to implement the above method, including: The semantic cleansing agent is used to perform semantic cleansing preprocessing on the user-input building material description text in order to extract the core material name entities; The multi-path retrieval fusion agent is used to obtain a preliminary set of candidate materials based on the core material name entity through multi-path retrieval fusion. The web retrieval agent is used to perform web retrieval based on a preliminary candidate material set, through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification, in order to obtain supplementary knowledge. The confidence decision agent is used to perform confidence-driven iterative decisions. Based on the initial candidate material set, definition and sample knowledge obtained from relational databases, historical correction knowledge and supplementary knowledge obtained from the Badcase case knowledge base, it determines the final material classification. The attribute extraction agent is used to perform attribute extraction based on a given final material classification, generating structured material attribute data. Output Agent, which outputs the processing results containing the final material classification, confidence assessment, and structured attribute data; The knowledge base agent includes a relational database storing standard material definitions and sample knowledge, a vector database for vector retrieval, and a Badcase knowledge base storing historical misjudgment cases.
[0017] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.
[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. Addressing the core pain points in the construction industry caused by the lack of standardized input, such as multiple textual identifiers for the same material and confusion between different materials due to identical abbreviations, this invention employs a full-process processing approach: semantic purification to extract core entities → multi-path fusion retrieval to generate a high-quality candidate set → iterative decision-making based on confidence levels by integrating definitional knowledge, corrective cases, and online information. This approach can accurately determine the unique corresponding standard material name from chaotic, non-standard inputs, outputting structured results and providing a reliable foundation for data statistics and intelligent decision-making.
[0019] 2. Traditional methods relying on data specialists for manual verification, judgment, and renaming are costly and lack quality assurance. This invention, through a programmatic multi-agent collaborative process, can automatically complete all tasks from input to structured output without human intervention. It can sustainably and efficiently process massive amounts of data, completely changing the unsustainable model that relies on human labor.
[0020] 3. Traditional "IF-ELSE" rules or simple keyword matching cannot effectively handle complex semantics, such as whether "bagged cement" should be classified under the general category of "cement" or a separate category, or whether "PC42.5R" is a specification of "ordinary silicate cement". This invention uses a Large Language Model (LLM) for deep semantic parsing, combined with multi-path retrieval and multi-source knowledge verification, to intelligently understand such complex, ambiguous, or technically terminological material descriptions and achieve accurate classification.
[0021] 4. Compared to the mechanical execution of traditional retrieval interfaces or the limited analytical capabilities of large models, this invention introduces an attacker / defender model into web retrieval to conduct multi-round adversarial intent clarification and forces the large model to perform multi-stage reflection, verification, and closed-loop optimization of the retrieval results. This procedural logic simulates the deep thinking and verification process of humans, ensuring that the final acquired supplementary network knowledge has high confidence and effectively supports subsequent decision-making.
[0022] 5. This invention not only solves the problem once and for all, but also stores historical misjudgment cases by constructing a Badcase case knowledge base and selectively archives new cases after a decision is made. This enables the system to learn from its mistakes, improve its ability to handle materials that are not easy to retrieve, and form a continuous knowledge evolution and performance evolution that becomes more accurate the more it is used.
[0023] 6. To avoid the illusions that may arise from relying solely on large models, this invention designs an iterative process in classification decision-making involving initial judgment, a self-correcting loop, and final decision, and introduces confidence calibration based on Bayesian inference. In attribute extraction, direct matching and numerical sequence matching are first performed using rule-based algorithms, followed by canonical verification by a large model. This hybrid mechanism of algorithmic constraints and model verification ensures that the final output classification and attribute data is both accurate and conforms to industry standards.
[0024] 7. This invention comprises seven highly specialized and clearly defined intelligent agents forming an organic whole, achieving multi-agent collaboration. The semantic purification agent and the multi-path retrieval fusion agent work first, completing the precise transformation from raw input to the candidate set; the network retrieval agent and the confidence decision agent collaborate to enhance each other, respectively responsible for iterative judgment under external knowledge expansion and internal multi-source knowledge fusion; the attribute extraction agent executes precise structured output based on the final classification result. The entire process is data-driven, forming a closed loop under the coordination of the output agent, and receiving full-process support and feedback from the knowledge base agent. This design allows the system to decompose the complex "understanding-retrieval-decision-extraction" task into a pipeline where expert agents sequentially deepen the processing and continuously optimize it through a shared knowledge base, thereby achieving processing depth, accuracy, and system-level robustness that a single model cannot achieve. Attached Figure Description
[0025] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] In the description of this invention, it should be noted that the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0028] like Figure 1 As shown, the present invention provides a multi-agent collaborative method for classifying and extracting building materials, comprising the following steps: Receive user-input text describing building materials; The input building material description text is preprocessed with semantic purification, and non-material descriptive interference information is identified and filtered based on a preset industry interference semantic rule library. Multi-path fusion retrieval is performed on the purified text to obtain a preliminary set of candidate materials from the constructed vector database and relational database; Based on the preliminary candidate material set, the material definition and sample knowledge are obtained from the relational database, and historical correction knowledge is obtained by matching from the pre-set Badcase case knowledge base; External knowledge is acquired as supplementary knowledge through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification. Perform confidence-driven iterative decision-making, based on the candidate material set, material definition and sample knowledge, historical correction knowledge and supplementary knowledge, to determine the final material classification; Based on the final material classification, the corresponding attribute extraction rules are obtained from the relational database; the attribute extraction rules are applied to perform field matching and attribute extraction on the building material description text to generate structured material attribute data; The output contains structured processing results including final material classification, confidence assessment, and material attribute data.
[0029] The vector database of this invention is used to store high-dimensional vector representations of material names, and can employ databases that support high-dimensional vector similarity retrieval, such as Milvus and Pinecone.
[0030] This invention presents a structured, traditional relational database built upon a comprehensive dataset of building industry products. It stores structured material knowledge, including material definitions, matching keywords, exclusion keywords, related knowledge, and attribute extraction rules. The database's content is partly generated by a large model through online retrieval and autonomous thinking, and partly constitutes manually defined attribute rules. During classification, the system extracts corresponding structured knowledge from this database based on candidate material names obtained through vector retrieval, providing the large model with judgment criteria and contextual information, supporting multi-dimensional confidence assessment and attribute mapping. The relational database can be, for example, MySQL or PostgreSQL. Those skilled in the art can choose according to the specific circumstances.
[0031] This invention performs semantic purification preprocessing on the input text, and identifies and filters non-material descriptive interference information based on a preset industry interference semantic rule library. The specific implementation process is as follows: Extract core material name entities from the input building material description text using natural language processing techniques or large language models; Based on a predefined industry interference semantic pattern library, the extracted core material name entities or input text are analyzed and identified. The pattern library defines strong interference semantic patterns that represent price information, transaction behavior or operation instructions. If content matching a strong interference semantic pattern is identified, the input is deemed invalid and all subsequent processing steps are terminated; otherwise, the core material name entity is passed as the purified text to the subsequent processing steps.
[0032] In one embodiment, the industry interference semantic pattern library supports customization based on material category; For specific categories of materials, the pattern library also predefines positive matching rules for identifying key attributes of that type of material; When analyzing and recognizing the input building material description text, if the corresponding key attributes are identified through positive matching rules, a processing flow customized for that specific material category is triggered.
[0033] The following example illustrates how customization based on material category can be supported: In the industry interference semantic pattern library, matching rules for identifying the "thickness" attribute are predefined for the "waterproof membrane" category; When the semantics related to "waterproof membrane" are identified from the input building material description text and the thickness attribute is matched, the thickness attribute information is passed along with the core material name entity to the subsequent processing stage to start the attribute extraction and optimization process for waterproof membrane.
[0034] One specific implementation of multi-path fusion retrieval includes: First search path: In the Milvus database (vector database), the core material name entity is converted into a query vector, vector semantic similarity search is performed, and a similarity ranking list is returned; The second search path: In the MySQL 8.0 database (relational database), the core material name entity is matched with the pre-stored multi-level classification name. The multi-level classification system includes at least a first-level classification and a second-level classification, and a list of hierarchical matching results is returned. The third search path: Extract one or more keywords from the user-input description text of building materials, query them in the Milvus database and the MySQL 8.0 database respectively, and return a supplementary list of results based on the keywords; Input the similarity ranking list, the hierarchical matching result list, and the supplementary result list into a preset fusion ranking algorithm; The fusion sorting algorithm calculates the comprehensive score of each candidate material based on the preset weights of each list source, the original order of the items, and the cross-duplicate situation, and generates a preliminary candidate material set in descending order of the scores.
[0035] Specifically, the operation of the first search path is as follows: The system converts the core material name entities obtained after purification into high-dimensional vectors through a pre-trained text embedding model. The vector is then input into the Milvus database. Within the Milvus database, the system calculates the vector and compares it with the vectors of all standard material names in the database. L2 Euclidean distance The system uses a similarity metric to measure the semantic similarity between the two vectors. After calculation, the system returns the top 20 standard material names with the highest semantic similarity to the vector and their similarity scores, forming the first similarity ranking list, which serves as the retrieval result for this path.
[0036] More specifically, the first retrieval path operates as follows: The system transforms the purified core material name entities into high-dimensional vectors using a pre-trained text embedding model. These vectors are then input into the Milvus database. Within the Milvus database, the system measures the semantic similarity between this vector and each standard material name vector in the database by calculating the L2 Euclidean distance 2.
[0037] Similarity calculation uses the following two-stage formula: Formula 1: Calculate basic semantic similarity: Calculate cosine similarity: ; Calculate Jaccard similarity: Where A is the word set after word segmentation of the core material name, and B is the word set after word segmentation of a standard material name in the Milvus database; Combinatorial similarity: ; Formula 2: Combine distance for final similarity determination: like The final semantic similarity is: ; like The final semantic similarity is: ; After the calculation is completed, the system sorts the results according to the final similarity and returns the top 20 standard material names with the highest similarity and their similarity scores, forming a similarity sorting list, which serves as the search results for this path.
[0038] Specifically, the second search path operates as follows: The system uses the same core material name entity as the query term and performs matching within the material classification system built in the MySQL 8.0 database. The system first attempts fuzzy matching in the standard material name field, while simultaneously querying predefined first-level, second-level, and other category name fields. All matched records are prioritized based on matching accuracy (e.g., exact material name matching takes precedence over category name matching). Finally, the system returns the top 15 records with the highest matching accuracy, containing the material ID, name, and complete classification path, forming a hierarchical matching result list, which serves as the search result for this path.
[0039] Specifically, the third search path operates as follows: First, the system extracts technical keywords, excluding the core material name, from the user-input description of the building materials. These keywords include specifications, models, attributes, and status terms. Then, the system performs parallel queries on these keywords in the Milvus database and / or the MySQL 8.0 database. In the Milvus database, the keywords are vectorized and then used for similarity retrieval; in the MySQL 8.0 database, content matching is performed on the material's attribute or specification fields. The search results from the two databases are merged and initially sorted based on the source database and matching relevance, ultimately forming a supplementary list of keywords as the search results for this path.
[0040] Specifically, the fusion ranking process is as follows: The system receives result lists from the three paths mentioned above and assigns a preset weight coefficient to each list. For example, the first retrieval path has the highest weight, followed by the second and third retrieval paths. The system first identifies duplicate material items in the three lists. For duplicate materials, their ranking scores in each list are weighted and accumulated according to the corresponding path weights to calculate the material's comprehensive score. For all unique materials, the score is directly calculated based on the weight and ranking of their respective lists. Finally, the system sorts all materials in descending order based on their comprehensive scores, generating a limited set of preliminary candidate materials arranged by comprehensive similarity. This preliminary set serves as the final output of the multi-path fusion retrieval and is sent to the subsequent knowledge enhancement and decision-making module.
[0041] This invention retrieves material definitions and sample knowledge from a relational database. The specific implementation process is as follows: Based on the generated final candidate material set, matching keywords, exclusion keywords, definitions and related knowledge of each candidate material are extracted from the relational database through iterative querying to form a core knowledge graph, which is the definition and sample knowledge of the material.
[0042] This invention constructs a Badcase case knowledge base based on error cases observed in historical tasks, particularly for material names that are "difficult to retrieve" due to their uniqueness, ambiguity, or the existence of aliases. This base stores information in a structured tabular format, recording the relationship between erroneous inputs and correct mappings. Core fields include at least: the input material name (material) that is prone to misjudgment, and its corresponding correct standard category or name (category). Targeted error correction can be achieved by matching the semantic features of the current query with the fault modes recorded in the base. Table 1 below shows a specific example of the Badcase case knowledge base construction: Table 1
[0043] As shown in Table 1, when a user enters "Modern Royal Blue", a conventional search may fail or result in a misclassification. By querying the Badcase case knowledge base, the system can directly obtain the correct classification knowledge that it should be "Colored Granite", thereby significantly improving the classification accuracy.
[0044] This invention retrieves historical correction knowledge from a pre-defined Badcase case knowledge base. The specific implementation process is as follows: Extract semantic features of the current context represented by the preliminary candidate material set; The semantic features of the current context are matched with the failure mode features of historical misjudged cases stored in the Badcase case knowledge base based on vectorized indexing. If the matching similarity is higher than the preset threshold, the corrective knowledge and the mapping relationship between the correct material and the historical misjudgment case that was successfully matched will be returned as historical corrective knowledge. Otherwise, do not return or return empty correction knowledge.
[0045] This invention employs a procedural closed-loop process for web retrieval that includes adversarial intent analysis and multi-stage reflective verification, specifically comprising: Adversarial intent analysis phase: The attacker model generates diverse and ambiguous questions, the defender model infers the user's intent and outputs a confidence score, and after multiple rounds of iteration, a high-confidence intent description is generated; Adaptive query generation and retrieval execution phase: Based on high-confidence intent descriptions, a set of search queries is generated and parallel retrieval is performed to obtain preliminary retrieval results; Multi-stage reflection verification and closed-loop optimization stage: Based on the preliminary search results, a preliminary answer is generated by the large language model; the preliminary answer is evaluated and reflected upon, and a diagnostic result containing the reasons for failure is output; and the search strategy is dynamically adjusted according to the diagnostic result until a final answer that meets the preset quality standard is generated as supplementary knowledge.
[0046] In a preferred embodiment of the present invention, the attacker model and / or defender model is an artificial intelligence model with text generation and understanding capabilities, which is existing technology and will not be described in detail.
[0047] The specific implementation process for the adversarial intent analysis phase is as follows: S11. Initial Intent Extraction: Input user questions and extract keywords and semantics from the questions based on the Large Language Model (LLM) to form an initial intent description.
[0048] S12, Multi-round adversarial intent analysis: Multiple rounds of adversarial iterations are conducted using attacker and defender models, specifically including: S121. Attacker model generates fuzzy questions: The attacker model proactively generates diverse and ambiguous user questions based on the current intent description. These ambiguous user questions include, but are not limited to: diverse expressions of the current intent, semantic expansions, approximate intent questions used to test intent boundaries, questions with ambiguous expressions, and adversarial sample questions.
[0049] S122, Determining and scoring the defender's intentions using the model: The defender model infers the user's true intent based on the fuzzy user questions generated by the attacker model, outputs an updated intent description, and simultaneously generates a confidence score that reflects the certainty of the description.
[0050] S123, Iterative Execution: Repeat steps S121 and S122. In each iteration, the attacker model uses the latest output intent description of the defender model as input to generate a new round of fuzzy user questions.
[0051] S124. Dynamic Termination Judgment: The iteration termination condition is determined by a preset maximum number of iterations and a confidence threshold. If the confidence score output by the defender model is higher than the preset score for N consecutive iterations, the intent is considered clear, the iteration is terminated early, and a series of intent descriptions and their corresponding confidence scores are obtained.
[0052] S13, Intent Fusion and Generation: The intent fusion model uses a weighted fusion and summary of the intent descriptions and their confidence scores output by the defender model in all iterations to generate a complete and highly confident intent description.
[0053] The adaptive query generation and retrieval execution phase is implemented as follows: S21. Query Generation: Based on high-confidence intent descriptions, multiple query statements covering different aspects and expressions of the complete intent are generated through a large language model; at the same time, a hierarchical query set is generated, including broad queries aimed at ensuring recall and precise queries aimed at ensuring accuracy.
[0054] S22. Call search tools to execute in parallel: Call one or more search tools (such as search engine API, professional database API) to execute all query statements in parallel and obtain the original search results.
[0055] S23. Preliminary cleaning of results: Automated preprocessing of the raw search results obtained in S22, specifically including: Deduplication: Remove duplicate search entries based on content similarity or unique identifiers; Merge: Combine results from different queries or data sources that point to the same information entity; Preliminary cleaning: Filter out obviously irrelevant, incorrectly formatted, or low-quality content to form a standardized and usable preliminary search results list for subsequent in-depth processing and analysis.
[0056] The multi-stage reflection, verification, and closed-loop optimization phases are implemented as follows: S31. Search Result Quality Assessment: Based on the large language model, the preliminary search result list is quickly scanned and evaluated to calculate its overall quality score. If the average quality score is lower than the preset score, the search is deemed unsuccessful, and the process is redirected to S34; otherwise, the search is deemed successful.
[0057] S32. Preliminary Answer Generation: Based on the large language model, the preliminary search results are summarized in depth to generate a preliminary answer.
[0058] S33. Refined Reflection, Verification, and Diagnosis: Force the large language model to perform refined reflection on the initial answer, evaluate whether it meets the user's question, diagnose the specific reasons for failure (such as bias in understanding intent, poor query generation, and resource limitations), and output diagnostic results including the reasons for failure.
[0059] S34. Closed-Loop Optimization Decision: Dynamically adjust the search strategy based on the diagnostic results to form a continuously optimized search closed loop. Specifically, this includes: If the diagnosis is "intent comprehension deviation", the optimization instruction will be fed back to the adversarial intent analysis stage to start a new round of intent clarification; If the diagnosis is "poor query generation", the optimization instruction will be fed back to the adaptive query generation and parallel retrieval stage to regenerate the query statement; If the diagnosis is "resource limitation", the plan is to switch the search tool in the next round of search and feed it back to the adaptive query generation and parallel search stage for re-execution; This optimization loop continues until the generated answer meets the preset quality standard or the maximum number of retries set by the system is reached. Finally, the answer that meets the quality standard is output as supplementary knowledge.
[0060] This invention performs confidence-driven iterative decision-making, and the specific implementation process is as follows: Initial judgment stage: The initial candidate material set, definitions and sample knowledge, historical correction knowledge, and supplementary knowledge are integrated into a unified decision context. This decision context is then input into a large language model, and a professionally designed decision prompt process forces the model to output the corresponding decision result as the initial decision result and the first confidence level.
[0061] First-level decision-making stage: If the first confidence level is higher than the preset first threshold, and the initial judgment result is within the valid state space consisting of the preliminary candidate material set and the unmatched state, then the judgment is successful and the initial judgment result is directly accepted as the final material classification; otherwise, the judgment is in an uncertain state, and the system triggers the first-level self-correction mechanism and enters the self-correction loop.
[0062] Self-correcting cycle phase: The large language model performs source analysis on the uncertainty sources of its primary judgment (or previous round of judgment) based on all existing judgment contexts, and performs systematic comparative reasoning on each candidate material in the preliminary candidate material set, outputting the updated judgment result and second confidence level.
[0063] Secondary decision-making stage: If the second confidence level is higher than the second threshold, the updated judgment result is accepted as the final material classification; if the second confidence level is less than or equal to the second threshold and the number of self-correction cycles has not reached the system's preset upper limit, the self-correction cycle stage is repeated for the next round of self-correction; if the number of self-correction cycles has reached the system's preset upper limit and the second confidence level is still less than or equal to the second threshold, the system will forcibly trigger the final decision.
[0064] Final Decision Stage: Under the final decision protocol, the large language model makes an irrevocable final choice based on all historical reasoning paths generated in the initial decision stage and the self-correction loop stage, and with reference to the similarity ranking of the preliminary candidate material set, to determine the final material classification.
[0065] Specifically, the update of the second confidence level in the self-correcting loop phase employs a calibration method based on Bayesian inference: In each self-correcting loop, the second confidence level output from the previous round is used as the current confidence level. .
[0066] Calculate the current confidence level of the large language model. Determine the posterior probability of a correct judgment. , .
[0067] in, Under the condition of making a correct judgment, the confidence level is The probability of; It is the prior probability, representing the probability that the model's judgment is correct; The confidence level is The marginal probability.
[0068] According to the formula Calculate the updated confidence level, where This is the preset adjustment factor.
[0069] If the number of self-correction loops exceeds the preset limit, and the updated confidence of all rounds of output is lower than the second threshold, the loop will terminate and the final decision will be triggered.
[0070] This invention applies attribute extraction rules to perform field matching and attribute extraction, including: performing direct text matching and specification number sequence matching on the building material description text, as specifically implemented below: 1. Direct text matching: For each field defined in the attribute extraction rules (such as "color" and "material"), its predefined set of possible values is as follows: The system will iterate through the collection and examine each value. Whether it appears directly in the building material description text as a consecutive substring. If it exists, it is determined to be a matching value for that field. This process can be formally represented as:
[0071] For example, if the rule defines the possible values for the "color" field as {"red", "blue", "transparent"}, and the description text is "transparent heat shrink tubing", then "color: transparent" can be extracted through direct text matching.
[0072] 2. Specification number sequence matching: For specifications and dimensions, where the values contain specific separators (such as " ") For fields such as "size" and "specification", the system uses numeric sequence matching logic. Let a possible value for a field be... Where a, b, and c are numbers. The system performs the following steps: Step 1: Number Extraction: From Extract the number sequence in order ; Step 2: Text Scanning: Scan the building material description text In the text, all appearing numbers are scanned sequentially and extracted to form a sequence of numbers. .
[0073] Step 3: Sequence Inclusion Determination: Determine... Does it contain subsequences in order? That is, an index exists. , making For all Established, that is .
[0074] If satisfied, then the building material description text is determined. With this specification value match.
[0075] For example, the rule defines the possible values for the "size" field as {"20×30", "50×100"}, and the descriptive text is "steel pipe sizes 50mm and 100mm". The extracted text number sequence is [50, 100], which is consistent with the number sequence [50,100] of "50×100", so the match is successful, and "size: 50×100" is extracted.
[0076] 3. Matching execution flow: The system sequentially attempts direct text matching for each field to be extracted. If a direct match fails and the field is identified as a specification field, specification number sequence matching is triggered. The final output is a dictionary where the keys are the field names, and the values are the matched text or specification strings; if no match is found, the value is empty.
[0077] Before generating structured material attribute data, this invention also includes validating the extracted key attributes using a large language model. In this invention, key attributes refer to core structured data extracted from building material description text that accurately defines the specific specifications, models, technical parameters, or states of the materials. These attributes are essential information for distinguishing different specific materials with the same name, enabling accurate procurement, pricing, and construction management. Key attributes typically exist in the form of key-value pairs, such as "strength grade: 42.5", "diameter: 8mm", and "color: transparent".
[0078] The attributes of a large language model can be divided into two categories: correct results (i.e., attribute values that are within the standard attribute table and semantically correct) and results that are not in the standard table. The standard table is an authoritative dataset stored in a relational database that defines the key attributes of various building materials and their legal values. Its initial data comes from publicly available industry standards (such as national standards and industry specifications), historical master data from enterprises, and domain expert knowledge.
[0079] Among them, the results that are not in the standard table are of two types: First, the attribute value corresponding to the field is empty, indicating that the original input text did not provide information about this field; Second, the model outputs an actual value, but this value is not in the standard table.
[0080] For the second type of attribute value that is not in the standard table, the extracted key attributes need to be validated using a large language model. The specific implementation process is as follows: 1. The system first performs semantic and format matching on the abnormal attribute values output by the large model that are not in the standard table, against all valid candidate values for that attribute field in the standard table. For example: When the model outputs "50×100" while the standard table outputs "50", When the value is 100, the system can successfully match and replace it.
[0081] When the model outputs "2×20mm" and the standard table contains "20mm" and "40mm", the system can correctly map it to the equivalent standard value "40mm" through calculation or semantic understanding.
[0082] If a match is successful, the system immediately calls the large language model again to determine whether the successfully matched standard value truly originates from the original input text. If the source is confirmed to be correct, the original erroneous output is replaced with this standard value; if it is confirmed not to originate from the input, the large model identifies the correct attribute field that the value might correspond to and records this information, as the standard table may be missing that attribute field or mapping relationship.
[0083] 2. If a match with the standard table fails (e.g., the model output "23×20" has no corresponding entry in the standard table), the system first sets the output value of that field to empty. Then, it immediately calls the large language model to perform source analysis on the outlier to determine whether it indeed originated from the original input text.
[0084] If the result is negative, the attribute value is considered a pure model illusion, and the verification process terminates.
[0085] If the determination is yes, it indicates that the user's input text contains a valid attribute value that is not covered by the current standard attribute table (i.e., the standard table lacks this attribute value or its corresponding relationship). In this case, the system will call the large language model to identify the correct attribute field that the outlier may correspond to, and record complete case information including material classification, attribute field, outlier, and original context, as the basis for subsequent judgment on whether the standard table needs to be expanded.
[0086] The method of the present invention further includes: After the task is completed, the task processing process and results are automatically evaluated; Representative misjudgment cases, ambiguous cases, and their corrective knowledge are stored in the Badcase case knowledge base; The system's processing performance is continuously optimized based on stored case data.
[0087] This invention provides a multi-agent collaborative material data processing system for the construction industry, comprising: The semantic cleansing agent is used to perform semantic cleansing preprocessing on the user-input text describing building materials in order to extract the core material name entities.
[0088] The multi-path retrieval fusion agent is used to obtain a preliminary set of candidate materials based on the core material name entity through multi-path retrieval fusion.
[0089] The web retrieval agent is used to perform web retrieval based on an initial candidate material set, through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification, in order to obtain supplementary knowledge.
[0090] The confidence-driven decision agent performs confidence-driven iterative decisions, determining the final material classification based on a preliminary set of candidate materials, definition and sample knowledge obtained from a relational database, historical correction knowledge and supplementary knowledge obtained from the Badcase knowledge base.
[0091] The attribute extraction agent is used to perform attribute extraction based on a determined final material classification, generating structured material attribute data.
[0092] Output Agent, which outputs the processing results containing the final material classification, confidence assessment, and structured attribute data.
[0093] The knowledge base agent includes a relational database storing standard material definitions and sample knowledge, a vector database for vector retrieval, and a Badcase knowledge base storing historical misjudgment cases.
[0094] Specifically, the multi-path retrieval fusion agent is used for: Convert the core material name entities into vectors and perform similarity searches in the vector database; Perform similarity searches between core material name entities and multi-level category names in relational databases; Technical keywords were extracted from the description text of building materials for supplementary retrieval; The results from multiple retrievals are then merged and sorted to generate a preliminary set of candidate materials.
[0095] Specifically, the web retrieval agent is used to execute the following procedural closed-loop process: Adversarial intent analysis phase: Multiple rounds of adversarial iterations are performed using attacker and defender models to generate high-confidence intent descriptions; Adaptive query generation and retrieval execution phase: Based on high-confidence intent descriptions, a set of search queries is generated and parallel retrieval is performed to obtain preliminary retrieval results; Multi-stage reflection verification and closed-loop optimization stage: Based on the preliminary search results, a preliminary answer is generated by the large language model; the preliminary answer is evaluated and reflected upon, and a diagnostic result containing the reasons for failure is output; and the search strategy is dynamically adjusted according to the diagnostic result until a final answer that meets the preset quality standard is generated as supplementary knowledge.
[0096] Specifically, the confidence decision module is used for: The initial candidate material set, definition and sample knowledge, historical correction knowledge and supplementary knowledge are integrated as the judgment context. The large language model performs the initial judgment and outputs the corresponding judgment result as the initial judgment result and the first confidence level. In the loop, the large language model first performs source analysis on the uncertainty of the preliminary judgment result based on the judgment context, then compares and infers each candidate material in the preliminary candidate material set based on the source analysis, and finally outputs the updated judgment result and the second confidence level. Based on the updated confidence level and the number of iterations, control whether the loop continues or triggers the final decision; In the final decision, the large language model makes a final judgment based on all historical reasoning paths generated in the initial decision stage and the self-correction loop stage, combined with the similarity ranking of the preliminary candidate material set, to determine the final material classification.
[0097] The following specific embodiment illustrates the complete workflow and effects of the present invention: 1. Enter information.
[0098] Building material description text: "Heat shrink tubing φ8mm, shrinkage size 4mm, transparent 100m".
[0099] 2. Processing procedure.
[0100] Semantic purification preprocessing: The system identifies the input as a material specification description, excludes interfering information such as price and action, and extracts the core material name entity "heat shrink tubing".
[0101] Vector library search: Search for similar materials in the vector database using L2 Euclidean distance and return a candidate list, including "heat shrink tubing", "heat shrink sleeve", "insulating sleeve", "flexible sleeve", "instrument tubing", etc.
[0102] Database Enhancement: Based on the preliminary candidate material set obtained from vector retrieval, the system extracts matching keywords, exclusion keywords, definitions, and related knowledge corresponding to each candidate material from a relational database to construct the material's definition and sample knowledge. For example, for the candidate material "heat shrink tubing," its matching keywords include "polyolefin, insulation, shrinkage, tubing, flame retardant," and its exclusion keywords include "metal, conductive, rigid, liquid, braided."
[0103] Badcase Case Knowledge Base Comparison: The vector representation of each candidate material is matched with the vector of historical misjudgment cases stored in the Badcase Case Knowledge Base for similarity. If the match is successful, the corresponding historical correction knowledge is introduced; if the match is unsuccessful, it is not introduced.
[0104] Supplementary online search: Obtain supplementary information about "heat shrink tubing" through an online search agent, confirming that it is a heat shrink tubing with shape memory effect.
[0105] Multi-dimensional judgment and confidence assessment: Based on the above information, the large model determines that the material should be classified as "heat shrink tubing" with a confidence level of 100%.
[0106] Attribute extraction and structured output: Based on the predefined attribute extraction rules in the relational database, output structured attributes, including size before shrinkage, shrinkage ratio, color, length, etc.
[0107] 3. Output results.
[0108] Material Name: Heat Shrink Tubing Confidence level: 100% Attribute output: - Size before shrinkage: 8mm - Shrinkage size: 4mm - Shrinkage ratio: 2:1 - Color: Transparent - Core Specifications: Shrinkage size 4mm, Transparent 100m - Series: Heat Shrink Tubing Series.
[0109] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention used to illustrate the technical solutions of the present invention, and are not intended to limit the invention, nor are they intended to limit the patent scope of the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention. That is to say, any changes or refinements made to the main design concept and spirit of the present invention that are not of substantial significance, but whose technical problems are still consistent with the present invention, should be included within the protection scope of the present invention. In addition, the direct or indirect application of the technical solutions of the present invention to other related technical fields are similarly included within the patent protection scope of the present invention.
Claims
1. A multi-agent collaborative method for classifying and extracting building materials, characterized in that, Includes the following steps: Receive user-input text describing building materials; The input building material description text is preprocessed with semantic purification, and non-material descriptive interference information is identified and filtered based on a preset industry interference semantic rule library. Multi-path fusion retrieval is performed on the purified text to obtain a preliminary set of candidate materials from the constructed vector database and relational database; Based on the preliminary candidate material set, the material definition and sample knowledge are obtained from the relational database, and historical correction knowledge is obtained by matching from the pre-set Badcase case knowledge base; External knowledge is acquired as supplementary knowledge through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification. Perform confidence-driven iterative decision-making, based on the candidate material set, material definition and sample knowledge, historical correction knowledge and supplementary knowledge, to determine the final material classification; Based on the final material classification, the corresponding attribute extraction rules are obtained from the relational database; the attribute extraction rules are applied to perform field matching and attribute extraction on the building material description text to generate structured material attribute data; The output contains structured processing results including final material classification, confidence assessment, and material attribute data.
2. The method according to claim 1, characterized in that, The input text undergoes semantic cleansing preprocessing, identifying and filtering non-material descriptive interference information based on a pre-defined industry interference semantic rule base. Specifically, this includes: Extract core material name entities from the input building material description text using natural language processing techniques or large language models; Based on a predefined industry interference semantic pattern library, the extracted core material name entities or input text are analyzed and identified. The pattern library defines strong interference semantic patterns that represent price information, transaction behavior or operation instructions. If content matching a strong interference semantic pattern is identified, the input is deemed invalid and all subsequent processing steps are terminated; otherwise, the core material name entity is passed as the purified text to the subsequent processing steps.
3. The method according to claim 1, characterized in that, Performing multi-path fusion retrieval on the cleaned text includes the following retrieval paths executed in parallel: First search path: In the vector database, perform vector semantic similarity retrieval based on the cleaned text; Second search path: In a relational database, hierarchical matching search is performed based on the purified text in a multi-level classification system; The third search path: supplementing the search by extracting keywords from the input building material description text in vector databases and / or relational databases; The search results from each path are integrated using a pre-defined fusion and sorting algorithm to generate a preliminary set of candidate materials.
4. The method according to claim 3, characterized in that, Semantic similarity in vector semantic similarity retrieval is calculated in two stages: Phase 1: Based on the first vector transformed from the purified text and the standard material name vectors in the vector database, calculate the cosine similarity and Jaccard similarity, and then perform a weighted fusion to obtain the combined similarity. ; Phase Two: Based on the L2 Euclidean distance between the first vector and the standard material name vector ,judge The relationship with the preset threshold, if If the threshold is less than or equal to the preset threshold, then... and The final similarity is obtained by weighted fusion. ;like >Preset threshold, then Directly used as the final similarity .
5. The method according to claim 1, characterized in that, Historical corrective knowledge is retrieved from a pre-defined Badcase knowledge base, specifically including: The semantic features of the preliminary candidate material set are matched with the failure mode features of historical misjudgment cases stored in the Badcase case knowledge base. If a match is successful, the corrective knowledge and the mapping relationship between the correct material and the historical misjudgment case are returned as historical corrective knowledge.
6. The method according to claim 1, characterized in that, Web retrieval is conducted through a procedural, closed-loop process that includes adversarial intent analysis and multi-stage reflective verification, specifically including: Adversarial intent analysis phase: The attacker model generates diverse and ambiguous questions, the defender model infers the user's intent and outputs a confidence score, and a high-confidence intent description is generated through multiple iterations; Adaptive query generation and retrieval execution phase: Based on high-confidence intent descriptions, a set of search queries is generated and parallel retrieval is performed to obtain preliminary retrieval results; Multi-stage reflection verification and closed-loop optimization stage: Based on the preliminary search results, a preliminary answer is generated by the large language model; the preliminary answer is evaluated and reflected upon, and a diagnostic result containing the reasons for failure is output; and the search strategy is dynamically adjusted according to the diagnostic result until a final answer that meets the preset quality standard is generated as supplementary knowledge.
7. The method according to claim 1, characterized in that, Perform confidence-driven iterative decision-making, specifically including: Preliminary Judgment Stage: Integrate the preliminary candidate material set, definition and sample knowledge, historical correction knowledge and supplementary knowledge as the judgment context, and use the large language model to make a preliminary judgment and output the corresponding judgment result as the preliminary judgment result and the first confidence level. First-level decision stage: If the first confidence level is higher than the first threshold, and the preliminary judgment result belongs to the valid result set consisting of the preliminary candidate material set and the unmatched state, then the preliminary judgment result is accepted as the final material classification; otherwise, a self-correction loop is triggered. Self-correcting loop phase: In the loop, the large language model first performs source analysis on the uncertainty of the preliminary judgment result based on the judgment context, then compares and infers each candidate material in the preliminary candidate material set based on the source analysis, and finally outputs the updated judgment result and the second confidence level. Secondary decision stage: If the second confidence level is higher than the second threshold, the updated judgment result is accepted as the final material classification; if it is less than or equal to the second threshold and the number of cycles has not exceeded the preset limit, self-correction continues; if the number of cycles has reached the preset limit, the final decision is triggered. Final Decision Stage: When the final decision is triggered, the large language model makes a final decision based on all historical reasoning paths generated in the initial decision stage and the self-correction loop stage, and combines the similarity ranking of the preliminary candidate material set to determine the final material classification.
8. The method according to claim 7, characterized in that, The update of the second confidence level in the self-correcting loop phase employs a calibration method based on Bayesian inference: In each self-correcting loop, the second confidence level output from the previous round is used as the current confidence level. ; Calculate the posterior probability that the large language model makes a correct judgment at the current confidence level. ; According to the formula Calculate the updated confidence level ,in This is a preset adjustment factor; If the number of self-correction loops exceeds the preset limit, and the updated confidence of all rounds of output is lower than the second threshold, the loop will terminate and the final decision will be triggered.
9. A multi-agent collaborative material data processing system for the construction industry, characterized in that: To implement the method of any one of claims 1-8, comprising: The semantic cleansing agent is used to perform semantic cleansing preprocessing on the user-input building material description text in order to extract the core material name entities; The multi-path retrieval fusion agent is used to obtain a preliminary set of candidate materials based on the core material name entity through multi-path retrieval fusion. The web retrieval agent is used to perform web retrieval based on a preliminary candidate material set, through a procedural closed-loop process that includes adversarial intent analysis and multi-stage reflective verification, in order to obtain supplementary knowledge. The confidence decision agent is used to perform confidence-driven iterative decisions. Based on the initial candidate material set, definition and sample knowledge obtained from relational databases, historical correction knowledge and supplementary knowledge obtained from the Badcase case knowledge base, it determines the final material classification. The attribute extraction agent is used to perform attribute extraction based on a determined final material classification, generating structured material attribute data. Output Agent, which outputs the processing results containing the final material classification, confidence assessment, and structured attribute data; The knowledge base agent includes a relational database storing standard material definitions and sample knowledge, a vector database for vector retrieval, and a Badcase knowledge base storing historical misjudgment cases.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the method as described in any one of claims 1-8 when executing a computer program.
Citation Information
Patent Citations
Intelligent agent device and method for automatically optimizing verbal skill and electronic equipment
CN118394904A
A material classification and attribute extraction method for the construction industry based on large language model
CN119378553B
Text adversarial sample generation method and device, electronic equipment and storage medium
CN116911374A
Multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval
CN120297425A
Abnormal information monitoring and processing method based on large model and intelligent agent
CN121387611A