Legal intelligent assisted processing method and multi-agent system

By building a dynamically updated legal knowledge system and a multi-agent collaboration mechanism, the problems of information islands and multi-case relationship perception in the legal processing system are solved, and intelligent assistance and efficient processing of legal decision-making are achieved.

CN120256605BActive Publication Date: 2025-09-12贵州中汇科技发展有限公司

Patent Information

Application Number
CN202510740723.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-12
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

Existing legal processing systems are unable to simulate the complex "review-analysis-decision-making" thinking chain of legal personnel. There are serious information silos between functional modules, and there is a lack of the ability to perceive the relationships between multiple cases and the reasoning chain alignment mechanism, resulting in limited intelligent assistance capabilities.

Method used

Build a dynamically updated legal knowledge system, form a hierarchical legal knowledge system through named entity recognition, relationship extraction and event detection technology, and design a multi-agent collaborative mechanism for case diversion, legal application, similar case retrieval and risk warning. Combine large-scale language models with Prolog knowledge management technology to build a PLANTOR framework and achieve multi-agent reasoning chain alignment.

Benefits of technology

It improves the accuracy and efficiency of handling complex cases, enhances the ability to accurately perceive and handle case relationships, ensures the timeliness and accuracy of the knowledge base, and realizes intelligent assistance in legal decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256605B_ABST
    Figure CN120256605B_ABST
Patent Text Reader

Abstract

The present application provides a method for intelligent legal assistance and a multi-agent system, the method including: constructing a dynamically updated legal knowledge system; constructing a case diversion agent, a legal application agent, a similar case retrieval agent and a risk warning agent based on the dynamically updated legal knowledge system, and realizing a multi-agent collaborative mechanism through a collaborative structure based on message passing and state sharing; constructing a preference mapping relationship model through case complexity assessment and quality assessment based on the multi-agent collaborative mechanism, and realizing multi-case relationship perception preference mapping; based on multi-case relationship perception preference mapping, combining a large language model with Prolog-based knowledge management technology to construct a planning tree PLANTOR framework, generate a robot-oriented knowledge base and planning program, and convert them into a behavior tree; according to the PLANTOR framework, realize multi-agent reasoning chain alignment through the joint optimization of transmission optimization and embedding optimization, and complete legal decision-making assistance. The above scheme effectively improves the accuracy and efficiency of legal processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence and legal processing technology, and in particular to a method for legal intelligent-assisted processing and a multi-agent system. Background Art

[0002] Legal affairs processing is a core component of the legal system's operations, encompassing multiple key processes, including case acceptance, legal application, similar case retrieval, and risk assessment. With the increasing number and complexity of legal cases, traditional manual processing methods face significant challenges in efficiency and accuracy. Therefore, the introduction of intelligent technology to assist in legal affairs processing has become a key trend in the industry.

[0003] Currently, common technologies in the legal affairs field primarily include basic case management systems and rudimentary intelligent assistance tools. For example, the electronic archive management systems used by some relevant departments enable digital storage and basic retrieval of case documents; while legal knowledge base systems employed by relevant departments in some regions provide simple legal article search and recommendation capabilities. While these systems offer some convenience in basic legal work, their intelligent assistance capabilities for complex legal processing remain limited.

[0004] The most relevant existing technology is a legal assistance system based on a single-function agent. This system builds a domain-specific legal knowledge base and, using machine learning algorithms, provides legal professionals with single-function assistance services such as legal article recommendations and similar case retrieval. These systems typically employ preset rules and a single model structure to analyze case materials and directly output corresponding assistance results, significantly improving the efficiency of legal work.

[0005] However, existing technologies suffer from significant technical flaws: First, single-functional intelligent agents are unable to simulate the complex "review-analysis-decision-making" thinking process of legal professionals, resulting in a limited ability to understand case context. Second, the lack of multi-agent collaboration mechanisms leads to severe information silos between functional modules, hindering the effective transfer and integration of legal knowledge and case information. Furthermore, existing systems lack the ability to perceive the relationships between multiple cases and mechanisms for aligning reasoning chains, making them incapable of handling complex and difficult cases. These technical flaws severely limit the depth and breadth of intelligent systems' application in the legal field. Summary of the Invention

[0006] In view of this, the present application provides a method for intelligent assisted legal processing and a multi-agent system, which solves the problems in the existing technology that a single functional agent cannot simulate the complex thinking chain of legal personnel, there are serious information islands between functional modules, and there is a lack of multi-case relationship perception ability and reasoning chain alignment mechanism.

[0007] This embodiment of the present application provides a method for intelligently assisting legal affairs processing, including:

[0008] Leveraging legal data including legal texts, legal interpretations, case law from relevant departments, and legal research results, through named entity recognition, relationship extraction, and event detection technologies, a dynamically updated legal knowledge system is constructed. The dynamically updated legal knowledge system includes legal entities, legal relationships, and legal events.

[0009] Based on the dynamically updated legal knowledge system, a case diversion agent, a law application agent, a similar case retrieval agent, and a risk warning agent are constructed, and a multi-agent collaboration mechanism is implemented through a collaborative structure based on message transmission and state sharing. The case diversion agent is used to identify case types and determine processing priorities, the law application agent is used to match legal provisions and legal interpretations, the similar case retrieval agent is used to achieve accurate case push, and the risk warning agent is used to generate risk assessment reports.

[0010] Based on the multi-agent collaborative mechanism, a preference mapping relationship model is constructed through case complexity assessment and quality assessment to achieve multi-case relationship perception preference mapping;

[0011] Based on the multi-case relationship perception preference mapping, a planning tree PLANTOR framework is constructed by combining a large language model with Prolog-based knowledge management technology to generate a robot-oriented knowledge base and planning program, and convert them into a behavior tree;

[0012] According to the PLANTOR framework, multi-agent reasoning chain alignment is achieved through the joint optimization of transmission optimization and embedding optimization to complete legal decision-making assistance.

[0013] Optionally, the step of constructing a dynamically updated legal knowledge system includes:

[0014] Through data cleaning, format unification and deduplication, a standardized legal data set is formed;

[0015] Based on the standardized legal data set, legal entities, legal relationships, and legal events are extracted through named entity recognition, relationship extraction, and event detection to form a basic legal knowledge representation;

[0016] Based on the basic legal knowledge representation and the standardized legal data set, logical associations between categories are established through legal domain ontology construction technology to form a hierarchical legal knowledge system;

[0017] Based on the hierarchical legal knowledge system, the dynamically updated legal knowledge system is constructed by executing an incremental learning algorithm to discover new knowledge and verifying and integrating it through a knowledge consistency verification mechanism.

[0018] Optionally, the step of constructing the case diversion agent based on the dynamically updated legal knowledge system includes:

[0019] Utilizing the dynamically updated legal knowledge system and the received case materials, a trained text classification model is constructed using multi-label text classification technology;

[0020] Based on the text classification model and the semantic features of the case materials, case classification is performed using a type recognition algorithm to generate a case type label;

[0021] Calculate and output a case handling priority score using a priority sorting algorithm based on the case type label and characteristic information of the case material;

[0022] The text classification model, the type recognition algorithm and the priority sorting algorithm are integrated into a unified processing framework to construct a case diversion agent that can identify case types and determine processing priorities.

[0023] Optionally, the step of constructing the law application agent based on the dynamically updated legal knowledge system includes:

[0024] Building a semantic matching model using deep learning technology based on the case type label and the legal provisions in the dynamically updated legal knowledge system;

[0025] Based on the semantic analysis results of the case materials by the semantic matching model, a set of candidate legal provisions is generated through a legal provision matching algorithm;

[0026] Using the candidate legal article set and the semantic feature vectors of the case materials, a list of applicable legal articles and reasons for their application is generated and output through legal reasoning technology;

[0027] The semantic matching model, the legal provision matching algorithm and the legal reasoning technology are encapsulated into a unified functional module to construct a legal application agent that can accurately match legal provisions and legal interpretations.

[0028] Optionally, the step of constructing the similar case retrieval agent based on the dynamically updated legal knowledge system includes:

[0029] Using the case type labels, the list of applicable laws and regulations, and a pre-built case knowledge base, a case similarity calculation model is constructed through deep semantic matching technology;

[0030] Screening and generating a candidate case set through a retrieval algorithm based on the case similarity calculation model and case features of the case knowledge base;

[0031] Based on the similarity scores of the candidate case set and the case similarity calculation model, a similar case set and similarity analysis results are screened and outputted through a sorting optimization technology;

[0032] The case similarity calculation model, the retrieval algorithm and the ranking optimization technology are integrated into an integrated functional unit to construct a similar case retrieval agent that can achieve accurate case push.

[0033] Optionally, the step of constructing the risk warning agent based on the dynamically updated legal knowledge system includes:

[0034] Constructing a risk pattern recognition model using machine learning technology based on the case type label, the list of applicable laws, and case features in the collection of similar cases;

[0035] Based on the analysis results of the case materials by the risk pattern recognition model, risk points are identified through feature extraction and pattern matching technology to generate a risk feature set;

[0036] Utilizing the risk feature set and the preset risk assessment rule base, risk quantification assessment and anomaly detection technology are used to generate and output a risk assessment report and treatment suggestions;

[0037] The risk pattern recognition model, the feature extraction and pattern matching technology, and the risk quantification assessment and anomaly detection technology are combined into a comprehensive processing system to construct a risk warning agent that can provide prompts for major and difficult cases.

[0038] Optionally, the step of constructing a preference mapping relationship model based on the multi-agent collaboration mechanism through case complexity assessment and quality assessment to implement multi-case relationship perception preference mapping includes:

[0039] Using the case type label, the list of applicable laws and regulations, the collection of similar cases, and the feature data in the risk assessment report, a case assessment model is constructed through deep learning and feature engineering techniques to generate a case complexity score and a case quality score;

[0040] Based on the scoring data output by the case evaluation model, similarity analysis is performed on the cases through multi-dimensional similarity calculation and hierarchical clustering technology to generate case grouping results and inter-group relationship characteristics;

[0041] Based on the case grouping results and the case scoring characteristics of the evaluation model, a preference mapping relationship model is constructed and output through preference mining and mapping learning technology to achieve the multi-case relationship perception preference mapping.

[0042] Optionally, the step of constructing a planning tree PLANTOR framework based on the multi-case relationship perception preference mapping and combining a large language model with a Prolog-based knowledge management technology includes:

[0043] Based on the feature data of the multi-case relationship perception preference mapping, a two-stage knowledge generation method is designed and implemented using a large language model and Prolog rule reasoning technology to generate a robot-oriented knowledge base;

[0044] Based on the two-stage knowledge generation method and the mapping rules of the preference mapping relationship model, a knowledge base component with reusability and combinatorial reasoning capabilities is constructed through modular design and rule formalization technology;

[0045] Based on the knowledge base components and preset task scheduling constraints, a three-step planning procedure is designed and implemented by mixed integer linear programming technology, which takes into account time dependency, resource constraints and parallel task execution, and generates a task planning solution;

[0046] Based on the execution process and resource allocation strategy of the mission planning scheme, the planning scheme is converted into an executable behavior tree structure through behavior tree mapping and path optimization technology, completing the construction of the PLANTOR framework.

[0047] Optionally, the steps of achieving multi-agent reasoning chain alignment through joint optimization of transmission optimization and embedding optimization according to the PLANTOR framework to complete legal decision support include:

[0048] By utilizing the knowledge base components and behavior tree structure in the PLANTOR framework, the inference chain features of each agent are extracted through deep inference path analysis technology to generate a standardized inference chain representation.

[0049] According to the normalized reasoning chain representation and the preset alignment optimization goal, a transmission optimization model is constructed through transfer learning and transmission optimization technology;

[0050] Using the normalized inference chain representation and the feature space of the transmission optimization model, an embedding optimization model is constructed through semantic representation learning and dimensionality reduction optimization technology;

[0051] According to the optimization parameter space of the transmission optimization model and the embedding optimization model, the alignment optimization of the reasoning chain is realized by a multi-objective joint optimization algorithm, and an aligned multi-agent reasoning chain set is output.

[0052] An embodiment of the present application also provides a multi-agent system for intelligently assisted legal processing, comprising: a processor; and a memory on which a computer program is stored, wherein the processor implements the steps of the above method when executing the computer program.

[0053] An embodiment of the present application further provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor;

[0054] In which, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method of legal intelligent assisted processing.

[0055] An embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the above-mentioned method of legal intelligent assisted processing.

[0056] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the above-mentioned method for legal intelligent assisted processing.

[0057] This application has the following technical effects:

[0058] By building a dynamically updated legal knowledge system and utilizing incremental learning algorithms and knowledge consistency verification mechanisms to automatically discover and integrate legal knowledge, the timeliness and accuracy of the knowledge base are ensured.

[0059] By designing a "serial-parallel" collaborative structure of case diversion agents, legal application agents, similar case search agents, and risk warning agents, we simulated the full process of "review-analysis-decision-making" for case handlers, improving the accuracy and efficiency of handling complex cases.

[0060] Through the multi-case relationship-aware preference mapping framework, the informativeness of preference data is enhanced and the granularity of alignment signals is improved, enabling accurate perception and processing of case relationships.

[0061] The PLANTOR framework combines large-scale language models with Prolog-based knowledge management technology to ensure knowledge reusability and combinatorial reasoning capabilities, effectively handling time dependencies, resource constraints, and parallel task execution issues;

[0062] By jointly applying transmission optimization and embedding optimization to the multi-agent reasoning chain, efficient migration of the reasoning process and semantically consistent representation of the reasoning content are achieved, thereby improving the overall reasoning effect of the system and its legal decision-making assistance capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.

[0064] Figure 1 A flowchart of the legal intelligent assisted processing method provided in an embodiment of the present application;

[0065] Figure 2 A schematic diagram of a process for constructing a dynamically updated legal knowledge system provided in an embodiment of the present application;

[0066] Figure 3 A flow chart of the multi-agent system architecture design and collaboration mechanism provided in the embodiments of the present application;

[0067] Figure 4 A flowchart of a multi-case relationship perception preference mapping framework provided in an embodiment of the present application;

[0068] Figure 5 A schematic diagram of the process of constructing the PLANTOR framework provided in the embodiments of the present application;

[0069] Figure 6 Schematic diagram of joint optimization of multi-agent reasoning chain alignment provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.

[0071] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0072] The term "and / or" herein simply describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.

[0073] like Figure 1 As shown, the embodiment of the present application provides a method for intelligent assisted legal processing, including:

[0074] S1: Utilize legal data including legal provisions, legal interpretations, case law of relevant departments and legal research results, and through named entity recognition, relationship extraction and event detection technology, build a dynamically updated legal knowledge system. The dynamically updated legal knowledge system includes legal entities, legal relationships and legal events.

[0075] The embodiments of this application will comprehensively collect multi-source legal data such as legal provisions, legal interpretations, case law of relevant departments and legal research results.

[0076] After the data collection is completed, a standardized legal data set is formed through pre-processing technologies such as data cleaning, format unification, and deduplication. Based on this standardized data, the embodiment of the present application uses named entity recognition technology to identify key entities in legal texts, such as legal subjects, legal objects, and legal acts.

[0077] At the same time, relationship extraction technology is used to explore the legal relationships between entities, such as rights and obligations, causal relationships, etc.; in addition, event detection technology is used to identify event information in legal texts, including elements such as time, place, and behavior.

[0078] These extracted legal entities, legal relations, and legal events constitute the basic legal knowledge representation. Subsequently, the embodiment of the present application uses legal domain ontology construction technology to classify and organize these basic knowledge in multiple dimensions, establish logical connections between categories, and form a hierarchical legal knowledge system. Finally, to ensure the timeliness and accuracy of knowledge, the embodiment of the present application implements a dynamic update mechanism, automatically discovers new knowledge through an incremental learning algorithm, and verifies and integrates it through a knowledge consistency verification mechanism, so that the legal knowledge system can be continuously enriched and optimized.

[0079] S2: Based on the dynamically updated legal knowledge system, construct a case diversion agent, a law application agent, a similar case retrieval agent and a risk warning agent, and realize a multi-agent collaboration mechanism through a collaborative structure based on message transmission and state sharing. Among them, the case diversion agent is used to identify the case type and determine the processing priority, the law application agent is used to match legal provisions and legal interpretations, the similar case retrieval agent is used to achieve accurate case push, and the risk warning agent is used to generate a risk assessment report.

[0080] S2 is designed to simulate the full-process thinking of legal personnel: "review-analysis-decision-making".

[0081] Based on the dynamically updated legal knowledge system built by S1, the embodiment of this application designs four types of specialized agents and adopts a "series-parallel" structure to enable efficient collaboration.

[0082] First, the case triage agent is responsible for identifying case types and determining processing priorities. It builds a text classification model through multi-label text classification technology, performs semantic analysis on the input case materials, generates case type labels, and calculates the case processing priority score through a priority sorting algorithm.

[0083] Secondly, the legal application agent is responsible for matching legal provisions and legal interpretations. Based on the case type labels and legal provisions information in the legal knowledge system, it builds a semantic matching model through deep learning technology, generates a set of candidate legal provisions, and outputs a list of applicable legal provisions and the reasons for their application through legal reasoning technology.

[0084] At the same time, the similar case retrieval agent is responsible for achieving accurate case push. It uses case type labels, a list of applicable laws and a pre-built case knowledge base to build a case similarity calculation model through deep semantic matching technology, generates a set of candidate cases through a retrieval algorithm, and outputs a set of similar cases and similarity analysis results through sorting optimization technology.

[0085] Finally, the risk warning agent is responsible for generating a risk assessment report. It integrates the output of the first three agents, builds a risk pattern recognition model using machine learning techniques, identifies risk points in the case, and generates a risk assessment report and action recommendations using risk quantification and anomaly detection. These four agents collaborate through messaging and state sharing, forming a multi-agent embodiment of this application that simulates the complete thought process of legal personnel.

[0086] In terms of the construction and training of each agent, the system adopts a sophisticated design and optimization strategy.

[0087] The case triage agent is trained in two stages: the first stage uses large-scale labeled data for supervised pre-training, with a dataset of 500,000 labeled cases covering major case types; the second stage uses small-scale high-quality data for fine-tuning, including 20,000 typical cases labeled by senior legal staff, to ensure that the model accurately grasps key case features. The main hyperparameters used in training include: the learning rate is set to 1e -4 , using the Adam optimizer, the weight decay is 0.01, the linear learning rate warm-up strategy is adopted, and the number of warm-up steps is 1000.

[0088] To address the imbalance in legal case categories, the system uses a weighted cross-entropy loss function, with the maximum weight for subcategories set to 5.0. The case triage agent ultimately achieved a macro-average F1 score of 94.2% on the test set. For example, when handling an intellectual property case, the system was able to simultaneously identify the broad category label of "intellectual property dispute," the mid-category label of "copyright," and the subcategory label of "photographic work," achieving multi-level, precise classification.

[0089] The training of the legal application agent adopts the knowledge distillation and multi-task learning framework.

[0090] During the knowledge distillation process, the system first uses the annotation results of a team of legal experts (including five senior legal staff and ten professional lawyers) as a "teacher model." It then trains a lightweight "student model" to approximate the output distribution of the teacher model. A multi-task learning framework simultaneously optimizes two related tasks: legal clause matching and legal reasoning, sharing underlying representations to improve model generalization.

[0091] Key hyperparameter settings include: a distillation temperature coefficient of 2.5, a multi-task loss weight ratio of 3:2 (legal provision matching: legal reasoning), a learning rate of 5e-5, a cosine annealing scheduling strategy, and a total of five training rounds. The training dataset contains 100,000 typical cases and corresponding legal provisions.

[0092] To improve training efficiency, the system uses mixed precision training technology and distributed training on 8 V100 GPUs through model parallelism and data parallelism strategies. A single round of training takes about 12 hours.

[0093] In practical applications, for example, when handling a commercial housing sales contract dispute, the Legal Application Agent can accurately match key provisions such as a certain article in a certain code (on the definition of a sales contract), (on the form of a housing sales contract), and (on the registration requirements for changes in property rights), and generate detailed application reasons, explaining the correspondence between these provisions and the facts of the case.

[0094] The training of similar case retrieval agent focuses on the optimization of similarity calculation model and adopts contrastive learning framework.

[0095] The training data consists of two parts: one is a case similarity dataset annotated by legal staff, which contains 5,000 case pairs. Each group contains a query case and multiple candidate cases, and is labeled hierarchically by similarity; the other is an automatically constructed large-scale weakly supervised dataset, which extracts case pairs from 1 million judgment documents through rules.

[0096] The key hyperparameters during training include: the temperature parameter in the contrastive loss function is set to 0.07, the interval parameter in the triplet loss function is set to 0.5, the batch size is 128, and the learning rate is 1e -5 , using the AdamW optimizer, with 10 training rounds. To enhance the robustness of the model, the system uses data augmentation techniques such as random deletion, replacement, and re-arrangement of paragraphs to generate variant samples. In terms of retrieval performance optimization, the system uses vector quantization technology to compress case vectors and adopts IVFPQ (Inverted File Product Quantization) index structure to support millisecond-level retrieval of case libraries of over 100 million cases. The index parameter configuration includes the number of cluster centers of 8192 and the number of sub-quantizers of 16. In practical applications, for example, in handling a work-related injury compensation dispute, the similar case retrieval agent can retrieve 10 highly similar reference cases and arrange them in descending order of similarity. At the same time, it provides a similarity analysis report, pointing out the similarities and differences between each reference case and the current case in terms of injury severity, disability level determination, and compensation calculation method.

[0097] The risk warning agent is trained using an ensemble learning approach, integrating the strengths of multiple machine learning algorithms. The underlying models include gradient boosted decision trees (GBDT), random forests (RF), and deep neural networks (DNN). The prediction results of each model are integrated through stacking technology.

[0098] The training data consists of a risk case library annotated by legal experts, containing 30,000 typical risk cases, each annotated with information such as risk type, risk severity, and risk location. The main hyperparameters for the GBDT model include: number of trees of 500, maximum depth of 6, learning rate of 0.05, and feature sampling ratio of 0.8; the hyperparameters for the RF model include: number of trees of 1000, maximum number of features of sqrt(n_features), and minimum number of leaf node samples of 5; the DNN model uses a three-layer fully connected network with hidden layer sizes of 512, 256, and 128, respectively, using the ReLU activation function and a dropout rate of 0.3.

[0099] To address the imbalance in risk categories, the system employs SMOTE oversampling to increase the number of minority class samples and uses a class weighting strategy, weighting high-risk classes three times that of the general class. Model evaluation uses weighted F1 scores and area under the curve (AUC). The ensemble model achieved a weighted F1 score of 0.88 and an average AUC of 0.92 on the test set. In real-world applications, such as analyzing a complex medical malpractice claim dispute, the risk warning agent accurately identified key risk points such as "insufficient proof of causality," "ambiguous determination of medical fault," and "improper calculation of claim amounts." It also generated detailed risk assessments and response recommendations for each risk point, such as "recommending additional appraisal by a professional medical institution to clarify the causal relationship between the medical treatment and the resulting damage."

[0100] S3: Based on the multi-agent collaboration mechanism, a preference mapping relationship model is constructed through case complexity assessment and quality assessment to achieve multi-case relationship perception preference mapping.

[0101] S3 is the step to achieve multi-case relationship perception preference mapping, which is a key link to improve the accuracy of legal processing.

[0102] Based on the multi-agent collaboration mechanism built by S2, this embodiment of the application first uses the feature data from case type labels, applicable legal provisions, similar case collections, and risk assessment reports to build a case assessment model through deep learning and feature engineering techniques, generating case complexity and quality scores. These scores can objectively reflect the complexity of the case and the quality of the handling.

[0103] Subsequently, the embodiment of the present application performs similarity analysis on the cases through multi-dimensional similarity calculation and hierarchical clustering technology to generate case grouping results and inter-group relationship characteristics. This step groups cases with similar complexity and quality characteristics into the same group. Based on these grouping results and evaluation characteristics, the embodiment of the present application constructs a preference mapping relationship model through preference mining and mapping learning technology to achieve multi-case relationship perception preference mapping. This mapping framework enhances the informativeness of preference data and improves the granularity of alignment signals by limiting preference comparisons to outputs of similar complexity and quality, enabling the embodiment of the present application to more accurately perceive and process complex relationships between cases.

[0104] S4: Based on the multi-case relationship perception preference mapping, a planning tree PLANTOR framework is constructed by combining a large language model with Prolog-based knowledge management technology to generate a robot-oriented knowledge base and planning program, and convert them into a behavior tree.

[0105] For S4, based on the multi-case relationship perception preference mapping implemented by S3, the embodiment of the present application first designs and implements a two-stage knowledge generation method through a large language model and Prolog rule reasoning technology.

[0106] In the first phase, the present embodiment utilizes a large language model to gain a deep semantic understanding of legal cases. In the second phase, this understanding is converted into a Prolog-processable rule representation, thereby generating a robot-oriented knowledge base. Subsequently, through modular design and rule formalization techniques, the present embodiment constructs knowledge base components with reusability and combinatorial reasoning capabilities. These components can be flexibly combined to address various legal scenarios.

[0107] Based on these knowledge base components and preset task scheduling constraints, the embodiment of the present application designs and implements a three-step planning procedure through mixed integer linear programming technology: the first step is to determine the order of task execution, the second step is to allocate resources, and the third step is to optimize the parallel execution strategy. This three-step planning comprehensively considers time dependence, resource constraints and parallel task execution to generate an efficient task planning solution. Finally, the embodiment of the present application converts the planning solution into an executable behavior tree structure through behavior tree mapping and path optimization technology, completing the construction of the PLANTOR framework. This framework enables the embodiment of the present application to have powerful knowledge representation and task planning capabilities.

[0108] S5: Based on the PLANTOR framework, multi-agent reasoning chain alignment is achieved through joint optimization of transmission optimization and embedding optimization to complete legal decision support.

[0109] In S5, based on the PLANTOR framework built in S4, this embodiment first utilizes the knowledge base component and behavior tree structure to extract the reasoning chain characteristics of each agent through deep reasoning path analysis technology, generating a standardized reasoning chain representation. These reasoning chains represent the complete reasoning process of each agent from case input to decision output.

[0110] Subsequently, the embodiment of the present application constructs a transmission optimization model through transfer learning and transmission optimization technology based on these standardized reasoning chain representations and preset alignment optimization goals. This model can achieve efficient migration of the reasoning process, so that the reasoning process between different agents is consistent. At the same time, the embodiment of the present application utilizes the standardized reasoning chain representation and the feature space of the transmission optimization model to construct an embedding optimization model through semantic representation learning and dimensionality reduction optimization technology. This model can achieve semantically consistent representation of the reasoning content, ensuring that different agents have a consistent understanding of the same legal concept. Finally, the embodiment of the present application realizes alignment optimization of the reasoning chain through a multi-objective joint optimization algorithm based on the optimization parameter space of the transmission optimization model and the embedding optimization model, and outputs a set of aligned multi-agent reasoning chains. This joint optimization mechanism significantly improves the overall reasoning effect and legal decision-making assistance capabilities of the embodiment of the present application, enabling each agent to work together to provide intelligent support for legal processing.

[0111] Among them, Figure 2 As shown, the steps for S1 to build a dynamically updated legal knowledge system include:

[0112] S1.1: Form a standardized legal data set through data cleaning, format unification and deduplication.

[0113] S1.1 is the step of preprocessing data to form a standardized legal data set, which is the basic work for building the entire legal knowledge system.

[0114] In actual implementation, the system first obtains legal data from multiple sources, including legal text databases, case databases of relevant departments, legal interpretation documents, and legal research results.

[0115] For legal text data, the system uses text parsing technology to extract key information such as the article number, article content and legal effect; for case law of relevant departments, the system extracts core elements such as the cause of the case, the focus of the dispute, the key points of the judgment and the judgment result; for legal interpretations and legal research results, the system extracts their key arguments and legal opinions. In the data cleaning process, the system uses regular expressions and natural language processing technology to identify and correct typos, punctuation errors and irregular formats; through text standardization technology, various documents are converted into a unified XML or JSON format to ensure structural consistency; at the same time, semantic similarity calculation and fingerprint recognition algorithms are used to deduplicate text to avoid the interference of duplicate data on the construction of the knowledge system. In addition, the system will also conduct data quality assessments, eliminate incomplete or low-quality data entries, and ultimately form a standardized legal data set with unified structure, accurate content and no redundancy, laying a solid foundation for subsequent knowledge extraction and representation.

[0116] S1.2: Based on the standardized legal data set, legal entities, legal relationships and legal events are extracted through named entity recognition, relationship extraction and event detection to form a basic legal knowledge representation.

[0117] In terms of specific implementation, the system uses a deep learning model based on BiLSTM-CRF (bidirectional long short-term memory network-conditional random field), combined with pre-trained word vectors specific to the legal field, to accurately identify legal subjects (such as plaintiffs, defendants, legal staff), legal objects (such as property, rights), legal acts (such as breach of contract) and other entity types.

[0118] Secondly, the system uses relationship extraction technology to uncover legal relationships between entities. This step utilizes a neural network model with remote supervised learning and an attention mechanism to automatically learn relationship patterns between entities from a large number of case documents, accurately identifying complex legal relationships such as rights and obligations, causality, and subordination. To improve the accuracy of relationship extraction, the system also incorporates a knowledge verification mechanism with legal experts to manually review relationships with high uncertainty.

[0119] Furthermore, the system utilizes event detection technology to identify event information within legal texts. By designing a specific event framework (including elements such as time, location, subject, and behavior), combined with trigger word detection and argument recognition, the system is able to extract complete descriptions of legal events from legal texts. These technically extracted legal entities, legal relationships, and legal events are structured to form a representation of fundamental legal knowledge, providing a rich set of knowledge elements for building a comprehensive legal knowledge system.

[0120] S1.3: Based on the basic legal knowledge representation and the standardized legal data set, logical associations between categories are established through legal domain ontology construction technology to form a hierarchical legal knowledge system.

[0121] First, based on legal theory and expert knowledge, the system designs a legal domain ontology framework, including core elements such as a legal concept classification system, concept attribute definitions, and relationship types between concepts. This ontology framework encompasses the knowledge structure characteristics of different legal departments.

[0122] The system then maps the basic legal knowledge extracted in S1.2 into this ontology framework. During this mapping process, the system uses a semantic matching algorithm to determine the correspondence between knowledge elements and ontology concepts. Simultaneously, it automatically derives implicit conceptual relationships through inference rules, enriching knowledge connections. To achieve logical connections between categories, the system constructs multiple relationship types, including "is-a" relationships to establish a conceptual hierarchy, "part-of" relationships to describe the composition of concepts, and "apply-to" relationships to express legal application scenarios.

[0123] Furthermore, the system uses association rule mining to discover potential knowledge associations within standardized legal data sets and integrates these associations into an ontology structure. The resulting hierarchical legal knowledge system not only encompasses a rich set of legal concepts and their relationships, but also features a multi-dimensional classification structure and clear logical connections, providing systematic knowledge support for legal reasoning and decision-making.

[0124] S1.4: Based on the hierarchical legal knowledge system, the dynamically updated legal knowledge system is constructed by executing an incremental learning algorithm to discover new knowledge and verifying and integrating it through a knowledge consistency verification mechanism.

[0125] In its implementation, the system employs a dual-track update mechanism: a combination of active discovery and passive ingestion. During the active discovery phase, the system regularly crawls the latest legal documents from authoritative legal information sources (such as websites of the highest authorities and regulatory databases) and processes them using an incremental learning algorithm. This incremental learning algorithm, based on a variational autoencoder (VAE) and contrastive learning, is capable of identifying new knowledge points from new documents that differ from existing knowledge.

[0126] For the passive ingestion phase, the system features a knowledge submission interface, allowing legal experts and system users to submit new legal knowledge. Before incorporating newly discovered or acquired knowledge into the knowledge system, it undergoes rigorous verification through a knowledge consistency verification mechanism. This mechanism primarily encompasses three levels of verification: formal consistency verification (ensuring the correct format of knowledge representation), logical consistency verification (ensuring there are no logical contradictions with existing knowledge), and authority verification (ensuring the knowledge source is reliable).

[0127] For new knowledge that passes verification, the system seamlessly integrates it into the existing knowledge system through an ontology evolution algorithm. This involves establishing connections between new and existing knowledge, updating affected knowledge connections, and adjusting the knowledge architecture as necessary. Furthermore, the system implements a knowledge timeliness management mechanism that can mark expired legal knowledge (such as repealed regulations) to ensure that the knowledge system always reflects the latest legal status. Through this series of technical means, the system has built a truly dynamic legal knowledge system, providing continuously updated knowledge support for legal intelligent assistance.

[0128] like Figure 3 As shown, S2 constructs a case diversion agent based on the dynamically updated legal knowledge system, specifically including the following steps:

[0129] S2.1: Utilizing the dynamically updated legal knowledge system and the received case materials, a trained text classification model is constructed using multi-label text classification technology.

[0130] S2.1 is the first step in building a case triage agent, which mainly involves establishing a text classification model that can perform multi-dimensional case classification.

[0131] In the specific implementation, we first extract a hierarchical label system of case types from the dynamically updated legal knowledge system, including major case categories (such as civil and commercial, administrative), medium case categories (such as contract disputes, intellectual property rights) and minor case categories (such as sales contracts, labor contracts, copyrights, etc.).

[0132] At the same time, a large number of annotated cases were extracted from the historical case library as training data. Given the characteristics of legal texts, such as long length, numerous technical terms, and complex syntactic structures, a multi-label text classification framework based on a pre-trained language model in the legal field was adopted.

[0133] Specifically, the BERT model dedicated to the legal field is used as the encoder to extract the semantic representation of the case text, and a hierarchical multi-label classifier is constructed by combining the label attention mechanism and the label correlation matrix.

[0134] During training, a combined optimization objective using a cross-entropy loss and a label-correlation regularization term was employed. Techniques such as adversarial training and label-balanced sampling were employed to enhance the model's ability to identify small sample categories. Furthermore, to adapt to the constant emergence of new case types in the legal industry, an incremental learning module was designed to rapidly update model parameters and maintain classification performance as new cases emerge. The resulting trained text classification model is capable of multi-dimensional, high-precision case classification for input materials, providing a critical basis for subsequent case triage.

[0135] S2.2: Based on the text classification model and the semantic features of the case materials, case classification is performed through a type recognition algorithm to generate a case type label.

[0136] When receiving new case materials, the system first performs text preprocessing, including word segmentation, stop word removal, and technical terminology recognition, to improve text quality. Subsequently, it uses a pre-trained legal text vectorization model to extract deep semantic features of the case materials. These features are capable of capturing the complex concepts and implicit relationships within legal documents.

[0137] Based on feature extraction, a type recognition algorithm performs multi-dimensional case classification. This algorithm uses an ensemble learning framework that combines rule-based case feature matching with deep learning semantic understanding to achieve high-precision classification.

[0138] Specifically, the algorithm first generates candidate categories and their probability distributions using the text classification model trained in S2.1. It then uses the category constraint rules within the legal knowledge system to filter the results and eliminate logically contradictory classification results. Finally, through adaptive adjustment of category thresholds, the algorithm determines the final output set of case type labels. For complex cases, a multi-granularity classification strategy is also employed, simultaneously outputting labels for major, medium, and minor categories to facilitate subsequent refined processing. The generated case type labels contain not only the legal category to which the case belongs, but also descriptions of key attributes of the case, such as the type of dispute and applicable procedures, providing a multi-dimensional reference basis for subsequent legal application and case retrieval.

[0139] The system also performs in-depth preprocessing on received case materials, including text segmentation, standardization, and cleaning. During segmentation, the system divides the original text into semantic sections, such as "Party Information," "Basic Case Information," "Facts and Reasons," and "Evidence," based on the structural characteristics of legal documents, to facilitate subsequent targeted processing. The system also standardizes each paragraph, unifying date formats, numerical representations, and specialized terminology. Customized legal text cleaning rules are then used to remove redundant information and formatting markup.

[0140] The system then employs a multi-layered feature extraction strategy to capture the semantic characteristics of the case materials. At the basic feature layer, Chinese words are segmented using a specialized legal word segmentation system. This system, which incorporates over 200,000 legal terms and is optimized for the specifics of legal language, achieves a 97.3% word segmentation accuracy. The system also extracts statistical features, such as document length, syntactic complexity, and term density, which reflect the underlying complexity of the case.

[0141] At the semantic feature layer, the system uses the pre-trained legal field BERT model (trained on 10 million legal documents, with a vocabulary expanded to 8,000 legal professional terms) to extract deep semantic representations of the text.

[0142] Specific parameter settings include: maximum sequence length set to 512, batch size set to 16, learning rate set to 2e-5, and training rounds set to 3. The system feeds case materials into the model in segments, obtains sentence vector representations for each segment, and then generates document-level semantic vectors using an attention-weighted mechanism. The system also extracts structured case information parameters, including the amount involved, type of parties involved, and case timeline information. These parameters are extracted from the text using regular expression matching and named entity recognition techniques.

[0143] For example, in a contract dispute case, the system accurately identified the amount involved, the responsible party, and the type of request in the sentence "the plaintiff requested the defendant to pay the contract amount of RMB 1,234,567 and overdue interest." Finally, using feature fusion technology, the system integrates text semantic features and structural parameters into a unified feature vector, which serves as the input for case classification.

[0144] S2.3: Based on the case type label and the characteristic information of the case materials, a priority ranking algorithm is used to calculate and output a case handling priority score.

[0145] In actual implementation, a multi-dimensional priority assessment framework was constructed based on case type labels and characteristic information of case materials.

[0146] First, information related to the case's urgency is extracted from the case type label, such as whether it involves time-sensitive legal relationships (such as personal safety protection orders and pre-litigation property preservation). Second, natural language processing technology is used to extract importance indicators from the case materials, including the case's amount, social impact, and the identities of the parties involved. Furthermore, case complexity factors such as the degree of overlap between legal relationships and the complexity of the evidence are considered. Based on these multi-dimensional characteristics, a priority ranking algorithm is used to calculate the case handling priority score. This algorithm uses a weighted ranking model that combines expert rules and machine learning methods to dynamically adjust the weights of each dimension.

[0147] In terms of technical implementation, the prioritization model is trained using gradient boosting decision trees and learning-to-rank techniques, and weight configuration is continuously optimized through A / B testing. To enhance the model's interpretability, a priority score explanation report is generated, clarifying the contribution of each factor to the final score. The final output priority score includes both a quantitative value (0-100) and a grading system (such as urgent, high priority, routine, and deferred), providing a scientific basis for resource allocation in subsequent case processing.

[0148] S2.4: Integrate the text classification model, the type recognition algorithm, and the priority sorting algorithm into a unified processing framework to build a case triage agent that can identify case types and determine processing priorities.

[0149] In the architectural design, the case diversion agent adopts a modular design concept, which includes three core layers: data processing layer, model calculation layer and interface service layer.

[0150] The data processing layer is responsible for the preprocessing and feature extraction of case materials, and integrates functional modules such as text cleaning, feature engineering, and vectorization.

[0151] The model computing layer encapsulates the text classification model of S2.1, the type recognition algorithm of S2.2, and the priority sorting algorithm of S2.3, and realizes the data flow between modules through the message queue.

[0152] The interface service layer provides REST API and WebSocket interfaces, supporting both synchronous and asynchronous calling methods. To ensure reliability and response speed, the case diversion agent adopts a microservice architecture and collaborates with other agents through a service registration and discovery mechanism. In terms of performance optimization, model quantization and inference acceleration are achieved, GPU parallel computing is supported, and processing efficiency is greatly improved. In addition, a complete exception handling mechanism and log monitoring are designed to capture and record classification errors and model anomalies, supporting continuous optimization. Through this unified and integrated processing framework, the case diversion agent can efficiently perform a series of tasks such as case reception, type identification, and priority determination, providing basic support for the entire legal intelligent assistance.

[0153] In addition, S2 constructs the legal application agent according to the dynamically updated legal knowledge system, specifically including the following steps:

[0154] A1: Based on the case type label and the legal provisions in the dynamically updated legal knowledge system, a semantic matching model is constructed using deep learning technology.

[0155] A1 is the initial step in building a legal application agent. Deep learning technology is used to establish a semantic matching model between case materials and legal text. In actual development, the scope of legal application is first determined based on the case type label, and a collection of relevant legal texts is extracted from the dynamically updated legal knowledge system. To address the specialized nature and complexity of legal language, deep semantic matching technology is employed to build a specialized semantic matching model.

[0156] Specifically, a dual-tower deep neural network is used, with one side processing case descriptions and the other side processing legal provisions. The two sides capture fine-grained semantic connections between texts through an interactive attention mechanism. In terms of model training, a contrastive learning strategy is adopted, using a large number of annotated case-legal provision matching pairs as positive samples. Negative sampling technology is used to generate high-quality negative samples, and the cosine similarity loss function is optimized. To improve the model's domain adaptability, knowledge distillation technology is also introduced to convert legal expert knowledge into soft labels to assist training. The core innovation of the model lies in the introduction of a legal concept alignment module, which utilizes the conceptual hierarchy of the legal knowledge system to construct a mapping relationship between case facts and legal concepts in the semantic feature space, effectively resolving the problem of differences in expression between legal language and natural language. The semantic matching model constructed using this deep learning technology can accurately capture the deep semantic connection between case materials and legal provisions, providing a reliable foundation for subsequent legal provision matching.

[0157] A2: Based on the semantic analysis results of the case materials by the semantic matching model, a set of candidate legal provisions is generated through a legal provision matching algorithm.

[0158] In practice, the semantic matching model built by A1 is first used to perform semantic analysis on the case materials, extracting key facts, legal relationships, and controversial issues, thereby forming a structured semantic representation of the case. Based on this representation, a legal article matching algorithm is then used to perform multi-level matching with legal articles in the legal knowledge system.

[0159] The legal provision matching algorithm adopts a strategy that combines hierarchical filtering and precise matching: first, a preliminary screening of legal departments and chapters is performed based on case type labels and domain knowledge to narrow the search scope; then, a semantic matching model is used to calculate the similarity score between the case semantic representation and the candidate legal provisions; finally, the final set of candidate legal provisions is determined through a graph structure reasoning algorithm, combining the reference relationship and applicable conditions between legal provisions.

[0160] To improve matching accuracy, a legal provision application scenario analysis module was introduced. This module analyzes typical application scenarios of legal provisions from historical cases and then scores candidate legal provisions for contextual matching. Furthermore, factors such as the legal effect hierarchy and temporal validity are considered to ensure that recommended legal provisions adhere to fundamental legal application principles such as "new laws prevail over old ones, and higher-level laws prevail over lower-level laws." The resulting set of candidate legal provisions includes not only substantive provisions directly relevant to the case, but also relevant procedural provisions and judicial interpretations, providing a comprehensive legal basis for subsequent legal reasoning.

[0161] A3: Using the candidate legal article set and the semantic feature vectors of the case materials, a list of applicable legal articles and applicable reasons are generated and output through legal reasoning technology.

[0162] Technically, the set of candidate legal provisions generated by A2 is first subjected to a deep correlation analysis with the semantic feature vectors of the case materials. This process utilizes legal reasoning technology based on graph neural networks, constructing a heterogeneous knowledge graph of case facts, legal concepts, and legal provisions. This process then enables information fusion and reasoning between nodes through a message-passing mechanism.

[0163] Specifically, first identify the constituent facts in the case materials and map them to the constituent elements of the legal provisions; then evaluate the applicability of each legal provision through element matching; finally, perform overall optimization based on the logical relationship between legal provisions (such as general laws and special laws, principle provisions and specific provisions) to generate the final list of applicable legal provisions.

[0164] For each recommended legal provision, a detailed justification is generated, explaining how the provision matches the case facts and the rationale for its application. This justification is generated using template-enhanced natural language generation technology, combining case characteristics, legal content, and reasoning to produce a professional, accurate, and easy-to-understand explanation.

[0165] To improve the reliability of reasoning results, an uncertainty quantification mechanism has been implemented, assigning a confidence score to each recommended legal provision and marking areas requiring manual review if confidence is insufficient. This legal reasoning technology can generate a list of applicable legal provisions and their rationale, both grounded in legal theory and specific to the case, providing powerful decision-making support for legal professionals.

[0166] A4: Encapsulate the semantic matching model, the legal provision matching algorithm, and the legal reasoning technology into a unified functional module to build a legal application agent that can accurately match legal provisions and legal interpretations.

[0167] In terms of architecture, the legal application agent adopts a layered design, including the semantic understanding layer, the knowledge reasoning layer and the result generation layer.

[0168] The semantic understanding layer encapsulates A1's semantic matching model and is responsible for deep semantic analysis of case materials.

[0169] The knowledge reasoning layer integrates A2's legal article matching algorithm and legal knowledge system to realize legal article retrieval and screening.

[0170] The result generation layer encapsulates A3's legal reasoning technology and is responsible for generating the final list of applicable laws and the reasons for their application.

[0171] Each layer communicates via standardized data interfaces, ensuring lossless information transfer. Technically, a service-oriented architecture is employed, deploying each functional module as an independent microservice and centrally managing service calls through an API gateway. To enhance scalability, the Legal Application Agent incorporates a plug-in framework that supports the flexible integration of specialized modules for different legal departments, such as a specific reasoning module for a particular code. Furthermore, a close collaboration mechanism with the Case Triage Agent is implemented, enabling it to receive case type tags and priority information and activate specialized processing flows based on the specific case type. Through this unified functional module encapsulation, the Legal Application Agent accurately matches legal provisions with legal interpretations, providing legal professionals with professional and reliable legal application advice and significantly improving the efficiency and accuracy of legal work.

[0172] At the same time, S2 constructs the similar case search agent based on the dynamically updated legal knowledge system, specifically including the following steps:

[0173] B1: Utilizing the case type labels, the applicable legal provisions list and the pre-built case knowledge base, a case similarity calculation model is constructed through deep semantic matching technology.

[0174] The system extracts a large number of historical cases from the case knowledge base, including key information such as the cause of the case, case summary, applicable laws, and key points of the judgment, and converts them into structured data through text preprocessing technology.

[0175] Then, the system designed a deep semantic matching model with multimodal fusion, which contains three key encoding modules: the case type encoder converts the case type label into a dense vector representation; the law encoder encodes the list of applicable laws into a legal basis vector; and the case encoder uses the Transformer model pre-trained in the legal field to extract the semantic features of the case facts.

[0176] These three features are adaptively integrated through an attention mechanism to form a comprehensive semantic representation of the case. At the similarity calculation level, the system has designed a multi-granularity similarity calculation framework, calculating the similarity between cases based on legal facts, dispute points, and legal basis, and automatically adjusting the weights of each dimension through meta-learning. To enhance the legal expertise of the model, the system introduces legal concept alignment technology. By mapping concepts within the legal knowledge system, the system establishes a precise correspondence between legal elements in the semantic space between cases.

[0177] The model training utilizes a combination of contrastive learning and learning-to-rank. It utilizes a case similarity dataset annotated by professional legal professionals as a supervisory signal and optimizes similarity calculation accuracy through triplet loss. This case similarity calculation model, constructed using this deep semantic matching technology, comprehensively and accurately assesses the degree of similarity between cases, providing key technical support for subsequent similar case retrieval.

[0178] B2: Based on the case similarity calculation model and the case features of the case knowledge base, a retrieval algorithm is used to screen and generate a candidate case set.

[0179] In terms of technical implementation, the system first converts the current case into a multi-dimensional semantic vector representation based on the case similarity calculation model constructed by B1.

[0180] To efficiently search through its massive case database, the system employs a hierarchical retrieval strategy: In the first phase, coarse-grained filtering based on case type labels and applicable laws is performed to quickly narrow the search scope; in the second phase, approximate nearest neighbor search technology is used for precise matching. Specifically, the system pre-encodes all cases in the case knowledge base into semantic vectors and constructs a high-dimensional index structure using techniques such as hash-sensitive indexing (LSH) and vector quantization (PQ), enabling millisecond-level retrieval of hundreds of millions of cases.

[0181] During the retrieval process, the system also takes into account factors such as the timeliness and authority of the case, and gives priority to recommending the latest cases heard by senior relevant departments. In addition, the system introduces a diversity guarantee mechanism. Through the maximum marginal relevance (MMR) algorithm, it increases the diversity of retrieval results while ensuring similarity, ensuring that candidate cases can cover different legal viewpoints and judicial thinking. To further improve the retrieval quality, the system has implemented a query expansion module to automatically expand the retrieval conditions based on the key elements of the case, and solve the retrieval loophole problem caused by differences in the expression of legal documents. The final set of candidate cases contains historical cases with a high degree of similarity to the current case. These cases are not only similar in the application of law, but also have a high reference value in terms of case facts and controversial issues, providing a high-quality candidate set for subsequent fine sorting and analysis.

[0182] B3: Based on the similarity scores of the candidate case set and the case similarity calculation model, a similar case set and similarity analysis results are screened and outputted through sorting optimization technology.

[0183] In the specific implementation, the system first comprehensively scores each candidate case based on the set of candidate cases generated by B2 through the case similarity calculation model of B1. Unlike the preliminary search, the similarity calculation at this stage is more refined, and it will deeply analyze the similarity of the cases in multiple dimensions such as factual composition, legal application, and judgment results. Subsequently, the system accurately ranks the candidate cases through sorting optimization technology. This technology adopts the Learning to Rank framework and combines a variety of sorting features for model training, including similarity scores, case authority, timeliness, citation frequency, etc. In order to adapt to the special needs of legal scenarios, the system also introduces a scenario-adaptive sorting mechanism, which can dynamically adjust the sorting strategy according to the user's case characteristics and query intent.

[0184] For example, for difficult cases where the application of the law is unclear, the system will give priority to recommending guiding cases with typical exemplary significance; and for cases with complex fact determination, it will give priority to recommending reference cases with similar fact patterns.

[0185] In the output phase, the system not only provides a collection of similar cases but also generates in-depth similarity analysis results, including summaries of similarities, comparisons of differences, and legal application recommendations. These analysis results are presented using visualization and natural language generation technology, enabling legal professionals to quickly grasp the key points and reference value of similar cases. This ranking optimization technology enables the system to accurately select and output the most valuable collection of similar cases, providing strong support for legal decision-making.

[0186] B4: Integrate the case similarity calculation model, the retrieval algorithm, and the ranking optimization technology into an integrated functional unit to construct a similar case retrieval agent that can achieve accurate case push.

[0187] In terms of architectural design, the similar case retrieval agent adopts a microservice architecture, which includes four core service modules: the vectorization service encapsulates B1's case similarity calculation model and is responsible for the semantic representation conversion of cases; the retrieval service integrates B2's retrieval algorithm to achieve efficient case retrieval; the sorting service encapsulates B3's sorting optimization technology and is responsible for the accurate sorting and analysis of cases; the knowledge management service is responsible for updating and maintaining the case knowledge base.

[0188] Each service module communicates through message queues and RESTful APIs, supporting high-concurrency access and flexible expansion.

[0189] At the system implementation level, the similar case retrieval agent adopts a hybrid storage architecture, combining the advantages of relational databases and vector databases to achieve efficient storage and retrieval of structured information and semantic vectors.

[0190] To ensure system performance, the search engine utilizes distributed indexing and cache acceleration technology, capable of processing case libraries exceeding 100 million cases while maintaining millisecond response times. Furthermore, the system implements a deep collaboration mechanism with the Legal Application Agent, automatically adjusting search strategies based on the legal provisions recommended by the Legal Application Agent to improve the accuracy of similar case recommendations. At the user interaction level, the Similar Case Search Agent provides a flexible search interface, supporting both structured and natural language query modes, and continuously optimizing search results based on user feedback. Through the integration of this integrated functional unit, the Similar Case Search Agent is able to accurately push cases, provide legal personnel with high-quality similar case references, and effectively improve case handling efficiency and quality.

[0191] In addition, S2 specifically includes the step of constructing the risk warning agent based on the dynamically updated legal knowledge system.

[0192] C1: Based on the case type label, the list of applicable laws and the case features in the set of similar cases, a risk pattern recognition model is constructed using machine learning technology.

[0193] In technical implementation, the system comprehensively utilizes case type labels, lists of applicable laws and case features in similar case collections to build a risk analysis framework that integrates multi-source information.

[0194] First, the system selects a large number of representative cases from the historical case library, including both normal cases and typical cases with various risks, as the basic data set for model training. For these cases, the system extracts multi-dimensional features, including case type characteristics, applicable legal provisions, judgment results characteristics, and case anomaly markers.

[0195] In terms of model design, the system adopts a hierarchical risk identification architecture: the first layer is a risk type identification model, which uses multi-label classification technology to identify potential risk types in a case, such as evidence risk, procedural risk, and legal application risk. The second layer is a risk severity assessment model, which uses a regression model to predict the severity of each risk type. The model training uses an ensemble learning approach, combining the strengths of multiple algorithms such as decision trees, neural networks, and support vector machines to improve the model's generalization and robustness. To address the imbalance in legal risk data, the system incorporates cost-sensitive learning and sample resampling techniques to enhance the identification of rare risk types. Furthermore, the system features a risk knowledge infusion module, which transforms risk pattern rules summarized by legal experts into feature engineering and model constraints, enhancing the model's professionalism. This risk pattern recognition model, constructed using this machine learning technology, can assess the potential risks of a case from multiple perspectives, providing a theoretical foundation for subsequent risk point identification.

[0196] C2: Based on the analysis results of the case materials by the risk pattern recognition model, risk points are identified through feature extraction and pattern matching technology to generate a risk feature set.

[0197] In practice, the system first uses the risk pattern recognition model built by C1 to conduct a comprehensive analysis of the current case materials and output a preliminary risk assessment result. Based on this result, the system further explores the risk points in the case.

[0198] Technically, the system employs a multi-layered approach to extracting risk features. At the text level, named entity recognition and relationship extraction techniques are used to identify key factual elements in case materials and analyze them against legal requirements to identify weaknesses in fact determination. At the structural level, case element integrity checks are performed to identify missing links in the chain of evidence and legal reasoning. At the logical level, consistency analysis and contradiction detection are used to identify internal logical conflicts within the case materials. These analyses are based on a technical approach that combines deep learning and rule-based reasoning, leveraging the semantic understanding capabilities of deep models with the expertise of legal experts. In the risk pattern matching phase, the system utilizes a predefined risk pattern library and a graph matching algorithm to identify parts of the case that meet typical risk patterns. For example, for evidentiary risk, the system checks whether key facts lack direct evidence support. For procedural risk, it examines compliance with procedural elements such as the statute of limitations and jurisdiction. The resulting risk feature set includes multi-dimensional information such as risk type, risk location, risk description, and risk basis, providing a comprehensive and accurate risk profile for subsequent risk assessment.

[0199] C3: Utilize the risk feature set and the preset risk assessment rule base to generate and output a risk assessment report and treatment suggestions through risk quantification assessment and anomaly detection technology.

[0200] The system first conducts an in-depth analysis based on the risk feature set generated by C2, combined with a preset risk assessment rule base. The risk assessment rule base is one of the system's core knowledge bases, containing assessment criteria, influencing factors, and handling strategies for various types of legal risks. It is constructed by a team of legal experts based on a large number of case studies and legal practice experience. The system assigns a risk value to each identified risk point through risk quantification assessment technology. The assessment adopts a multi-factor weighted model, considering factors such as the severity of the risk type, the probability of occurrence, and the possible scope of impact. At the same time, the system also implements a case anomaly detection function. Through a combination of statistical analysis and deep learning, it identifies abnormal patterns in the case handling process, such as significant deviations from the judgment results of similar cases and obvious disputes in the application of the law.

[0201] When generating assessment reports, the system uses template-enhanced natural language generation technology to automatically generate professional, detailed risk descriptions and analyses based on different risk types and levels. Furthermore, based on the experience of similar risk management in the case knowledge base and taking into account the specific characteristics of the case, the system generates targeted handling recommendations, including risk avoidance strategies, suggestions for supplementary evidence, and directions for strengthening legal argumentation. To enhance the practicality of the report, the system also generates a risk handling priority ranking to help legal personnel rationally allocate resources and prioritize key risks. Through this risk quantification and anomaly detection technology, the system is able to generate professional, comprehensive risk assessment reports and practical handling recommendations, providing strong risk management support for legal decision-making.

[0202] C4: Combine the risk pattern recognition model, the feature extraction and pattern matching technology, and the risk quantification assessment and anomaly detection technology into a comprehensive processing system to build a risk warning agent that can provide prompts for major and difficult cases.

[0203] In terms of system architecture, the risk warning agent adopts a three-layer structure design: the data layer is responsible for integrating input information from other agents, such as case type labels, lists of applicable laws, and collections of similar cases, and performing preprocessing and standardization; the computing layer encapsulates C1's risk pattern recognition model, C2's feature extraction and pattern matching technology, and C3's risk quantification assessment and anomaly detection technology, and is responsible for core risk analysis and processing; the application layer provides risk warning service interfaces and visualization display functions, supporting interaction with other agents and direct interaction with users.

[0204] Technically, the Risk Warning Agent utilizes an event-driven architecture, enabling real-time responses to changes in case status and the addition of new evidence, dynamically updating risk assessment results. To enhance system intelligence, the Risk Warning Agent implements a continuous learning mechanism, learning from user feedback and case handling outcomes to optimize risk models. Furthermore, to address the unique needs of major and difficult cases, the system has designed a tiered warning mechanism, automatically triggering different levels of warning processes based on risk severity and initiating expert review and team consultation for high-risk cases.

[0205] In terms of knowledge updating, the Risk Warning Agent maintains close integration with the dynamically updated legal knowledge system, enabling timely access to new legal changes and the latest judicial interpretations, ensuring risk assessments are always based on the latest legal environment. Through this integrated processing system, the Risk Warning Agent can provide accurate early warnings for major and difficult cases, helping legal personnel promptly identify and address potential risks, effectively improving the safety and success rate of case handling.

[0206] like Figure 4 As shown, S3 builds a preference mapping relationship model based on the multi-agent collaboration mechanism through case complexity assessment and quality assessment. The steps of realizing multi-case relationship perception preference mapping specifically include:

[0207] S3.1: Utilize the case type labels, the list of applicable laws, the collection of similar cases, and the feature data in the risk assessment report to build a case assessment model through deep learning and feature engineering technology to generate a case complexity score and quality score.

[0208] The system first integrates the rich feature data output by the multi-agent system: it obtains case type labels from the case triage agent, including classification information such as case field and dispute type; obtains a list of applicable laws from the legal application agent, reflecting the complexity of the legal application of the case; obtains a collection of similar cases from the similar case retrieval agent, providing a reference basis for case handling; and obtains a risk assessment report from the risk warning agent, indicating the potential risk points of the case.

[0209] Based on these multi-source features, the system uses feature engineering technology to construct a multi-dimensional feature space.

[0210] Specifically, the system is designed with four core features: content complexity, including the degree of intersection of legal relationships, the completeness of the chain of evidence, and the number of legal disputes; processing difficulty, including the ambiguity of legal interpretation, the degree of consistency in similar cases, and the requirements for professional knowledge; risk level, including the number of risk points, the severity of the risk, and the level of uncertainty; and quality assessment, including the rigor of legal reasoning, the rationality of evidence acceptance, and the predictability of judgment results. In terms of model construction, the system adopts a hybrid model architecture that combines deep learning and expert rules. Deep neural networks are responsible for automatically learning implicit features and complex patterns from massive case data, while the expert rule system incorporates legal expertise to ensure that the assessment results are consistent with legal practice experience.

[0211] Through model integration and parameter optimization, the system ultimately outputs a case complexity score (0-100 points) and a quality score (0-100 points). These two scores reflect the difficulty level of case handling and the degree of standardization of case handling results, respectively, providing a quantitative basis for subsequent case grouping and preference mapping.

[0212] S3.2: Based on the scoring data output by the case evaluation model, similarity analysis is performed on the cases through multi-dimensional similarity calculation and hierarchical clustering technology to generate case grouping results and inter-group relationship characteristics.

[0213] In specific implementation, the system constructs a two-dimensional scoring space as the initial clustering basis based on the case complexity score and quality score generated by S3.1. However, it is difficult to fully reflect the similarity of cases by relying solely on the scores of two dimensions, so the system further introduces multi-dimensional similarity calculation technology. This technology comprehensively considers the similarities of cases in multiple dimensions such as legal field, focus of dispute, application of law, fact pattern, etc., and generates a comprehensive similarity matrix between cases through weighted fusion. In order to adapt to the special needs of the legal field, the system adopts a domain-adaptive similarity calculation method, which can dynamically adjust the weights of each dimension according to the characteristics of different legal fields. For example, in intellectual property cases, the similarity of technical features has a higher weight; while in contract dispute cases, the similarity of contract terms is more important. Based on the comprehensive similarity matrix, the system uses hierarchical clustering technology to group cases.

[0214] Specifically, the system uses an agglomerative hierarchical clustering algorithm, starting with a single case and gradually merging similar cases to form a hierarchical case cluster structure. Through dynamic threshold pruning technology, the system can automatically determine the optimal number of clusters to avoid over-aggregation or over-dispersion. For each generated case grouping, the system extracts common features of the cases within the group to form a grouping feature description; simultaneously, it calculates the similarity relationships and structural features between the groups to construct an inter-group relationship network. The final output case grouping results not only contain case classification information, but also rich intra-group features and inter-group relationship features, providing a structured case relationship representation for the next step of preference mapping.

[0215] S3.3: Based on the case grouping results and the case scoring characteristics of the evaluation model, a preference mapping relationship model is constructed and output through preference mining and mapping learning technology to achieve the multi-case relationship perception preference mapping.

[0216] Technically, the system first conducts preference mining within groups of cases of similar complexity and quality, based on the case grouping results generated by S3.2. This preference mining employs a variety of techniques: First, by analyzing the revisions of lower-level decisions by higher-level authorities, the implicit preferences of professional legal personnel are extracted; second, by comparing the disposition outcomes of similar cases, patterns of disposition preferences are identified.

[0217] The system also directly learns explicit preference expressions using case evaluation data annotated by legal experts. At the preference representation level, the system employs a multi-layered preference structure: a foundational layer describes preferences for individual elements, such as the tendency to accept a specific type of evidence; a composite layer describes preference patterns for multiple elements, such as the tendency to choose applicable legal provisions in specific situations; and a holistic layer describes strategic preferences for overall case handling, such as the balance between procedural handling and substantive judgments.

[0218] Based on these preference representations, the system constructs a preference mapping relationship model using mapping learning technology. This model employs a neural network structure to map the case feature space to the preference space, achieving a precise mapping from case features to processing preferences. To enhance the model's expressiveness and generalization performance, the system introduces contrastive learning technology to construct preference comparison samples to learn finer preference distinction boundaries. The resulting preference mapping relationship model is able to predict appropriate processing preferences based on case characteristics and ensure preference consistency within groups of cases of similar complexity and quality. Through this multi-case relationship-aware preference mapping framework, the system can enhance the informativeness of preference data and improve the granularity of alignment signals, providing strong preference knowledge support for the subsequent construction of the PLANTOR framework.

[0219] like Figure 5 As shown, S4 constructs a planning tree PLANTOR framework based on the multi-case relationship perception preference mapping, combining a large language model with Prolog-based knowledge management technology, including the following steps:

[0220] S4.1: Based on the feature data of the multi-case relationship perception preference mapping, a two-stage knowledge generation method is designed and implemented through a large language model and Prolog rule reasoning technology to generate a robot-oriented knowledge base.

[0221] In its technical implementation, the system first analyzes the multi-case relationship perception preference mapping feature data output by S3.3 to extract key preference patterns and legal knowledge elements. Based on this data, the system designs a two-stage knowledge generation method.

[0222] The first stage is the knowledge extraction and conversion stage, in which the system uses large language models (such as the GPT series or pre-trained models dedicated to the legal field) to deeply understand legal texts and case data.

[0223] Specifically, the system uses the semantic parsing capabilities of large language models to extract structured knowledge elements from unstructured legal texts, including legal concepts, legal rules, legal facts, and reasoning logic.

[0224] The system then uses a specially designed knowledge converter to convert these extracted knowledge elements into logical expressions understandable by Prolog. For example, it converts the legal provision "Article 1165 of a certain code provides that a person who, due to fault, infringes upon the civil rights and interests of another and causes damage shall bear liability" into the Prolog rule "Liability(actor, victim): - act(actor, act), fault(actor, act), infringement(act, rights), civil rights(victim, rights), damages caused(act, damages)."

[0225] The second stage is knowledge organization and reasoning optimization. Based on Prolog's knowledge representation and reasoning mechanisms, the system organizes the converted knowledge into a structured knowledge base. During this stage, the system implements knowledge conflict detection and automatic resolution mechanisms to ensure the consistency of the knowledge base. It also introduces a meta-rule system to improve the reasoning efficiency and expressiveness of the knowledge base. Furthermore, the system incorporates an interface mechanism with the preference mapping model, enabling the knowledge base to flexibly adjust its reasoning strategies based on different case types and processing preferences. The resulting robot-oriented knowledge base not only contains a wealth of legal knowledge but also incorporates the intelligent features of preference mapping, providing powerful knowledge support for subsequent task planning.

[0226] S4.2: Based on the two-stage knowledge generation method and the mapping rules of the preference mapping relationship model, a knowledge base component with reusability and combinatorial reasoning capabilities is constructed through modular design and rule formalization technology;

[0227] In actual implementation, the system developed a modular knowledge base architecture based on the two-stage knowledge generation method designed in S4.1 and the preference mapping relationship model constructed in S3.3. This architecture adheres to the "core-extension" design concept and consists of three layers: the bottom layer is the core knowledge layer, which stores basic legal concepts, universal legal rules, and reasoning frameworks; the middle layer is the domain knowledge layer, which organizes specialized legal knowledge by legal department and case type; and the top layer is the application knowledge layer, which contains task knowledge and processing strategies for specific application scenarios.

[0228] Each layer of knowledge components utilizes a unified interface specification, enabling flexible combination and plug-and-play integration. Regarding rule formalization, the system employs a multi-level rule representation system: factual rules describe basic legal facts and legal relationships; inference rules define the logical flow of legal reasoning; and meta-rules control the applicable conditions and priority of rules. To enhance the expressiveness of rules, the system also incorporates extensions of temporal logic and modal logic, enabling the processing of temporal elements and modal concepts such as necessity / possibility within legal rules.

[0229] At the component implementation level, each knowledge component consists of three parts: self-describing metadata, functional interface definition, and internal implementation. The metadata describes the component's function, scope of application, and dependencies, facilitating the system's dynamic selection and combination of components. To achieve combinatorial reasoning capabilities, the system has designed a reasoning and combination mechanism based on a graphical model, which can automatically construct reasoning chains based on task requirements, enabling the decomposition and resolution of complex legal issues. In addition, the system also implements knowledge component version management and an automated testing framework to ensure component quality and system stability. Through this modular design and rule formalization technology, the system has successfully constructed a knowledge base component set with high reusability and powerful combinatorial reasoning capabilities, providing a solid knowledge foundation for the PLANTOR framework.

[0230] S4.3: Based on the knowledge base components and the preset task scheduling constraints, a three-step planning procedure that considers time dependency, resource constraints, and parallel task execution is designed and implemented through mixed integer linear programming technology to generate a task planning solution.

[0231] In its technical implementation, the system first established a complete planning problem model based on the knowledge base component built in S4.2 and combined it with pre-set task scheduling constraints. This model takes into account the various complex constraints in legal processing: time dependency constraints, which describe the order of tasks; resource constraints, including limitations on human resources, time resources, and expertise resources; and parallel execution constraints, which define which tasks can be processed in parallel and the degree of parallelism.

[0232] Based on these constraints, a three-step planning procedure was designed for the system.

[0233] The first step is task decomposition and dependency analysis. The system decomposes complex legal tasks into basic operation units through target task decomposition technology, and establishes a task dependency graph through dependency analysis to clarify the prerequisite relationship and dependency degree between each subtask.

[0234] The second step is resource allocation and scheduling optimization. The system transforms the task dependency graph and resource constraints into a mixed integer linear programming (MILP) problem, and uses a solver to calculate the optimal resource allocation plan and task execution schedule. To improve planning efficiency, the system employs heuristic preprocessing and a hierarchical solution strategy, enabling it to handle large-scale task planning problems.

[0235] The third step is execution monitoring and dynamic adjustment. The system incorporates an event-driven execution monitoring mechanism that tracks task execution status in real time and dynamically adjusts plans when deviations or new circumstances arise. Planning results are presented in a variety of formats, including Gantt charts representing timelines, network diagrams representing task dependencies, and resource allocation tables, facilitating understanding and evaluation of planning solutions from various perspectives. This three-step planning process enables the system to generate task plans that satisfy various constraints while ensuring efficient execution, providing a scientific execution blueprint for subsequent behavior tree conversion.

[0236] S4.4: Based on the execution process and resource allocation strategy of the mission planning scheme, the planning scheme is converted into an executable behavior tree structure through behavior tree mapping and path optimization technology, completing the construction of the PLANTOR framework.

[0237] In actual implementation, the system first analyzes the task plan generated by S4.3, including the task execution sequence, resource allocation strategy, and parallel execution information. Based on this planning information, the system uses behavior tree mapping technology to convert the plan into a structured behavior tree representation. Behavior trees are a decision-making model widely used in artificial intelligence and robotics. They organize behavior nodes in a tree-like structure, supporting modular representation and flexible execution of complex tasks.

[0238] During the mapping process, the system first establishes a correspondence between task nodes and behavior nodes: atomic tasks are mapped to action nodes in the behavior tree; composite tasks are mapped to sequence nodes, selection nodes, or parallel nodes; and conditional judgments are mapped to condition nodes and decorator nodes. Then, based on the dependencies between tasks and the execution strategy, the system constructs a hierarchical structure of these nodes to form the initial behavior tree. To improve the execution efficiency of the behavior tree, the system uses path optimization technology to optimize the initial behavior tree.

[0239] Specifically, the system uses path analysis to identify redundant paths and execution bottlenecks in behavior trees, and optimizes the tree structure through techniques such as node merging, branch rearrangement, and conditional simplification. It also introduces a dynamic parameter mechanism that allows behavior nodes to dynamically adjust parameters based on the execution context, improving the adaptability and robustness of the behavior tree. Furthermore, the system implements visual editing and debugging tools for behavior trees, supporting manual review and fine-tuning of generated behavior trees. The resulting behavior tree structure retains the execution logic and optimization characteristics of the original planning scheme while possessing the modularity, readability, and execution efficiency of the behavior tree itself, marking the completion of the PLANTOR framework. This framework successfully combines the knowledge extraction capabilities of large language models, the logical reasoning capabilities of Prolog, and the execution control capabilities of behavior trees, providing powerful planning and execution support for legal intelligent assistance systems.

[0240] like Figure 6 As shown, S5, based on the PLANTOR framework, achieves multi-agent reasoning chain alignment through joint optimization of transmission optimization and embedding optimization. The steps to complete legal decision support include:

[0241] S5.1: Using the knowledge base components and behavior tree structure in the PLANTOR framework, the reasoning chain features of each agent are extracted through deep reasoning path analysis technology to generate a standardized reasoning chain representation.

[0242] In its implementation, the system first leverages the knowledge base components and behavior tree structure within the PLANTOR framework to establish a complete reasoning tracking mechanism. This mechanism records in real time the reasoning steps, intermediate results, and decision-making basis of the case triage agent, legal application agent, similar case search agent, and risk warning agent as they process cases.

[0243] For each agent, the system extracts reasoning chain features from three dimensions: the reasoning content dimension, which includes the input information used in each reasoning step, the applied rule knowledge, and the generated intermediate results; the reasoning structure dimension, which describes the logical relationships and dependencies between reasoning steps, including serial relationships, parallel relationships, and conditional branching relationships; and the reasoning semantics dimension, which captures the core legal concepts, key factual judgments, and value trade-off information in the reasoning process.

[0244] To address the heterogeneity of reasoning expressions across different agents, the system designed a unified reasoning step representation model, abstracting various reasoning operations into a standardized form consisting of "premise-reasoning rule-conclusion" triples. The system then processes the original reasoning chain using deep reasoning path analysis technology, standardizing the granularity of reasoning steps, making implicit reasoning steps explicit, and streamlining redundant reasoning steps. This technology, using a graph neural network-based reasoning path analysis model, identifies key nodes and paths in the reasoning chain and automatically repairs breakpoints and redundant links. The resulting standardized reasoning chain representation is presented as a directed acyclic graph (DAG), with nodes representing reasoning steps and edges representing reasoning dependencies. Each node and edge is accompanied by rich semantic annotations, providing a standardized foundation for subsequent reasoning chain alignment.

[0245] S5.2: Based on the normalized reasoning chain representation and the preset alignment optimization goal, a transfer optimization model is constructed through transfer learning and transfer optimization technology.

[0246] First, based on the standardized reasoning chain representation generated by S5.1 and combined with pre-defined alignment optimization goals, a transfer optimization framework for reasoning process migration was designed. These alignment optimization goals cover several aspects: consistency in reasoning structure, ensuring that different agents adopt similar reasoning paths for similar cases; balance in reasoning depth, balancing the depth and level of detail across agents; and optimization of reasoning efficiency, reducing redundant reasoning steps and improving reasoning efficiency.

[0247] Based on these goals, the system uses transfer learning technology to build a transmission optimization model. The core of this model is a domain-adaptive network based on a graph structure, which can achieve cross-agent migration of reasoning structures while maintaining reasoning semantics.

[0248] Specifically, the system treats each agent's reasoning chain as a source or target domain. Through domain-invariant feature extraction and a domain adaptation layer, it learns the mapping between different agents' reasoning patterns. To enhance the model's transferability, the system employs an adversarial training strategy and introduces a reasoning domain discriminator, encouraging the model to learn universal reasoning patterns that are independent of specific agents. At the transfer optimization level, the system employs a multi-level optimization strategy: at the micro level, it optimizes the expression and execution efficiency of individual reasoning steps; at the meso level, it optimizes the structure and sequence of reasoning subpaths; and at the macro level, it optimizes the overall organization and critical paths of the reasoning chain. These optimizations, based on cross-agent knowledge gained through transfer learning, effectively transfer the reasoning patterns of excellent agents to other agents. The resulting transfer optimization model achieves efficient transfer of reasoning processes, aligning and optimizing the reasoning structures of different agents, and laying a solid foundation for the alignment of multi-agent reasoning chains.

[0249] S5.3: Utilizing the normalized inference chain representation and the feature space of the transmission optimization model, an embedding optimization model is constructed through semantic representation learning and dimensionality reduction optimization techniques.

[0250] In practical implementation, the system designed an embedding optimization framework for semantically aligning reasoning content based on the standardized reasoning chain representation generated by S5.1 and the feature space of the transfer optimization model constructed by S5.2. The core of this framework is to map the legal concepts, factual judgments, and reasoning rules used by different agents into a unified semantic space, ensuring consistency and comparability of semantic representations.

[0251] In terms of technical implementation, the system first constructs a basic semantic space for the legal field based on the legal knowledge system, including a legal concept system, a legal relationship network, and a reasoning pattern library. Then, using semantic representation learning technology, the elements in each agent's reasoning chain are mapped to this semantic space.

[0252] Specifically, the system uses a Transformer-based encoder model, combined with a knowledge-enhanced attention mechanism, to learn context-sensitive representations of inference elements. It also introduces a contrastive learning strategy, which encourages semantically similar inference elements to be closer in the representation space, while keeping semantically different elements apart. To improve the efficiency and interpretability of semantic representation, the system processes high-dimensional semantic features through dimensionality reduction optimization techniques.

[0253] This technology combines nonlinear dimensionality reduction methods (such as t-SNE) with interpretability-preserving strategies to reduce dimensionality while preserving semantic structure and interpretability. Furthermore, the system incorporates a semantic consistency verification mechanism. Through automatically generated semantic test cases, it assesses the consistency of different agents' understanding of key legal concepts and adjusts semantic mapping parameters accordingly. The resulting embedding optimization model maps the reasoning content of each agent into a unified, efficient, and interpretable semantic space, achieving a semantically consistent representation of the reasoning content and providing semantic support for the final alignment of multi-agent reasoning chains.

[0254] S5.4: Based on the optimization parameter space of the transmission optimization model and the embedding optimization model, alignment optimization of the reasoning chain is achieved through a multi-objective joint optimization algorithm, and an aligned multi-agent reasoning chain set is output.

[0255] During technical implementation, the system first identified multiple optimization objectives for reasoning chain alignment: structural alignment, which seeks similarity and optimization of the reasoning chain structure; semantic alignment, which strives for semantic consistency of the reasoning content; efficiency alignment, which strives for efficient and concise reasoning; and accuracy, which aims to maintain or improve the accuracy of the reasoning results. These objectives potentially conflict and require a trade-off between them, requiring joint optimization techniques to find the optimal balance.

[0256] Based on the transmission optimization model of S5.2 and the embedded optimization model of S5.3, the system constructed a unified optimization parameter space, encompassing multiple parameter sets, including structural transformation parameters, semantic mapping parameters, and efficiency control parameters. Based on this, the system designed a multi-objective joint optimization algorithm, employing a Pareto optimization framework to address multi-objective optimization problems. It then used an evolutionary algorithm to search for non-dominated solution sets and combined expert preferences to select the final solution.

[0257] To improve optimization efficiency, the system introduces an adaptive sampling strategy and a hierarchical optimization method, which can obtain a near-optimal solution with limited computing resources. At the alignment implementation level, the system adopts an incremental alignment strategy, first accurately aligning key reasoning nodes and core legal concepts, and then gradually expanding to the complete reasoning chain to ensure the controllability and effectiveness of the alignment process. The final generated alignment results are presented in various forms: a graphical representation of the aligned reasoning chain, which intuitively displays the correspondence between the reasoning paths of each agent; an alignment quality assessment report, which quantifies the alignment effect of each dimension; and an alignment explanation document, which details the processing logic of key alignment points. Through this multi-objective joint optimization algorithm, the system successfully achieves comprehensive alignment of multi-agent reasoning chains, enabling each agent to maintain a high degree of consistency in structure and semantics, significantly improving the reasoning consistency and legal decision-making support capabilities of the overall system.

[0258] An embodiment of the present application also provides a multi-agent system for intelligently assisted legal processing, comprising: a processor; and a memory on which a computer program is stored, wherein the processor implements the steps of the above method when executing the computer program.

[0259] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the method for intelligent legal assistance and the steps of the multi-agent system described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0260] In addition, an embodiment of the present disclosure also provides a computer program product, which stores a computer program. When the computer program is run by a processor, it executes the method of legal intelligent assisted processing and the steps of the multi-agent system provided in any of the above embodiments of the present disclosure. For details, please refer to the above method embodiments and will not be repeated here.

[0261] The computer program product may be implemented in hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is embodied as a computer storage medium, which may be a volatile or non-volatile computer-readable storage medium. In another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK).

[0262] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment and devices can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0263] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0264] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0265] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0266] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A method for intelligent legal assistance processing, characterized in that: include: Leveraging legal data including legal texts, legal interpretations, case law from relevant departments, and legal research results, through named entity recognition, relationship extraction, and event detection technologies, a dynamically updated legal knowledge system is constructed. The dynamically updated legal knowledge system includes legal entities, legal relationships, and legal events. Based on the dynamically updated legal knowledge system, a case diversion agent, a law application agent, a similar case retrieval agent, and a risk warning agent are constructed, and a multi-agent collaboration mechanism is implemented through a collaborative structure based on message transmission and state sharing. The case diversion agent is used to identify case types and determine processing priorities, the law application agent is used to match legal provisions and legal interpretations, the similar case retrieval agent is used to achieve accurate case push, and the risk warning agent is used to generate risk assessment reports. Based on the multi-agent collaborative mechanism, a preference mapping relationship model is constructed through case complexity assessment and quality assessment to achieve multi-case relationship perception preference mapping; Based on the multi-case relationship perception preference mapping, a planning tree PLANTOR framework is constructed by combining a large language model with Prolog-based knowledge management technology to generate a robot-oriented knowledge base and planning program, and convert them into a behavior tree; Based on the PLANTOR framework, the multi-agent reasoning chain is aligned through the joint optimization of transmission optimization and embedding optimization to complete legal decision-making assistance; The steps of constructing a preference mapping relationship model based on the multi-agent collaborative mechanism and implementing multi-case relationship perception preference mapping through case complexity assessment and quality assessment include: Using case type labels, a list of applicable laws and regulations, a collection of similar cases, and feature data from the risk assessment report, a case assessment model is constructed through deep learning and feature engineering techniques to generate case complexity and quality scores. Based on the scoring data output by the case evaluation model, similarity analysis is performed on the cases through multi-dimensional similarity calculation and hierarchical clustering technology to generate case grouping results and inter-group relationship characteristics; Based on the case grouping results and the case scoring characteristics of the evaluation model, a preference mapping relationship model is constructed and output through preference mining and mapping learning technology to achieve the multi-case relationship perception preference mapping.

2. The method according to claim 1, characterized in that The steps of constructing a dynamically updated legal knowledge system include: Through data cleaning, format unification and deduplication, a standardized legal data set is formed; Based on the standardized legal data set, legal entities, legal relationships, and legal events are extracted through named entity recognition, relationship extraction, and event detection to form a basic legal knowledge representation; Based on the basic legal knowledge representation and the standardized legal data set, logical associations between categories are established through legal domain ontology construction technology to form a hierarchical legal knowledge system; Based on the hierarchical legal knowledge system, the dynamically updated legal knowledge system is constructed by executing an incremental learning algorithm to discover new knowledge and verifying and integrating it through a knowledge consistency verification mechanism.

3. The method according to claim 1, characterized in that The step of constructing the case diversion agent based on the dynamically updated legal knowledge system includes: Utilizing the dynamically updated legal knowledge system and the received case materials, a trained text classification model is constructed using multi-label text classification technology; Based on the text classification model and the semantic features of the case materials, case classification is performed using a type recognition algorithm to generate a case type label; Calculate and output a case handling priority score using a priority sorting algorithm based on the case type label and characteristic information of the case material; The text classification model, the type recognition algorithm and the priority sorting algorithm are integrated into a unified processing framework to construct a case diversion agent that can identify case types and determine processing priorities.

4. The method according to claim 3, characterized in that The step of constructing the law application agent based on the dynamically updated legal knowledge system includes: Building a semantic matching model using deep learning technology based on the case type label and the legal provisions in the dynamically updated legal knowledge system; Based on the semantic analysis results of the case materials by the semantic matching model, a set of candidate legal provisions is generated through a legal provision matching algorithm; Using the candidate legal article set and the semantic feature vectors of the case materials, a list of applicable legal articles and reasons for their application is generated and output through legal reasoning technology; The semantic matching model, the legal provision matching algorithm and the legal reasoning technology are encapsulated into a unified functional module to construct a legal application agent that can accurately match legal provisions and legal interpretations.

5. The method according to claim 4, characterized in that The step of constructing the similar case retrieval agent based on the dynamically updated legal knowledge system includes: Using the case type labels, the list of applicable laws and regulations, and a pre-built case knowledge base, a case similarity calculation model is constructed through deep semantic matching technology; Screening and generating a candidate case set through a retrieval algorithm based on the case similarity calculation model and case features of the case knowledge base; Based on the similarity scores of the candidate case set and the case similarity calculation model, a similar case set and similarity analysis results are screened and outputted through a sorting optimization technology; The case similarity calculation model, the retrieval algorithm and the ranking optimization technology are integrated into an integrated functional unit to construct a similar case retrieval agent that can achieve accurate case push.

6. The method according to claim 5, characterized in that The step of constructing the risk warning agent based on the dynamically updated legal knowledge system includes: Constructing a risk pattern recognition model using machine learning technology based on the case type label, the list of applicable laws, and case features in the collection of similar cases; Based on the analysis results of the case materials by the risk pattern recognition model, risk points are identified through feature extraction and pattern matching technology to generate a risk feature set; Utilizing the risk feature set and the preset risk assessment rule base, risk quantification assessment and anomaly detection technology are used to generate and output a risk assessment report and treatment suggestions; The risk pattern recognition model, the feature extraction and pattern matching technology, and the risk quantification assessment and anomaly detection technology are combined into a comprehensive processing system to construct a risk warning agent that can provide prompts for major and difficult cases.

7. The method according to claim 1, characterized in that The steps of constructing a planning tree PLANTOR framework based on the multi-case relationship perception preference mapping and combining a large language model with Prolog-based knowledge management technology include: Based on the feature data of the multi-case relationship perception preference mapping, a two-stage knowledge generation method is designed and implemented using a large language model and Prolog rule reasoning technology to generate a robot-oriented knowledge base; Based on the two-stage knowledge generation method and the mapping rules of the preference mapping relationship model, a knowledge base component with reusability and combinatorial reasoning capabilities is constructed through modular design and rule formalization technology; Based on the knowledge base components and preset task scheduling constraints, a three-step planning procedure is designed and implemented by mixed integer linear programming technology, which takes into account time dependency, resource constraints and parallel task execution, and generates a task planning solution; Based on the execution process and resource allocation strategy of the mission planning scheme, the planning scheme is converted into an executable behavior tree structure through behavior tree mapping and path optimization technology, completing the construction of the PLANTOR framework.

8. The method according to claim 1, characterized in that According to the PLANTOR framework, the steps of achieving multi-agent reasoning chain alignment through joint optimization of transmission optimization and embedding optimization to complete legal decision-making assistance include: By utilizing the knowledge base components and behavior tree structure in the PLANTOR framework, the inference chain features of each agent are extracted through deep inference path analysis technology to generate a standardized inference chain representation. According to the normalized reasoning chain representation and the preset alignment optimization goal, a transmission optimization model is constructed through transfer learning and transmission optimization technology; Using the normalized inference chain representation and the feature space of the transmission optimization model, an embedding optimization model is constructed through semantic representation learning and dimensionality reduction optimization technology; According to the optimization parameter space of the transmission optimization model and the embedding optimization model, the alignment optimization of the reasoning chain is realized by a multi-objective joint optimization algorithm, and an aligned multi-agent reasoning chain set is output.

9. A multi-agent system for intelligent legal assistance processing, characterized in that: include: processor; and a memory storing a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • Distributed near-end strategy optimization method based on cognitive behavior knowledge and application thereof

    CN112906233A

  • Self-updating legal case recommendation system based on large model and rule reasoning

    CN118193716A

Cited By

  • A Method for Legal Matter Identification and Task Planning Based on Multi-Agent Systems

    CN122492130A