Law knowledge question and answer method and device based on large model memory, equipment and medium
Patent Information
- Application Number
- CN202611139679.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-08-28
AI Technical Summary
①、许多法律智能问答系统主要依赖大模型的固定上下文窗口保存历史对话,当咨询轮次增加后,早期关键信息容易被截断或遗忘,导致法律智能问答系统无法稳定利用用户此前提供的事实、证据和阶段性结论
(1)本发明所提供的一种基于大模型记忆与动态检索的法律智能问答方法,该方法面向多轮法律咨询和连续问答场景,旨在提升法律智能问答系统对历史信息的组织能力、检索能力和一致性维护能力,解决大语言模型在长周期交互过程中容易出现的历史信息遗漏、上下文割裂以及前后事实不一致等问题。具体的,该方法包括记忆库构建与时效维护机制、动态检索与记忆加载机制、跨时序信息冲突消解与答复生成机制,通过上述阶段的协同处理,系统能够将用户输入中的有效信息转化为结构化记忆单元,并在后续问答中根据当前问题动态召回相关历史记忆,进而结合冲突判定和记忆状态更新生成具有上下文连续性的法律答复。
Smart Images

Figure CN122654293A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of interdisciplinary technology of artificial intelligence and law, and relates to a legal knowledge question-and-answer method, device, equipment and medium based on large model memory. Background Technology
[0002] With the development of large-scale language model technology, legal intelligent question-answering systems are gradually being applied in scenarios such as legal consultation, legal interpretation, contract review, and dispute resolution advice. Compared with traditional legal question-answering systems based on rule or keyword matching, large-scale language models can understand natural language expressions and generate more complete analytical responses, thus having high application value in automated legal services. Especially in multi-round legal consultation scenarios, users often continuously supplement facts, evidence, and processing requests. Legal intelligent question-answering systems need to combine the content of previous and subsequent consultations for continuous analysis, rather than just providing isolated answers to single-round questions.
[0003] However, existing legal intelligent question-answering solutions still have the following obvious shortcomings when handling multi-round, long-term legal consultations: ① Many legal intelligent question-answering systems mainly rely on fixed context windows of large models to save historical dialogues. As the number of consultation rounds increases, key information from the early stages is easily truncated or forgotten, causing the legal intelligent question-answering system to be unable to reliably utilize the facts, evidence and interim conclusions previously provided by users.
[0004] ② While some existing legal intelligent question-answering systems alleviate the problem of lost context by piecing together historical dialogues, this method introduces a large amount of repetitive, low-value, or even outdated information, increasing the input burden on the model and potentially interfering with the generation of subsequent responses.
[0005] ③ Existing legal intelligent question-and-answer systems manage historical information in a coarse-grained manner, often lacking memory unit construction, hierarchical storage, and timeliness maintenance mechanisms for legal consultation scenarios; valid legal information input by users is often not broken down into structured memory objects that can be independently retrieved, updated, and traced, making it difficult for the system to accurately call relevant historical information in subsequent questions and answers, and also difficult to clean up duplicate, expired, or low-relevance content in a timely manner.
[0006] ④ During multiple rounds of consultation, users may continuously revise previous facts or supplement new evidence. For example, a user might state in one round that "no employment contract was signed," but in another round add that "an electronic employment contract was later found." Existing question-and-answer systems often lack the ability to handle cross-temporal information conflicts, easily mechanically using old information or directly accepting new information, resulting in inconsistent responses and even erroneous legal judgments. Therefore, identifying the consistency, supplementation, conflict, or substitution relationships between current input and historical memory, and updating the memory state accordingly, is a key issue in improving the reliability of legal question-and-answer systems.
[0007] In summary, the main problems with existing technologies are: first, the lack of a continuous memory mechanism for multiple rounds of legal consultation makes it difficult to preserve and reuse key historical information in the long term; second, the lack of a dynamic memory retrieval and loading mechanism for current issues makes it easy for historical information to be missed or for redundant context to interfere; and third, the lack of a mechanism for resolving cross-temporal information conflicts and writing back memories makes it difficult to ensure the consistency and traceability of facts in multiple rounds of responses. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention aims to propose a legal intelligent question-answering method based on large-scale model memory and dynamic retrieval. This method constructs standardized memory units, sets up short-term and long-term memory banks, dynamically recalls relevant historical memories based on the current question, and performs conflict determination and status write-back on the current candidate memory and the recalled historical memory before generating the answer. This solves the problems of existing legal question-answering systems, such as the difficulty in continuously utilizing historical information, the easy fragmentation of context, and the easy inconsistency of facts in multiple rounds of consultation.
[0009] This invention provides a legal knowledge question-answering method based on a large model memory, comprising the following steps: S1. Construct a memory bank, including a short-term memory bank. Long-term memory bank and archive area ; Transform valid legal information entered by the user into standardized memory units. ; Based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area And for storage in short-term memory and long-term memory bank Existing memory units in Perform memory updates and timeliness maintenance; S2. Identify the user's intent regarding their current legal inquiry and determine whether the user's current legal inquiry requires understanding based on historical memory; if so, generate a search anchor for the user's current legal inquiry; otherwise, proceed directly to S3. Based on the search anchor points corresponding to the user's current legal consultation question, a recall method is used to retrieve data from the short-term memory. and long-term memory bank China recalls related standardized memory units It is then loaded into the workspace to form a structured context; S3. Determine whether the user input in this round forms a candidate memory unit in S1; if not, do not trigger cross-temporal conflict determination, and directly proceed to the subsequent response generation process; if so, determine the relationship type between the candidate memory unit input in this round and the historical memory already loaded into the work area to form a conflict determination result. The relationship types include consistent, complementary, conflicting, or substitution. Based on the relationship tags between the candidate memory units input by the user in this round and the historical memories already loaded into the work area, determine the response generation strategy for the user input in this round, generate the legal response result for the user input in this round, and write back the memory bank based on the legal response result.
[0010] Furthermore, the valid legal information includes legal facts, evidentiary materials, consultation questions, supplementary explanations, legal basis, and interim conclusions.
[0011] Furthermore, standardized memory units are obtained. The specific process is as follows: S1.11. Preprocess the original interactive text to obtain the preprocessed interactive text; the preprocessing includes noise cleaning, removal of redundant line breaks, duplicate spaces, abnormal characters, and replacement of sensitive entities with standard placeholders. S1.12. Call the large language model and, based on the preset system prompt words, determine the validity of the preprocessed interactive text to obtain valid and invalid legal information; The invalid legal information includes invalid text fragments that only contain small talk, repetitive confirmations, irrelevant expressions, or do not affect legal analysis, and the invalid text fragments are not written into the standardized memory unit; S1.13. Use a large language model to perform semantic compression and standardization on effective legal information to obtain standardized memorized text; S1.14. Label each standardized memory text with a memory type, and encapsulate each standardized memory text with the labeled memory type into a standardized memory unit. .
[0012] Furthermore, the standardized memory unit The types of memory include: factual memory, evidence memory, problem memory, legal basis memory, conclusion memory, and user preference memory; The standardized memory unit The memory states include pending verification, confirmed, and expired.
[0013] Furthermore, based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area The specific process is as follows: The newly generated memory units are written to the short-term memory bank by default. For each standardized memory unit Building a multi-view index To standardize each memory unit The memory is divided into multiple memory units with independent semantics and clear types, including factual memory, evidence memory, and problem memory; the memory units obtained from the division are judged, and if they meet the conditions for migration to the long-term memory bank, they are migrated to the long-term memory bank. Low-frequency, expired, or invalid memory information in the long-term memory bank that still needs to be retained for traceability should be migrated to the archive area.
[0014] Furthermore, the process of judging the memory units obtained from the splitting is as follows: When the A memory unit is moved from the short-term memory bank to the long-term memory bank when all of the following conditions are met: ; in, This indicates that the memory has been confirmed by the user, corroborated by evidence, or confirmed by the system's response process; This indicates that the memory does not conflict with newly added facts, evidence, or legal basis; This indicates that the memory was recalled in at least two rounds of question and answer; Represented as a set of core memory types, and ; When the Even if a memory unit simultaneously meets the following conditions, Similarly, it is migrated from the short-term memory bank to the long-term memory bank: ; The core elements include key subjects, key time, key actions, amount in dispute, evidentiary materials, legal relationships or applicable legal basis.
[0015] Furthermore, for storage in short-term memory and long-term memory bank Existing memory units in The specific process for updating and maintaining memory validity is as follows: Candidate memory units are extracted from user supplementary information and / or the results of this round of responses. ; Based on memory type and confirmation status, the current candidate memory units are... Write the data into a hierarchical memory structure for hierarchical storage, and synchronously record its memory state, generation time, update time, and hierarchical marker; if the current candidate memory unit... If a candidate memory unit has been explicitly confirmed by the user or is supported by clear evidence, then the current candidate memory unit will be... The status is set to "confirmed"; if the current candidate memory unit Further verification is still needed; in that case, the current candidate memory unit will be... The status is set to "Pending Verification"; This candidate memory unit is generated or updated synchronously. Dense semantic vectors, sparse lexical features, and sets of legal entities; Let the memory units already stored in the Long Short-Term Memory (LSTM) architecture be called existing memory units. ; For candidate memory units With existing memory units Perform repeated testing; When candidate memory units With existing memory units Candidate memory units will be selected if the following conditions are met simultaneously. With existing memory units Merge the memories while preserving the original memory ID, source round number, and update time: ; ; ; in, Represented as candidate memory units With existing memory units The memory type labels are the same, belonging to the same memory type, such as fact memory, evidence memory, or conclusion memory; ; Represented as candidate memory units With existing memory units Semantic similarity between them; Represented as existing memory units Dense semantic vectors; Represented as candidate memory units Dense semantic vectors; Represented as candidate memory units With existing memory units Cosine similarity between them The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer they are in semantic similarity; Represented as candidate memory units With existing memory units The degree of overlap between legal entities and factual elements, Represented as existing memory units The collection of legal entities and factual elements in the text Represented as candidate memory units The collection of legal entities and factual elements in the text The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer the facts and legal elements involved; If candidate memory units With existing memory units If the candidate memory units are similar but do not meet the criteria for duplicate merging, then... Retained as an independent memory unit; Perform timely maintenance on the short-term memory and long-term memory according to the preset cycle.
[0016] Furthermore, the specific process of S2 is as follows: S2.1 Receive the user's current legal consultation question and identify its intent to determine whether the user's current legal consultation question needs to be understood in conjunction with historical memory; if so, construct a query for the user's current legal consultation question to obtain a rewritten search query question; if not, do not actively load historical memory and directly proceed to S3. S2.2. Generate search anchors based on the user's current legal consultation question or the rewritten search query question. ; S2.3, Based on the search anchor points corresponding to the user's current legal consultation question. A hybrid recall approach is employed, simultaneously performing semantic vector recall, keyword recall, and legal entity recall to retrieve relevant memory units from both short-term and long-term memory banks. The results from these different recalls are then fused and ranked to obtain the candidate memory set most relevant to the current problem. ; S2.4, on the candidate memory set Perform a fusion sort to obtain a fusion score. Score selection based on fusion score Select the top-scoring memories to form a set of memories to be loaded. ; S2.5, Load the memory set to be loaded. Load the content into the current workspace and assemble it into a large language model input according to the preset prompt word structure to form a structured context.
[0017] Furthermore, obtain the candidate memory set. The specific process is as follows: Based on the search anchor points corresponding to the user's current legal consultation question From short-term memory and long-term memory bank Standardized memory units related to the recall ; Set time The active memory set that can participate in the default search is ; Based on retrieval anchor points Query semantic vectors Perform semantic vector recall to obtain semantic vector recall results. ; Based on retrieval anchor points Lexical features in Perform keyword recall and obtain keyword recall results. ; Based on retrieval anchor points The set of legal entities and factual elements in Execute entity recall and obtain entity recall results. ; semantic vector recall results Keyword recall results And the results of the physical recall Merging and deduplication are performed to obtain a candidate memory set. .
[0018] Furthermore, the specific process of S2.5 is as follows: Load the relevant memories obtained from the screening into the current workspace; The recall results are organized into zones based on memory type and memory state: confirmed fact memories are loaded into the relevant fact zone; evidence memories are loaded into the evidence material zone; legal basis memories or historical conclusion memories are loaded into the existing legal basis or historical conclusion zone; memories in the pending verification or conflict-marked state are loaded into the pending verification or conflict information zone, and the prompt explicitly requires the large language model not to use them directly as confirmed facts; expired memories are not loaded into the working area by default. The content of the workspace is concatenated into the input of the large language model according to the preset prompt word structure, which serves as the structured context for S3.
[0019] Furthermore, the specific method for determining whether the user input in this round forms a candidate memory unit in S1 is as follows: If the user input in this round is only an independent legal consultation question and does not form new factual memory, evidentiary memory, legal basis memory, or conclusion memory, then the cross-temporal conflict judgment will not be triggered, and the process will directly proceed to the subsequent response generation process. If the user input in this round contains new facts, evidence, revised explanations, or interim conclusions, and has been converted into a candidate memory unit by S1, then the relationship type between this candidate memory unit and the historical memories already loaded into the work area is determined, and a conflict determination result is obtained. The relationship types include consistent, complementary, conflicting, or replacement.
[0020] Furthermore, the conflict determination result is obtained. The specific process is as follows: Let the candidate memory units input by the user in this round be... The historical memory unit recalled and loaded by S2 is ; For candidate memory units and historical memory unit Perform semantic similarity overlap with legal entities Initial screening; when or When that happens, then determine the candidate memory unit. With historical memory unit There is a connection between them, and further relationship determination is needed; For memory pairs that pass the initial screening, the large language model is invoked to output candidate memory units based on candidate memory texts, historical memory texts, memory types, memory states, and legal entity sets. With historical memory unit Relationship tags ; Based on candidate memory units With historical memory unit Relationship tags are used to form conflict determination results. .
[0021] Furthermore, the specific process of determining the response generation strategy based on user input in this round and writing the processing results back to the memory is as follows: Based on the conflict determination results Based on candidate memory units With historical memory unit Relationship tags Different response strategies are chosen based on the value of the response. When the credibility of conflicting information cannot be determined based on existing information, a supplementary inquiry is triggered. Based on memory status and conflict markers Filter available information; Based on the screening results, a legal response will be generated; The memory is written back based on the results of this round of conflict resolution.
[0022] Furthermore, the specific response strategy is as follows: When the relationship label is consistent, the processing method is that the current input is consistent with the historical memory content, and the response strategy is that the response can be generated directly based on the workspace content; When the relationship label is supplementary, the processing method is to improve the historical memory based on the current input, and the response strategy is to add the supplementary information to the workspace and then generate a response. When the relationship label is conflicting, the handling method is that there is an inconsistency between the current input and the historical memory. The response strategy is not to directly accept the conflicting information, but to generate a response with conditional explanations or supplementary questions. When the relationship label is "substitution", the processing method is that the current input may update or negate the historical memory, and the response strategy is to combine user confirmation, evidence support and information time to determine whether to replace the old memory.
[0023] Furthermore, supplementary inquiries are applicable in the following situations: ① There is a conflict between the current input and historical memory, but it is impossible to determine which piece of information is more reliable; ② The candidate memories involve key facts, but lack necessary elements such as time, subject, amount, and content of evidence; ③ The candidate memory may replace the old memory, but it has not yet been confirmed by the user or supported by evidence; ④ The preconditions upon which historical conclusions are based have changed and need to be reconfirmed.
[0024] Furthermore, memory state The specific handling methods are as follows: When the memory state is In such cases, the handling method is that it can be used as a basis for the reply; When the memory state is In such cases, the approach is to use it only as a risk warning or as a basis for supplementary inquiries; When the memory state is In such cases, the appropriate action is to not participate in the generation of this round of responses; When the memory state is In such cases, the approach is to not use them as definitive facts, but only to illustrate uncertainty.
[0025] As a further aspect of the present invention, the present invention also provides a legal knowledge question-answering device based on large model memory, used to implement the legal knowledge question-answering method based on large model memory as described above, the device comprising: The memory bank construction and timeliness maintenance module is used to construct the memory bank, preprocess the received legal consultation content from users, extract valid legal information and convert it into standardized memory units, store the memory units in the short-term memory bank, long-term memory bank or archive area, and perform preset maintenance operations on the memory bank. Dynamic retrieval and memory loading module: This module is used to identify the intent of users' legal consultation content. For memory units that need to be understood in conjunction with historical memory, it sequentially performs query construction, hybrid recall, fusion sorting, and workspace loading to generate candidate memory units and input them into the conflict resolution and response generation module. Memory units that do not need to be understood in conjunction with historical memory are directly input into the conflict resolution and response generation module to generate responses. Conflict resolution and response generation module: Determines the relationship type between candidate memory units and historical memories in the working area, processes the information in the candidate memory units based on the relationship type and adds it to the working area, generates legal responses based on the processed content of the working area, and writes the incremental information of this round back to the memory bank.
[0026] As a further aspect of the present invention, the present invention also provides an electronic device, including a memory, one or more processors, and one or more programs stored in the memory, said one or more programs including instructions for executing the legal knowledge question-and-answer method based on large model memory as described above.
[0027] As a further aspect of the present invention, the present invention also provides a storage medium including one or more programs executable by one or more processors of an electronic device, said one or more programs including instructions for performing the legal knowledge question-and-answer method based on large model memory as described above.
[0028] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention provides a legal intelligent question-answering method based on large model memory and dynamic retrieval. This method is designed for multi-round legal consultation and continuous question-answering scenarios, aiming to improve the legal intelligent question-answering system's ability to organize, retrieve, and maintain consistency of historical information, and to solve problems such as historical information omission, context fragmentation, and inconsistency of facts that easily occur in long-cycle interaction of large language models. Specifically, the method includes a memory bank construction and timeliness maintenance mechanism, a dynamic retrieval and memory loading mechanism, and a cross-temporal information conflict resolution and response generation mechanism. Through the collaborative processing of the above stages, the system can transform the effective information in the user input into structured memory units, and dynamically recall relevant historical memories according to the current question in subsequent question-answering, and then generate legal responses with contextual continuity by combining conflict determination and memory state updates.
[0029] (2) This invention has the ability to improve the utilization of historical information in multiple rounds of legal consultation; specifically: This advantage primarily stems from the memory bank construction and time-sensitive maintenance mechanism described in the first phase. Existing legal Q&A systems typically rely on fixed context windows to store historical dialogues. As the number of consultation rounds increases, problems such as omissions of historical facts, duplicate input, and contextual fragmentation easily arise. This invention does not directly store complete dialogues. Instead, it transforms legal facts, evidence materials, consultation questions, supplementary explanations, legal basis, or interim conclusions from user consultations into searchable and updatable memory units, and manages them hierarchically through short-term memory, long-term memory, and an archive area. Therefore, the system can continuously retain key legal information during long-term consultations, while reducing interference from low-value, repetitive, or outdated information in subsequent Q&A sessions.
[0030] (3) The present invention improves the accuracy and relevance of historical memory recall; specifically: This advantage primarily stems from the dynamic retrieval and memory loading mechanism described in the second phase. Existing technologies often employ simple historical dialogue splicing or single-path retrieval, easily introducing a large amount of irrelevant content, leading to redundant information occupying the large model's context. This invention, before generating a response, first determines whether the current question requires activating historical memory, and if necessary, performs a hybrid recall through query rewriting, semantic vector retrieval, keyword retrieval, and legal entity matching, before loading the relevant memory into the working area. This avoids the mechanical splicing of complete historical dialogues, allowing the model to analyze only facts, evidence, and historical conclusions relevant to the current question, thereby improving retrieval relevance and response efficiency.
[0031] (4) This invention improves the consistency and reliability of the response results; specifically: This advantage primarily stems from the cross-temporal information conflict resolution and response generation mechanism described in the third stage. Existing question-and-answer systems tend to continue using old information or directly accept new information when users subsequently supplement or correct facts, leading to contradictory responses. Before generating a response, this invention determines the relationship between the candidate memories formed by the current input and the historical memories recalled in this round, identifying consistency, supplementation, conflict, or substitution relationships. For information that cannot be directly confirmed, the system can initiate supplementary inquiries and write back the memory state after the response. This avoids old, contradictory, or unverified information being directly used as established facts, improving the stability, accuracy, and traceability of legal responses.
[0032] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description
[0033] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart illustrating a legal knowledge question-and-answer method based on large model memory in Embodiment 1 of the present invention; Figure 2 yes Figure 1 A flowchart of S1 in the middle; Figure 3 yes Figure 1 A flowchart of the S2 process; Figure 4 yes Figure 1 A flowchart of the S3 process; Figure 5 This is a schematic diagram illustrating the implementation of a legal knowledge question-and-answer method based on large model memory in Embodiment 1 of the present invention. Detailed Implementation
[0034] To make the above-mentioned objects, features, and advantages of the present invention clearer and easier to understand, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the accompanying drawings of the present invention are all in a simplified form and use non-precise proportions, and are only used to facilitate and clearly illustrate the implementation of the present invention.
[0035] Example 1: See Figures 1 to 5 As shown in the figure, the legal intelligent question answering method based on large model memory and dynamic retrieval provided in this embodiment includes the following steps: S1. Construct a memory bank, including a short-term memory bank. Long-term memory bank and archive area The short-term memory bank Used to store recently generated, not yet fully verified, or potentially changing information; the long-term memory The archive area is used to store confirmed, repeatedly accessed information that continuously supports the main line of legal consultation; Used to store low-frequency, expired, or invalid information that still needs to be kept for traceability; Transform valid legal information entered by the user into standardized memory units. ; Based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area And for storage in short-term memory and long-term memory bank Existing memory units in Perform memory updates and timeliness maintenance.
[0036] Preferably, the valid legal information includes legal facts, evidentiary materials, consultation questions, supplementary explanations, legal basis, and interim conclusions.
[0037] Preferred, standardized memory units are obtained. The specific process is as follows: S1.11. Preprocess the original interactive text to obtain the preprocessed interactive text; the preprocessing includes noise cleaning, removal of redundant line breaks, repeated spaces, abnormal characters, and replacement of sensitive entities with standard placeholders, aiming to transform unstructured natural language into searchable, storable, and updatable standardized memory text. S1.12. Call the large language model and, based on the preset system prompt words, determine the validity of the preprocessed interactive text to obtain valid and invalid legal information; The invalid legal information includes text that contains only small talk, repetitive confirmations, irrelevant expressions, or does not affect legal analysis, and the invalid text fragments are not written into the standardized memory unit; S1.13. Use a large language model to perform semantic compression and standardization on effective legal information to obtain standardized memorized text; S1.14. Label each standardized memory text with a memory type, and encapsulate each standardized memory text with the labeled memory type into a standardized memory unit. .
[0038] Further optimized, standardized memory units The expression is as follows: ; in, This represents a unique identifier for a memory unit; This is represented as the cleaned, desensitized, and standardized rewritten memory text; Represented as a dense semantic vector generated by the embedding model; It is represented by sparse word features such as keywords, legal terms, dates, amounts, and evidence names; It is represented as a set of legal entities and factual elements; Represented as a memory type label; This is represented as a memory state, including pending verification, confirmed, and expired; This represents the number of historical calls; This is represented by the time of the most recent call; This is represented as the creation time or most recent update time of the memory cell; Indicated as a conflict marker; when A value of 0 indicates that no conflict was found; when A value of 1 indicates that the memory conflicts with newly added facts, evidence, or legal basis; It represents a memory hierarchy marker, including short-term memory, long-term memory, and archived memory.
[0039] Preferably, the preprocessing process for the original interactive text is as follows: S1.21. Perform noise cleaning on the original interactive text, remove redundant line breaks, duplicate spaces and abnormal characters to obtain the initial pre-processed interactive text; S1.22. Considering that the original interactive text may contain sensitive information such as personal names, organization names, addresses, and contact information, the Named Entity Recognition (NER) model is further called to identify sensitive entities in the initial preprocessed interactive text and replace them with standard placeholders to obtain the preprocessed interactive text. This embodiment cleanses and desensitizes the original interactive text to protect user privacy while preserving entity relationships, syntactic structures, and contextual references in the original text.
[0040] More preferably, in this embodiment, the specific method of calling the named entity recognition model to identify sensitive entities and replacing them with standard placeholders is as follows: replacing specific person names with... Replace the organization name with Replace the address information with .
[0041] Preferably, the standardized memory text includes several pieces of semantically complete and independently understandable information.
[0042] The specific process for further optimization to obtain standardized memory text is as follows: S1.31. Call the Large Language Model (LLM) and, based on the preset system prompts, determine the validity of the preprocessed interactive text to obtain valid and invalid text fragments. The valid legal information includes legal facts, evidentiary materials, consultation questions, supplementary explanations, legal basis, and interim conclusions; The invalid text fragments are used to continue performing semantic compression and memory unit construction; the invalid text fragments include fragments containing only small talk, repetitive confirmations, irrelevant expressions or that do not affect legal analysis, and the invalid text fragments are not written into the standardized memory unit; S1.32. Use a large language model to perform semantic compression and standardization on effective text fragments to obtain standardized memory text.
[0043] More preferably, in this embodiment, the semantic compression is not a simple truncation of valid text segments, but rather a screening, extraction, normalization, and rewriting of valid legal information within the valid text segments. The specific process includes: The referential meanings of "he," "this company," and "the other party" are neutralized. Time normalization is performed on relative times such as "yesterday", "last month", and "the day after leaving the company"; Extract legal elements such as subject, time, behavior, amount, evidence, rights and obligations, and user demands; The lengthy, colloquial, or mixed narratives are broken down into several semantically complete and independently comprehensible standardized memory texts.
[0044] Preferably, the standardized memory unit The types of memory include: factual memory, evidence memory, problem memory, legal basis memory, conclusion memory, and user preference memory; The factual memory is used to record factual information in legal consultations, such as start date, contract signing details, payment behavior, and tortious acts. The evidence memory is used to record evidentiary materials, such as contract texts, chat logs, transfer vouchers, audio and video recordings, etc. The question memory is used to record the user's inquiry intent, such as whether compensation can be claimed, whether arbitration can be applied for, and whether the contract can be terminated; The legal basis memory is used to record the regulations, judicial interpretations, or case rules that have been obtained; The conclusion memory is used to record the stage judgments or processing suggestions that the system has generated; The user preference memory is used to record users' stable preferences in terms of response format, processing path, or risk preference.
[0045] Preferably, the standardized memory unit The memory states include pending verification, confirmed, and expired.
[0046] Further preferred, based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area The specific process is as follows: The newly generated memory units are written to the short-term memory bank by default. For each standardized memory unit Building a multi-view index To standardize each memory unit The memory is divided into multiple memory units with independent semantics and clear types, including factual memory, evidence memory, and problem memory. The memory units obtained from the division are judged, and if they meet the conditions for migration to the long-term memory bank, they are migrated to the long-term memory bank. This embodiment, through the joint construction of dense semantic index, sparse lexical index, and structured entity index, can simultaneously support semantic approximate matching, keyword exact matching, and conditional filtering, thereby improving the accuracy of subsequent historical memory retrieval and providing a structured foundation for subsequent processes. Low-frequency, expired, or invalid memory information in the long-term memory bank that still needs to be retained for traceability will be migrated to the archive area. Get at the moment The overall memory set is ; At any moment Overall memory collection The expression is as follows: ; in, Represented as a short-term memory bank, It primarily stores newly generated valid legal information from the current input, recently added content by the user, unconfirmed intermediate information, and information that still requires further verification. Emphasis is placed on fast writing, instant access, and dynamic correction; Represented as long-term memory, It primarily preserves the confirmed core consultation facts, stable evidentiary materials, confirmed applicable legal basis, and interim conclusions reached through multiple rounds of questioning and answering. Emphasis should be placed on cross-round reuse and maintaining the main consulting theme; This is designated as the archive area. It primarily stores low-frequency, expired, invalid, or historically valuable memories, and does not participate in subsequent question-and-answer generation by default. Furthermore, the smallest object stored in each short-term memory bank and each long-term memory bank is a standardized unit of memory. .
[0047] Further optimized, multi-view index The expression is as follows: ; in, Used for semantic similarity retrieval Used for BM25 keyword retrieval. It is used for entity matching retrieval based on structured conditions such as time, subject, and evidence type.
[0048] Specifically, let's consider a user input: "I joined a Beijing-based tech company owned by Li Si in May 2023. The company never signed a labor contract with me, and now in March 2024, they've notified me of my termination. I have salary transfer records and WeChat chat logs. Can I claim double wages as compensation?" This original input can be broken down into multiple memory units, one of which... It can be represented as: " ": "MEM_202403_0001", " The user joined [ORG_1] in May 2023, but [ORG_1] did not sign a written employment contract with the user. " ": [0.021, -0.137, 0.084, "...", 0.056], " ["May 2023", "Joined", "No signed employment contract", "Written employment contract", "[ORG_1]"], " {"Timeframe": "May 2023","Subjects Involved": "[ORG_1]","Legal Act": "Employment without a written employment contract","Key Facts": "Employment relationship existed but no written employment contract was signed"}, " ": "Factual Memory", " ": "Pending verification", " ": 0, " null, " ": "2024-03-XX", " ": 0, " Short-term memory
[0049] The above describes factual memory units extracted from user input. In addition, the same user input, such as "I have salary transfer records and WeChat chat history," can be broken down into evidence memory units, and "Can I claim double salary compensation?" can be broken down into question memory units. Both are stored using the same tuple structure. Through this processing, a complex legal consultation is not stored as a single long text, but rather broken down into multiple memory units with independent semantics and clear types, such as factual memory, evidence memory, and question memory, thus providing a structured foundation for subsequent processes.
[0050] Preferably, the process of judging the memory units obtained from the splitting is as follows: When the A memory unit is moved from the short-term memory bank to the long-term memory bank when all of the following conditions are met: ; in, This indicates that the memory has been confirmed by the user, corroborated by evidence, or confirmed by the system's response process; This indicates that the memory does not conflict with newly added facts, evidence, or legal basis; This indicates that the memory was recalled in at least two rounds of question and answer; Represented as a set of core memory types, and In other words, only memories that have been confirmed, are conflict-free, have been accessed at least twice, and belong to the core type are allowed to enter the long-term memory bank by default. In this embodiment, this rule can prevent unconfirmed or low-value information from being prematurely solidified. For certain key memories with significant lasting value, further priority migration rules are set; when the first Even if a memory unit simultaneously meets the following conditions, Similarly, it is migrated from the short-term memory bank to the long-term memory bank: ; The core elements include key parties, key times, key actions, the amount in dispute, evidentiary materials, and legal relationships or applicable grounds. This rule ensures that key information that provides continuous support for subsequent consultations is retained in a timely manner. For example, in a labor dispute consultation scenario, when a user first enters "I joined a company in May 2023, but the company has never signed a labor contract with me," the system breaks this content down into factual memories and writes it into the short-term memory bank. Subsequently, if the user continues to supplement information such as salary transfer records, WeChat chat records, and departure time, the system continues to save the relevant content as short-term memory. If the user subsequently confirms that the above information is correct, and these memories are repeatedly called in issues such as compensation calculation or evidence analysis, the system determines that they meet the conditions for long-term migration and migrates them to the long-term memory bank.
[0051] Through the aforementioned design of long and short-term memories and migration conditions, memories with different levels of stability and different uses can be stored in layers. On the one hand, the short-term memory ensures that the system can receive and correct new content added by users in a timely manner; on the other hand, the long-term memory ensures that the system can continuously reuse key information in multiple rounds of legal consultation; the archive area is used to store low-frequency or expired information, reducing its interference with subsequent retrieval and response generation.
[0052] Preferably, for storage in short-term memory and long-term memory bank Existing memory units in The specific methods for updating and maintaining memory validity are as follows: To ensure that the content in the Long Short-Term Memory (LSTM) architecture can be continuously updated as users supplement information, respond to results, and use the database over a long period of time, this embodiment also sets up a memory update and timeliness maintenance mechanism. This mechanism is mainly responsible for operations such as adding candidate memories to the database, merging duplicate memories, synchronizing indexes, archiving low-value memories, and updating call records, in order to maintain the simplicity, searchability, and traceability of the database.
[0053] Specifically, for inconsistencies in information or memory substitution that occur during subsequent question-and-answer sessions, the system will further process these issues using the following cross-temporal conflict resolution mechanisms at different stages after the relevant memories are recalled and entered into the working area: S1.41, Candidate memory entry and index update; When candidate memory units are extracted from user input, supplementary explanations, or the results of the current round of responses Then, based on the memory type and confirmation status, it is first written into a hierarchical memory structure for hierarchical storage; for newly generated factual memories, evidence memories, problem memories, or conclusion memories, they are written into the short-term memory bank by default, and their memory status, generation time, update time, and hierarchical marker are recorded synchronously; if a candidate memory unit If a memory has been explicitly confirmed by the user or is supported by clear evidence, its status can be set to "Confirmed"; if the memory still needs further verification, its status can be set to "Pending Verification".
[0054] After a memory is written, the system synchronously generates or updates the candidate memory unit. The dense semantic vectors, lexical sparse features, and legal entity sets enable them to be invoked by subsequent semantic retrieval, keyword retrieval, and entity matching retrieval. If a user provides supplementary information about a memory later, the text content, entity set, update time, and index information of that memory can be updated.
[0055] S1.42, Repeated memory merging; Let the memory units already stored in the Long Short-Term Memory (LSTM) architecture be called existing memory units. ; To reduce the problem of repetitive accumulation of similar expressions in multiple rounds of legal consultation, candidate memory units are... With existing memory units Duplicate detection is performed. The purpose of this detection is to identify duplicate or near-duplicate information, not to resolve conflicts. If a candidate memory is highly consistent with an existing memory in terms of memory type, semantic content, and legal entity, the system can merge them into a more concise and comprehensive memory.
[0056] Preferably, when candidate memory units With existing memory units The duplicate merging process is triggered when all of the following conditions are met: ; ; ; in, Represented as candidate memory units With existing memory units The memory type labels are the same, belonging to the same memory type, such as fact memory, evidence memory, or conclusion memory; ; Represented as candidate memory units With existing memory units Semantic similarity between them; Represented as existing memory units Dense semantic vectors; Represented as candidate memory units Dense semantic vectors; Represented as candidate memory units With existing memory units Cosine similarity between them The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer they are in semantic similarity; Represented as candidate memory units With existing memory units The degree of overlap between legal entities and factual elements, Represented as existing memory units The collection of legal entities and factual elements in the text Represented as candidate memory units The collection of legal entities and factual elements in the text The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer the facts and legal elements involved, the better.
[0057] When the above conditions are met simultaneously, the two memories are considered to be repetitive or nearly repetitive expressions, and the large language model is used to merge them into a single, more concise, and semantically complete comprehensive memory. At the same time, the original memory ID, source round, and update time are retained to support subsequent retrieval. For example, if expressions such as "the company did not sign a labor contract with me," "the company has never signed a paper contract with me," and "no written labor agreement was signed after I joined the company" appear in multiple rounds of consultation, the system can merge them into "the user claims that no written labor contract was signed with the employer after joining the company." This method can reduce the interference of repetitive memories on subsequent retrieval and prompt word concatenation while preserving core facts.
[0058] If candidate memory units With existing memory units If two elements are similar but do not meet the conditions for repeated merging, they will not be forcibly merged at this stage, nor will their existence be directly determined. Instead, they will be retained as independent memory units and will be further processed by the cross-temporal conflict resolution mechanism after they are recalled and entered into the working area in subsequent question-and-answer sessions.
[0059] S1.43, Memory expiration and retrieval record maintenance; The short-term memory and long-term memory are maintained periodically according to a preset cycle. Specifically, in this embodiment, the preset cycle is set as follows: a lightweight maintenance is performed after every 10 rounds of dialogue, and a full maintenance is performed daily or after each consultation session.
[0060] For short-term memories that have not been accessed for 10 consecutive rounds or have been generated for more than 7 days but have not been confirmed, their retrieval priority will be reduced; for those that have not been confirmed or accessed for more than 30 days, they will be moved to the archive area. For memories in the long-term memory that have not been accessed for more than 90 days, perform summary compression. Items that have not been accessed for more than 180 days in the long-term memory and are no longer relevant to the current consultation topic will be moved to the archive area. For expired memories, they are excluded from the default retrieval candidate set and retained only for tracing purposes.
[0061] Preferably, when a memory cell is retrieved and actually loaded into the work area to participate in response generation, its call count and most recent call time are updated using the following formula: ;
[0062] in, This represents the number of historical calls to the current memory unit. This represents the time of the most recent access to the current memory unit. This is represented by the current time. It should be noted that only memories that actually enter the work area and participate in the response generation will have their call count updated; memories that are only retrieved but not loaded will not have their call count updated.
[0063] Through the above mechanism, this embodiment can continuously maintain the quality of the memory bank during long-term operation, reduce the accumulation of redundant memories and low-value information, ensure the retrieval, reusability and traceability of the memory content, and provide a stable foundation for subsequent dynamic retrieval and cross-temporal conflict resolution.
[0064] S2, Dynamic Retrieval and Memory Loading: Identify the user's intent for their current legal consultation question and determine whether it requires understanding based on historical memory. If so, generate a retrieval anchor for the user's current legal consultation question; otherwise, proceed directly to S3. Based on the search anchor points corresponding to the user's current legal consultation question, a recall method is used to retrieve data from the short-term memory. and long-term memory bank China recalls related standardized memory units It is then loaded into the workspace to form a structured context.
[0065] Preferred, see Figure 3 As shown, the specific process of S2 is as follows: S2.1 Receive the user's current legal consultation question and identify its intent to determine whether the user's current legal consultation question needs to be understood in conjunction with historical memory; if so, construct a query for the user's current legal consultation question to obtain a rewritten search query question; if not, do not actively load historical memory and directly proceed to S3. S2.2. Based on the user's current legal consultation question or the rewritten search query question, generate search anchors to describe the user's current legal consultation question from three perspectives: semantics, lexicality, and entity. This will convert the user's natural language input into a query representation suitable for retrieval, providing input for subsequent memory-mixed retrieval and workspace loading. S2.3. Based on the search anchor points corresponding to the user's current legal consultation question, a hybrid recall method is adopted, simultaneously performing semantic vector recall, keyword recall, and legal entity recall to retrieve relevant memory units from the short-term memory bank and long-term memory bank; and the different recall results are merged and ranked to obtain the candidate memory set most relevant to the current question. ; S2.4, on the candidate memory set Perform a fusion sort to obtain a fusion score. Score selection based on fusion score Select the top-scoring memories to form a set of memories to be loaded. ; S2.5, Load the memory set to be loaded. Load the content into the current workspace and assemble it into a large language model input according to the preset prompt word structure to form a structured context; Unlike directly piecing together complete historical dialogues, this stage uses steps such as memory retrieval triggering, query construction, hybrid recall, fusion sorting, and workspace loading to select only key memory content relevant to the current question, thereby improving the efficiency of historical memory utilization and reducing interference from irrelevant content in response generation.
[0066] Preferably, the user's current legal consultation question can be the original question or a series of follow-up questions.
[0067] Preferably, the work area refers to a context organization area temporarily constructed before the generation of a single round of legal responses, used to hold the user's current question and related historical memories.
[0068] Preferably, the specific process of S2.1 is as follows: The large language model is invoked to identify the user's intent regarding the current legal consultation question, determining whether the input requires integration with historical memory for understanding. If the user's current legal consultation question is a relatively independent general legal knowledge consultation and can be fully understood without relying on historical input, then historical memory is not actively loaded; instead, the subsequent response generation process (i.e., S3) is initiated based on the user's current legal consultation question. If the current legal consultation question contains historical context-dependent information, the large language model outputs a judgment result indicating that historical memory needs to be activated, and the historical memory retrieval process is initiated. Among them, historical context-dependent information is used to indicate situations where a user's current legal consultation question requires the combination of previous consultation content, historical facts, relevant parties, legal relationships, or contextual references to be fully understood.
[0069] Preferably, the specific process of S2.2 is as follows: S2.2.1 After triggering historical memory retrieval, the system constructs a query for the user's current legal consultation question. If the user's current legal consultation question is complete, the system directly generates a retrieval query based on the user's original question. If the user's current legal consultation question contains omissions, references, or contextual dependencies, the system calls the large language model to rewrite the query. This rewriting is only used for subsequent memory retrieval and does not replace the user's original question. For example, when the user enters "Can I still claim double wages?", the system can rewrite it as "The user inquires whether they can claim double wages as compensation when there is an employment relationship but the employer has not signed a written employment contract."
[0070] S2.2.2 Generate search anchors based on the current problem or the rewritten search query. ; Search anchor The expression is as follows: ; in, This represents the semantic vector of the query after rewriting the user's current legal consultation question; This refers to the lexical features such as keywords, legal terms, time, amount, and evidence names that represent the user's current legal consultation question or the rewritten search query. It is represented as a set of legal entities and factual elements.
[0071] Preferably, the specific process of S2.3 is as follows: S2.3.1, Based on the search anchor points corresponding to the user's current legal consultation question. From short-term memory and long-term memory bank Standardized memory units related to the recall ; S2.3.2. Since a user's current legal consultation question may rely on semantically similar historical descriptions, or on specific legal terms, time, amount, evidence, or subject information, a hybrid recall method is adopted. This method simultaneously performs semantic vector recall, keyword recall, and legal entity recall, and merges and ranks the results of different recalls to obtain the candidate memory set most relevant to the current question. The specific method is as follows: Set time The active memory set that can participate in the default search is ; time The active memory set that can participate in the default search is The expression is as follows: ; in, Represented as the first One memory unit, Represented as the first The memory state of each memory unit; Archived memories are not included in the active search scope by default, and are only invoked when users inquire about historical processes or when the system performs tracing.
[0072] S2.3.3, Based on retrieval anchor points Query semantic vectors Perform semantic vector recall to find historical memories that are semantically similar to the current question; Semantic vector recall results The expression is as follows: ; ; in, Represents a semantic vector for the current question or rewritten query; Represented as the first Memory unit semantic vector; Represented as and Cosine similarity between them; This means selecting the top-scoring candidates based on semantic similarity. A memory; This recall method is applicable to retrieving historical information with different expressions but similar meanings, such as associating "no labor contract signed" with "no written labor agreement concluded".
[0073] S2.3.4, Based on retrieval anchor points Lexical features in Perform keyword recall to match precise expressions such as legal terms, time, amount, and evidence name; Keyword Recall Results The expression is as follows: ; ; in, Represented as the first Memory unit lexical features; This is represented as the keyword matching score between the current question and the memory unit; Indicated as according to The scores are selected from those ranked higher. A memory; This recall method is applicable to retrieving historical memories containing specific dates, amounts, legal terms, or evidence names.
[0074] S2.3.5, Based on retrieval anchor points The set of legal entities and factual elements in Entity recall is used to locate memory units involving the same subject, the same time point, the same evidence, or the same legal relationship. The degree of overlap between the current problem and the memory unit The expression is as follows: ; in, Represented as the first Memory unit The collection of legal entities and factual elements in the text Represented as and The number of shared entities or elements Represented as and The total number of all entities or elements.
[0075] Entity recall results The expression is as follows: ; ; in, This indicates that the top-scoring entities are selected based on their degree of overlap. A memory; This recall method is applicable to retrieving historical memories involving the same persons, institutions, times, amounts, contractual relationships, evidentiary materials, or legal relationships.
[0076] S2.3.6, Recall Results of Semantic Vectors Keyword recall results And the results of the physical recall Merging and deduplication are performed to obtain a candidate memory set. ; Candidate memory set The expression is as follows: ; in, This indicates a deduplication operation; When deduplicating, we can make judgments based on memory unit number, memory text similarity, and legal entity overlap to avoid the same fact, the same evidence, or the same interim conclusion being added to the candidate set repeatedly.
[0077] Preferably, the specific process of S2.4 is as follows: S2.4.1. The RRF ranking fusion method is used to integrate the ranking results of different recall paths to optimize the candidate memory set. Perform a fusion sort to obtain the first... Memory unit Fusion score ; Fusion score The expression is as follows: ; in, This is represented as a recall path, including semantic recall. Keyword Recall and physical recall ; Represented as the first Memory unit In the The sorting position in the recall results; This represents a smoothing parameter used to reduce the impact of ranking fluctuations in a single recall path on the final score. Furthermore, if a memory unit does not appear in a particular recall result, that path will not participate in its fusion score calculation. The higher the fusion score, the more likely that memory should be prioritized as a candidate memory.
[0078] S2.4.2. Based on memory state and memory type, select candidate memory sets. Perform a screening; specifically, screen the candidate memory set. Factual memories, evidentiary memories, legal basis memories, and conclusion memories that are in the "confirmed" state have a higher retention priority; for candidate memory sets... Memories in the "pending verification" state or marked with conflict can be retained as cue information, but not used directly as definitive facts; for candidate memory sets Memory entries with a status of "invalid" are not included in the candidate loading results by default.
[0079] S2.4.3. Based on the fusion sorting results, select several memories with the highest scores to form a set of memories to be loaded after fusion sorting and state filtering. ; Memories to be loaded The expression is as follows: ; ; in, This represents the selection of the top-ranked memories based on their fusion scores; the set of memories to be loaded. This will serve as input for subsequent workspace design and prompt loading.
[0080] By combining the above-mentioned memory hybrid recall and fusion sorting mechanism, and integrating three types of signals—semantic similarity, keyword matching, and legal entity matching—the most relevant memory units to the current problem are selected from the short-term memory bank and the long-term memory bank. This avoids missed or false recalls caused by relying on a single retrieval method and provides candidate memory content for subsequent work area construction.
[0081] Preferably, the specific process of S2.5 is as follows: S2.5.1 Load the relevant memories obtained from the filtering into the current workspace; The work area is a context organization area temporarily constructed by the system before the generation of a single round of legal responses, used to hold the user's current question and related historical memories.
[0082] The working area differs from the short-term memory and long-term memory. It is not used to store data for a long time, but is dynamically generated based on the current question before each response is generated and released after the current round of responses is completed. If new valid facts, interim conclusions or user-supplemented information are generated in the current round of interaction, they are written back to the corresponding memory by the memory update mechanism of Phase 1.
[0083] S2.5.2 During the work area loading process, the recall results are organized into partitions based on memory type and memory state; specifically: For factual memories with a status of "confirmed", load them into the "Related Facts" area; For evidence memories, load them into the "Evidence Materials" area; For memories of legal basis or historical conclusions, load them into the "Existing Legal Basis or Historical Conclusions" area; For memories that are in the "pending verification" state or have conflict markers, load them into the "pending verification or conflict information" area, and explicitly require the large language model not to use them directly as established facts in the prompt words; Memory entries with a status of "expired" are not loaded into the workspace by default.
[0084] Preferably, the content in the workspace is organized in the following order: first, the user's current question is retained; second, confirmed facts directly related to the current question are loaded; third, evidence materials and historical conclusions are loaded; and finally, information to be verified or conflicting information is loaded. This organization allows the system to distinguish between "information that can be directly used as evidence" and "information that requires careful handling," reducing interference from information to be verified or conflicting information in the generation of responses.
[0085] S2.5.3. Concatenate the contents of the workspace into the large language model input according to the preset prompt word structure; if specific requirements are needed, the prompt words may include the following parts: Workspace Design [Current Issue] {User's current input} [Relevant Facts] {Recalled confirmed facts} [Evidence Materials] {Evidence of Recall} [Existing legal basis or historical conclusion] {Remember the legal basis or conclusions for the recall} [Information pending verification or conflict] {Memories in a state of pending verification or with conflict markers} [Response Requirements] Please analyze based on the confirmed facts, evidence, and existing legal basis; Information that is pending verification or conflicting shall not be used directly as established facts; If key information is insufficient, the user should be asked to provide further details. The answer should be logically clear and explain the main basis for the judgment.
[0086] For example, in a labor dispute consultation scenario, if a user's current question is "Can I still claim double wages?", the system can load information such as "The user joined a company in May 2023" and "The user claims that no written labor contract was signed after joining the company" into the relevant fact area; "The user claims to have wage transfer records and WeChat chat records" into the evidence materials area; and "Whether an electronic labor contract exists has not yet been confirmed" into the information to be verified area. Subsequently, the above content is organized into model input according to the prompt word template, enabling the large language model to generate a legal response based on a clear factual basis and evidentiary status.
[0087] Through the aforementioned workspace design and prompt loading mechanism, the system can dynamically organize historical memories around the user's current question, rather than directly piecing together complete historical dialogues, thereby improving memory utilization efficiency and providing a structured context for subsequent cross-temporal information conflict resolution and legal response generation.
[0088] S3. Determine whether the user input in this round forms a candidate memory unit in S1; if not, do not trigger cross-temporal conflict determination, and directly proceed to the subsequent response generation process; if so, determine the relationship type between the candidate memory unit input in this round and the historical memory already loaded into the work area to form a conflict determination result. The relationship types include consistent, complementary, conflicting, or substitution. Based on the relationship tags between the candidate memory units input by the user in this round and the historical memories already loaded into the work area, determine the response generation strategy for the user input in this round, generate the legal response result for the user input in this round, and write back the memory bank based on the legal response result.
[0089] Specifically, the process of S3 is as follows: S3.1, Detection of cross-temporal information conflicts; Before generating a response, it is first determined whether the user input in this round has formed a candidate memory unit in S1; If the user input in this round is only an independent legal consultation question and does not form new factual memory, evidentiary memory, legal basis memory, or conclusion memory, then the cross-temporal conflict judgment will not be triggered, and the process will directly proceed to the subsequent response generation process. If the user input in this round contains new facts, evidence, corrective statements, or interim conclusions, and has been converted into a candidate memory unit by S1, then the relationship type between the candidate memory unit and the historical memory already loaded into the work area is determined; the relationship type includes consistency, supplementation, conflict, or replacement.
[0090] Furthermore, the specific process for determining cross-time-series information conflicts is as follows: Let the candidate memory units input by the user in this round be... The historical memory unit recalled and loaded by S2 is ; For candidate memory units and historical memory unit Perform semantic similarity overlap with legal entities Initial screening; semantic similarity The expression is as follows: ; in, Represented as candidate memory units Dense semantic vectors, Represented as historical memory unit Dense semantic vectors Represented as candidate memory units and historical memory unit Cosine similarity between them.
[0091] Overlapping legal entities The expression is as follows: ; in, Represented as candidate memory units The collection of legal entities and factual elements in the text Represented as historical memory unit The set of legal entities and factual elements in the text; when or When that happens, then determine the candidate memory unit. With historical memory unit There is a connection between them, and further relationship determination is needed; For memory pairs that pass the initial screening, the large language model is invoked to output candidate memory units based on candidate memory texts, historical memory texts, memory types, memory states, and legal entity sets. With historical memory unit Relationship tags Here, "consistent" represents a candidate memory unit. With historical memory unit Expressing the same or similar content; "supplement" indicates a candidate memory unit. Historical memory unit The facts, evidence, or conclusions in the text are refined; "conflicts" are represented as candidate memory units. With historical memory unit Inconsistencies exist regarding the subject, time, amount, status of evidence, legal act, or factual conclusion; "alternative" indicates a candidate memory unit. Clearly revise, update, or deny historical memory units The content in [the document / article].
[0092] Based on candidate memory units With historical memory unit Relationship tags are used to form conflict determination results. Specifically, if candidate memory units With historical memory unit If the relationship label is "consistent" or "complementary," it indicates that the current user input and the historical memory unit are consistent. There is no substantial conflict between them, and the subsequent process can proceed to memory merging, content supplementation, or response generation; if the candidate memory units With historical memory unit If the relationship label is "conflict", it indicates that the candidate memory unit With historical memory unit If there are unconfirmed inconsistencies, the relationship is recorded as a conflict to be verified; if candidate memory units With historical memory unit If the relationship label is "substitution", it indicates a candidate memory unit. Possibly related to historical memory units The information may be updated or denied, but further judgment is still needed based on user confirmation, evidence, and the time of the information to determine whether the original memory should be updated.
[0093] Conflict determination results The expression is as follows: ; in, Represented as candidate memory units With historical memory unit Relationship tags between them This represents the basis for relational judgments provided by the large language model; this judgment record does not directly overwrite the original memory, but serves as the basis for subsequent supplementary inquiries, response generation, and memory rewriting. For example, historical memory units. The record states "the user did not sign a written employment contract with the employer after joining the company," while the candidate memory units formed in this round of user input... For the statement "the user later found an electronic labor contract", the system determines that both involve the signing of a labor contract through semantic similarity and entity overlap. Then, it calls the large language model to determine their relationship. If the model outputs the relationship label as "conflict" or "substitution", it will not directly continue to accept the historical memory of "no written labor contract signed", but will record the conflict as a pending matter and enter the subsequent supplementary inquiry and response generation process.
[0094] By using the above-mentioned cross-temporal information conflict determination, newly added information (candidate memory units) can be identified before a response is generated. ) and loaded historical memory (historical memory unit) By understanding the relationships between these elements, we can distinguish between consistent, supplementary, conflicting, and alternative information, thereby avoiding conflicts within historical memory units. It is mechanically adopted, thus avoiding the direct overwriting of old memories by unconfirmed new information.
[0095] S3.2 Response generation and memory write-back; Based on candidate memory units With historical memory unit The relationship labels are used to determine the response generation strategy for this round, and the processing results are written back to the memory. This process is used to avoid the system directly generating definitive conclusions based on contradictory information, while ensuring that newly confirmed information, corrected information, and interim response results can enter subsequent memory loops.
[0096] Preferably, the specific process of S3.2 is as follows: S3.2.1 Based on the conflict determination results Based on candidate memory units With historical memory unit Relationship tags Different response strategies are chosen based on the value of the response: Table 1. Correspondence between Relationship Tags and Response Strategies
[0097] For example, if the historical memory is "the user did not sign a written labor contract" and the current candidate memory is "the user later found an electronic labor contract", the system will identify the relationship between the two as "conflict" or "substitution" and enter a supplementary inquiry or memory status update process, instead of directly using the original conclusion.
[0098] S3.2.2 When the credibility of conflicting information cannot be determined based on existing information, a supplementary inquiry is triggered; specifically, supplementary inquiries are applicable to the following situations: ① There is a conflict between the current input and historical memory, but it is impossible to determine which piece of information is more reliable; ② The candidate memories involve key facts, but lack necessary elements such as time, subject, amount, and content of evidence; ③ The candidate memory may replace the old memory, but it has not yet been confirmed by the user or supported by evidence; ④ The preconditions upon which historical conclusions are based have changed and need to be reconfirmed.
[0099] For example, when a user adds "later found an electronic employment contract", the following supplementary question can be generated: "Please confirm the signing time, the signing party, and whether it was signed by the individual; also please confirm whether the contract specifies the start time of the employment relationship." Through supplementary questions, the authenticity and scope of application of conflicting information can be further confirmed.
[0100] S3.2.3 Before generating a legal response, based on the memory state and conflict markers Filter available information; specifically, remember the state. The processing methods are shown in the table below: Table 2 Correspondence between Memory States and Processing Methods
[0101] S3.2.4 Based on the above screening results, the following structure can be used when generating a legal response: (1) Summarize the currently confirmed facts; (2) Provide relevant evidence or historical conclusions; (3) Indicate the impact of the information to be verified or conflicting on the judgment result; (4) Provide legal analysis or suggestions for handling the matter under the current conditions; (5) If the information is insufficient, raise questions that require the user to provide further confirmation.
[0102] For example, in the question of "whether double wages can be claimed", if the "failure to sign a written labor contract" is still pending verification, a definitive conclusion should not be given directly. Instead, it should be stated as follows: "If a written labor contract was indeed not signed and it can be proven that the labor relationship continued, then there may be a basis for claiming double wages; however, since there is currently an issue of whether electronic labor contracts are valid, it is recommended to first confirm the signing time, signing parties, and contract content of the contract." S3.2.5 After the response is generated, the memory is written back based on the conflict resolution results of this round. Specifically, the write-back rules are shown in the table below: Table 3 Correspondence between different situations and write-back methods
[0103] The aforementioned write-back rules allow for tiered processing of conflicting, supplementary, and invalid information without directly overwriting historical memories. Unverified conflicting information remains in a pending verification state; older information superseded by new facts or evidence is moved to the archive area for historical tracing only, and is no longer used for default searches or response generation. This preserves the traceability of historical records while preventing invalid or contradictory memories from continuing to influence subsequent legal responses.
[0104] Through the aforementioned response generation and memory rewriting mechanism, supplementary, conflicting, and alternative information can be processed in a layered manner without directly overwriting historical memory. On the one hand, this avoids conflicting historical information from directly affecting legal responses; on the other hand, it enables new and effective information and status changes to be continuously rewritten into the memory bank, ensuring that subsequent rounds of legal consultation maintain contextual continuity, information consistency, and historical traceability.
[0105] Example 2: This embodiment provides a legal knowledge question-answering device based on a large model memory, used to implement the legal knowledge question-answering method based on a large model memory as described in Embodiment 1; the device includes: The memory bank construction and timeliness maintenance module is used to construct the memory bank, preprocess the received legal consultation content from users, extract valid legal information and convert it into standardized memory units, store the memory units in the short-term memory bank, long-term memory bank or archive area, and perform preset maintenance operations on the memory bank. Dynamic retrieval and memory loading module: This module is used to identify the intent of users' legal consultation content. For memory units that need to be understood in conjunction with historical memory, it sequentially performs query construction, hybrid recall, fusion sorting, and workspace loading to generate candidate memory units and input them into the conflict resolution and response generation module. Memory units that do not need to be understood in conjunction with historical memory are directly input into the conflict resolution and response generation module to generate responses. Conflict resolution and response generation module: Determines the relationship type between candidate memory units and historical memories in the working area, processes the information in the candidate memory units based on the relationship type and adds it to the working area, generates legal responses based on the processed content of the working area, and writes the incremental information of this round back to the memory bank.
[0106] Example 3: As a further embodiment of the present invention, the present invention also provides an electronic device, comprising: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0107] In practical use, users can interact with servers, which are also electronic devices, via a network to receive or send messages. Terminal devices are generally various electronic devices equipped with a display and used through a human-computer interface, including but not limited to smartphones, tablets, laptops, and desktop computers. Various specific application software can be installed on these terminal devices as needed, including but not limited to web browsers, instant messaging software, social media platforms, and shopping apps.
[0108] Furthermore, the server is a network server that provides various services, such as a backend server that provides corresponding calculation services for valid legal information input by users transmitted from terminal devices, so as to realize the processing of legal knowledge question-and-answer methods based on large model memory, calculate the legal response results of the current round of user input, and finally return them to the terminal device.
[0109] Example 4: As a further embodiment of the present invention, the present invention also provides a storage medium including one or more programs executable by one or more processors of an electronic device, the one or more programs including instructions for performing the legal knowledge question-answering method based on large model memory as described above.
[0110] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A legal knowledge question-answering method based on large-scale model memory, characterized in that, Includes the following steps: S1. Construct a memory bank, including a short-term memory bank. Long-term memory bank and archive area ; Transform valid legal information entered by the user into standardized memory units. ; Based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area And for storage in short-term memory and long-term memory Existing memory units in Perform memory updates and timeliness maintenance; S2. Identify the user's intent regarding their current legal inquiry and determine whether the user's current legal inquiry requires understanding based on historical memory; if so, generate search anchors for the user's current legal inquiry. If not, proceed directly to S3; Based on the search anchor points corresponding to the user's current legal consultation question, a recall method is used to retrieve data from the short-term memory. and long-term memory China recalls related standardized memory units It is then loaded into the workspace to form a structured context; S3. Determine whether the user input in this round forms a candidate memory unit in S1; if not, do not trigger cross-temporal conflict determination, and directly enter the subsequent response generation process; If so, the relationship type between the candidate memory units input by the user in this round and the historical memories already loaded into the work area will form a conflict determination result. The relationship types include consistent, complementary, conflicting, or substitution. Based on the relationship tags between the candidate memory units input by the user in this round and the historical memories already loaded into the work area, determine the response generation strategy for the user input in this round, generate the legal response result for the user input in this round, and write back the memory bank based on the legal response result.
2. The legal knowledge question-answering method based on large model memory according to claim 1, characterized in that, The valid legal information includes legal facts, evidence, consultation questions, supplementary explanations, legal basis, and interim conclusions.
3. The legal knowledge question-answering method based on large model memory according to claim 2, characterized in that, Obtain standardized memory units The specific process is as follows: S1.
11. Preprocess the original interactive text to obtain the preprocessed interactive text; the preprocessing includes noise cleaning, removal of redundant line breaks, duplicate spaces, abnormal characters, and replacement of sensitive entities with standard placeholders. S1.
12. Call the large language model and, based on the preset system prompt words, determine the validity of the preprocessed interactive text to obtain valid and invalid legal information; The invalid legal information includes invalid text fragments that only contain small talk, repetitive confirmations, irrelevant expressions, or do not affect legal analysis, and the invalid text fragments are not written into the standardized memory unit; S1.
13. Use a large language model to perform semantic compression and standardization on effective legal information to obtain standardized memorized text; S1.
14. Label each standardized memory text with a memory type, and encapsulate each standardized memory text with the labeled memory type into a standardized memory unit. .
4. The legal knowledge question-answering method based on large model memory according to claim 3, characterized in that, The standardized memory unit The types of memory include: factual memory, evidence memory, problem memory, legal basis memory, conclusion memory, and user preference memory; The standardized memory unit The memory states include pending verification, confirmed, and expired.
5. The legal knowledge question-answering method based on large model memory according to claim 4, characterized in that, Based on standardized memory units The memory type and memory state will be used to standardize memory units. Stored separately in short-term memory Long-term memory bank or archive area The specific process is as follows: The newly generated memory units are written to the short-term memory bank by default. For each standardized memory unit Building a multi-view index To standardize each memory unit The memory is divided into multiple memory units with independent semantics and clear types, including factual memory, evidence memory, and problem memory; the memory units obtained from the division are judged, and if they meet the conditions for migration to the long-term memory bank, they are migrated to the long-term memory bank. Low-frequency, expired, or invalid memory information in the long-term memory bank that still needs to be retained for traceability should be migrated to the archive area.
6. The legal knowledge question-answering method based on large model memory according to claim 5, characterized in that, The process of judging the memory units obtained from the splitting is as follows: When the A memory unit is moved from the short-term memory bank to the long-term memory bank when all of the following conditions are met: ; in, This indicates that the memory has been confirmed by the user, corroborated by evidence, or confirmed by the system's response process; This indicates that the memory does not conflict with newly added facts, evidence, or legal basis; This indicates that the memory was recalled in at least two rounds of question and answer; Represented as a set of core memory types, and ; When the Even if a memory unit simultaneously meets the following conditions, Similarly, it is migrated from the short-term memory bank to the long-term memory bank: ; The core elements include key subjects, key time, key actions, amount in dispute, evidentiary materials, legal relationships or applicable legal basis.
7. The legal knowledge question-answering method based on large model memory according to claim 6, characterized in that, For storage in short-term memory and long-term memory Existing memory units in The specific process for updating and maintaining memory validity is as follows: Candidate memory units are extracted from user supplementary information and / or the results of this round of responses. ; Based on memory type and confirmation status, the current candidate memory units are... Write the data into a hierarchical memory structure for hierarchical storage, and synchronously record its memory state, generation time, update time, and hierarchical marker; if the current candidate memory unit... If a candidate memory unit has been explicitly confirmed by the user or is supported by clear evidence, then the current candidate memory unit will be... The status is set to "confirmed"; if the current candidate memory unit Further verification is still needed; in that case, the current candidate memory unit will be... The status is set to "Pending Verification"; This candidate memory unit is generated or updated synchronously. Dense semantic vectors, sparse lexical features, and sets of legal entities; Let the memory units already stored in the Long Short-Term Memory (LSTM) architecture be called existing memory units. ; For candidate memory units With existing memory units Perform duplicate testing; When candidate memory units With existing memory units Candidate memory units will be selected if the following conditions are met simultaneously. With existing memory units Merge the memories while preserving the original memory ID, source round number, and update time: ; ; ; in, Represented as candidate memory units With existing memory units The memory type labels are the same, belonging to the same memory type, such as factual memory, evidence memory, or conclusion memory; ; Represented as candidate memory units With existing memory units Semantic similarity between them; Represented as existing memory units Dense semantic vectors; Represented as candidate memory units Dense semantic vectors; Represented as candidate memory units With existing memory units Cosine similarity between them The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer they are in semantic similarity; Represented as candidate memory units With existing memory units The degree of overlap between legal entities and factual elements, Represented as existing memory units The collection of legal entities and factual elements in the text Represented as candidate memory units The collection of legal entities and factual elements in the text The higher the value, the more likely it is to be a candidate memory unit. With existing memory units The closer the facts and legal elements involved; If candidate memory units With existing memory units If the candidate memory units are similar but do not meet the criteria for duplicate merging, then... Retain it as an independent memory unit; Perform timely maintenance on the short-term memory and long-term memory according to the preset cycle.
8. The legal knowledge question-answering method based on large model memory according to claim 7, characterized in that, The specific process of S2 is as follows: S2.1 Receive the user's current legal consultation question and identify its intent to determine whether the user's current legal consultation question needs to be understood in conjunction with historical memory; if so, construct a query for the user's current legal consultation question to obtain a rewritten search query question; if not, do not actively load historical memory and directly proceed to S3. S2.
2. Generate search anchors based on the user's current legal consultation question or the rewritten search query question. ; S2.3, Based on the search anchor points corresponding to the user's current legal consultation question. A hybrid recall approach is employed, simultaneously performing semantic vector recall, keyword recall, and legal entity recall to retrieve relevant memory units from both short-term and long-term memory banks. The results from these different recalls are then fused and ranked to obtain the candidate memory set most relevant to the current problem. ; S2.4, on the candidate memory set Perform a fusion sort to obtain a fusion score. Score selection based on fusion score Select the top-scoring memories to form a set of memories to be loaded. ; S2.5, Load the memory set to be loaded. Load the content into the current workspace and assemble it into a large language model input according to the preset prompt word structure to form a structured context.
9. The legal knowledge question-answering method based on large model memory according to claim 8, characterized in that, Obtain candidate memory set The specific process is as follows: Based on the search anchor points corresponding to the user's current legal consultation question From short-term memory and long-term memory Standardized memory units related to the recall ; Set time The active memory set that can participate in the default search is ; Based on retrieval anchor points Query semantic vectors Perform semantic vector recall to obtain semantic vector recall results. ; Based on retrieval anchor points Lexical features in Perform keyword recall and obtain keyword recall results. ; Based on retrieval anchor points The set of legal entities and factual elements in Execute entity recall and obtain entity recall results. ; semantic vector recall results Keyword recall results And the results of the physical recall Merging and deduplication are performed to obtain a candidate memory set. .
10. The legal knowledge question-answering method based on large model memory according to claim 9, characterized in that, The specific process of S2.5 is as follows: Load the relevant memories obtained from the screening into the current workspace; The recall results are organized into zones based on memory type and memory state: confirmed fact memories are loaded into the relevant fact zone; evidence memories are loaded into the evidence material zone; legal basis memories or historical conclusion memories are loaded into the existing legal basis or historical conclusion zone; memories in the pending verification or conflict-marked state are loaded into the pending verification or conflict information zone, and the prompt explicitly requires the large language model not to use them directly as confirmed facts; expired memories are not loaded into the working area by default. The content of the workspace is concatenated into the input of the large language model according to the preset prompt word structure, which serves as the structured context for S3.
11. The legal knowledge question-answering method based on large model memory according to claim 10, characterized in that, The specific method for determining whether the user input in this round forms a candidate memory unit in S1 is as follows: If the user input in this round is only an independent legal consultation question and does not form new factual memory, evidentiary memory, legal basis memory, or conclusion memory, then the cross-temporal conflict judgment will not be triggered, and the process will directly proceed to the subsequent response generation process. If the user input in this round contains new facts, evidence, revised explanations, or interim conclusions, and has been converted into a candidate memory unit by S1, then the relationship type between this candidate memory unit and the historical memories already loaded into the work area is determined, and a conflict determination result is obtained. The relationship types include consistent, complementary, conflicting, or replacement.
12. The legal knowledge question-answering method based on large model memory according to claim 11, characterized in that, Conflict determination result obtained The specific process is as follows: Let the candidate memory units input by the user in this round be... The historical memory unit recalled and loaded by S2 is ; For candidate memory units and historical memory unit Perform semantic similarity overlap with legal entities Initial screening; when or When that happens, then determine the candidate memory unit. With historical memory unit There is a connection between them, and further relationship determination is needed; For memory pairs that pass the initial screening, the large language model is invoked to output candidate memory units based on candidate memory texts, historical memory texts, memory types, memory states, and legal entity sets. With historical memory unit Relationship tags ; Based on candidate memory units With historical memory unit Relationship tags are used to form conflict determination results. .
13. The legal knowledge question-answering method based on large model memory according to claim 12, characterized in that, The specific process of determining the response generation strategy for this round of user input and writing the processing results back to the memory is as follows: Based on the conflict determination results Based on candidate memory units With historical memory unit Relationship tags Different response strategies are chosen based on the value of the response. When the credibility of conflicting information cannot be determined based on existing information, a supplementary inquiry is triggered. Based on memory status and conflict markers Filter available information; Based on the screening results, a legal response will be generated; The memory is written back based on the results of this round of conflict resolution.
14. The legal knowledge question-answering method based on large model memory according to claim 13, characterized in that, The specific response strategy is as follows: When the relationship label is consistent, the processing method is that the current input is consistent with the historical memory content, and the response strategy is that the response can be generated directly based on the workspace content; When the relationship label is supplementary, the processing method is to improve the historical memory based on the current input, and the response strategy is to add the supplementary information to the workspace and then generate a response. When the relationship label is conflicting, the handling method is that there is an inconsistency between the current input and the historical memory. The response strategy is not to directly accept the conflicting information, but to generate a response with conditional explanations or supplementary questions. When the relationship label is "substitution", the processing method is that the current input may update or negate the historical memory, and the response strategy is to combine user confirmation, evidence support and information time to determine whether to replace the old memory.
15. The legal knowledge question-answering method based on large model memory according to claim 13, characterized in that, Supplementary inquiries are applicable in the following situations: ① There is a conflict between the current input and historical memory, but it is impossible to determine which piece of information is more reliable; ② The candidate memories involve key facts, but lack necessary elements such as time, subject, amount, and content of evidence; ③ The candidate memory may replace the old memory, but it has not yet been confirmed by the user or supported by evidence; ④ The preconditions upon which historical conclusions are based have changed and need to be reconfirmed.
16. The legal knowledge question-answering method based on large model memory according to claim 13, characterized in that, Memory state The specific handling methods are as follows: When the memory state is In such cases, the handling method is that it can be used as a basis for the reply; When the memory state is In such cases, the approach is to use it only as a risk warning or as a basis for supplementary inquiries; When the memory state is In such cases, the appropriate action is to not participate in the generation of this round of responses; When the memory state is In such cases, the approach is to not use them as definitive facts, but only to illustrate uncertainty.
17. A legal knowledge question-and-answer device based on a large model memory, characterized in that, The apparatus for implementing the legal knowledge question-answering method based on large model memory as described in any one of claims 1 to 16, the apparatus comprising: The memory bank construction and timeliness maintenance module is used to construct the memory bank, preprocess the received legal consultation content from users, extract valid legal information and convert it into standardized memory units, store the memory units in the short-term memory bank, long-term memory bank or archive area, and perform preset maintenance operations on the memory bank. Dynamic retrieval and memory loading module: This module is used to identify the intent of users' legal consultation content. For memory units that need to be understood in conjunction with historical memory, it sequentially performs query construction, hybrid recall, fusion sorting, and workspace loading to generate candidate memory units and input them into the conflict resolution and response generation module. Memory units that do not need to be understood in conjunction with historical memory are directly input into the conflict resolution and response generation module to generate responses. Conflict resolution and response generation module: Determines the relationship type between candidate memory units and historical memories in the working area, processes the information in the candidate memory units based on the relationship type and adds it to the working area, generates legal responses based on the processed content of the working area, and writes the incremental information of this round back to the memory bank.
18. An electronic device, characterized in that, It includes a memory, one or more processors, and one or more programs stored in the memory, said one or more programs including instructions for executing the legal knowledge question-answering method based on large model memory as described in any one of claims 1-16.
19. A storage medium, characterized in that, Includes one or more programs executable by one or more processors of an electronic device, said one or more programs including instructions for performing the legal knowledge question-answering method based on large model memory as described in any one of claims 1-16.