Ai legal consultation system and method using rag-based adaptive question generation and multi-evidence cross-validation
Patent Information
- Application Number
- KR1020260010815
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2026-01-20
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2046-01-20
Smart Images

Figure 112026007813315-PAT00064_ABST
Abstract
Description
Technology Field
[0001] The present invention relates to an artificial intelligence legal consultation system that performs RAG-based adaptive question generation and multiple evidence cross-verification, and a method of operation thereof. Background Technology
[0002] With the recent advancements in artificial intelligence (AI) technology and large-scale language models (LLM), automated consultation and advisory services are being introduced across various fields, and the legal sector is at the center of these changes. Existing online legal services have relied on chatbots for simple question-and-answer functions or keyword-based search systems, and the general structure required users to directly search for specific legal provisions or precedents.
[0003] Subsequently, as natural language processing technology advanced, automated consultation systems emerged that understood user inquiries and provided relevant legal information; however, these systems still had numerous limitations, making it difficult to secure the level of accuracy and reliability required for handling actual cases. In particular, despite the fact that accurately grasping the facts is essential due to the nature of legal consultation, existing technologies failed to sophisticatedly distinguish between incomplete or contradictory user statements. As a result, there was a persistent possibility that incorrect legal interpretations or advice could be provided based on inaccurate facts.
[0004] Furthermore, while existing AI consultation systems provide the ability to automatically generate the next question based on the conversation flow, their capabilities to evaluate the quality of user responses or adjust question strategies to suit the purpose of the consultation were very limited. Most systems relied on predefined rules or operated using simple question-answer pattern matching, frequently leading to the problem of continuing the consultation to the next stage even when the user had not provided key information. This approach prevents the collection of sufficient information at the beginning of the consultation and significantly reduces the accuracy of subsequent analysis results. In particular, since general users without legal knowledge find it difficult to distinguish which information is important on their own, existing technologies have failed to meet the requirement of a consultation system that elicits information by appropriately adjusting the difficulty, format, and specific requirements of questions, as this is essential.
[0005] Furthermore, while various forms of evidence—such as contracts (PDFs), text messages, audio recordings, accident photos, and CCTV footage—are utilized in actual legal consultations, existing automated systems were mostly capable of processing only text-based input. Unstructured data, such as images, audio, and video, had to be analyzed using separate tools, and functions for integrating this data within the legal consultation flow were not provided. Moreover, due to the absence of technology to compare consistency among various pieces of evidence or automatically detect inconsistencies between user statements and evidence, problems arose where critical information was omitted or misinterpreted in the actual judgment of a case. These limitations undermine the reliability of AI-generated legal advice and make it difficult to assist users in consulting with actual lawyers or proceeding with legal procedures.
[0006] Meanwhile, although technologies attempting to integrate with statute and precedent databases to provide legal grounds for responses offered by generative AI have recently emerged, they remain limited. Many systems remain at the level of simply listing search results or providing summaries based on the retrieved content, failing to perform legal reasoning that reflects the actual facts of a case. In particular, existing technologies often consistently utilize RAG (Retrieval-Augmented Generation) modules throughout the consultation process, leading to issues such as increased information noise during question generation or the inclusion of excessive legal information in the user's initial explanations. Although it is essential in legal consultation to establish the facts first and then separate the legal application stage, existing systems have failed to satisfy this structural procedure.
[0007] Furthermore, existing counseling systems lacked the functionality to systematically save and restore conversation context when a user interrupted or lost connection, resulting in the inconvenience of having to restart the consultation from the beginning upon reconnection. In addition, the absence of learning mechanisms to improve question generation models or refine counseling strategies by utilizing data accumulated during the process led to a problem where the system remained in a static environment with no performance improvement even after long-term operation.
[0008] Ultimately, existing technologies have significant limitations: they cannot precisely evaluate the quality and inconsistencies of user responses, lack the ability to adaptively generate and adjust questions according to the purpose of the consultation, cannot integrate and analyze various evidentiary materials, cannot utilize RAG as an essential step for ensuring accuracy, and lack a structure for performance improvement through session preservation and system learning.
[0009] To address these issues, there is a growing need for a new legal AI consultation system that integrates user response evaluation and contradiction detection, adaptive question generation, multiple evidence analysis, RAG-based legal reasoning, conversation session restoration, and offline model training capabilities. The problem to be solved
[0010] The present invention was devised to solve the aforementioned problems, and aims to provide a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system and method capable of providing accurate and highly reliable AI legal consultation by resolving the incompleteness and contradictions of user responses, fragmentary analysis of atypical evidence, and inaccuracy of legal grounds.
[0011] However, the technical problems that the present invention aims to solve are not limited to those described above, and other unmentioned problems will be clearly understood by those skilled in the art from the description of the invention below. means of solving the problem
[0012] A RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system according to one aspect of the present invention may be configured to include a memory in which commands are stored and a processor configured to perform a legal consultation processing function by executing said commands. The processor collects user question-and-answer data from a user terminal used by a user and manages accumulated consultation information in the form of context. It evaluates the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal with the previous question and consultation context information of the AI model. It selects a type of subsequent question according to a predefined rule or a learned policy using the evaluation result and the consultation context information as input, generates question text corresponding to the selected question type, analyzes evidence data including at least one of text, PDF, image, voice, or video to extract key information, cross-verifies consistency or inconsistency between the extracted information and the user's statement, and, upon receiving a report generation request signal from the user terminal, performs a RAG (Retrieval-Augmented Generation) based information search to look up statutes, precedents, or related documents to derive legal grounds, and generates a report including case analysis and scenarios by combining said derived legal grounds and consultation context information.
[0013] Preferably, the processor may be configured to generate scenarios from the perspectives of attackers and defenders responding to legal issues using the consultation context information and RAG-based information search results.
[0014] Preferably, when generating a report including the event analysis and scenario, the processor may be configured to generate a structured report including an event overview, a summary of the facts, legal issues, legal grounds, event strategy, expected actions and duration, and necessary documents.
[0015] Preferably, the processor may be configured to extract metadata including at least one of optical character recognition (OCR), named entity recognition (NER), speech-to-text conversion (STT), speaker separation, and scene understanding when performing evidence data analysis.
[0016] Preferably, the processor may be configured to compare the extracted metadata with the user's statement to determine whether there is a discrepancy regarding items including dates, people, places, and amounts.
[0017] Preferably, the processor is configured to record consultation status information of the consultation process for the user in a session store to restore the consultation status upon reconnection, and the consultation status information may include a context summary, answer evaluation results, generated question information, and evidence analysis results.
[0018] Preferably, the processor may be configured to use at least one of a lightweight first AI model for generating questions and a second AI model for generating reports, de-identify data accumulated during the consultation process with the user to fine-tune the first AI model, and learn question selection rules through reinforcement learning-based policy learning.
[0019] Preferably, reinforcement learning-based policy learning through the processor may be based on state information including a context summary, answer fidelity evaluation results, and whether there is a contradiction, behavior information for selecting a follow-up question type, and reward information calculated based on the efficiency of the consultation or the report quality score.
[0020] Preferably, the processor may be configured to assign the operation of an AI model for at least one of generating question data, analyzing evidence data, or generating a report to a parallel processing executor, receive a processing result transmitted from the parallel processing executor via a message queue, and provide a response to a request for report generation from a user terminal regardless of whether the operation is completed.
[0021] A RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to one aspect of the present invention comprises: a step of collecting user question-and-answer data from a user terminal used by a user and managing accumulated consultation information in the form of context; a step of evaluating the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal with the previous question and consultation context information of the AI model; a step of selecting a type of subsequent question according to a predefined rule or learned policy using the evaluation result and consultation context information as input, and generating question text corresponding to the selected question type; a step of analyzing evidence data including at least one of text, PDF, image, voice, or video to extract key information and cross-verifying consistency or inconsistency between the extracted information and the user's statement; and, when a report generation request signal is received from the user terminal, a step of performing a RAG (Retrieval-Augmented Generation) based information search to query statutes, precedents, or related documents to derive legal grounds, and generating a report including case analysis and scenarios by combining the derived legal grounds and consultation context information. Effects of the invention
[0022] According to an embodiment of the present invention, user question-and-answer data is structured and managed in a contextual form, and factual relationships can be efficiently established during the consultation process by evaluating fidelity and logical contradictions by comparing the user's answer with previous questions and accumulated consultation information.
[0023] In addition, by automatically selecting the type of follow-up question based on evaluation results and generating corresponding question text, the flow of counseling can be adaptively controlled to minimize unnecessary questions and effectively collect only key information.
[0024] Furthermore, the accuracy of factual determinations can be enhanced by analyzing various forms of evidentiary data, such as text, PDF, images, audio, and video, to extract key information, and cross-verifying consistency with the user's statements. When a user requests the generation of a report, objective legal grounds, such as statutes and precedents, are secured through RAG-based information retrieval; by combining these with the consultation context to generate a report that includes case analysis and scenarios, the reliability of legal judgments can be improved.
[0025] As such, the system of the present invention has the effect of providing precise and highly reliable legal consultation compared to existing consultation systems by integrally performing functions of answer evaluation, adaptive question generation, multiple evidence analysis, and derivation of legal grounds.
[0026] In addition, various other additional effects may be achieved by various embodiments of the present invention. These various effects of the present invention are described in detail in each embodiment, or the description of effects that are easily understood by those skilled in the art is omitted. Brief explanation of the drawing
[0027] The following drawings attached to this specification illustrate preferred embodiments of the present invention and serve to further enhance understanding of the technical concept of the present invention together with the detailed description of the invention provided below; therefore, the present invention should not be interpreted as being limited only to the matters described in such drawings. FIG. 1 is a diagram illustrating components for performing a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to an embodiment of the present invention. FIG. 2 is a diagram illustrating the elements constituting a system for performing an AI legal consultation method based on RAG-based adaptive question generation and multiple evidence cross-verification according to an embodiment of the present invention. Figure 3 is a diagram showing an example of an AI legal consultation method based on RAG-based adaptive question generation and multiple evidence cross-verification implemented by the system of Figure 2. FIG. 4 is a flowchart illustrating a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to one embodiment of the present invention. Specific details for implementing the invention
[0028] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the attached drawings. Prior to this, terms and words used in this specification and claims should not be interpreted as being limited to their ordinary or dictionary meanings, and should be interpreted in a meaning and concept consistent with the technical spirit of the present invention, based on the principle that the inventor can appropriately define the concept of the terms to best describe his invention.
[0029] Therefore, it should be understood that the embodiments described in this specification and the configurations illustrated in the drawings are merely the most preferred embodiments of the present invention and do not represent all of the technical ideas of the present invention, and that various equivalents and modifications that can replace them may exist at the time of filing this application.
[0030] FIG. 1 is a diagram illustrating components for performing a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to an embodiment of the present invention, FIG. 2 is a diagram illustrating elements constituting a system (100) for performing a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to an embodiment of the present invention, and FIG. 3 is a diagram showing an example of a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method implemented by the system (100) of FIG. 2.
[0031] Referring to FIGS. 1 to 3, each component for performing the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to one embodiment of the present invention may include a system (100) and a user terminal (200) for performing the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method.
[0032] Specifically, the system (100) can exchange data with user terminals (200) via wired or wireless communication and perform RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation methods. In one embodiment, the system (100) performing the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation methods may be a server device or a computer device. And, the user terminals (200) may be mobile devices or PCs used by users.
[0033] The RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method can be implemented in the form of a computer program or a mobile application. For example, processes for the operation of the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method can be performed by the user terminal (200) running the computer program and the mobile app and the system (100) running the computer program.
[0034] In addition, the system (100) that performs the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method includes an AI model and can perform the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method through the training of the AI model.
[0035] The above AI model may be trained based on supervised learning methods, but is not limited thereto, and may also be trained based on unsupervised learning or semi-persistent learning methods.
[0036] In addition, an AI model may consist of one or more neural network layers, and each neural network may include one or more weights. An AI model can perform learning or inference by performing operations between one or more weights and input data.
[0037] Referring to FIG. 2, a system (100) for performing RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation methods may include memory (110) and a processor (120). However, it is not limited thereto, and other general-purpose components may be further included in the system (100) for performing RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation methods.
[0038] Memory (110) may be configured to store instructions of a computer program or application that implements a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method, and a processor (120) may execute the program or application by executing the instructions stored in memory (110). For example, memory (110) may be implemented as non-volatile memory such as ROM, PROM, EPROM, EEPROM, flash memory, PRAM, MRAM, RRAM, FRAM, etc., or volatile memory such as DRAM, SRAM, SDRAM, PRAM, RRAM, FeRAM, etc., and may be implemented in the form of HDD, SSD, SD, Micro-SD, etc., or a combination thereof. The processor (120) may be implemented as an array of logic gates, a microprocessor, a CPU, a GPU, an AP, or a combination thereof.
[0039] A RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system according to one embodiment of the present invention may be implemented by including a memory (110) in which various commands are stored, and a processor (120) configured to perform a legal consultation processing function by executing the commands.
[0040] The present invention differs in technical nature from existing simple question-and-answer-based legal chatbots in that a single processor (120) consistently controls the flow of the entire legal consultation process. In particular, it is characterized in that user answer evaluation, context-based adaptive question generation, multiple evidence analysis and cross-verification, and RAG-based legal grounds generation are performed step-by-step within a single integrated processing system. This integrated architecture enables the simultaneous securing of consultation accuracy and reliability by combining the reasoning capabilities of a large-scale language model (LLM) with data-based structured consultation techniques.
[0041] Additionally, the processor (120) can collect user question-and-answer data from the user terminal (200) used by the user and manage accumulated consultation information in the form of context. Here, context is not merely the accumulation of simple conversation logs, but rather information that extracts only meaningful core elements from past question-and-answer pairs and summarizes and stores them in a structured form, which is utilized as an important input value in subsequent question generation and response evaluation stages. The context management method of the present invention efficiently manages information accumulated as conversation time increases, prevents duplicate questions, and provides a basis for evaluating inconsistencies between user statements. Furthermore, since the present invention is applicable not only to free-form consultation but also to guided intake based on a predefined set of questions, the context formed in the initial stage also plays a role in maintaining the flow of the consultation guide more accurately.
[0042] In this embodiment, the processor (120) may provide a predefined initial set of questions through the user terminal (200) according to the type of case or legal category of the case to be consulted, prior to the full-scale adaptive question generation step. The initial set of questions is designed by a legal expert and may include questions designed to guide even a user without legal knowledge to explain their case in a structured form.
[0043] For example, the processor (120) may provide an initial set of questions to verify the time of occurrence of the incident, the relationship with the other party, whether money was transferred, and whether evidence exists for a consultation request classified as a fraud case. When the user responds to the initial questions, the processor (120) may collect the responses to form an initial state of the consultation context.
[0044] The consultation context constructed through the provision of initial questions in this manner can be utilized as input for subsequent steps of user response fidelity evaluation, logical contradiction detection, adaptive question selection, and multiple evidence analysis. This prevents the omission of essential information during the initial consultation and improves the efficiency and accuracy of subsequent question generation.
[0045] Additionally, the processor (120) can evaluate the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal (200) with the AI model's previous question and consultation context information. Here, the fidelity evaluation is a procedure to determine whether the user's answer sufficiently satisfies the requirements of the question, and multi-stage evaluation criteria such as "sufficient," "insufficient," "meaningless," and "unknown" are applied. For example, if the user answers only some of the essential elements required in the question, it is classified as insufficient; in this case, a re-question or supplementary question regarding the same question can be generated in a subsequent step. On the other hand, if the user clearly indicates a lack of information, such as "I don't know," it may be more efficient to switch to generating a new follow-up question to proceed with the consultation. Since these judgment criteria are performed based on LLM-based semantic matching and context analysis rather than simple string comparison, they can respond more actively to the natural language user's actual expression style. At the same time, the answer evaluation process is closely linked to contradiction detection, so the logical conflict between the existing statement in the context and the new answer is also evaluated. At this stage, whether meaningful units such as time, sequence of events, place, and character relationships are maintained is reviewed, and if contradictions are found, corrective questions are generated to clearly verify them within the counseling flow, thereby improving the quality of counseling.
[0046] Additionally, the processor (120) can select a type of follow-up question based on predefined rules or learned policies using evaluation results and consultation context information as input, and generate question text corresponding to the selected question type. The types of follow-up questions can be classified into clarification questions, re-questions, new in-depth questions, etc., and can be realized in a form where the processor (120) executes the function of an adaptive question selection module. In the present invention, question selection is initially performed based on rules defined by experts, and a more optimized question selection policy can be learned by applying reinforcement learning techniques based on consultation data accumulated during the system operation process. This method provides a user-customized consultation flow, thereby enabling the efficient collection of only appropriate information, and when combined with an evaluation model designed to secure high information density at the beginning of the consultation, it has the effect of continuously improving the quality of AI consultation. The generation of question text is performed using a lightweight AI model, and the composition of the actual question sentence is customized based on the previously selected question type and context information.
[0047] Additionally, the processor (120) can analyze evidence data including at least one of text, PDF, image, voice, or video to extract key information and cross-verify consistency or inconsistency between the extracted information and the user's statement. The evidence data is preprocessed through various modules such as OCR, Named Entity Recognition (NER), Speech-to-Text (STT), Speaker Separation, and Scene Understanding, and in this process, key metadata such as date, time, place, amount, and person name is automatically extracted. This module structure corresponds to the configuration of multiple evidence analysis and cross-verification modules. Subsequently, the processor (120) reviews whether there is an inconsistency between the user's statement and the evidence metadata; for example, if the time of the accident stated by the user differs from the time information extracted from image or voice data, it determines this as a contradiction and can generate a follow-up question or a warning signal. As such, the present invention adopts an approach that improves the accuracy of legal consultation by utilizing unstructured data, which is a key component that overcomes the limitations of the conventional simple text-based consultation system.
[0048] In this embodiment, the processor (120) may additionally perform sentiment analysis during the process of analyzing evidence data in the form of text or voice. The sentiment analysis is intended to produce an indicator representing the emotional characteristics, threat, aggression, or conflict intensity contained in a sentence or utterance, and may use text data extracted through OCR, STT, or speaker separation as input.
[0049] For example, the processor (120) can perform speech-to-text conversion (STT) on a call recording file and then apply sentiment analysis to the converted text to determine whether threatening expressions or coercive language are used in the other party's speech. The results of this sentiment analysis can be combined with user statements to assist in determining the nature of the dispute in the case.
[0050] The processor (120) can improve the accuracy of determining whether a criminal case exists, analyzing the possibility of damage, or deriving legal issues by reflecting the results of the sentiment analysis in the consultation context along with other evidence metadata.
[0051] Additionally, the processor (120) may be configured to perform a Retrieval-Augmented Generation (RAG)-based information search upon receiving a report generation request signal from a user terminal (200) to derive legal grounds by querying statutes, precedents, or related documents, and to generate a report including case analysis and scenarios by combining the derived legal grounds with consultation context information. Here, the RAG-based information search may be implemented not as a simple document search, but as a process of semantically searching for provisions, precedents, and interpretation materials necessary for actual legal judgments in a consultation context and inserting them as grounds for the LLM generation results. This method effectively suppresses the hallucination problem inherent in existing LLM consultation systems, and allows the user to clearly verify within the report what grounds each legal judgment is based on. The report may include a case overview, facts, key issues, legal grounds, expected procedures, duration, and adversarial scenarios. In addition, if necessary, an active task recommendation function based on the report can be performed in subsequent steps, and instructions for follow-up actions by the lawyer (e.g., drafting a content verification letter) or securing additional evidence can be automatically suggested.
[0052] In this embodiment, after a report including case analysis and scenarios is generated, the processor (120) can analyze the report to automatically derive subsequent legal tasks corresponding to the stage of the case or legal issues. The subsequent legal tasks may be determined by comprehensively considering the consultation context, the results of multiple evidence analysis, and the legal basis based on RAG.
[0053] For example, if the processor (120) determines in the report that there is a high probability of fraud, it may recommend sending a certified letter or drafting a complaint as a subsequent legal task, and in the case of a civil dispute, it may suggest applying for a payment order or filing a lawsuit as a subsequent task. In addition, if it determines that additional evidence needs to be secured, it may guide the user to secure a specific type of evidence.
[0054] In this way, by having the processor (120) recommend subsequent legal tasks based on the results of the report analysis, the present invention can provide a technical effect that goes beyond simply providing consultation results and suggests a response direction that can be directly utilized in actual legal practice.
[0055] According to this embodiment of the present invention, user question-and-answer data is structured and managed in a contextual form, and factual relationships can be efficiently established during the consultation process by evaluating the fidelity and logical contradictions of the user's answers by comparing them with previous questions and accumulated consultation information.
[0056] In addition, by automatically selecting the type of follow-up question based on evaluation results and generating corresponding question text, the flow of counseling can be adaptively controlled to minimize unnecessary questions and effectively collect only key information.
[0057] Furthermore, the accuracy of factual determinations can be enhanced by analyzing various forms of evidentiary data, such as text, PDF, images, audio, and video, to extract key information, and cross-verifying consistency with the user's statements. When a user requests the generation of a report, objective legal grounds, such as statutes and precedents, are secured through RAG-based information retrieval; by combining these with the consultation context to generate a report that includes case analysis and scenarios, the reliability of legal judgments can be improved.
[0058] As such, the system (100) of the present invention has the effect of providing precise and highly reliable legal counseling compared to existing counseling systems by integrally performing functions of answer evaluation, adaptive question generation, multiple evidence analysis, and derivation of legal grounds.
[0059] In one embodiment, the processor (120) may be configured to generate scenarios from the perspectives of attackers and defenders responding to legal issues using consultation context information and RAG-based information search results.
[0060] Here, the consultation context information is information stored by structuring factual elements accumulated during the user question-and-answer process (e.g., time of occurrence, location, relationship with the other party, financial transaction history, existence of evidence, etc.), and the processor (120) identifies the core issues, points of inconsistency, and points of missing information of the case based on this context. In addition, the processor (120) combines statutes, precedents, and practical standards derived through RAG-based information search to precisely construct legal interpretations and applicable provisions that can be asserted at specific points. By combining the context and legal grounds in this way, the processor (120) can generate possible legal strategies and expected claims in a comparative and contrasting form from the perspective of the attacker (plaintiff / complainant) and the defender (defendant / suspect), respectively, regarding the same factual situation, and in this process, the branching structure of possible claim scenarios for each issue of the case can be derived more clearly.
[0061] More specifically, the processor (120) calculates the 'legal issue contribution' among the factual elements within the consultation context to construct attacker and defender scenarios, and may apply different weights to each element. For example, in the case of a fraud case, the existence of a record of fund transfers has a high weight, and in the case of a defamation case, the specificity of the expression and the statement of facts have a high weight. These weights can be modeled as follows (see Equation 1).
[0062] [Mathematical Formula 1]
[0063]
[0064] Here is the final weight for issue i, is the strength of elements directly related to the issue in the user's statement (e.g., the probative value of monetary transfers), is the reliability extracted from the results of multiple evidence analysis (e.g., degree of agreement with evidence metadata), is a weighted adjustment parameter that the processor (120) pre-defines or adjusts through learning.
[0065] The processor (120) is derived in this way It determines the priority of key legal issues in a case based on the relative magnitude of values and generates scenario flows from the perspectives of both the attacker and the defender, centering on high-priority issues. This approach enables scenario strategy modeling based on the correlational structure of facts and evidence, rather than simple sentence generation, and provides users with more logical and structured analysis results.
[0066] Furthermore, the attacker scenario is structured to emphasize elements within the user's statements that support the claims, such as the opposing party's illegality, the structure of damage occurrence, and causality; conversely, the defender scenario may focus on grounds within the user's statements and evidence analysis results that can refute the opposing party's claims (e.g., lack of constituent elements, absence of intent, insufficient proof of damages, etc.). For instance, in the context of a fraud case where the transfer of funds may be reinterpreted as a simple loan relationship, the defender scenario places higher weight on "circumstances indicating a loan relationship and intent to repay," while the attacker scenario may reflect circumstantial elements supporting "intent to deceive or mislead" with higher weight.
[0067] Furthermore, the processor (120) may use the following scoring function to calculate the confidence scores of the attacker and defender scenarios (see Equation 2).
[0068] [Mathematical Formula 2]
[0069]
[0070] Here is either an attacker (plaintiff / prosecutor) or a defender (defendant), and This is an impact factor of the issue from the perspective of the attacker or defender, and can be dynamically updated through statistical analysis during LLM-based pre-learning or counseling operations.
[0071] The processor (120) can quantitatively evaluate which perspective can form a relatively stronger argument in a specific legal issue based on the above-calculated scenario score and reflect this in a visualized structure or comparative narrative form within the report. This calculation-based scenario analysis method clearly derives the core structure of the dispute in cases involving a mixture of various issues and helps the user immediately understand the legal situation in which their case is situated for each position of attacker and defender during the initial consultation stage.
[0072] Furthermore, the scenario analysis structure of the present invention is designed to be directly utilized for future attorney-linked consultations or decisions regarding subsequent legal actions. Specifically, if a specific issue is identified as having a very high weight in an attacker scenario, a strategy can be generated suggesting that sending a certified letter or filing a complaint is appropriate; conversely, if the weakening of an issue is evident in a defender scenario, a conclusion can be drawn that a settlement proposal or evidence reinforcement is necessary. This demonstrates significant technical utility in that it automatically generates expert-level analysis useful for establishing actual case strategies, rather than serving as a mere descriptive report.
[0073] Consequently, the function of the processor (120) to generate scenarios from the perspectives of attackers and defenders by utilizing consultation context and RAG-based information search results provides an important technical effect that enables the user to clearly understand their legal position and possible response strategies by presenting balanced perspectives of both sides of the dispute by comprehensively considering facts, legal grounds, consistency of evidence, and weight modeling.
[0074] In one embodiment, the processor (120) may be configured to generate a structured report including a case overview, a summary of facts, legal issues, legal grounds, case strategy, expected actions and duration, and necessary documents when generating a report including case analysis and scenarios. This report is not merely a summary document, but a multidimensional analysis result in which consultation context information, response fidelity evaluation results, multiple evidence analysis results, and RAG-based legal grounds are organically combined, and systematically includes key elements necessary for the user to make a legal judgment on their case.
[0075] Specifically, the processor (120) generates an overview of the case by reconstructing the facts provided by the user based on the consultation context, in chronological order and causal relationships. The summary of facts is created by structuring the questions and answers accumulated during the consultation process, removing duplicate information, and selecting only the key facts; this is automatically updated in conjunction with the context management function of the processor (120). At this time, by including metadata provided by the multiple evidence analysis module (e.g., contract date, transcript conversation time, time of image capture, etc.) and reflecting the consistency between the user's statements and evidence data, the summary of facts in the report acquires precision beyond simple summary of statements.
[0076] Additionally, the processor (120) automatically extracts legal issues based on the case overview and summary of the facts, and performs a RAG-based legal search for each issue to search for relevant legal provisions, summaries of precedents, and practical interpretation standards. Through this, the “legal basis” item in the report is provided in a verifiable form based on search results from an actual legal database, rather than an arbitrary judgment by the AI, which contributes significantly to securing important reliability in legal consultation.
[0077] Next, the processor (120) combines the derived legal grounds and the consultation context to construct a case strategy. For example, in the case of a damages claim, options for legal scenarios can be compared and analyzed, such as determining which claim is more valid—whether it is liability for breach of contract or liability for tort—in the case of a fraud case, determining the possibility of establishing a deceptive act and whether there is an intention to make a payment. These case strategies can be divided into the perspective of the attacker (plaintiff / complainant) and the perspective of the defender (defendant / suspect) from the user's perspective, and the processor (120) presents strategies that can be argued from each of the two perspectives in a comparative and contrasting format.
[0078] The report also includes “estimated measures and duration,” which is calculated by reflecting the average duration of each stage of legal proceedings and the characteristics of the user case. At this time, the processor (120) can calculate the duration using a weighted model based on the complexity of the case, the number of issues, the amount of evidence, etc. For example, a simple prediction model as follows can be used (see Equation 3).
[0079] [Mathematical Formula 3]
[0080]
[0081] Here, is the estimated duration, The basic procedure duration, is the complexity score of each issue or procedural step, is a weight that is pre-set by the processor (120) or obtained through learning.
[0082] This formula-based calculation method enhances the objectivity of report generation and has high practical utility because it can be extended by case type.
[0083] Additionally, the processor (120) automatically generates items of required documents, which can be implemented by distinguishing between “currently secured documents” and “documents requiring additional securing” based on the data presented by the user and the results of multiple evidence analysis. For example, in the case of a civil lawsuit, original contracts, remittance records, text conversation records, etc. are required, and in the case of a criminal case, a complaint, medical certificate, CCTV footage, etc. may be required. The identification of these required documents can be automatically calculated based on the importance and availability of each document as follows (see Equation 4).
[0084] [Mathematical Formula 4]
[0085]
[0086] Here is the necessity score of the i-th document, is the importance of the relevant document in the case, It is set to 1 if the user has already submitted the document or it has been obtained during the evidence analysis process, and 0 otherwise.
[0087] Through this, the processor (120) can prioritize the documents that need to be secured first among the necessary documents and guide the user.
[0088] Consequently, the structured report generated by the processor (120) goes beyond simply summarizing the consultation content; it provides an integrated report in which the case overview, facts, legal issues, legal grounds, arguments / defense scenarios, strategies, expected procedures and duration, and necessary documents are logically connected, allowing the user to clearly grasp the legally important points and future course of action in their case. Since this method of generating the structured report is the result of technically integrating various elements such as the quality of the user's initial statement, consistency of evidence, and legal search results, it has unique technical features that distinguish it from existing automatic report generation technologies.
[0089] In one embodiment, the processor (120) may be configured to extract metadata including at least one of optical character recognition (OCR), named entity recognition (NER), speech-to-text conversion (STT), speaker separation, and scene understanding when performing evidence data analysis.
[0090] This metadata extraction function serves as a foundational technology for integrating various forms of data submitted by the user into data of a consistent structure. The processor (120) applies different preprocessing pipelines depending on the format of the data (PDF, document scan image, photo, audio file, video, etc.). For example, for image data such as documents or text message screens, text information is extracted through OCR, and STT converts the audio signal of audio files and videos into text. Additionally, units with legal meaning, such as people, dates, place names, and amounts, are automatically identified through Named Entity Recognition (NER). In the case of audio or video data with multiple speakers, the flow of statements by speaker is separated through a speaker separation function. For video data, the chronological order, characters, and specific actions (e.g., assault gestures, movement of objects, etc.) can be extracted using a scene understanding module. This metadata is utilized as a key element in forming the objective structure of events, such as time axes, spatial axes, and character relationship diagrams.
[0091] The metadata extracted in this manner is used as an input value to precisely construct the factual relationship by combining it with the internal context derived from the user's statement, and the processor (120) evaluates the quality of the metadata according to criteria such as the result of the analysis module (confidence score), the resolution of the data, and sound quality. In some cases, a weighting model that amplifies confidence based on whether the same event element is repeatedly confirmed in multiple pieces of evidence may be applied. To this end, the processor (120) may use the following basic confidence calculation formula (see Equation 5).
[0092] [Mathematical Formula 5]
[0093]
[0094] Here is the final confidence level of the i-th metadata element, is the quality score (confidence) returned by analysis modules such as OCR, STT, and NER, is a consistency value indicating the degree to which the same information appears repeatedly in multiple pieces of evidence, and and is a weighting coefficient by data type. For example, if the time of the accident matches in the photo's EXIF information, the video's metadata, and the user's statement. As it increases, the reliability of the corresponding metadata is significantly strengthened.
[0095] Additionally, the processor (120) may be configured to determine whether there is a discrepancy regarding items including dates, people, places, and amounts by comparing the extracted metadata with the user's statement. This comparison and determination function is performed based on cross-validation between semantic units rather than simple string comparison. The processor (120) stores user statement elements within the context maintained during the consultation process (e.g., “The incident occurred at 9 PM on March 2,” “The other party is A,” “The down payment was 3 million won”) as structured entities and determines whether there is a discrepancy by matching them with date, amount, person, and place information extracted through evidence analysis.
[0096] For example, if the transaction date confirmed in the transcript differs from the transaction date stated by the user, or if the store location extracted through image analysis differs from the user's statement, the processor (120) may mark the item as 'possible discrepancy' and pass it to the subsequent question generation module. Through this, the system can identify contradictions early in the consultation process and control the consultation flow in a way that induces clarification questions to resolve them.
[0097] The determination of whether there is a discrepancy can be realized not by a simple True / False method, but by a score-based determination that reflects both metadata reliability and statement reliability. For example, the processor (120) may use the following discrepancy score calculation formula (see Equation 6).
[0098] [Mathematical Formula 6]
[0099]
[0100] Here is the value of the i-th fact element derived from the user's statement (e.g., stated amount, stated date), is the corresponding metadata value extracted through evidence analysis, is the weight of importance that the relevant factual element has on the legal judgment.
[0101] For example, in monetary transaction cases, regarding the amount It is set high, and in assault cases, location and time related The value can be set relatively high. If the ConflictScore calculated in this way exceeds a pre-set threshold, the processor (120) determines the item as a major discrepancy item, records it in the consultation context, and then prompts in-depth questions to resolve the contradiction in subsequent questions.
[0102] Furthermore, the processor (120) can analyze the occurrence pattern of the ConflictScore in conjunction with the scenario generation module to determine whether the discrepancy is an error of a single element or a systematic conflict between multiple metadata. For example, if date and location metadata are simultaneously inconsistent, it may be determined that additional verification is needed to determine whether the user is confused about the order of events or whether the time axis between evidence materials is incorrectly recorded. This structure contributes to sophisticatedly correcting ambiguities in user statements and deriving reliable facts during the report generation stage.
[0103] As such, in this embodiment, the function of the processor (120) to extract metadata using OCR, NER, STT, speaker separation, scene understanding, etc., and then to determine whether there is an inconsistency regarding key items such as date, person, place, and amount is not a simple processing function at the level of a single module, but rather provides a unique technical effect that maximizes the accuracy of factual relationships based on the integrated analysis of multimodal evidence and user statements. This configuration is closely connected to adaptive question generation, argument / defense scenario generation, structured report writing, etc., performed in subsequent steps, and functions as a foundational technology that improves the reliability and precision of the entire legal consultation process.
[0104] In one embodiment, the processor (120) may be configured to record consultation status information of the consultation process for the user in a session storage so as to restore the consultation status upon reconnection.
[0105] In this embodiment, the processor (120) can record consultation status information generated during the consultation process with the user in a session storage implemented with a high-speed in-memory cache structure. The consultation status information may include a context summary, user response evaluation results, generated question information, and evidence analysis results.
[0106] When a user leaves the service during a consultation and then reconnects, the processor (120) can restore the consultation state by immediately loading the consultation state information recorded in the session storage based on user identification information or session identifier. At this time, the processor (120) can continue to provide questions or analysis results that were generated in the previous consultation step but have not yet been provided to the user.
[0107] Through this in-memory cache-based session management method, the recording and restoration of consultation status can be performed in near real-time, improving the user experience and stably maintaining the continuity of the consultation flow.
[0108] This configuration is intended to ensure that the continuity and context of the consultation are maintained even if the user temporarily leaves the service due to external factors such as interruption of the consultation or unstable network connection. The consultation state saving function of the present invention has technical significance in that it goes beyond simply recording past conversation content and stores core data forming the logical structure of the consultation in a structured form in the session storage, thereby enabling the consultation to continue in the same inference state upon reconnection.
[0109] In addition, consultation status information may include a context summary, response evaluation results, generated question information, and evidence analysis results.
[0110] Here, the context summary refers to information reconstructed from Q&A content collected during the consultation process into semantic units; it prevents the duplication of identical questions and serves as essential input data for generating subsequent questions. The response evaluation result is metadata reflecting fidelity assessments, semantic consistency, and internal contradictions for each response provided by the user, and it functions as a criterion for determining whether to re-ask the same question or proceed with a new one during future consultations. The generated question information may include the question types generated by the system to date, the purpose of the questions (e.g., clarification, in-depth investigation, etc.), and question quality evaluation results; this is necessary to accurately reconstruct the next question at the point of consultation interruption. The evidence analysis result includes metadata derived through modules such as OCR, NER, STT, and scene understanding, along with reliability evaluation values for the corresponding data; this enables evidence-based logical judgments to continue from the same state when the consultation resumes.
[0111] When the processor (120) records these counseling status information in the session storage, it may apply different weights by considering the characteristics of the case, the counseling stage, and the quality of user-provided information. For example, dynamic adjustment is possible in such a way that the weight of the context summary is relatively high in the early stages of the case, and the weight of the corresponding item increases as the results of the evidence analysis accumulate. To explain this, an equation for calculating the overall reliability or restoration priority of the counseling status can be defined as follows (see Equation 7).
[0112] [Mathematical Formula 7]
[0113]
[0114] Here is the total importance score of the session state, The amount of information and consistency of the context summary, is cumulative information of answer evaluation results, is the quality of generated question information and question flow, is the reliability of the evidence analysis results, and is a weight that is adjusted according to the counseling stage and the type of case.
[0115] This formula can be used to determine which elements should be recovered first when prioritizing the recording or restoration of elements in the session store, and the weights can change dynamically depending on whether the user's case is civil or criminal, and whether it is an evidence-based or statement-based case.
[0116] When restoring a session, the processor (120) reads the consultation status information and reproduces the question flow, intermediate inference state, and contradiction judgment record immediately before the consultation was interrupted, thereby allowing the user to resume the consultation without interruption. For example, if the session ends immediately after the user provides an answer to a specific question, upon restoration, the evaluation result of that answer and the subsequent question type generated based on it are automatically calculated, and the internal threshold of the question quality evaluation model also inherits the previous state. The function of restoring the evidence analysis results is particularly important. This means that, for example, if monetary information extracted through image analysis was already combined with the context, the existing results can be referenced as they are without the need to repeat the analysis process again upon restoration, which substantially increases the system processing efficiency.
[0117] Additionally, the processor (120) may accumulate the amount of change in consultation status information at each session saving point and apply a change-based correction weight to correct the stability and consistency of the consultation. For example, the following equation can be used to determine the update priority based on how much each status item has changed compared to the previous consultation step (see Equation 8).
[0118] [Mathematical Formula 8]
[0119]
[0120] Here is the update importance of the i-th state item, is the value of the current consultation stage, is the value of the previous step, is the variation sensitivity coefficient of each item.
[0121] For example, items with significant changes, such as a sudden drop in response evaluation results or the extraction of new metadata from evidence analysis, have a high update priority, which enables precise restoration without omissions during session saving and restoration.
[0122] Consequently, the function of the processor (120) of the present embodiment to record consultation status information in a session storage and restore it upon reconnection not only ensures the continuity of consultation but also provides a technical effect that ensures the inference state of each module is accurately maintained in an AI legal consultation system in which various modules such as context, answer evaluation, question generation, and evidence analysis are connected step-by-step. This is an important feature of the present invention in that it goes beyond the basic session maintenance function of a simple chatbot and realizes "logical state restoration," which is essential in structured legal consultation.
[0123] In one embodiment, the processor (120) may use at least one of a lightweight first AI model for generating questions and a second AI model for generating reports. Here, the first AI model is a lightweight model optimized for rapid question generation required during the consultation process, and is suitable for generating follow-up questions by reflecting user response evaluation results and consultation context in real time. On the other hand, the second AI model may be composed of a high-performance large-scale language model for generating reports with complex structures such as case analysis, legal grounds, argument and defense scenarios, and measures; although this involves a large amount of computation and long inference time, it is suitable for tasks requiring high sentence quality and accuracy at the consultation completion stage. By utilizing these two types of models separately, the system can simultaneously ensure speed during the consultation process and accuracy at the time of consultation completion.
[0124] And, the processor (120) can be configured to de-identify data accumulated during the consultation process with the user, fine-tune the first AI model, and learn question selection rules through reinforcement learning-based policy learning.
[0125] This configuration enables the adaptive question generation function of the present invention to be continuously improved and provides an active learning structure that evolves autonomously based on actual consultation data, unlike existing AI consultation systems that rely simply on predefined rules. Data de-identification is a process of removing or generalizing elements that can identify an individual from consultation records containing personal and sensitive information, thereby ensuring user privacy and data security during the model training process. De-identified data may consist of question types, question-answer pairs, answer fidelity evaluation results, contradiction evaluation results, and consultation efficiency indicators, and this data is used as core input values for fine-tuning and policy learning.
[0126] Model fine-tuning is a process designed to enable the lightweight first AI model to generate more sophisticated in-depth or clarification questions required in the early stages of consultation. For example, fine-tuning data may include a tuning set with the following structure: “User response type → Optimal question type → Quality evaluation score of the generated question.” Through this data, the first AI model learns patterns such as “Insufficient answer → Re-questioning,” “Contradiction detection → Confirmation question,” and “Discovery of new evidence → In-depth question.”
[0127] Reinforcement learning-based policy learning is a key mechanism for making optimal decisions in the question type selection stage prior to question generation. The processor (120) analyzes the impact of question types on counseling efficiency through counseling data and can use counseling time, amount of information collected, final report quality, etc., as reward values. The policy learning process can be expressed by the following basic policy value update formula (see Equation 9).
[0128] [Mathematical Formula 9]
[0129]
[0130] Here ε is the probability of selecting action a in state s (question type selection policy), η is the learning rate, R is the reward value based on consultation efficiency or report quality, and b is the baseline for variance reduction.
[0131] This formula operates by reinforcing the probability of selecting a specific question type if that type enhances the effectiveness of information gathering during the consultation process, while conversely, it learns to decrease the probability of selecting types that induce unnecessary questions.
[0132] In another embodiment, the processor (120) may apply different weight-based model selection logic depending on the consultation category (e.g., fraud, assault, unpaid wages, etc.) or consultation stage (initial information collection stage, intermediate in-depth analysis stage, stage immediately before report generation). For example, in the initial consultation stage, the speed of question generation is important, so the weight of using the first AI model may be increased, and in the later part of the consultation or the report generation stage, high-performance analysis is required, so the weight of the second AI model may be increased, and for this purpose, the following dynamic model selection formula may be used (see Equation 10).
[0133] [Mathematical Formula 10]
[0134]
[0135] Here is the complexity of the counseling context (amount of evidence, number of issues, etc.), is the processing level required during the consultation phase, and λ and μ are model selection weights.
[0136] It can operate in such a way that if this value exceeds a certain threshold, the second AI model is selected, and if not, the first AI model is selected.
[0137] This configuration satisfies both conflicting requirements of “real-time question generation speed” and “high-quality legal report generation,” which a single model cannot achieve, and also provides the technical effect of simultaneously improving consultation accuracy and efficiency by enabling the system to make increasingly sophisticated question decisions over time through model fine-tuning and policy learning.
[0138] In one embodiment, reinforcement learning-based policy learning through a processor (120) may be based on state information including a context summary, a result of an answer fidelity evaluation, and whether there is a contradiction, behavior information for selecting a subsequent question type, and reward information calculated based on the efficiency of the consultation or a report quality score. This reinforcement learning structure is intended to enable the consultation system to gradually establish a more efficient question selection policy on its own by learning user response patterns and information collection effects that are repeatedly observed in actual consultation data, rather than using only predefined rules.
[0139] First, the state information of reinforcement learning includes a context summary accumulated by the processor (120) during the consultation, a fidelity evaluation result for the recent answer, and a result of determining whether there is a contradiction. The context summary refers to a structural representation of facts, key event elements, and unresolved information already secured in the consultation flow, and functions as basic information for determining the characteristics of questions required at each consultation stage. The answer fidelity evaluation result indicates the extent to which the user's answer satisfies the requirements of the existing question, and this is an important state variable for determining which type of subsequent question should be a “re-question,” “clarification question,” or “in-depth question.” The presence of a contradiction indicates the level of consistency between the user's statement and the result of the evidence analysis, and since a question to resolve the contradiction is required when a contradiction is detected, it has a high influence on the question selection policy.
[0140] Action information is a type of follow-up question (action) selected by the processor (120), which can be classified into clarification questions, supplementary questions, fact-checking questions, deep questions, etc. The processor (120) receives the current state as input and selects a question type expected to have the highest information collection efficiency, and this selection policy is gradually optimized through reinforcement learning.
[0141] Compensation information is calculated based on consultation efficiency and report quality, which is a quantified value of how much useful information was actually secured through the questions selected during the consultation process, or how much they contributed to the accuracy and structuring quality of the final report. Consultation efficiency can be measured as the “ability to secure the maximum key information with the minimum number of questions,” and report quality can be evaluated based on criteria such as “accuracy of legal issues, inclusion of grounds, and clarity of scenarios.” For example, positive compensation is granted if question types are appropriately selected to secure new key information, while negative compensation may be granted if they lead to unnecessary or repetitive questions.
[0142] Reinforcement learning-based policy learning can be implemented with the following basic Q-value update formula (see Equation 11).
[0143] [Mathematical Formula 11]
[0144]
[0145] Here, s is the current state (context summary, answer fidelity, contradiction), a is the selected question type, R is the reward information, γ is the discount rate, η is the learning rate, s' is the new state after question selection, and a' represents the subsequent question type corresponding to the new state s'.
[0146] Through this equation, the processor (120) can continuously learn which type of question yields the highest counseling performance in the long term in a specific state. For example, if user answers are consistently provided insufficiently, the Q-value of the “re-questioning” behavior in that state may be higher than other behaviors, and conversely, if there are frequent contradictions between user statements and evidence, the Q-value of the “clarity-finding questioning” behavior may be strengthened.
[0147] In another embodiment, state variables, behavioral variables, and reward values may be processed with different weights depending on the case category or counseling stage. For example, in criminal cases, the importance of the presence of contradiction is high, so the weight Set it high, and since clarity of amount or conditions can be important in contract dispute cases, the fidelity evaluation weight can be set relatively large. These weights can be used to reconstruct the state values using the following linear combination model (see Equation 12).
[0148] [Mathematical Formula 12]
[0149]
[0150] Here, C is the amount of information derived from the context summary, A is the answer fidelity evaluation value, M is whether a contradiction is detected (0 or 1), It is a weight that varies depending on the type of incident or counseling strategy.
[0151] The state value reconstructed in this manner is used as input for the question selection policy, and as the consultation progresses, the weight adjustment algorithm can be automatically updated by analyzing the pattern of state change. The processor (120) continuously improves system performance by enhancing the question selection policy based on this reinforcement learning structure, thereby minimizing duplicate questions during the consultation process and focusing on securing only core information.
[0152] Consequently, the reinforcement learning-based policy learning structure of the present embodiment enables the selection of an optimal questioning action by combining various state elements (context, answer quality, and whether there is a contradiction) occurring in a consultation situation, and by ensuring that the selection is fed back into consultation efficiency and report quality, it provides a technical effect in which the AI legal consultation system learns and improves itself.
[0153] In one embodiment, the processor (120) may assign the computation of an AI model for at least one of generating question data, analyzing evidence data, or generating a report to a parallel processing executor. This configuration is intended to distribute the computational load across multiple execution units and minimize overall processing delays, taking into account that the computational load and processing time of various types of AI computations performed during the legal consultation process differ from one another. For example, question generation can be performed in a relatively short time because it uses a lightweight first AI model, whereas the execution time for analyzing evidence data or generating a report may be longer because it requires image, voice, video processing, or the generation of large-scale LLM-based documents. Taking these differences into account, the processor (120) assigns computational tasks to parallel processing executors (e.g., thread pool-based executors or AI-dedicated inference servers) according to the type of computation, thereby maintaining the real-time nature of the consultation and the accuracy of the report generation simultaneously.
[0154] Additionally, the processor (120) can receive processing results transmitted from a parallel processing executor via a message queue. The message queue serves as an intermediate layer that asynchronously transmits the completion status and processing results of various tasks performed by the parallel executor, allowing the processor (120) to receive results when necessary without directly waiting for the completion of operations. For example, although the task of analyzing evidence takes a relatively long time, as soon as the intermediate and final results arrive via the message queue, the processor (120) incorporates the results into the context or report generation stage. This message queue structure ensures the stability and processing efficiency of the entire system even in complex consultation environments where multiple pieces of evidence are submitted simultaneously or various types of tasks are performed simultaneously.
[0155] And, the processor (120) may be configured to provide a response to a request for report generation from a user terminal (200) regardless of whether the operation is completed.
[0156] This serves as a clear explanation of the asynchronous processing structure of the present invention. When a report generation request is received, the processor (120) immediately delegates the request to a parallel processing executor and immediately returns status information to the user, such as "Request received" or "Processing in progress." Subsequently, the completion status of the actual report generation operation is transmitted via a message queue, and the processor (120) transmits the report generation result to the user terminal (200) based on this. This configuration eliminates the disadvantages of the traditional synchronous structure, where the user must wait until the report generation task is finished, and has the effect of significantly improving the user experience.
[0157] Additionally, the processor (120) may apply a weight-based scheduling model to set the priority of parallel processing tasks differently according to the type of event, data complexity, consultation stage, etc. For example, the following basic priority calculation formula may be applied (see Equation 13).
[0158] [Mathematical Formula 13]
[0159]
[0161] Here is the execution priority of the i-th task, is the estimated processing time of a task (e.g., longer tasks can be set to a higher priority), is the importance of the task to the counseling context (e.g., tasks directly related to contradiction resolution have high importance), is the size of the resources required to perform the task (e.g., GPU computation amount), is a weight that varies depending on the type of incident and the counseling stage.
[0162] For example, in the latter part of the consultation, that is, the report generation stage, the importance of large-scale LLM operations responsible for report generation increases. It is set relatively high, and conversely, the priority of the question generation task is high during the initial stages of consultation. This can be emphasized. This dynamic scheduling method optimizes overall consultation quality and response speed simultaneously by ensuring that the most critical operations at each consultation stage are preferentially allocated system resources.
[0163] Meanwhile, the processor (120) can sequentially integrate results received through a message queue to keep the consultation context up to date, and the parallel processing and asynchronous response structure are naturally connected to the answer evaluation, contradiction detection, scenario generation, and report generation modules described in the preceding claim. For example, when the evidence analysis work is completed, the result is immediately reflected in the context update, and this information is used immediately in the subsequent question generation and report generation stages. The asynchronous response structure of the report generation request allows the user to continue the consultation or check the request results again after closing the system without being constrained by long processing times, thereby significantly improving the flexibility and practical applicability of the entire consultation flow.
[0164] Consequently, in this embodiment, the processor (120) performs the functions of delegating operations to a parallel processing executor, receiving asynchronously based on a message queue, and providing a user response regardless of whether the operation is completed, thereby providing the system with technical effects that offer high processing efficiency, stability, and improved user experience in a complex AI legal consultation environment.
[0165] FIG. 4 is a flowchart illustrating a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to one embodiment of the present invention.
[0166] Referring to FIG. 4, the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method according to one embodiment of the present invention may include the following steps S1 to S5. However, it is not limited thereto, and other general steps may be further included in the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method.
[0167] The above RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method may consist of steps processed chronologically in a system (100) that performs the aforementioned RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method. Therefore, even if details are omitted below, the description above regarding the system (100) that performs the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method may be equally applied to the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method described later.
[0168] In the above S1 step, the processor (120) can collect user question-and-answer data from a user terminal used by the user and manage accumulated consultation information in the form of context.
[0169] In the above S2 step, the processor (120) can evaluate the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal (200) with the previous question and consultation context information of the AI model.
[0170] In the above S3 step, the processor (120) can select a type of follow-up question according to a predefined rule or learned policy using evaluation results and consultation context information as input, and generate question text corresponding to the selected question type.
[0171] In the above S4 step, the processor (120) can analyze evidence data including at least one of text, PDF, image, voice, or video to extract key information and cross-verify the consistency or inconsistency between the extracted information and the user's statement.
[0172] In the above S5 step, when the processor (120) receives a report generation request signal from the user terminal (200), it can perform a RAG (Retrieval-Augmented Generation) based information search to look up statutes, precedents, or related documents to derive legal grounds, and generate a report including case analysis and scenarios by combining the derived legal grounds and consultation context information.
[0173] Meanwhile, the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method performed by the aforementioned system (100) may be implemented in the form of a computer program stored on a computer-readable storage medium. That is, the computer program may include instructions for implementing the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation method, and the instructions of the computer program may be stored on a computer-readable storage medium. The computer program may include a mobile application.
[0174] For example, computer-readable storage media may include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and hardware devices specifically configured to store and execute computer program instructions, such as ROM, RAM, and flash memory. Computer program instructions may include machine code generated by a compiler and high-level language code that can be executed by a computer using an interpreter, etc.
[0175] Additionally, the processor (120) can perform legal consultation through an integrated consultation pipeline in which the provision of preliminary questions, the generation of adaptive questions, the cross-verification of multiple evidence, the derivation of legal grounds based on RAG, and the recommendation of subsequent legal tasks are linked in stages.
[0176] Specifically, the processor (120) can form a consultation context through preliminary questions in the initial stage and then gradually establish the facts through user response evaluation and adaptive question selection. Once the facts are established to a certain level or higher, the processor (120) can correct the reliability of the user's statement by performing multiple evidence analysis and cross-verification, and then derive legal grounds through RAG-based information search.
[0177] Finally, the processor (120) can generate a report including case analysis and scenarios, and recommend subsequent legal tasks based on the report, thereby allowing the consultation results to naturally lead to actual legal responses. Through this, the present invention can achieve the technical effect of providing a consistent automation structure from the initial consultation stage to the practical application stage.
[0178] As described above, although the present invention has been explained by limited embodiments and drawings, the present invention is not limited thereto, and it is obvious that various modifications and variations are possible within the scope of the technical spirit of the present invention and the equivalent scope of the claims described below by those skilled in the art to which the present invention belongs.
[0179] Meanwhile, although terms indicating directions such as up, down, left, right, front, and back have been used in this invention, these terms are used merely for convenience of explanation, and it is obvious to those skilled in the art that they may vary depending on the position of the object or the position of the observer. Explanation of the symbols
[0180] 100 : System 110 : Memory 120 : Processor 200 : User terminal
Claims
Claim 1 Memory where instructions are stored; The system includes a processor configured to perform legal consultation processing functions by executing the above commands, wherein the processor collects user question-and-answer data from a user terminal used by a user and manages accumulated consultation information in the form of context, evaluates the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal with the previous question and consultation context information of an AI model, selects a type of subsequent question according to a predefined rule or learned policy using the evaluation result and consultation context information as input, generates question text corresponding to the selected question type, extracts key information by analyzing evidence data including at least one of text, PDF, image, voice, or video, cross-verifies consistency or inconsistency between the extracted information and the user's statement, and, upon receiving a report generation request signal from the user terminal, performs a RAG (Retrieval-Augmented Generation) based information search to query statutes, precedents, or related documents to derive legal grounds, and generates a report including case analysis and scenarios by combining the derived legal grounds and consultation context information, wherein the processor uses at least one of a lightweight first AI model for question generation and a second AI model for report generation, and to the user Data accumulated during the consultation process is anonymized to fine-tune the above-mentioned first AI model, and the model is configured to learn question selection rules through reinforcement learning-based policy learning, and is configured to apply different weight-based model selection logic according to the consultation category or consultation stage, and the weight-based model selection logic is defined according to the following Equation 1, [Equation 1] (Here is the complexity of the counseling context (amount of evidence, number of issues), is the processing level required during the consultation phase, and λ and μ are model selection weights.) Reinforcement learning-based policy learning through the above processor is performed based on state information including a context summary, answer fidelity evaluation results, and whether there is a contradiction, behavior information for selecting a follow-up question type, and reward information calculated based on the efficiency of the consultation or report quality score, and the state information of reinforcement learning includes a context summary accumulated by the processor during the consultation, fidelity evaluation results for recent answers, and results of determining whether there is a contradiction, and reinforcement learning-based policy learning is implemented by the Q-value update formula of Equation 2 below, [Equation 2] (Here, s is the current state (context summary, answer fidelity, presence of contradiction), a is the selected question type, R is the reward information, γ is the discount rate, η is the learning rate, s' is the new state after question selection, and a' refers to the subsequent question type corresponding to the new state s'.) RAG-based adaptive question generation and multiple evidence cross-validation AI legal consultation system. Claim 2 In claim 1, the processor is configured to generate scenarios from the perspectives of attackers and defenders responding to legal issues using the consultation context information and RAG-based information search results, in a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system. Claim 3 In paragraph 2, the processor is configured to generate a structured report including a case overview, a summary of facts, legal issues, legal grounds, case strategy, expected actions and duration, and necessary documents when generating a report including the case analysis and scenario, a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system. Claim 4 In claim 1, the processor is configured to extract metadata including at least one of Optical Character Recognition (OCR), Named Entity Recognition (NER), Speech-to-Text (STT), Speaker Separation, and Scene Understanding when performing evidence data analysis, a RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system. Claim 5 A method for AI legal consultation based on RAG-based adaptive question generation and multiple evidence cross-verification, performed by an AI legal consultation system based on RAG-based adaptive question generation and multiple evidence cross-verification, comprising: a step of collecting user question-and-answer data from a user terminal used by a user and managing accumulated consultation information in the form of context; a step of evaluating the fidelity and logical contradiction of the user's answer by comparing the user's answer input from the user terminal with the previous question and consultation context information of the AI model; a step of selecting a type of subsequent question according to a predefined rule or learned policy using the evaluation result and consultation context information as input, and generating question text corresponding to the selected question type; a step of analyzing evidence data including at least one of text, PDF, image, voice, or video to extract key information, and cross-verifying the consistency or inconsistency between the extracted information and the user's statement. The method includes the step of, upon receiving a report generation request signal from a user terminal, performing a RAG (Retrieval-Augmented Generation) based information search to query statutes, precedents, or related documents to derive legal grounds, and generating a report including case analysis and scenarios by combining the derived legal grounds with consultation context information; wherein the RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system uses at least one of a lightweight first AI model for question generation and a second AI model for report generation, de-identifies data accumulated during the consultation process with the user to fine-tune the first AI model, and is configured to learn question selection rules through reinforcement learning-based policy learning, and is configured to apply different weight-based model selection logic according to the consultation category or consultation stage, and wherein the weight-based model selection logic is defined according to the following Equation 1, [Equation 1] (Here is the complexity of the counseling context (amount of evidence, number of issues), is the processing level required during the consultation phase, and λ and μ are model selection weights.) Reinforcement learning-based policy learning through the above RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system is performed based on state information including context summary, answer fidelity evaluation results, and whether there is a contradiction, behavior information for selecting a subsequent question type, and reward information calculated based on the efficiency of the consultation or report quality score, and the state information of reinforcement learning includes the context summary, fidelity evaluation results for recent answers, and contradiction determination results accumulated by the above RAG-based adaptive question generation and multiple evidence cross-verification AI legal consultation system during the consultation, and reinforcement learning-based policy learning is implemented by the Q-value update formula of Equation 2 below, [Equation 2] (Here, s is the current state (context summary, answer fidelity, presence of contradiction), a is the selected question type, R is the reward information, γ is the discount rate, η is the learning rate, s' is the new state after question selection, and a' refers to the subsequent question type corresponding to the new state s'.) RAG-based adaptive question generation and multiple evidence cross-validation AI legal consultation method.
Citation Information
Patent Citations
System, server and method for customized interview based on artificial intelligence
KR1020250006664A
Method and apparatus for generating legal document
KR1020250167263A
Method for providing chronological summary of information about the development of an incident and the system thereof
KR1020250173315A
Method for simulating legal cases using artificial intelligence agent
KR102873605B1
Method for simulating legal cases using artificial intelligence
KR102873606B1
