Legal service method and system based on large language model and related equipment

By employing a legal service approach based on a large language model, identifying user requests and selecting appropriate intelligent agents, and combining RAG retrieval and visualization technologies, the complexity and professionalism of legal services are addressed, resulting in efficient and accurate legal services.

CN120407818AActive Publication Date: 2025-08-01EAST CHINA NORMAL UNIV

Patent Information

Application Number
CN202510921151.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-08-01
Estimated Expiration
2045-07-04

AI Technical Summary

Technical Problem

Existing legal models face challenges in terms of the complexity, specialization, diversity, personalized needs, and rigor of legal language, making it difficult to meet the demand for efficient, accurate, and interpretable legal services.

Method used

This paper adopts a legal service approach based on a large language model. By identifying the category and domain of user request information, selecting an appropriate intelligent agent, and combining RAG retrieval and visualization technologies, it generates target results for user requests.

Benefits of technology

It enables flexible responses and personalized services to legal issues, improves the efficiency and accuracy of legal services, and supports multi-domain, multi-modal knowledge base queries and visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407818A_ABST
    Figure CN120407818A_ABST
Patent Text Reader

Abstract

The invention provides a legal service method and system based on a large language model and related equipment, and the method comprises the steps: obtaining user request information, and recognizing the class information and field information of the user request information; according to the category information and the domain information, a preset agent meeting the category information and the domain information is selected from a preset agent library, the preset agent meeting the category information and the domain information serves as a target agent, and the target agent comprises a preset large language model meeting the domain information and a preset function matrix meeting the category information; inputting the user request information into the target agent to obtain an initial result; on the basis of the user request information, enhanced information is inquired in a preset vector knowledge base through an RAG retrieval technology; and generating a target result for the user request information based on the enhanced information and the initial result, and displaying the target result through a visualization technology. And different legal problems can be flexibly handled according to the diversity and individuation requirements of legal services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence and legal technology, and particularly to a legal service method, system and related devices based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) are increasingly widely used in various fields. The legal field, as a highly specialized and standardized industry, has also begun to explore the use of large language models to improve the intelligence level of legal services. The traditional legal service model mainly relies on manual processing, which has problems such as low efficiency, high cost, and limited service coverage, and is difficult to meet the growing demand for legal services.

[0003] In recent years, research institutions and enterprises at home and abroad have invested in the research and development of legal large models.

[0004] Despite many achievements, the current legal large models still face some challenges. First, the complexity and professionalism of legal language require the model to have profound legal knowledge and reasoning ability. Second, the diverse and personalized needs of legal services require the model to be able to flexibly handle different legal issues. Finally, the rigor and authority of legal services require the output results of the model to have a high degree of accuracy and interpretability. Summary of the Invention

[0005] To address the deficiencies in the prior art, the present invention provides a legal service method, system and related devices based on a large language model to solve problems such as the complexity and professionalism of legal language requiring the model to have profound legal knowledge and reasoning ability, the diverse and personalized needs of legal services requiring the model to be able to flexibly handle different legal issues, and the rigor and authority of legal services requiring the output results of the model to have a high degree of accuracy and interpretability.

[0006] To solve the above technical problems, the present invention adopts the following technical solutions.

[0007] In a first aspect, the present application provides a legal service method based on a large language model, including the following steps: Obtain user request information and identify the category information and domain information of the user request information; Select a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, and use the preset intelligent agent that meets the category information and domain information as the target intelligent agent. The target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; Input the user request information into the target intelligent agent to obtain an initial result; Based on the user request information, enhanced information is retrieved from a preset vector knowledge base through RAG retrieval technology; Based on the enhanced information and the initial result, a target result for the user request information is generated, and the target result is displayed through visualization technology.

[0008] Optionally, the step of identifying the category information and domain information of the user request information includes: Identifying the user request information through intent recognition technology to obtain the intent information of the user request information, and determining the category information and domain information of the user request information according to the intent information; Or, Obtaining the source information of the user request information, and determining the category information and domain information of the user request information based on the source information.

[0009] Optionally, before the step of selecting a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, it further includes: Based on a preset distributed data collection network, collecting raw data in different legal fields through data collection technology, and using the source information of the raw data as annotation information to annotate the raw data to obtain an initial data set, where the data collection technology at least includes text parsing technology, image feature extraction technology, and video frame analysis technology; Performing data analysis on each raw data in the initial data set to obtain an analysis result, and screening each raw data in the initial data set according to the analysis result to obtain target data that meets preset requirements. The data analysis includes comparative analysis, time series analysis, structural analysis, RFM analysis, grouping analysis, and regression analysis; Converting the format of the target data to obtain a JSON-LD format data set including three dimensions of factual elements, legal application, and judgment results. Among them, when the target data is unstructured data, through entity recognition technology, relationship extraction technology, and semantic disambiguation technology, the target data is converted into a JSON-LD format data including three dimensions of factual elements, legal application, and judgment results; Based on the JSON-LD format data set, training an initial large language model for different legal fields according to a preset tuning algorithm to obtain a preset large language model for different legal fields. The preset tuning algorithm includes at least one of LoRA algorithm, SFT algorithm, DPO algorithm, P-Tuning algorithm, RAG-FT algorithm, RLHF algorithm, and KTO algorithm; Construct a preset intelligent agent library based on preset large language models for different legal fields and a preset function matrix for different categories of information. The preset function matrix includes a first matrix based on a semantic parsing engine of BERT-Judicial Edition, a second matrix based on a similarity calculation model integrating spatio-temporal elements, a third matrix based on GPT-4 and a legal format validator, a fourth matrix integrating adversarial debate and evidence chain analysis algorithms, and a fifth matrix based on multi-language legal alignment technology. The initial large language models include the Qwen-14B model for the field of civil disputes, the DeepSeek-legal model for the field of commercial disputes, the ChatGLM3-6B model for the field of criminal defense, and the LawyerLlama model for the field of administrative disputes.

[0010] Optionally, the step of training the initial large language models for different legal fields according to the preset tuning algorithm based on the JSON-LD format dataset to obtain the preset large language models for different legal fields includes: Optimize the data ratio in the JSON-LD format dataset through domain term injection to obtain a target JSON-LD format dataset; Based on the target JSON-LD format dataset, train the initial large language models for different legal fields according to the preset tuning algorithm to obtain secondary large language models for different legal fields; Calibrate the dimensional space of the secondary large language models with the cosine similarity greater than 0.85 to obtain the preset large language models for different legal fields.

[0011] Optionally, before the step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information, it further includes: Integrate the original data into a legal provision library, a judge library, a lawyer library, and a case library according to the source of the original data; Associate the data in the legal provision library, the judge library, the lawyer library, and the case library according to the association index system based on legal elements to obtain multi-dimensional semantic association data with an association density greater than 85%; Adopt a privatized embedding model to construct a unified vector space mapping system for text, images, and videos, extract feature vectors of the multi-dimensional semantic association data according to the unified vector space mapping system, and establish a preset vector knowledge base based on the feature vectors.

[0012] Optionally, the step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information includes: Parse the user request information to obtain a query feature vector; Calculate the cosine similarity between the query feature vector and the feature vectors in the preset vector knowledge base, identify the feature vectors whose cosine similarity with the query feature vector is greater than or equal to the cosine similarity threshold, sort the identified feature vectors according to the cosine similarity to obtain a feature vector queue, and select the top ten feature vectors in the feature vector queue as target feature vectors; Select the document data corresponding to the target feature vectors from the legal provision library, the judge library, the lawyer library, and the case library; Perform legal logic verification on the document data to exclude invalid legal provision references and obtain target document data; Generate a retrieval report with adjudication gist annotations based on the target document data, and use the retrieval report with adjudication gist annotations as enhanced information.

[0013] Optionally, the method further includes: when there are at least two preset agents in the preset agent library that meet the category information and the domain information, establish a data transmission channel between the preset agents according to preset rules to enable the sharing of evidence chains between the preset agents; when there are at least two preset agents in the preset agent library that meet the category information and the domain information, and the output results of the preset agents conflict, optimize the output results through a federated learning algorithm to obtain a target result for the user request information.

[0014] On the other hand, the present application also provides a legal service system based on a large language model. The system includes: A request receiving module, configured to obtain user request information and identify the category information and the domain information of the user request information; A selection module, configured to select a preset agent that meets the category information and the domain information from the preset agent library according to the category information and the domain information, and use the preset agent that meets the category information and the domain information as a target agent. The target agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; An execution module, configured to input the user request information into the target agent to obtain an initial result; An enhancement module, configured to query enhanced information in a preset vector knowledge base based on the user request information through RAG retrieval technology; A display module, configured to generate a target result for the user request information based on the enhanced information and the initial result, and display the target result through visualization technology.

[0015] In a third aspect, the present application also provides an electronic device, including a memory, a processor, and a first computer program stored in the memory and executable on the processor. When the processor executes the first computer program, the above-described legal service method based on a large language model is implemented.

[0016] In a fourth aspect, the present application also provides a computer-readable storage medium storing a second computer program, which, when executed by a processor, implements the above-described legal service method based on a large language model.

[0017] Beneficial effects: In the present application, user request information is obtained, and the category information of the user request information is identified; according to the category information, a preset intelligent agent corresponding to the category information is selected from a preset intelligent agent library to obtain a target intelligent agent, where the preset intelligent agent includes a preset large language model and a preset function matrix; the user request information is input into the target intelligent agent to obtain an initial result; based on the user request information, enhanced information is retrieved from a preset vector knowledge base through RAG retrieval technology; a target result for the user request information is generated based on the enhanced information and the initial result, and the target result is displayed through visualization technology. Facing the diverse and personalized needs of legal services, different legal issues can be flexibly addressed. Description of the Drawings

[0018] Figure 1 is a flowchart of the operation of a legal service method based on a large language model of the present invention; Figure 2 is an architecture diagram of a legal service method based on a large language model of the present invention; Figure 3 is a technical roadmap for multi-source heterogeneous big data collection and unified analysis of the present invention; Figure 4 is a technical architecture diagram of large model training based on high-quality sample data of the present invention; Figure 5 is a technical roadmap for a multi-domain and multi-modal vector knowledge base and RAG enhanced retrieval of the present invention; Figure 6 is a technical roadmap for the application of multi-intelligent agents in the full legal scenario of the present invention; Figure 7 is a technical roadmap for legal digital visualization based on a large model of the present invention; Figure 8 is a technical roadmap for data privacy and security protection of the legal service large model base of the present invention; Figure 9Schematic diagram of a legal service system based on a large language model in an embodiment of the present invention; Figure 10 Schematic diagram of an electronic device provided in an embodiment of the present application; Figure 11 Schematic diagram of a computer-readable storage medium provided in an embodiment of the present application. Detailed implementation manners

[0019] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0020] The embodiments described in the present application are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the spirit of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0021] Through the integration of the above functions, the legal large model system will effectively improve the efficiency and quality of legal services, and promote the intelligent and inclusive development of legal services.

[0022] Based on the collaborative work of multiple key steps, the present invention is used for multi-source heterogeneous big data collection and unified analysis, for large model training of high-quality sample data, for vector knowledge bases and RAG enhanced retrieval in multiple fields and modalities, for legal full-scenario multi-agent applications, for legal digital visualization, and for data privacy and security protection, to implement a legal large model system integrating functions such as judicial big data, legal Q&A, case retrieval, document generation, foreign-related rule of law, intelligent court, case visualization, security compliance, etc., aiming to solve problems such as the complexity and professionalism of legal language requiring the model to have profound legal knowledge and reasoning ability, the diversity and personalization requirements of legal services requiring the model to be able to flexibly handle different legal issues, and the rigor and authority of legal services requiring the output results of the model to have high accuracy and interpretability.

[0023] See Figure 1 As shown, a legal service method based on a large language model provided by the present invention includes the following steps: S110. Obtain user request information, and identify the category information and domain information of the user request information; S120. Select a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, and use the preset intelligent agent that meets the category information and the domain information as the target intelligent agent. The target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; S130. Input the user request information into the target intelligent agent to obtain an initial result; S140. Based on the user request information, query enhanced information in a preset vector knowledge base through RAG retrieval technology; S150. Generate a target result for the user request information based on the enhanced information and the initial result, and display the target result through visualization technology.

[0024] Exemplarily, such as Figure 2 As shown, the system architecture when executing a legal service method based on a large language model provided by the present invention includes: Multi-source heterogeneous big data collection and unified analysis; large model training based on high-quality sample data; multi-domain and multi-modal vector knowledge base and RAG enhanced retrieval; intelligent agent application; legal digital visualization based on a large model; data privacy and security protection.

[0025] In a possible implementation manner, the step of identifying the category information and domain information of the user request information includes: Identify the user request information through intent recognition technology to obtain the intent information of the user request information, and determine the category information and domain information of the user request information according to the intent information; Or, Obtain the source information of the user request information, and determine the category information and domain information of the user request information based on the source information.

[0026] Exemplarily, when the user inputs user request information through a specific button on a specific page, for example, in a certain scenario, the user selects the "Civil Dispute Consultation" button on the page, then according to the source information (button) of the user request information, determine that the domain information of the user request information is the civil domain, and determine that the type information of the user request information is the legal question and answer type.

[0027] Exemplarily, when the user inputs a request by voice, convert the user voice information into text information through voice conversion technology, and then through intent recognition technology, determine the category information and domain information of the user request information according to the text information.

[0028] In a possible implementation manner, before the step of selecting a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, it further includes: Based on a preset distributed data acquisition network, raw data in different legal fields is collected through data acquisition technologies, and the source information of the raw data is used as annotation information to annotate the raw data, obtaining an initial dataset. The data acquisition technologies at least include text parsing technology, image feature extraction technology, and video frame analysis technology; Data analysis is performed on each piece of raw data in the initial dataset to obtain an analysis result, and based on the analysis result, each piece of raw data in the initial dataset is screened to obtain target data that meets the preset requirements. The data analysis includes comparative analysis, time series analysis, structural analysis, RFM analysis, grouping analysis, and regression analysis; Format conversion is performed on the target data to obtain a JSON-LD format dataset containing three dimensions: factual elements, legal application, and judgment results. Among them, when the target data is unstructured data, through entity recognition technology, relationship extraction technology, and semantic disambiguation technology, the target data is converted into a JSON-LD format data containing three dimensions: factual elements, legal application, and judgment results; Based on the JSON-LD format dataset, the initial large language models for different legal fields are trained according to a preset tuning algorithm to obtain preset large language models for different legal fields. The preset tuning algorithm includes at least one of LoRA algorithm, SFT algorithm, DPO algorithm, P-Tuning algorithm, RAG-FT algorithm, RLHF algorithm, and KTO algorithm; According to the preset large language models for different legal fields and the preset function matrices for different category information, a preset intelligent agent library is constructed. The preset function matrices include the first matrix based on the semantic parsing engine of BERT-Judicial Edition, the second matrix based on the similarity calculation model integrating spatio-temporal elements, the third matrix based on GPT-4 and the legal format validator, the fourth matrix integrating adversarial debate and evidence chain analysis algorithms, and the fifth matrix based on multi-language legal alignment technology. The initial large language models include the Qwen-14B model for the civil dispute field, the DeepSeek-legal model for the commercial dispute field, the ChatGLM3-6B model for the criminal defense field, and the LawyerLlama model for the administrative dispute field.

[0029] Exemplarily, such as Figure 3As shown in the figure, when collecting data, a distributed data collection network covering four major fields of civil disputes, commercial disputes, criminal defense, and administrative disputes is established, and technical modules such as text parsing, image feature extraction, and video frame analysis are deployed to achieve the full-form capture of structured and unstructured data in legal practice scenarios. At the same time, a data source annotation and quality preliminary screening mechanism is established. A domain data fusion system is constructed. An original data pool for the four major fields of civil, commercial, criminal, and administrative is established, and a distributed crawler system is deployed to achieve automated collection of more than 15 data sources such as the Judgments Online and law firm case libraries. A data lineage tracking mechanism is designed to record more than 40 metadata tags such as the cause of action, trial level, and region of each case, forming a domain-specific data reserve library with a daily increment of 2TB.

[0030] Integrate seven major databases including a legal provision library (laws, regulations, and judicial interpretations), a judge library (adjudication rules and trial experience), a lawyer library (agency cases and practice strategies), a case library (judicial precedents and characteristics of similar cases), a foreign-related library (foreign laws and cross-border cases), a document library (litigation documents and contract document templates), and an enterprise library (identity information and activity data). Design the association rules of the domain knowledge graph and complete the standardized cleaning and metadata annotation of the original data.

[0031] When conducting data analysis, six core algorithm modules including comparative analysis (specification conflict detection), time series analysis (judicial judgment result prediction), structural analysis (case element deconstruction), RFM analysis (litigation risk stratification assessment), grouping analysis (judge adjudication preference clustering), and regression analysis (compensation amount prediction model) are configured in the unified analysis platform to establish a multi-dimensional analysis index system and a visual interactive interface.

[0032] As Figure 3 shown in the figure, the process of multi-source heterogeneous big data collection and unified analysis is as follows: Connect each layer through a two-way data flow pipeline: The bottom-layer collected data is sent upward to the middle-layer database after quality verification; The middle-layer structured data is pushed to the top-layer analysis engine through the API interface; The analysis results such as the case feature vectors and judgment prediction coefficients generated by the top layer are fed back downward to the database to optimize the data label system, forming a closed-loop optimization link of "data cleaning - knowledge precipitation - intelligent feedback".

[0033] Laying the foundation for the legal large model system through bottom-up data integration and intelligent analysis. The bottom layer relies on a multi-source heterogeneous data collection system, covering diverse data forms such as text, images, and videos in the four major legal fields of civil, commercial, criminal, and administrative law, achieving full-dimensional coverage of legal practice scenarios; the middle layer deploys a structured data collection platform, integrating seven core databases including a legal provision library, a judge library, a lawyer library, a case library, a foreign-related library, a document library, and an enterprise library, and converting the original data into computable resources through standardized processing; the top layer constructs a unified analysis platform, providing six types of intelligent analysis methods including comparative analysis, group analysis, structural analysis, RFM analysis, time series analysis, and regression analysis, forming a technical closed-loop from data collection, governance to multi-modal analysis. The three-layer architecture realizes dynamic interaction through two-way data flow arrows, not only supporting the upward convergence and cleaning of underlying heterogeneous data, but also ensuring the downward feedback of analysis results to optimize data quality, and ultimately providing data support and quantitative analysis capabilities with both breadth and depth for the legal large model system with multi-agent collaboration.

[0034] Exemplarily, a text structuring engine based on BERT-Law Edition is adopted, and through a three-layer processing architecture of entity recognition (such as parties, legal provision citations, etc.), relation extraction (legal fact determination logic), and semantic disambiguation (standardization of professional terms), the unstructured legal documents are converted into a standard data set in JSON-LD format containing three dimensions of fact elements, legal application, and judgment results.

[0035] In a possible implementation manner, the step of training the initial large language model for different legal fields according to a preset tuning algorithm based on the JSON-LD format data set to obtain the preset large language model for different legal fields includes: Optimizing the data ratio in the JSON-LD format data set through domain term injection to obtain a target JSON-LD format data set; Based on the target JSON-LD format data set, training the initial large language model for different legal fields according to a preset tuning algorithm to obtain a secondary large language model for different legal fields; Calibrating the dimension space of the secondary large language model with a cosine similarity greater than 0.85 to obtain the preset large language model for different legal fields.

[0036] Exemplarily, such as Figure 4As shown in the figure, the Qwen-14B model is selected for civil disputes, the DeepSeek-legal model for commercial disputes, the ChatGLM3-6B model for criminal defense, and the LawyerLlama model for administrative disputes. Then, the above models are adapted and transformed in three stages (loading a legal vocabulary of more than 2 million through domain term injection, optimizing the pre-training data ratio to increase the proportion of domain data to 65%, and calibrating the dimensional space to make the cosine similarity > 0.85). After training, preset large language models for different legal fields are obtained.

[0037] Exemplarily, when facing different user request information, that is, when different preset large language models are running, the LoRA algorithm for low-rank adaptation, the SFT algorithm for supervised fine-tuning, the DPO algorithm for direct preference optimization, the P-Tuning algorithm for prompt tuning, the RAG-FT algorithm for retrieval-augmented fine-tuning, the RLHF algorithm for human feedback reinforcement learning, and the KTO algorithm for knowledge distillation are dynamically combined to achieve tuning.

[0038] The precise adaptation of the large model in the legal field is achieved through the full-link optimization from the data source to the algorithm application. Relying on the processing data of historical cases in the four major legal fields of civil, commercial, criminal, and administrative, it provides raw data resources covering all business scenarios; at the data layer, a large amount of unstructured data is converted into a standard data set through a selection and cleaning mechanism to ensure the quality benchmark of training samples; at the model layer, general large models such as Qwen or Deepseek are used as the foundation to generate dedicated large models for the four major fields of civil, commercial, criminal, and administrative respectively; at the training layer, seven algorithm modules including LoRA, SFT, and Pre-Training are innovatively integrated to form a composite tuning system, and the in-depth injection of legal professional capabilities is achieved through four targeted optimization channels such as civil dispute fine-tuning. A two-way enhancement mechanism is formed through the technical conduction path between each layer, which not only maintains the general capabilities of the basic model but also strengthens the knowledge density of the professional field. Finally, an intelligent agent collaborative training paradigm with both legal reasoning accuracy and cross-field adaptability is constructed to provide an extensible model support for multi-task legal services.

[0039] In a possible implementation manner, before the step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information, it further includes: Integrating the original data into a legal provision library, a judge library, a lawyer library, and a case library according to the source of the original data; Associating the data in the legal provision library, the judge library, the lawyer library, and the case library according to the association index system based on legal elements to obtain multi-dimensional semantic association data with an association density greater than 85%; Adopt a private embedding model to construct a unified vector space mapping system for text, images, and videos, extract the feature vectors of the multi-dimensional semantic association data according to the unified vector space mapping system, and establish a preset vector knowledge base based on the feature vectors.

[0040] Exemplarily, such as Figure 5 As shown, integrate four core databases: the legal provision library (including more than 4.5 million current laws and regulations), the judge library (covering the adjudication tendency analysis of more than 400,000 judges), the lawyer library (more than 7 million case agency strategies), and the case library (more than 150 million judgment documents), establish an association index system based on legal elements (the triad of case cause - legal provision - judgment result), realize the multi-dimensional semantic association of knowledge nodes (association density > 85%), and obtain multi-dimensional semantic association data; adopt three types of private embedding models, namely Voyage-large-2-instruct (text semantic encoding), SFR-Embedding-Mistral (cross-modal alignment), and BGE-M3 (multilingual adaptation), to construct a unified vector space mapping system for text (in formats such as TXT / DOCX), images (such as scanned files / signature samples), and videos (such as court trial recordings), and efficiently extract 1280-dimensional vectors of legal semantic features (encoding latency < 150ms) to obtain a vector knowledge base for multiple fields and modalities.

[0041] Exemplarily, for fields such as civil and commercial (contract clause deconstruction) and criminal (electronic evidence chain analysis), deploy dedicated data processing modules: for structured data, extract it using regular templates (accuracy > 95%), and for unstructured data, perform document layout analysis through LayoutLMv3 to construct a domain-specific feature-enhanced vector space (intra-class similarity increased by 23%).

[0042] In a possible implementation manner, the step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information includes: Parse the user request information to obtain a query feature vector; Calculate the cosine similarity between the query feature vector and the feature vectors in the preset vector knowledge base, identify the feature vectors whose cosine similarity with the query feature vector is greater than or equal to the cosine similarity threshold, sort the identified feature vectors according to the cosine similarity to obtain a feature vector queue, and select the top ten feature vectors in the feature vector queue as target feature vectors; Select the document data corresponding to the target feature vectors in the legal provision library, the judge library, the lawyer library, and the case library; Perform legal logic verification on the document data to exclude invalid legal provision references and obtain target document data; Generate a retrieval report with gist annotations based on the target document data, and use the retrieval report with gist annotations as enhanced information.

[0043] Exemplarily, a retrieval enhancement generation pipeline is used to parse user input, and the parsing process supports OCR for recognizing handwritten pleadings. Multi-modal query vectorization to find query results (target feature vectors) with a cosine similarity threshold ≥ 0.78. Recall of the knowledge base candidate set. Specifically, select cases / articles (document data) corresponding to the target feature vector from the article library, the judge library, the lawyer library, and the case library. Use the CONTEXT module for legal logic verification to exclude invalid article citations. Generate a retrieval report with gist annotations based on the target document data.

[0044] Specifically, use blue (data layer), purple (algorithm layer), and yellow (application layer) color blocks to distinguish functional modules: deploy a MySQL cluster (structured data) and MinIO object storage (unstructured data) at the data layer; run Faiss vector indexing (1 billion-level vector retrieval) and BERT-Law similarity calculation at the algorithm layer; provide an API gateway (QPS ≥ 500) and a visual retrieval interface (supporting 3D knowledge graph navigation) at the application layer.

[0045] Precise information matching is achieved by integrating a legal professional database with advanced vectorization technology. At the top of the system, four core databases, namely the legal provision library, judge library, lawyer library, and case library, are integrated to form a structured knowledge base. Users can trigger the retrieval process through text or image input. The system relies on three types of private embedding models, Voyage-large-2-instruct, SFR-Embedding-Mistral, and BGE-M3, to perform multi-modal vector encoding on the input content, and simultaneously converts heterogeneous data such as text, images, and videos in the knowledge base into a unified vector space representation. Through contrastive learning and similarity calculation, dynamic matching between the input features and the knowledge base resources is achieved. The CONTEXT module enhances the retrieval results based on the RAG technology and outputs high-precision retrieval content that meets the legal professional requirements. The technical base deploys multi-domain data processing modules in a hierarchical manner, covering structured and unstructured data in vertical fields such as civil disputes, commercial disputes, criminal defenses, and administrative disputes, forming a complete technical chain from raw data cleaning, multi-modal vectorization to intelligent retrieval. The system adopts a modular architecture and color block coding to clearly display the collaborative relationship between the data layer, algorithm layer, and application layer. Distinct color blocks such as blue, purple, and yellow (the specific color is not limited here, only for functional differentiation) distinguish the work processes of different functional modules, which not only ensures the deep integration of legal professional data but also strengthens the cross-modal information correlation retrieval ability, providing accurate and reliable knowledge support for multi-agent collaboration.

[0046] In a possible implementation manner, the method further includes: when there are at least two preset agents in the preset agent library that meet the category information and the domain information, a data transmission channel is established between the preset agents according to a preset rule to enable the sharing of evidence chains between the preset agents; when there are at least two preset agents in the preset agent library that meet the category information and the domain information, and the output results of the preset agents conflict, the output results are optimized through a federated learning algorithm to obtain a target result for the user request information.

[0047] Exemplarily, as Figure 6 shown, an intelligent scheduling center for coordinating Agents is constructed. The intelligent scheduling center is used to ensure that the retrieval path can call the RAG enhancement system in real time to obtain the latest legal basis; the intelligent scheduling center is also used to dynamically load the domain fine-tuning model in the training path. For example, the parameter weights are updated weekly; through the task routing rules for 23 types of case causes such as civil, criminal, and administrative, intelligent distribution with a request recognition accuracy rate > 95% is achieved. For example, loan disputes are automatically routed to the collaborative processing of the similar case retrieval Agent and the document generation Agent.

[0048] For example, a two-way interactive channel is built: the vertical channel realizes real-time data exchange between the agent and the knowledge base; the horizontal channel establishes an evidence chain sharing mechanism between agents. For example, the focus of the dispute discovered by the legal question-and-answer agent is automatically synchronized to the intelligent court agent; at the same time, when the conclusions of multiple agents conflict, the federated learning mechanism is activated to optimize the decision.

[0049] Specifically, a layered architecture design is adopted: the knowledge layer deploys hybrid storage of a graph database (Neo4j) and a vector database (Milvus); the intelligent body layer manages the agent cluster through Kubernetes orchestration (the application layer develops three entrances: web, mobile, and API, and designs a legal consulting service matrix dashboard).

[0050] For example, the Agent strategy network is updated daily through user feedback data (adoption rate, correction record) through micro-loop; cross-domain knowledge distillation is implemented monthly through macro-loop (the success rate of criminal → commercial strategy migration is >65%), and the collaborative strategy is optimized in combination with A / B testing.

[0051] The coordinated agent achieves an organic linkage between the intelligent agent cluster and the knowledge base. The core of the system consists of six specialized knowledge bases: the legal provisions library, the case library, the document library, the judge library, the lawyer library, and the foreign-related library. These are connected to the five functional agent modules of legal Q&A, similar case search, document generation, intelligent court, and foreign-related rule of law, forming a service matrix covering the entire legal practice scenario. When users initiate service requests through the five application-side portals, such as legal Q&A and similar case search, the coordinated agent schedules tasks based on customized retrieval and training, driving the corresponding intelligent agent to call on the associated knowledge base resources to perform professional operations: the legal Q&A agent analyzes the laws, regulations, and judicial interpretations in the legal provisions library in real time, the similar case search agent accurately matches historical precedents in the case library, the document generation agent intelligently calls the document library format specifications, the intelligent court agent integrates the practical experience of the judge and lawyer library, and the foreign-related rule of law agent connects to the international legal resources in the foreign-related library. Each intelligent agent maintains dynamic collaboration with the coordinating agent through a two-way interactive channel, which not only enables the precise calling of knowledge base resources, but also completes the feedback optimization of task execution results. The system adopts a modular architecture to clearly display the technical transmission path of the knowledge layer, intelligent agent layer and application layer, and improves the collaborative efficiency of multiple agents through a continuously iterative customized training mechanism, ultimately forming a full-process legal solution with both professional depth and scenario coverage.

[0052] The method further comprises: Figure 7As shown, the system deploys electronic evidence collection and restoration modules (supporting FTK / EnCase evidence collection tool chain), storage medium fixing and analysis devices (including hard disk hash verification and read-only interface), massive data acquisition systems (using scripts to download public data, covering real-time capture of 20+ data sources), program reverse analysis sandboxes (dynamic parsing of Windows / Linux binary files), multimodal data processing engines (stripping image EXIF / document metadata) and digital simulation interfaces, forming a full-chain technical support covering data tracing, evidence fixing and cleaning, and connecting to the lower-level system through a secure communication protocol.

[0053] Based on a distributed storage architecture, we integrate general data (public information on the Internet) and legal industry data (eight types of forms, such as judicial documents and court trial videos), and build a fusion analysis network that includes natural language processing (BERT-Judicial Edition), intelligent voice (Wav2Vec 2.0 Legal Voice Recognition), and computer vision (YOLOv5 Evidence Positioning). Through machine learning (XGBoost evidence chain evaluation) and retrieval enhancement technology (RAG legal knowledge injection), we achieve joint analysis of multimodal data and output 12-dimensional quantitative indicators such as legal requirement matching degree (F1>0.88) and behavioral pattern correlation.

[0054] Unreal Engine 5 is used to develop a three-dimensional legal scene mirror, integrating a digital twin module (1:1 restoration of the hardware equipment involved in the case), an image and video analyzer (reconstruction of the spatiotemporal trajectory of electronic evidence), and a hardware-accelerated rendering interface (NVIDIA Omniverse real-time collaboration). Through the communication simulation protocol, network attack links are reproduced, and natural language processing is combined to generate interactive evidence reports (supporting VR / AR multi-terminal viewing), forming a closed-loop process of data collection → intelligent analysis → scene reconstruction, achieving a dynamic restoration error rate of electronic evidence of less than 3% and a visual decision-making support capability that improves the efficiency of trial deduction by 55%.

[0055] Through the collaboration of security agents, AI engines, and visualization platforms, in-depth analysis and three-dimensional presentation of legal digital evidence are achieved. At the top layer, a cluster of security agents is deployed, integrating six core modules: electronic forensics and restoration, storage medium fixation and analysis, massive data collection, program reverse analysis, multi-modal data processing, and digital simulation, forming a full-chain technical support covering data traceability, evidence fixation, and cleaning; the middle layer is driven by an AI engine, relying on basic technologies such as natural language processing, neural networks, intelligent speech, computer vision, and machine question answering to build an intelligent analysis center, integrating general data, legal industry data, and intelligent cloud platform resources through a distributed storage and computing architecture, and realizing the fusion analysis of multi-modal data through machine learning, deep learning, and retrieval enhancement technologies; at the bottom layer, a visualization digital simulation platform is built, reconstructing the digital mirror of legal scenarios based on technologies such as binary reverse, electronic forensics, digital twin, and image and video analysis, dynamically restoring electronic evidence through hardware simulation and communication simulation, and improving the 3D modeling efficiency of legal data with natural language processing and hardware acceleration technologies. The system adopts a modular architecture in blue and white colors to clearly divide functional levels. The security agent and the AI engine achieve intelligent screening and feature extraction of legal data through two-way data streams, while the visualization platform converts the analysis results into an interactive simulation model through multi-dimensional rendering technology, forming a closed-loop process from data collection, intelligent analysis to scenario reconstruction, providing a visualization analysis solution with both technical credibility and decision-making assistance value for legal practice.

[0056] The method further includes: as Figure 8 shown, deploy an irreversible ciphertext interaction system based on multi-party secure computation (MPC), establish a four-stage closed-loop covering encrypted model training (homomorphic encryption parameter fine-tuning), secure deployment (TEE trusted execution environment), ciphertext calculation request (access control based on SM9 algorithm), and ciphertext result output (differential privacy perturbation), design a distributed secure computing node cluster (with a parallel computing capacity of 1000+ cores), and achieve secure interaction of "data available but invisible" between data providers and users through a federated learning architecture (sensitive information leakage rate < 0.01%), supporting 500,000 legal data call requests per day.

[0057] Build an LLM privacy protection system, including: an adaptive privacy perception module (sensitivity classification based on BiLSTM, recognition accuracy > 95%); an intelligent cleaning engine (combined desensitization of regular expressions + deep learning); privacy attribute modeling (construction of a 1300-dimensional legal privacy feature space using Word2Vec + knowledge graph); a leakage risk assessment model (calculation of sensitive exposure index based on Monte Carlo simulation); a secure data publishing gateway (supporting dynamic configuration of K-anonymization and L-diversity strategies); an audit tracking system (blockchain storage of key operation logs), to achieve real-time desensitization processing of legal texts (desensitization efficiency > 500 articles / second) and personalized protection strategy configuration (supporting 32 compliance templates).

[0058] In a possible implementation, during the training phase, the privacy computing framework injects encryption parameters (model privacy budget ε < 1.0), and during the inference phase, the privacy protection system monitors data flow in real time (detection latency < 50ms); develop a risk conduction blocking module (locating leakage paths based on Causal Inference), and when detecting a risk of sensitive information exposure (CVSS score ≥ 7.0), automatically trigger data isolation and model hot update (response time < 3s), finally forming a full-chain security closed-loop covering data collection (compliant with GB / T 35273), processing (ISO / IEC 27001 certified), and application (GDPR cross-border transfer protection), supporting the compliant operation of the "Wise Law" large model in handling more than 1 million legal consultation services per day.

[0059] Achieve full-process data security control through the synergistic effect of privacy computing and adaptive security mechanisms. On the left side of the system, build a privacy computing framework based on irreversible ciphertext interaction, which runs through the four core processes of encrypted model training, deployment, calculation requests, and operation results. The secure computing node coordinates the ciphertext interaction between the data provider and the user, blocking the risk of original sensitive information leakage while ensuring data availability; on the right side, construct a privacy protection system exclusive to large language models, dynamically identify the privacy sensitivity of data through an adaptive privacy perception module, desensitize the input information using intelligent sensitive data cleaning technology, establish a privacy protection modeling method based on privacy attribute discovery algorithms, and simultaneously use a privacy data leakage risk assessment model to quantify the sensitive information exposure index, finally forming a personalized and customizable secure data publishing mechanism. The dual-track system achieves deep integration throughout the data life cycle. The privacy computing framework provides an encrypted operation environment for model training and inference, while the large model security system optimizes data quality through dynamic evaluation and cleaning. The two work together to drive the value flow of legal data within the security boundary, jointly supporting the compliant operation of the "Wise Law" legal service large language model, and building a privacy and security protection closed-loop throughout the entire chain of data collection, processing, and application for the multi-agent collaborative system.

[0060] The present invention constructs a full-process intelligent service system in diversified legal scenarios such as civil disputes, commercial disputes, criminal defense, and administrative disputes. Through the integration of a multi-agent collaborative architecture and multi-modal technologies, it significantly improves the accuracy and scenario adaptability of legal services. Relying on a three-layer data governance architecture and a four-layer training system, the system realizes the in-depth analysis of judicial big data and the dynamic injection of legal knowledge. Combining RAG enhanced retrieval and 3D visualization technologies, it increases the legal reasoning accuracy by more than 25% and improves the similar case matching efficiency by 40%. At the same time, it supports the intelligent alignment of cross-border legal resources and the digital twin deduction of the court trial process. The modular design of the system breaks through the technical limitations of traditional single models and can be flexibly extended to legal sub-domains such as administrative compliance and international arbitration.

[0061] This application constructs a legal large model system integrating functions such as judicial big data processing, legal Q&A, similar case retrieval, document generation, foreign-related rule of law, intelligent court, case visualization, security compliance, etc., which becomes the key to improving the intelligent level of legal services. The system should be able to collect, clean, and structurally process judicial big data to build a knowledge base suitable for legal large model training and reasoning; based on this knowledge base, provide multi-functional intelligent Q&A services, including legal Q&A, similar case retrieval, and document generation, etc.; support the understanding of multi-lingual legal corpora and cross-domain matching and translation prompts of legal provisions in different countries / regions; construct a mock court function, by presetting court trial scenarios and legal roles, using the large model to simulate the trial process and generate complete dialogue records; realize the case visualization function, and display information such as case facts, legal relationships, procedural processes, and related case precedents in the form of visual charts on the user interface.

[0062] It constructs a legal intelligent ecosystem with "data-model-application" three-axis linkage: through a two-way governance mechanism for multi-source heterogeneous data, it solves the contradiction between legal professionalism and data complexity; adopts a composite optimization algorithm and a domain-specific model matrix to achieve a balance between legal semantic understanding and cross-scenario migration ability; based on a multi-agent dynamic collaboration framework, it upgrades independent functions such as legal Q&A, similar case retrieval, document generation, intelligent court, foreign-related rule of law, and case visualization to a full-process closed-loop service, and provides basic data for subsequent functions such as winning rate prediction. Especially through a privatized embedding model and a dual-track privacy protection system, on the premise of ensuring data security, it overcomes the technical bottlenecks of legal multi-modal data processing and cross-border compliance applications, provides a reliable intelligent infrastructure for judicial digitization, and can promote the improvement of legal service efficiency and user adoption rate.

[0063] On the other hand, as Figure 9 shown, this application also provides a coiler control system, and the system includes: A request receiving module 201, configured to obtain user request information and identify the category information and domain information of the user request information; A selection module 202, configured to select a preset intelligent agent that meets the category information and the domain information from a preset intelligent agent library according to the category information and the domain information, and use the preset intelligent agent that meets the category information and the domain information as a target intelligent agent, where the target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; An execution module 203, configured to input the user request information into the target intelligent agent to obtain an initial result; An enhancement module 204, configured to query enhancement information in a preset vector knowledge base based on the user request information through RAG retrieval technology; A display module 205, configured to generate a target result for the user request information based on the enhancement information and the initial result, and display the target result through visualization technology.

[0064] In a possible implementation manner, as Figure 10 shown, an embodiment of the present application provides a terminal device 300, including: a memory 310, a processor 320, and a first computer program 311 stored on the memory 310 and executable on the processor 320. When the processor 320 executes the first computer program 311, the following is implemented: obtaining user request information and identifying the category information and domain information of the user request information; selecting a preset intelligent agent that meets the category information and the domain information from a preset intelligent agent library according to the category information and the domain information, and using the preset intelligent agent that meets the category information and the domain information as a target intelligent agent, where the target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; inputting the user request information into the target intelligent agent to obtain an initial result; querying enhancement information in a preset vector knowledge base based on the user request information through RAG retrieval technology; generating a target result for the user request information based on the enhancement information and the initial result, and displaying the target result through visualization technology.

[0065] In a possible implementation manner, as Figure 11As shown in the figure, an embodiment of the present application provides a computer-readable storage medium 400, on which a second computer program 411 is stored. When the second computer program 411 is executed by a processor, it realizes: obtaining user request information and identifying the category information and domain information of the user request information; selecting a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, and using the preset intelligent agent that meets the category information and domain information as the target intelligent agent. The target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; inputting the user request information into the target intelligent agent to obtain an initial result; querying enhanced information in a preset vector knowledge base through RAG retrieval technology based on the user request information; generating a target result for the user request information based on the enhanced information and the initial result, and displaying the target result through visualization technology.

[0066] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiment of the present application, their specific functions and the technical effects brought can be specifically referred to in the method embodiment part, and will not be elaborated here.

[0067] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual application, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.

[0068] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, a computer program can be used to instruct relevant hardware to complete them. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0069] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0070] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0071] In the embodiments provided by this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical, or other form.

[0072] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0073] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

[0074] The above disclosure is only for the preferred embodiments of the present invention, and of course cannot be used to limit the scope of the rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.

Claims

1. A legal service method based on large language models, characterized in that, It includes the following steps: Obtain user request information, and identify the category information and domain information of the user request information; Select a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, and use the preset intelligent agent that meets the category information and the domain information as the target intelligent agent. The target intelligent agent includes a preset large language model that meets the domain information and a preset function matrix that meets the category information; Input the user request information into the target intelligent agent to obtain an initial result; Based on the user request information, query for enhanced information in a preset vector knowledge base through RAG retrieval technology; Generate a target result for the user request information based on the enhanced information and the initial result, and display the target result through visualization technology.

2. The legal service method based on a large language model according to claim 1, wherein The step of identifying the category information and domain information of the user request information includes: Identify the user request information through intent recognition technology to obtain the intent information of the user request information, and determine the category information and domain information of the user request information according to the intent information; Or, Obtain the source information of the user request information, and determine the category information and domain information of the user request information based on the source information.

3. The legal service method based on the large language model according to claim 1, wherein Before the step of selecting a preset intelligent agent that meets the category information and domain information from a preset intelligent agent library according to the category information and the domain information, it further includes: Based on a preset distributed data collection network, collect raw data in different legal fields through data collection technology, and use the source information of the raw data as annotation information to annotate the raw data to obtain an initial data set. The data collection technology at least includes text parsing technology, image feature extraction technology, and video frame analysis technology; Perform data analysis on each piece of raw data in the initial data set to obtain an analysis result, and filter each piece of raw data in the initial data set according to the analysis result to obtain target data that meets preset requirements. The data analysis includes comparative analysis, time series analysis, structural analysis, RFM analysis, grouping analysis, and regression analysis; Convert the format of the target data to obtain a JSON-LD format data set including three dimensions of factual elements, legal application, and judgment results. Among them, when the target data is unstructured data, through entity recognition technology, relationship extraction technology, and semantic disambiguation technology, the target data is converted into a JSON-LD format data including three dimensions of factual elements, legal application, and judgment results; Based on the JSON-LD format data set, train an initial large language model for different legal fields according to a preset tuning algorithm to obtain a preset large language model for different legal fields. The preset tuning algorithm includes at least one of LoRA algorithm, SFT algorithm, DPO algorithm, P-Tuning algorithm, RAG-FT algorithm, RLHF algorithm, and KTO algorithm; Construct a preset intelligent agent library according to the preset large language models for different legal fields and the preset function matrices for different categories of information. The preset function matrices include the first matrix based on the semantic parsing engine of BERT-Judicial Edition, the second matrix based on the similarity calculation model integrating spatio-temporal elements, the third matrix based on GPT-4 and the legal format validator, the fourth matrix integrating adversarial debate and evidence chain analysis algorithms, and the fifth matrix based on multi-language legal alignment technology. The initial large language models include the Qwen-14B model for the field of civil disputes, the DeepSeek-legal model for the field of commercial disputes, the ChatGLM3-6B model for the field of criminal defense, and the LawyerLlama model for the field of administrative disputes.

4. The legal service method based on a large language model according to claim 3, wherein The steps of training the initial large language models for different legal fields according to the preset tuning algorithm based on the JSON-LD format dataset to obtain the preset large language models for different legal fields include: Optimize the data ratio in the JSON-LD format dataset through domain term injection to obtain a target JSON-LD format dataset; Based on the target JSON-LD format dataset, train the initial large language models for different legal fields according to the preset tuning algorithm to obtain secondary large language models for different legal fields; Perform dimensional space calibration on the secondary large language models with a cosine similarity greater than 0.85 as the standard to obtain the preset large language models for different legal fields.

5. The legal service method based on a large language model according to claim 3, wherein Before the step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information, it also includes: Integrate the original data into a legal provision library, a judge library, a lawyer library, and a case library according to the source of the original data; Associate the data in the legal provision library, the judge library, the lawyer library, and the case library according to the association index system based on legal elements to obtain multi-dimensional semantic association data with an association density greater than 85%; Adopt a privatized embedding model to construct a unified vector space mapping system for text, images, and videos, extract the feature vectors of the multi-dimensional semantic association data according to the unified vector space mapping system, and establish a preset vector knowledge base based on the feature vectors.

6. The legal service method based on a large language model according to claim 5, wherein The step of querying enhanced information in the preset vector knowledge base through the RAG retrieval technology based on the user request information includes: Parse the user request information to obtain a query feature vector; Calculate the cosine similarity between the query feature vector and the feature vectors in the preset vector knowledge base, identify the feature vectors with a cosine similarity greater than or equal to the cosine similarity threshold with the query feature vector, sort the identified feature vectors according to the cosine similarity to obtain a feature vector queue, and select the first ten feature vectors in the feature vector queue as target feature vectors; Select the document data corresponding to the target feature vectors in the legal provision library, the judge library, the lawyer library, and the case library; Perform legal logic verification on the said document data, exclude the citation of invalid legal provisions, and obtain the target document data; Generate a retrieval report with gist annotations based on the target document data, and use the retrieval report with gist annotations as enhanced information.

7. A legal service method based on a large language model according to claim 1, characterized in that, The said method further includes: When there are at least two preset agents in the preset agent library that meet the said category information and domain information, establish a data transmission channel between the preset agents according to preset rules to enable the sharing of evidence chains between the preset agents; When there are at least two preset agents in the preset agent library that meet the said category information and domain information, and the output results of the preset agents conflict, optimize the output results through a federated learning algorithm to obtain the target result for the user request information.

8. A legal service system based on a large language model, characterized in that, The said system includes: A request receiving module, used to obtain user request information and identify the category information and domain information of the user request information; A selection module, used to select preset agents that meet the said category information and domain information from the preset agent library, and use the preset agents that meet the said category information and domain information as target agents. The target agents include a preset large language model that meets the domain information and a preset function matrix that meets the category information; An execution module, used to input the user request information into the target agent to obtain an initial result; An enhancement module, used to query enhanced information in the preset vector knowledge base based on the user request information through RAG retrieval technology; A display module, used to generate a target result for the user request information based on the enhanced information and the initial result, and display the target result through visualization technology.

9. An electronic device, comprising a memory, a processor, and a first computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the first computer program, it implements the legal service method based on a large language model according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a second computer program, characterized in that, When the second computer program is executed by the processor, it implements the legal service method based on a large language model according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intellectual property and academic assistant system and implementation method and device thereof, electronic equipment and storage medium

    CN119623619A

  • Question and answer method and device based on large language model, electronic equipment and computer program product

    CN119886332A

Cited By

  • Take-out service system and method based on vertical domain large model, and take-out service platform

    CN120612159A

  • Intelligent mediation case analysis method and system based on AI large model

    CN120876172A

  • Intelligent question answering method and device for multi-agent cooperative customer service system, storage medium and related equipment

    CN121072556A

  • Method and system for generating legal reasoning thinking chain data and electronic equipment

    CN121094086A

  • Multi-agent collaborative data question-answering system and method based on large model

    CN121119169A