Multi-agent interaction reasoning method and system for high-fidelity legal consultation
By employing a multi-agent interactive reasoning method, the problem of uncertain state transitions and information vacuums in existing legal AI systems when faced with incomplete or ambiguous inputs is solved, achieving certainty and auditability of high-fidelity legal advice and improving the system's robustness and advice quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHEAST FORESTRY UNIV
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-31
AI Technical Summary
Existing legal AI systems lack interactive clarification mechanisms when faced with incomplete or ambiguous user input, leading to uncertain state transitions, information vacuums, and factual illusions. This prevents the formation of stable workflow loops, and semantic biases arise from contextual information when calling heterogeneous tools, reducing the system's professional reliability.
A multi-agent interactive reasoning method is adopted, which uses a unified state blackboard control system, including an interactive coordination agent, a tool execution agent, a response generation agent, and a reflective agent. By utilizing a sliding window mechanism and a deterministic symbol correction function, invalid communication is intercepted, fuzzy queries are proactively clarified, and query rewriting and response generation are optimized to ensure the determinism and auditability of the system in a high-fidelity environment.
It improves the controllability and auditability of the workflow, effectively intercepts invalid calculations, optimizes cross-modal retrieval accuracy, significantly improves the robustness and consultation integrity under extreme conditions, and enhances consultation quality and the professional reliability of responses.
Smart Images

Figure CN122491491A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and legal technology, and in particular to a multi-agent reasoning and workflow control method suitable for handling legal consultations with ambiguity and high fidelity requirements. Background Technology
[0002] In the field of legal AI, large language models are currently widely used in tasks such as legal question answering, judgment prediction, and contract review. However, most existing legal AI tools are designed as single-turn "query-response" systems. When faced with incomplete or ambiguous user input, current models often fail to initiate dialogues aimed at clarifying the facts, instead being forced to guess at the missing legal facts. This lack of iterative and clarification-driven workflows easily leads to models generating biased, misleading, or factually illusory legal advice, thus reducing professional reliability in high-risk legal environments.
[0003] Furthermore, while existing multi-agent systems attempt to address these issues through multi-agent collaboration, they largely rely on open-ended random generation and debate (a black-box model), which conflicts with the auditability and stringent accountability standards required by the legal industry. Current algorithms and architectures do not offer fundamental optimizations from the perspectives of systematically eliminating query ambiguity, enhancing process traceability, and proactively clarifying interactions.
[0004] Existing legal consultation AI systems lack interactive clarification mechanisms, leading to random state transitions between nodes when processing complex, long text inputs in existing open multi-agent systems. This results in uncontrollable and untraceable reasoning paths, making it difficult to form stable workflow loops in specific professional fields. Furthermore, traditional single-round retrieval systems cannot autonomously complete key parameters when the user's original input information is missing or ambiguous, causing the model to generate invalid calculations or factual illusions in an "information vacuum" state, reducing the system's professional reliability. Simultaneously, when invoking heterogeneous tools such as similar case matching or legal provision retrieval, the original query statements often cannot directly adapt to structured retrieval needs, resulting in low retrieval recall and semantic deviations arising from multiple rounds of contextual information flow. Summary of the Invention
[0005] This invention addresses the technical problems in existing legal consultation AI systems, including task failures due to uncertain state transitions caused by the lack of interactive clarification mechanisms, information vacuums and illusions in complex semantic environments, and context drift in heterogeneous tool invocations. It proposes a deterministic multi-agent closed-loop reasoning framework suitable for high-fidelity legal consultation scenarios, specifically:
[0006] A multi-agent interactive reasoning method for high-fidelity legal consultation, characterized in that the method is based on a unified state blackboard control system, the system comprising an interactive coordination agent, a tool execution agent, a response generation agent, and a reflection agent, specifically including the following steps:
[0007] Step 1: The interactive coordination agent obtains the user's input legal consultation request and performs intent routing evaluation by combining the currently maintained digital case file context, which includes dynamic case summaries and dialogue history. If the information is insufficient, a "clarification needed" instruction is generated. If external evidence is required, a "use tool" plan is generated. The dialogue history is processed using a sliding window mechanism, and an invalid communication is intercepted and legal terminology search is forced in the fuzzy query through a neural symbol routing strategy that includes basic strategies and deterministic symbol correction functions.
[0008] Step 2: After receiving the "Use Tool" plan, the tool execution agent automatically rewrites the user's colloquial expression into a structured legal search query using the digital case file context, and sequentially calls the preset legal toolchain to perform the search, outputting the search results as observation values.
[0009] Step 3: After receiving the observed value or non-tool instruction, the response generating agent evaluates the quality and relevance of the context, and triggers an adaptive reasoning mechanism based on the intent signal issued by the interactive coordinating agent to dynamically adjust the cognitive load, thereby synthesizing a clear, user-oriented legal response text; wherein, for non-tool instructions, a fast-track mode that truncates complex thought chains is enabled, while for complex legal analysis, deep reasoning is retained.
[0010] Step 4: The reflective agent performs a quality assurance review on the generated response text by executing an audit function that has four orthogonal constraints: semantic novelty, pragmatic utility, tone alignment, and factual constraints. If the review fails and the maximum recursion depth is not reached, the generated criticism information is updated in the system's state vector, forcing the response generating agent to return to step 3 for regeneration with the criticism information as a conditional constraint. If the review passes, the final high-fidelity response is output.
[0011] Furthermore, the digital case file is a persistent digital storage space maintained by the system, and its content includes at least: dynamic case summaries, multi-turn dialogue history, and intermediate signals for controlling routing switching between intelligent agents.
[0012] Furthermore, in step 1, the neural symbol routing strategy includes a basic strategy and a deterministic symbol correction function, which is used to forcibly intercept and trigger a legal term search to supplement key legal elements when the user input is detected as a fuzzy query.
[0013] Furthermore, in step 2, before rewriting the query, the tool execution agent first extracts key legal information based on the current digital case file context, and reconstructs the user's original colloquial expression into a structured query statement containing legal attribute tags.
[0014] Furthermore, in step 2, the legal toolchain includes at least: a similar case matching tool, a legal provision retrieval tool, and a web search tool; the tool execution agent performs chained calls according to the tool types and their order specified in the "Use Tools" plan.
[0015] Furthermore, in step 3, the response generating agent evaluates the observations output in step 2 before synthesizing the text. The evaluation criteria include the relevance of the retrieved content to the legal facts of the case and the timeliness of the evidence.
[0016] Furthermore, in step 4, the audit function executed by the reflective agent examines the generated response text under orthogonal constraints in the following four dimensions;
[0017] Semantic novelty: Check whether the response avoids mechanical repetition of user input;
[0018] Pragmatic practicality: Check whether actionable legal advice or wording suggestions are provided;
[0019] Tone alignment: Check whether the tone combines legal professionalism with user empathy;
[0020] Factual constraints are followed: legal advice is examined to ensure it is strictly based on the legal evidence and facts of the case.
[0021] Furthermore, the method also includes an ablation protection step: when the missing information retrieved by the external tool is detected, the user is actively asked to obtain the missing legal facts by triggering the "clarification needed" instruction in step 1, so as to prevent the model from generating a factual illusion.
[0022] The technical effects achieved by this invention are reflected in the following four aspects:
[0023] 1. Improved controllability and auditability of workflow: Through a unified state blackboard and deterministic intent routing evaluation, random multi-agent debates are transformed into pre-defined path flows, ensuring the determinism of state transitions at each node and solving the problem of untraceable paths in complex task processing.
[0024] 2. Effectively intercept invalid computations and eliminate ambiguity: By introducing a neural symbol routing strategy and a "need clarification" instruction, the system can proactively identify whether the input features meet the processing conditions in the early stages of computation. By proactively completing parameters, it avoids illegal reasoning and factual illusions caused by missing information, and significantly improves the robustness of the system under extreme conditions.
[0025] 3. Improved retrieval accuracy across modalities and tools: The query rewriting mechanism in the dynamic RAG implementation solves the semantic alignment problem between user natural language and professional structured databases. By maintaining a persistent "digital file" among multiple agents, it effectively suppresses semantic loss or shift during context flow.
[0026] 4. Quantitative improvement in computational performance: Experimental data shows that this solution improves consultation integrity by 17% under the AUDIT benchmark test, and demonstrates strong anti-crash capability in the ablation experiment with missing information, verifying the technical advantages of this solution in handling high-fidelity tasks.
[0027] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, characterized in that the storage medium stores at least one instruction, which is loaded and executed by a processor to implement a multi-agent interactive reasoning method for high-fidelity legal consultation as described in any one of claims 1 to 8.
[0028] This invention also proposes a multi-agent interactive reasoning system for high-fidelity legal consultation, characterized in that it includes:
[0029] Status blackboard module: Used for real-time maintenance and updating of digital case files containing case summaries, dialogue history, and routing signals;
[0030] A multi-agent processing group comprises an interactive coordinating agent, a tool execution agent, a response generation agent, and a reflective agent, each for performing the method steps of any one of claims 1 to 8. Attached Figure Description
[0031] Figure 1 A flowchart comparing the existing single-agent architecture with the ZhiFa multi-agent framework of this invention in handling legal consultation.
[0032] Figure 2 This is a closed-loop workflow diagram of the present invention;
[0033] Figure 3 A comparison diagram of the standard RAG workflow and the agent-based dynamic RAG workflow of this invention;
[0034] Figure 4 This is a bar chart comparing the overall performance of the present invention with various baseline models on the AUDIT benchmark;
[0035] Figure 5 A violin plot showing the score distribution of the core evaluation indicators. Detailed Implementation Specific Implementation Example 1:
[0037] This implementation method takes the handling of "rent deposit refund disputes" as an example, combined with... Figure 1-5 This invention describes the specific execution process of a multi-agent interactive reasoning method for high-fidelity legal consultation, as proposed in this invention, specifically including:
[0038] Combination Figure 2 This invention explains the working principle of a multi-agent interactive reasoning method for high-fidelity legal consultation. The system first obtains the user's legal consultation request, such as: "My landlord won't return my deposit, what should I do?". The interactive coordinating agent performs intent routing evaluation based on the currently maintained digital case file context. If the information is insufficient, such as the absence of a written contract, a "clarification needed" instruction is generated; if external evidence is required, a "use tools" plan is generated. A sliding window mechanism is used to process the dialogue history, and a neural symbol routing strategy, including a basic strategy and a deterministic symbol correction function, intercepts invalid communication and forces legal terminology searches in fuzzy queries.
[0039] Preferably, during the above process, the system maintains a persistent state management blackboard in the background. The digital case file includes at least: dynamically updated case summaries for "lease contract disputes - deposit type", multi-turn dialogue history, and intermediate signals for controlling routing switching between intelligent agents to prevent information loss during multi-turn reasoning.
[0040] Furthermore, the system employs a sliding window mechanism to process dialogue history and uses a neural symbol routing strategy that includes a basic strategy and a deterministic symbol correction function to intercept invalid communication and force legal term searches to be triggered in fuzzy queries.
[0041] Upon receiving a "use tool" plan, the tool execution agent automatically rewrites the user's colloquial expression into a structured legal search query using the digital case file context. It then sequentially invokes a pre-set legal toolchain to perform the search, outputting the results as observations. Combined with... Figure 3 This section compares the standard RAG workflow with the agent-based dynamic RAG workflow of this invention.
[0042] Furthermore, the intelligent agent automatically rewrites users' colloquial expressions, such as "no refund," into structured legal search queries that include legal terminology tags, such as "lease agreement + deposit refund conditions + explanation of liability for breach of contract," thereby optimizing subsequent search results. After receiving the "use tool" plan issued in step 1, the tool execution agent preprocesses the user request using contextual information from the digital case file.
[0043] Preferably, the tool execution agent sequentially invokes a preset legal toolchain. In this embodiment, the system first invokes a similar case matching tool (SCM) to find similar precedents, then invokes a legal provision retrieval tool (LAS) to locate relevant clauses in the Civil Code, and finally invokes a web search tool (WEB) to obtain the latest local rental policies, and outputs the completed results as an observation.
[0044] After receiving the observed values or non-tool instructions, the response generation agent assesses the quality and relevance of the context and synthesizes clear, user-oriented legal response text.
[0045] Furthermore, the agent first evaluates the quality and relevance of the observations (the retrieved legal facts and evidence). After receiving the observations, the response generation agent does not immediately generate a response. Instead, it removes irrelevant or outdated information and then synthesizes a clear, user-oriented legal response text.
[0046] Preferably, the generated response text is fed into a reflective agent for quality assurance review. The reflective agent executes an audit function with the following four orthogonal constraints:
[0047] 1. Semantic novelty: Check whether the response avoids mechanical repetition of user input;
[0048] 2. Pragmatic practicality: Check whether actionable legal wording suggestions are provided, such as "request the landlord to return the deposit within 7 days";
[0049] 3. Tone Alignment: Check whether the tone is both professional and empathetic;
[0050] 4. Factual constraints: Verify whether the recommendations are strictly based on the retrieved legal evidence and case file facts.
[0051] If the response fails the audit function review, the reflective AI will send it back to the response generation stage with criticism information for regeneration. Furthermore, to prevent the reasoning logic from entering an infinite loop, the system sets a maximum recursion depth, i.e., a maximum number of retries. If the response still fails after exceeding this number, it will be downgraded or the current optimal response will be output.
[0052] Preferably, an ablation protection mechanism is present throughout the entire process. When the tool's execution agent reports missing externally retrieved information, or when the interaction coordination agent detects missing key user facts such as deposit amount, the system will forcibly trigger a "clarification required" mechanism to intercept illegal guesses made by the model in an information vacuum. By proactively asking the user, the system's professional reliability is significantly improved.
[0053] This invention provides a deterministic design for the multi-agent collaborative process of legal consultation, proposing a closed-loop architecture of proactive clarification and self-correction, combined with... Figure 1 Compared to traditional single-agent architectures, the ZhiFa multi-agent framework proposed in this invention significantly reduces factual illusions while ensuring the auditability of the reasoning process. Combined with... Figure 4 The experimental results, presented in the AUDIT benchmark test comprising 240 rounds of legal dialogue, cover four main areas: marriage and family, labor disputes, contract disputes, and other legal issues. Figure 5 Compared with a zero-sample baseline large model, the technical solution provided by this invention improves consultation quality by 31% and response completeness by 17%. Furthermore, ablation experiments demonstrate that the interactive clarification mechanism designed in this invention effectively prevents model performance collapse under information loss conditions, significantly improving the professional reliability of the system. Specific Implementation Example 2:
[0055] This embodiment discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements all the steps of a multi-agent interactive reasoning method for high-fidelity legal consultation as described in Embodiment 1. The storage medium can be a physical medium such as random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, optical disc, or magnetic recording device. By embedding the aforementioned multi-agent reasoning logic in the storage medium, the portability and execution stability of the legal consultation system on different computing terminals are ensured. Specific Implementation Example 3:
[0057] This embodiment discloses a computer system for implementing high-fidelity legal consultation. The system physically consists of a processor and memory, and logically is divided into an interactive coordination agent, a tool execution agent, a response generation agent, and a reflective agent.
[0058] Through decoupling and collaboration between modules, this system enables deterministic reasoning from fact verification to suggestion generation in the legal consultation process, significantly improving the system's professional reliability and auditability.
[0059] The scope of this invention is not limited to the above-described embodiments; a combination of one or more specific embodiments can also achieve the purpose of the invention.
Claims
1. A multi-agent interactive reasoning method for high-fidelity legal consultation, characterized in that, The method is based on a unified state blackboard control system, which includes an interactive coordinating agent, a tool execution agent, a response generation agent, and a reflective agent. Specifically, it includes the following steps: Step 1: The interactive coordination agent acquires the user's input legal consultation request and performs intent routing evaluation by combining the currently maintained digital case file context, which includes dynamic case summaries and dialogue history. In the above-mentioned digital case file context maintenance step, a sliding window mechanism is used to process the dialogue history to update the case summary. In the above-mentioned intent routing evaluation step, the intent is determined by a neural symbol routing strategy that includes a basic strategy and a deterministic symbol correction function: if the interactive coordination agent evaluates that the current case file factual information is insufficient, it generates a "clarification needed" instruction so that questions can be asked to the user in subsequent steps to supplement the case facts; if the factual information is clear but it is determined that the consultation requires external legal knowledge or similar case evidence, it generates a "use tool" plan and hands it over to the subsequent tool execution agent for processing; in addition, the neural symbol routing strategy also intercepts invalid communication and forces the triggering of legal terminology search in fuzzy queries. Step 2: After receiving the "Use Tool" plan, the tool execution agent automatically rewrites the user's colloquial expression into a structured legal search query using the digital case file context, and sequentially calls the preset legal toolchain to perform the search, outputting the search results as observation values. Step 3: After receiving the observed value or non-tool instruction, the response generating agent evaluates the quality and relevance of the current digital case file context, which includes retrieval evidence provided by the upstream agent, dynamic case summary, and user-input dialogue history. Based on the intent signal issued by the interactive coordinating agent, it triggers an adaptive reasoning mechanism to dynamically adjust the cognitive load and synthesize user-oriented legal response text. Among these steps, a fast-track mode that truncates complex thought chains is enabled for non-tool instructions, while deep reasoning is retained for complex legal analysis. Step 4: The reflective agent performs a quality assurance review on the generated response text by executing an audit function that has four orthogonal constraints: semantic novelty, pragmatic utility, tone alignment, and factual constraints. If the review fails and the maximum recursion depth is not reached, the generated criticism information is updated in the system's state vector, forcing the response generating agent to return to step 3 for regeneration with the criticism information as a condition constraint; if the review passes, the final high-fidelity response is output.
2. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, wherein, The digital case file is a persistent digital storage space maintained by the system, and its content includes at least: dynamic case summaries, multi-turn dialogue history, and intermediate signals used to control routing switching between intelligent agents.
3. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, In step 1, the neural symbol routing strategy includes a basic strategy and a deterministic symbol correction function, which is used to forcibly intercept and trigger a legal term search to supplement key legal elements when the user input is detected as a fuzzy query.
4. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, In step 2, before rewriting the query, the tool's execution agent first extracts key legal information based on the current digital case file context, and reconstructs the user's original colloquial expression into a structured query statement containing legal attribute tags.
5. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, In step 2, the legal toolchain includes at least: a similar case matching tool, a legal provision retrieval tool, and a web search tool; the tool execution agent performs chained calls according to the tool types and their order specified in the "Use Tools" plan.
6. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, In step 3, the response generating agent evaluates the observations output in step 2 before synthesizing the text. The evaluation criteria include the relevance of the retrieved content to the legal facts of the case and the timeliness of the evidence.
7. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, In step 4, the audit function executed by the reflective agent examines the generated response text under orthogonal constraints in the following four dimensions; Semantic novelty: Check whether the response avoids mechanical repetition of user input; Pragmatic practicality: Check whether actionable legal advice or wording suggestions are provided; Tone alignment: Check whether the tone combines legal professionalism with user empathy; Factual constraints are followed: legal advice is examined to ensure it is strictly based on the legal evidence and facts of the case.
8. The multi-agent interactive reasoning method for high-fidelity legal consultation according to claim 1, characterized in that, The method also includes an ablation protection step: when the missing information retrieved by the external tool is detected, the user is actively asked to obtain the missing legal facts by triggering the "clarification needed" instruction in step 1, so as to prevent the model from generating a factual illusion.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the multi-agent interactive reasoning method for high-fidelity legal consultation as described in any one of claims 1 to 8.
10. A multi-agent interactive reasoning system for high-fidelity legal consultation, characterized in that, include: Status blackboard module: Used for real-time maintenance and updating of digital case files containing case summaries, dialogue history, and routing signals; A multi-agent processing group comprises an interactive coordinating agent, a tool execution agent, a response generation agent, and a reflective agent, each for performing the method steps of any one of claims 1 to 8.