Intelligent dialogue method and system, electronic equipment, storage medium and program product

By introducing structured storage of parameter values ​​and dialogue path diagrams into the intelligent dialogue framework, the problems of memory management fragility and high-frequency interactions in enterprise office scenarios are solved, stable and efficient dialogue process control is achieved, and delays and costs are reduced.

CN120849568AInactive Publication Date: 2025-10-28HUA DATA TECH (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511357350.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2025-10-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing technologies, intelligent dialogue frameworks suffer from memory management fragility and instability in enterprise office scenarios, leading to context loss and uncertainty in the decision-making process. High-frequency interactions also bring about network delays and high computing costs.

Method used

By using structured stored parameter values ​​and dialogue path graphs, we can determine task intent, extract key parameters, navigate on the dialogue path graph, generate guiding dialogue, implement task execution, and reduce dependence on large language models.

Benefits of technology

It improves the stability and efficiency of the conversation process, reduces API latency and computing costs, enhances maintainability and scalability, and avoids process interruptions caused by context loss and large language model hallucinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849568A_ABST
    Figure CN120849568A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent dialogue method and system, electronic equipment, a storage medium and a program product. The method comprises the steps of determining a dialogue path diagram in response to a task-type dialogue as a dialogue input content; extracting a parameter value of a key parameter required for realizing the task intention from the dialogue input content, and associatively storing the parameter value and the task identifier; judging whether the parameter values of all the key parameters are stored or not; if the judgment result is no, generating a guiding verbal skill for guiding and providing the next conversation input content according to the conversation path diagram, and returning to the step of extracting the parameter values of the key parameters required for realizing the task intention; and if the judgment result is yes, triggering the execution action of the task intention according to the parameter values of all the key parameters. According to the method, the structurally stored parameter values and the dialogue path diagram are deeply fused to jointly form a stable, efficient and predictable dialogue process control core, and the method does not need to transmit tedious dialogue history and can get rid of dependence on infinitely growing contexts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to an intelligent dialogue method, system, electronic device, storage medium, and program product. Background Art

[0002] With the rapid development of artificial intelligence technology, conversational agents have become a key tool for improving the efficiency of modern enterprise offices. In an ideal office setting, the agent can seamlessly integrate into employees' daily workflows, acting as an intelligent assistant to autonomously complete various tasks such as scheduling meetings, requisitioning supplies, accessing internal knowledge, and answering administrative questions. This frees employees from tedious transactional work, allowing them to focus on more creative core business, and greatly improving the company's operational efficiency and employee job satisfaction.

[0003] However, current mainstream frameworks for building dialogue agents, especially those centered around large language models (LMs), exhibit significant technical bottlenecks when dealing with real-world, complex enterprise office scenarios. These frameworks typically employ a "flattened" memory management mechanism, relying on a continuously growing, linear dialogue history context. The agent needs to submit the complete dialogue history, detailed tool function descriptions, and the chain of thoughts for intermediate steps to the large language model, which then reasons through the massive text to determine its next action.

[0004] This approach, which heavily relies on extremely long contexts and tool descriptions for tool selection and scheduling, presents two major challenges in practical applications:

[0005] 1. Vulnerability and Instability of Memory Management: As the number of dialogue turns increases and task switching becomes more frequent, the context window expands rapidly, even exceeding the processing limits of large language models. To address this issue, the framework has to use methods such as truncation and summarization to compress historical information, but this easily leads to the loss of key state information, causing the agent to "amnesia." For example, in a complex process of switching from "querying knowledge" to "claiming a gift" and then back to "claiming a gift based on the previous query result," the agent may forget the initial query result due to context truncation. Furthermore, relying entirely on LLM to dynamically select tools and extract parameters from natural language descriptions lacks determinism in its decision-making process and is susceptible to model illusion, leading to tool call failures or parameter errors, resulting in highly unstable overall system performance.

[0006] 2. Challenges in operational efficiency and cost: Each interaction requires processing and transmitting massive amounts of contextual text, which not only introduces significant network latency but also drastically increases the computational overhead of large language models and the cost of API calls. For enterprise office scenarios requiring high-frequency interactions, this high-latency, high-cost model is difficult to scale. Summary of the Invention

[0007] The technical problem to be solved by this disclosure is to overcome the above-mentioned defects in the prior art and provide an intelligent dialogue method, system, electronic device, storage medium, and program product.

[0008] This disclosure solves the above-mentioned technical problems through the following technical solution:

[0009] Firstly, an intelligent dialogue method is provided, including:

[0010] In response to the dialogue input being a task-oriented dialogue, a dialogue path graph matching the task intent of the dialogue input is determined; the nodes of the dialogue path graph represent specific states and / or decision points of the dialogue logic, and the edges of the dialogue path graph represent the flow of the dialogue.

[0011] Extract the parameter values ​​of the key parameters required to achieve the task intent from the dialogue input content, and store the parameter values ​​in association with the task identifier;

[0012] Determine whether the parameter values ​​of all key parameters required to achieve the stated task intent are stored;

[0013] In response to the absence of parameter values ​​for all key parameters, a guiding dialogue is generated based on the dialogue path graph to guide the provision of the next dialogue input, and the step of extracting parameter values ​​for key parameters required to achieve the task intent from the dialogue input is returned.

[0014] In response to the parameter values ​​that store all key parameters, the execution action of the task intent is triggered based on the parameter values ​​of all key parameters.

[0015] Optionally, a guiding dialogue is generated based on the dialogue path diagram to guide the provision of the next dialogue input, including:

[0016] Identify the edges that match the task intent from the dialogue path graph;

[0017] The guiding script is determined based on the nodes connected to the matching edges.

[0018] Optionally, the guiding script is determined based on the nodes connected to the matching edges, including:

[0019] The guiding script is determined based on the nodes connected to the matching edges;

[0020] Determine whether the task intent can be achieved, adjust the guiding script based on the determination result, and display the adjusted guiding script.

[0021] Optionally, the task intent is to collect an item; determining whether the task intent can be achieved, and adjusting the guiding dialogue based on the determination result, includes:

[0022] Determine whether the inventory of the item meets the item redemption requirements;

[0023] If the requirements are not met, adjust the guiding script.

[0024] Optionally, the nodes connected by the matching edges represent specific states of the dialogue; determining the guiding dialogue based on the nodes connected by the matching edges includes:

[0025] In response to ambiguity in the value of a parameter for at least one key parameter in a specific state, a background thread is invoked to perform a clarification action, and the guiding script is determined based on the execution result of the clarification action.

[0026] Optionally, the intelligent dialogue method further includes: in response to the execution action of completing the task intent, clearing the parameter values ​​stored associated with the task identifier of the task intent;

[0027] And / or, in response to the dialogue input being a non-task-oriented dialogue, a response matching the dialogue input is generated based on a retrieval-enhanced generation model;

[0028] And / or, populate the parameter values ​​into the key parameter collection nodes contained in the dialogue path graph, the key parameter collection nodes defining key parameters associated with the task identifier.

[0029] Secondly, an intelligent dialogue system is provided, including:

[0030] An intent recognition module is used to determine a dialogue path graph that matches the task intent of the dialogue input content in response to the dialogue input content being a task-oriented dialogue; the nodes of the dialogue path graph represent specific states and / or decision points of the dialogue logic, and the edges of the dialogue path graph represent the flow of the dialogue.

[0031] The parameter extraction module is used to extract the parameter values ​​of key parameters required to achieve the task intent from the dialogue input content;

[0032] The memory management module is used to associate and store the parameter values ​​with the task identifier;

[0033] The path navigation module determines whether the memory management module has stored the parameter values ​​of all key parameters required to achieve the task intent;

[0034] The path navigation module, in response to the absence of parameter values ​​for all key parameters, generates a guiding dialogue based on the dialogue path diagram to guide the provision of the next dialogue input content, and returns the parameter values ​​of the key parameters required to achieve the task intent from the dialogue input content.

[0035] The path navigation module, in response to the parameter values ​​stored in all key parameters, triggers the execution action of the task intent based on the parameter values ​​of all key parameters.

[0036] Optionally, the memory management module is used to associate and store the parameter values ​​required to call the external tool to complete the task intent with the task identifier and the current dialogue node information; the external tool to be called to complete the task is also the external tool to be called to execute the task intent.

[0037] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein the processor executes the computer program to implement the intelligent dialogue method described in any one of the first aspects.

[0038] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the intelligent dialogue method described in any one of the first aspects.

[0039] Fourthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the intelligent dialogue method described in any one of the first aspects.

[0040] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this disclosure.

[0041] The positive advancements of this disclosure are as follows: It deeply integrates structured parameter values ​​and dialogue path graphs, forming a stable, efficient, and predictable dialogue flow control core. This fundamentally solves the problems of flow interruption and tool call failures caused by context loss and the illusion of large language models (LLMs) in traditional frameworks. This embodiment eliminates the need to transmit lengthy dialogue histories, freeing it from dependence on infinitely growing context. Each interaction with a large language model is lightweight and goal-oriented, significantly reducing API latency and computational costs. Furthermore, the dialogue logic exists in a visual graph configuration form; adding or modifying intent tasks only requires adjusting the corresponding graph configuration without altering the core code, greatly improving maintainability and scalability. Attached Figure Description

[0042] Figure 1 A flowchart illustrating an exemplary embodiment of this disclosure is provided.

[0043] Figure 2 A schematic diagram illustrating an application scenario of an intelligent dialogue method provided in an exemplary embodiment of this disclosure;

[0044] Figure 3 A schematic diagram of the structure of an intelligent dialogue system provided as an exemplary embodiment of this disclosure;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0046] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.

[0047] The prefixes such as "first" and "second" used in this disclosure are merely for distinguishing different descriptive objects and do not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes used to distinguish descriptive objects in this disclosure does not constitute a limitation on the described objects. The description of the described objects is given in the claims or the context of the embodiments, and should not be construed as an unnecessary limitation. Furthermore, in the description of this embodiment, unless otherwise stated, "multiple" means two or more.

[0048] Figure 1 A flowchart of an exemplary embodiment of this disclosure provides an intelligent dialogue method, which includes the following steps:

[0049] Step 101: In response to the dialogue input being a task-oriented dialogue, determine the dialogue path graph that matches the task intent of the dialogue input.

[0050] In this dialogue path diagram, the nodes represent specific states and / or decision points in the dialogue logic. Decision points and specific states can be set according to the task intent. Each node in the diagram is assigned a specific function, such as: a key parameter collection node, a path navigation node based on the user's task intent, a decision node based on a specific state, or an external tool invocation node.

[0051] Each node explicitly defines its interaction method with the memory management module. The edges of the dialogue path graph represent the flow of the dialogue.

[0052] A dialogue path graph is a directed graph data structure used to define the logic of multi-turn dialogues. Each task execution logic can be abstracted into an independent dialogue path graph. One type of task corresponds to one type of task intent. For example, if a user's task intent is to collect office supplies, the corresponding task is "item collection".

[0053] In this embodiment, complex dialogue logic is configured in the form of a graph, making the process clear, visible, and easy to maintain. This transforms intelligent dialogue from a "black box" of impromptu reasoning within massive texts into navigation on a well-defined dialogue path graph, greatly enhancing the stability and predictability of the process.

[0054] In step 101, the dialogue input is provided by the user, which can be, but is not limited to, text, voice, etc.

[0055] Step 102: Extract the parameter values ​​of the key parameters required to achieve the task intent from the dialogue input content, and store the parameter values ​​in association with the task identifier.

[0056] In one implementation, all key parameters required to achieve the task intent are predefined. During the dialogue, the parameter values ​​of the key parameters are extracted from the user-provided dialogue input. For example, the key parameters required to achieve the task intent of "office supplies collection" include the name, quantity, and collection time of the office supplies. In step 102, the parameter values ​​of these three key parameters need to be extracted from the dialogue input during the dialogue. For example, the parameter value for the quantity is "3", and the parameter value for the collection time is "Monday". Each extracted parameter value is associated with and stored with a task identifier. The task identifier can be represented by an ID or by text; this embodiment of the disclosure does not particularly limit this.

[0057] Understandably, the dialogue input provided by the user may involve multiple task intents (tasks), and each task intent is stored independently and in association. For example, based on the user's historical dialogue input, the user's task intent is determined to be meeting room reservation, and based on the user's current dialogue input, the user's task intent is determined to be office supplies pickup. The parameter values ​​of the key parameters for meeting room reservation and office supplies pickup are stored separately.

[0058] In one embodiment, the key parameters required for the task intent are bound to the dialogue path graph. Step 101 determines the key parameters required for the task intent while determining the dialogue path graph.

[0059] In one embodiment, parameter values ​​are associated with task identifiers and stored in nodes of the dialogue path graph. Specifically, parameter values ​​are populated in key parameter collection nodes within the dialogue path graph, which define key parameters associated with the task identifier. When a key parameter collection node finds that all required key parameters have been populated, it proceeds to the next node according to a preset path, triggering the execution of the task intent. When external tools (such as inventory lookup or task intent execution) need to be invoked, structured parameter values ​​are read directly from the key parameter collection nodes, ensuring accurate invocation.

[0060] In one embodiment, a globally unique session ID is created for each user, and an empty session variable space is initialized to store global information across tasks, that is, the parameter values ​​of key parameters of all task intents of the user are stored in the session variable space.

[0061] In one embodiment, each dialogue session has an independent, persistent memory instance. When the intelligent dialogue switches between different task scenarios, that is, when the dialogue input involves multiple task intents and switches back and forth, the memory state of each scenario is independently stored and restored, avoiding information confusion caused by context pollution.

[0062] In one embodiment, parameter values ​​and task identifiers are stored in a structured manner, which can be, but is not limited to, key-value pairs for precise storage. This represents a set of key parameters and their corresponding values ​​required to achieve the task intent or complete a specific task, rather than being mixed in with the natural language history. This embodiment does not simply record the dialogue flow, but rather stores and manages the key parameters necessary to complete the intended task, as well as the internal state flags during the intelligent dialogue process, in a structured form. This approach makes the reading and updating of the state extremely efficient and accurate.

[0063] In one embodiment, a memory management module is defined, which associates storage parameter values ​​with task identifiers.

[0064] Step 103: Determine whether the parameter values ​​of all key parameters required to achieve the task intent are stored.

[0065] To achieve the task intent, the parameter values ​​of all key parameters must be obtained. In step 103, it is determined whether the parameter values ​​of all key parameters required to achieve the task intent are stored, that is, whether the task intent can be achieved.

[0066] Step 104: In response to the parameter values ​​not being stored for all key parameters, generate a guiding dialogue based on the dialogue path graph to guide the provision of the next dialogue input, and return to the step of extracting the key parameters required to achieve the task intent from the dialogue input.

[0067] If the values ​​of all key parameters are not stored, it means that the task intent cannot be achieved yet. Guiding dialogue is needed to guide the user to input the next dialogue content in order to extract the values ​​of the missing key parameters.

[0068] Step 105: In response to the parameter values ​​that store all key parameters, trigger the execution action of the task intent based on all key parameters.

[0069] If the parameter values ​​of all key parameters are stored, indicating that the task intent can be fulfilled, then the execution action of the task intent is triggered. Triggering the execution action of the task intent may include invoking external tools. External tools may include various APIs required to implement the task intent.

[0070] In this embodiment, structured parameter values ​​and dialogue path graphs are deeply integrated to form a stable, efficient, and predictable dialogue flow control core. This fundamentally solves the problems of flow interruption and tool call failure caused by context loss and the illusion of large language models (LLMs) in traditional frameworks. This embodiment eliminates the need to transmit lengthy dialogue history, freeing it from dependence on infinitely growing context. Each interaction with a large language model is lightweight and goal-oriented, significantly reducing API latency and computational costs. Furthermore, the dialogue logic exists in a visual graph configuration format; adding or modifying intent tasks only requires adjusting the corresponding graph configuration without altering the core code, greatly improving maintainability and scalability.

[0071] In one embodiment, the step of generating a guiding phrase for providing the next dialogue input based on the dialogue path graph includes: determining edges that match the task intent from the dialogue path graph; and determining the guiding phrase based on the nodes connected to the matching edges.

[0072] In this embodiment, based on the task intent of the dialogue input, the correct edge is selected in the dialogue path graph, thereby smoothly advancing the dialogue to the next node and realizing dialogue path navigation. The generation of guiding dialogue can be achieved using an LLM model.

[0073] In one embodiment, the step of determining the guiding dialogue based on the nodes connected to the matching edges includes: determining the guiding dialogue based on the nodes connected to the matching edges; determining whether the task intent can be achieved; adjusting the guiding dialogue based on the determination result; and displaying the adjusted guiding dialogue. Determining whether the task intent can be achieved includes determining whether the parameter values ​​of all key parameters required to achieve the task intent have been collected, and whether the API return result matches the task intent.

[0074] For example, suppose the task intent is to claim an item. The entire interaction process of the dialogue agent involves collecting parameter values ​​for calling an external tool, then calling the external tool (item claim API), and generating specific prompting messages based on the API's return results. If the parameter values ​​for key parameters are incomplete, corresponding prompting messages are generated to guide the user to provide the complete parameter values. After collecting all the parameter values ​​for the key parameters required to call the item claim API, the item claim API is called. Based on the API's return results, specific prompting messages are generated: if the claimed item is out of stock, the API will return information related to "the item is out of stock," and the Large Language Model (LLM) will understand the API's return results and generate specific response content.

[0075] In one embodiment, the node connected to the matching edge represents a specific state of the dialogue. Determining the guiding dialogue based on the node connected to the matching edge includes: in response to ambiguity in the parameter value of at least one key parameter in the specific state, invoking a background thread to perform a clarification action, and determining the guiding dialogue based on the result of the clarification action.

[0076] For example, if the key parameter value "red wine" extracted from the user's dialogue input is a category rather than a specific gift item that can be directly claimed, this is considered an ambiguous parameter value. Therefore, a background thread is invoked to trigger a clarification action, such as querying the inventory for all specific gift items based on the category "red wine." Based on the inventory query results, a guiding message is determined, such as, "We have found the following red wines for you. Which one would you like?\n1. Brand A dry red (sufficient stock)\n2. Brand B Cabernet Sauvignon (3 bottles remaining)." Simultaneously with the background thread triggering the clarification action, a confirmation and guiding message generated based on the current memory state (knowing the user wants "red wine," with a quantity of "1 bottle") is displayed to the user.

[0077] In one embodiment, the method further includes the step of: clearing the parameter values ​​stored associated with the task identifier of the task intent in response to the execution action of completing the task intent. This is to alleviate the storage pressure on the system executing the intelligent dialogue method.

[0078] In one embodiment, prior to step 101, the dialogue input is fed into an intent classifier based on a Large Language Model (LLM). The purpose of this intent classifier is to route the user's initial request to different processing pipelines. The categories output by the intent classifier can be configured according to actual needs; for example, the intent classifier can be configured to recognize the following intent categories:

[0079] Category 1: General knowledge questions (e.g., "How many days of annual leave does the company offer?").

[0080] Category 2: Business knowledge Q&A (e.g., "Introduce our AIGC product line.");

[0081] Category 3: Meeting room booking tasks (e.g., "I want to book a meeting room for tomorrow.");

[0082] Category 4: Gift claim task (e.g., "I would like to claim a bottle of red wine.");

[0083] Category 5: Small talk (e.g., "Hello.");

[0084] Categories 1, 2, and 5 are non-task-based dialogues, while categories 3 and 4 are task-based dialogues.

[0085] In one embodiment, in response to a non-task-oriented dialogue input, a response matching the dialogue input is generated based on a retrieval-enhanced generation (RAG) model.

[0086] The following section provides further explanation of the dialogue path diagram and the intelligent dialogue process. Figure 2 For example.

[0087] The dialogue path diagram in this embodiment can be represented as a tree diagram or a topology diagram; of course, the dialogue path diagram can also describe each node and the relationship between the nodes through text.

[0088] Figure 2 Branch A of the dialogue path graph involved includes the following nodes.

[0089] Top-level dialogue routing: The agent's intent recognition model receives the input and classifies it as a "general knowledge question-and-answer" intent. The request is then routed to the non-task-oriented dialogue (RAG) processing pipeline.

[0090] Query rewritten nodes:

[0091] Function: This node is responsible for ensuring the clarity of the query. In this example, the query "How many days of annual leave does the company offer?" is clear enough, so the node directly passes it to the next step. If the input is ambiguous (for example, after discussing annual leave, the user then asks "What about interns?"), the node will consider the context and rewrite the query as "How many days of annual leave do interns offer?".

[0092] Knowledge retrieval node:

[0093] Function: Upon receiving a specific query, this node performs a search operation in the pre-configured "Company Rules and Regulations" knowledge base to find policy clauses related to "annual leave".

[0094] Answer generation node:

[0095] Function: The system provides the user's original query and relevant clauses retrieved from the knowledge base as contextual information to a large language model (LLM). The LLM is responsible for integrating this information to generate a fluent and accurate natural language response, such as: "According to the company's Employee Handbook, your annual leave days depend on your length of service. Those with 1 year but less than 10 years of service are entitled to 5 days of annual leave..."

[0096] End node:

[0097] Function: Present the generated answer to the user, completing this dialogue interaction.

[0098] Figure 2 Branch B of the dialogue path graph involved includes the following nodes.

[0099] Starting node:

[0100] Description: The entry point for all "gift claim" tasks.

[0101] Function: Activate the task session, initialize the memory management module, and define the required parameter set (e.g., gift_name_list, gift_number_list, recipient).

[0102] Outbound: Unconditionally jump to the "Key Parameter Collection Node".

[0103] Key parameter collection node

[0104] Description: Responsible for collecting all the information needed to complete the task from the user.

[0105] Function: Receive user input from the previous node.

[0106] The "Parameter Extraction and Parameter Extraction Module" is called to parse the input and update the value of the extracted key parameters (such as gift_name_list=["red wine"]) to the memory management module.

[0107] Check that all required key parameters in the memory management module are filled in and are unambiguous.

[0108] Out of bounds:

[0109] Ambiguous parameters -> Jump to the "Parameter Clarification Node": When an ambiguous parameter value is detected (for example, gift_name_list=["red wine"] is a category rather than a specific item), jump along this path.

[0110] Incomplete parameters -> Self-loop: When there are still required parameters that have not been filled in (for example, the name is known as "Brand A Dry Red Wine", but the quantity is unknown), generate a prompt ("How many bottles do you need to apply for?") and wait for the next user input.

[0111] Complete parameters -> Jump to "Final Confirmation Decision Node": Jump along this path when the parameter values ​​of all key parameters are clear and filled in.

[0112] Key parameter clarification node:

[0113] Description: A node specifically designed to handle fuzzy user commands.

[0114] Function: Decision based on specific state: Identify the state as "the parameter gift_name is ambiguous".

[0115] External tool call: Call the inventory query API in parallel to retrieve all specific gift items in the "red wine" category.

[0116] Generate recommended prompts: Integrate API results to generate a recommendation list ("We found the following wines for you. Which one would you like?").

[0117] Out of bounds:

[0118] User makes a selection -> Jump back to the "Parameter Collection Node": The user's explicit selection (such as "I want Brand A dry red wine") is used as new input and returned to the Parameter Collection Node for processing and refinement.

[0119] Final decision-making node:

[0120] Description: Give the user one last chance to confirm before performing a critical operation.

[0121] Function: Based on the complete parameters in the memory module, generate a summary confirmation message ("You are about to claim 1 bottle of 'Brand A Dry Red Wine', recipient is Zhang San, do you confirm?").

[0122] Out of bounds:

[0123] User confirmation -> Redirect to "External Tool Invocation Node": If the user replies "Confirm".

[0124] User cancels -> Jump to "End Node": If the user replies "Cancel".

[0125] External tool call node:

[0126] Description: The node that executes the final business logic.

[0127] Function: Read all structured parameters from the memory management module and call the enterprise's internal "gift application and approval" API.

[0128] Out of bounds:

[0129] API call complete -> Jump to "End Node".

[0130] End node:

[0131] Description: The endpoint of the task flow.

[0132] Function: Based on the API response from the previous step, generate the final success or failure information and end the current task session.

[0133] No borders.

[0134] Figure 2 The dialogue flow example is as follows:

[0135] If the user's input is "How many days of annual leave does the company offer?", the process will proceed to the general knowledge Q&A branch. This includes:

[0136] 1. Query rewriting: The user's original query will go through a query rewriting module. This module uses LLM combined with the dialogue history (if it exists) to rewrite queries that may have ambiguous referents (such as "How is it?") into an independent query statement with complete context.

[0137] 2. Knowledge Retrieval: The rewritten query is used for vector and keyword retrieval in the corresponding enterprise knowledge base. The system selects different knowledge bases based on the intent classification results (e.g., Category 1 corresponds to "Company Rules and Regulations Library", and Category 2 corresponds to "Product Solution Library").

[0138] 3. Answer generation: The retrieved relevant knowledge fragments will be used as context, along with the user's original query, and fed into a large language model to generate the final, human-like natural language answer.

[0139] 4. Return Results: The generated answers are presented directly to the user. In this branch, the task-oriented memory management module is not activated.

[0140] If the user's dialogue input is "I want to claim a bottle of red wine", then proceed to the task-oriented dialogue branch (corresponding to steps 101-105):

[0141] The top-level intent is categorized as a "gift claim task," and the workflow will proceed as follows:

[0142] S1. Task Session Activation and Memory Management Module Initialization

[0143] 1. Upon checking the global session variable space, it was found that the task identifier ID associated with the gift claim task was empty.

[0144] 2. Generate a task identifier ID unique to this task (e.g., gift_uuid_456) and store it in the global session variable space.

[0145] 3. Create a separate memory management module instance based on this unique task identifier ID.

[0146] 4. The memory management module initializes itself based on the pre-defined configuration file for the "Gift Claim" dialog path. This configuration file defines all the parameters required to complete the task, such as: gift_name_list (list of gift names) and gift_number_list (list of gift quantities). The memory management module initializes these parameters to null values.

[0147] S2, Dialogue Path Navigation and Preliminary Parameter Extraction

[0148] 1. The user's dialogue input ("I want to claim a bottle of red wine") is passed to a parameter extraction and path navigation module that is bound to the "gift claim" dialogue path map.

[0149] 2. This module is based on LLM and uses a highly focused prompt to parse user input. In this example, it successfully extracts the value of the `gift_name_list` parameter as `["red wine"]` and the value of the `gift_number_list` parameter as `[1]`, and updates this structured data in the memory management module. Simultaneously, it recognizes the user's intent as "requesting a gift".

[0150] 3. Based on this intent, find the outgoing edges of the current node (initial node) in the dialogue path graph and guide the dialogue flow to a key parameter collection node.

[0151] S3, Node-Driven Parameter Clarification and Intelligent Recommendation

[0152] 1. Now, the dialogue flow has entered the critical parameter collection node. The core responsibility of this node is to ensure that all parameters required for tool calls are complete and unambiguous.

[0153] 2. The node checks the current memory management module and finds that the value "red wine" in gift_name_list is a category, not a specific gift item that can be directly claimed. This is a case of unclear parameters.

[0154] 3. Therefore, the node triggers a clarification and recommendation action: a. Parallel task initiation: This action first submits a time-consuming I / O task—"querying all specific gift items in inventory based on the category 'red wine'"—to a background thread pool for parallel execution. b. Immediate front-end response: While waiting for the backend API to return, the main thread immediately uses LLM to generate the first part of the response. This part of the response does not depend on the API result; its content is a confirmation and guiding message generated based on the current memory state (knowing that the user wants "red wine" in "1 bottle"), such as: "Okay, we have received your request to claim 1 bottle of red wine. We have several different red wines to choose from and are currently querying the specific information for you. Please wait." This part of the message is immediately streamed back to the user. c. Backend result integration and intelligent recommendation: After the backend API call is completed, the main thread obtains the specific list of red wines (e.g., "Brand A dry red", "Brand B Cabernet Sauvignon" and their inventory information). Then, using this data as context, it calls LLM again to generate the second part of the response, presenting it to the user as a recommendation list: "We found the following red wines for you. Which one would you like?\n1. Brand A dry red wine (sufficient stock)\n2. Brand B Cabernet Sauvignon (3 bottles remaining)." This part follows the first part of the response and continues to stream back to the user.

[0155] S34 Multi-round Interaction and Memory Refinement

[0156] 1. After receiving the recommendation, the user makes a choice: "I want brand A dry red wine".

[0157] 2. The input then passes through the parameter extraction and path navigation module again, which understands that the user is clarifying the previously ambiguous parameters. It refines the value of the gift_name_list parameter in the memory management module from ["red wine"] to ["Brand A dry red wine"].

[0158] 3. At this point, the dialogue process remains at the key parameter collection node. The node checks the memory again and finds that all necessary parameters (gift name is clear, quantity is known) have been filled in and are unambiguous.

[0159] 4. Nodes that meet the conditions will automatically trigger an internal process jump, which will jump to a final tool call node along the "parameter complete" edge, according to the definition in the dialogue path diagram.

[0160] S35 Final Tool Call and Process End

[0161] 1. The final tool call node triggers a claim execution action.

[0162] 2. This action reads all the populated, structured parameter information from the memory management module ({gift_name_list:["Brand A Dry Red"],gift_number_list:[1]}).

[0163] 3. It passes these accurate parameters to the enterprise's internal "gift application approval" API and executes the call.

[0164] 4. Based on the success or failure result returned by the API, this action then calls the LLM to generate the corresponding confirmation or failure information (e.g., "Your application for 1 bottle of 'Brand A Dry Red Wine' has been successfully submitted. Do you need to apply for any other gifts?").

[0165] 5. When the user indicates "no longer needed," the intent recognition module identifies the intention to end the process, and the workflow jumps to the end node, completing the task. At this point, the task identifier and its associated memory management module instance will be retained for a period of time before being destroyed or archived.

[0166] As can be seen from the above examples, the method of this embodiment can clearly route different types of user intents and process them in the most efficient way.

[0167] Through the above implementation methods, the agent constructed in this embodiment can flexibly schedule RAG knowledge-based question answering and multiple independent task-oriented dialogues based on graph paths and structured memory within a unified workflow. Its core intent recognition, parameter extraction, memory management, and path navigation mechanisms ensure stability and efficiency when performing complex multi-round tasks, perfectly solving the various pain points of existing agents.

[0168] Corresponding to the aforementioned embodiments of intelligent dialogue methods, this disclosure also provides embodiments of intelligent dialogue systems.

[0169] Figure 3 A module of an intelligent dialogue system is provided as an exemplary embodiment of this disclosure, the system being used to implement the intelligent dialogue method provided in any of the above embodiments, the system comprising:

[0170] The intent recognition module 31 is used to determine a dialogue path graph that matches the task intent of the dialogue input content in response to the dialogue input content being a task-oriented dialogue; the nodes of the dialogue path graph represent specific states and / or decision points of the dialogue logic, and the edges of the dialogue path graph represent the flow of the dialogue.

[0171] The parameter extraction module 32 is used to extract the parameter values ​​of key parameters required to achieve the task intent from the dialogue input content.

[0172] Memory management module 33 is used to associate and store the parameter values ​​with the task identifier;

[0173] The path navigation module 34 determines whether the memory management module has stored the parameter values ​​of all key parameters required to achieve the task intent;

[0174] The path navigation module, in response to the memory management module not storing parameter values ​​of all key parameters, generates a guiding dialogue for providing the next dialogue input based on the dialogue path diagram, and returns the step of extracting parameter values ​​of key parameters required to achieve the task intent from the dialogue input.

[0175] The path navigation module, in response to the memory management module storing the parameter values ​​of all key parameters, triggers the execution action of the task intent based on the parameter values ​​of all key parameters.

[0176] Optionally, the memory management module associates and stores the parameter values ​​required to call the external tool to complete the task intent with the task identifier and the current dialogue node information; the external tool to be called to complete the task intent is also the external tool to be called for the execution action of the task intent.

[0177] Optionally, when generating guiding dialogue for providing the next dialogue input based on the dialogue path diagram, the path navigation module is specifically used for:

[0178] Identify the edges that match the task intent from the dialogue path graph;

[0179] The guiding script is determined based on the nodes connected to the matching edges.

[0180] Optionally, when determining the guiding script based on the nodes connected by the matching edges, the path navigation module is specifically used for:

[0181] The guiding script is determined based on the nodes connected to the matching edges;

[0182] Determine whether the task intent can be achieved, adjust the guiding script based on the determination result, and display the adjusted guiding script.

[0183] Optionally, the task intent is item retrieval; when determining whether the task intent can be achieved and adjusting the guiding dialogue based on the determination result, the path navigation module is specifically used for:

[0184] Determine whether the inventory of the item meets the item redemption requirements;

[0185] If the requirements are not met, adjust the guiding script.

[0186] Optionally, the nodes connected by the matching edges represent specific states of the dialogue; when determining the guiding dialogue based on the nodes connected by the matching edges, the path navigation module is specifically used for:

[0187] In response to ambiguity in the value of a parameter for at least one key parameter in a specific state, a background thread is invoked to perform a clarification action, and the guiding script is determined based on the execution result of the clarification action.

[0188] Optionally, the intelligent dialogue system further includes:

[0189] The clearing module, in response to the execution action of completing the task intent, clears the parameter values ​​stored as associated with the task identifier of the task intent;

[0190] And / or, the knowledge question answering module, in response to the dialogue input being a non-task-oriented dialogue, generates a response that matches the dialogue input based on a retrieval-enhanced generation model;

[0191] And / or, populate the parameter values ​​into the key parameter collection nodes contained in the dialogue path graph, the key parameter collection nodes defining key parameters associated with the task identifier.

[0192] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs.

[0193] Figure 4 The present disclosure illustrates the structural intent of an electronic device according to an example embodiment. The electronic device includes a memory, a processor, and a computer program stored in the memory and executed on the processor. When the processor executes the computer program, it implements the intelligent dialogue method described in any of the above embodiments. Figure 4 The electronic device 40 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0194] like Figure 4 As shown, the electronic device 40 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 40 may include, but are not limited to: at least one processor 41, at least one memory 42, and a bus 43 connecting different system components (including memory 42 and processor 41).

[0195] Bus 43 includes a data bus, an address bus, and a control bus.

[0196] The memory 42 may include volatile memory, such as random access memory (RAM) 421 and / or cache memory 422, and may further include read-only memory (ROM) 423.

[0197] The memory 42 may also include a program tool 425 (or utility) having a set (at least one) program module 424, such program module 424 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0198] The processor 41 executes various functional applications and data processing by running computer programs stored in the memory 42, such as the intelligent dialogue method provided in any of the above embodiments.

[0199] Electronic device 40 can also communicate with one or more external devices 44 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 45. Furthermore, electronic device 40 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 46. As shown, network adapter 46 communicates with other modules of electronic device 40 via bus 43. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0200] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0201] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intelligent dialogue method provided in any of the above embodiments.

[0202] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0203] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the intelligent dialogue method described in any of the preceding embodiments.

[0204] The program code for executing the computer program product of this disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on a user device, partially on a user device, as a stand-alone software package, partially on a user device and partially on a remote device, or entirely on a remote device.

[0205] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.

Claims

1. An intelligent dialogue method, characterized in that, include: In response to the dialogue input being a task-oriented dialogue, a dialogue path graph matching the task intent of the dialogue input is determined; The nodes of the dialogue path graph represent specific states and / or decision points of the dialogue logic, and the edges of the dialogue path graph represent the flow of the dialogue. Extract the parameter values ​​of key parameters required to achieve the task intent from the dialogue input content, and store the parameter values ​​with the task identifier; when the dialogue input content involves multiple task intents, store the parameter values ​​of each task intent independently with the task identifier. Determine whether the parameter values ​​of all key parameters required to achieve the stated task intent are stored; In response to the absence of parameter values ​​for all key parameters, a guiding dialogue is generated based on the dialogue path diagram to guide the provision of the next dialogue input content, in order to extract the parameter values ​​of the missing key parameters from the next dialogue input content, and the step of extracting the parameter values ​​of the key parameters required to achieve the task intent from the dialogue input content is returned. In response to the parameter values ​​that store all key parameters, the execution action of the task intent is triggered based on the parameter values ​​of all key parameters.

2. The intelligent dialogue method according to claim 1, characterized in that, Generate guiding dialogue based on the dialogue path diagram to provide input for the next dialogue, including: Identify the edges that match the task intent from the dialogue path graph; The guiding script is determined based on the nodes connected to the matching edges.

3. The intelligent dialogue method according to claim 2, characterized in that, After determining the guiding script based on the nodes connected by the matching edges, the method further includes: Determine whether the task intent can be achieved, adjust the guiding script based on the determination result, and display the adjusted guiding script.

4. The intelligent dialogue method according to claim 3, characterized in that, The task intent is to collect an item; determine whether the task intent can be achieved, and adjust the guiding script based on the determination result, including: Determine whether the inventory of the item meets the item redemption requirements; If the requirements are not met, adjust the guiding script.

5. The intelligent dialogue method according to claim 2, characterized in that, The nodes connected by the matching edges represent specific states of the dialogue; determining the guiding dialogue based on the nodes connected by the matching edges includes: In response to ambiguity in the value of a parameter for at least one key parameter in a specific state, a background thread is invoked to perform a clarification action, and the guiding script is determined based on the execution result of the clarification action.

6. The intelligent dialogue method according to any one of claims 1-5, characterized in that, The intelligent dialogue method further includes: in response to the execution action of completing the task intent, clearing the parameter values ​​stored associated with the task identifier of the task intent; And / or, in response to the dialogue input being a non-task-oriented dialogue, a response matching the dialogue input is generated based on a retrieval-enhanced generation model; And / or, populate the parameter values ​​into the key parameter collection nodes contained in the dialogue path graph, the key parameter collection nodes defining key parameters associated with the task identifier.

7. An intelligent dialogue system, characterized in that, include: An intent recognition module is used to determine a dialogue path graph that matches the task intent of the dialogue input content in response to the dialogue input content being a task-oriented dialogue. The nodes of the dialogue path graph represent specific states and / or decision points of the dialogue logic, and the edges of the dialogue path graph represent the flow of the dialogue. The parameter extraction module is used to extract the parameter values ​​of key parameters required to achieve the task intent from the dialogue input content; The memory management module is used to associate and store the parameter values ​​with task identifiers; when the dialogue input content involves multiple task intents, the parameter values ​​for each task intent are independently associated and stored with the task identifier. The path navigation module determines whether the memory management module has stored the parameter values ​​of all key parameters required to achieve the task intent; The path navigation module, in response to the absence of parameter values ​​for all key parameters, generates a guiding dialogue based on the dialogue path diagram to guide the provision of the next dialogue input content, extracts the parameter values ​​of the missing key parameters from the next dialogue input content, and returns the step of extracting the parameter values ​​of the key parameters required to achieve the task intent from the dialogue input content. The path navigation module, in response to the parameter values ​​stored in all key parameters, triggers the execution action of the task intent based on the parameter values ​​of all key parameters.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes the computer program, it implements the intelligent dialogue method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the intelligent dialogue method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the intelligent dialogue method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Intelligent dialogue processing method and device, equipment and storage medium

    CN116737910A

  • Automatically initiating and adapting conversations with user via user interface device of computing device

    CN117234708A

  • Task processing method, resource registration method, task updating method and electronic equipment

    CN117950822A

  • Intelligent task-based dialogue method, system, device and program product fused with large language model

    CN118569385A

  • Man-machine conversation method and device, electronic equipment and storage medium

    CN119621885A