Intelligent agent interaction methods, electronic devices and readable storage media
Patent Information
- Application Number
- CN202611073187.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-08-18
AI Technical Summary
传统方法通常采用一次性检索策略,直接返回大量候选文档或实体集合,无法依据用户问题意图动态调整关系扩展的深度与范围
[0014] The beneficial effects of this application are as follows: For the target entity of an intelligent agent's interaction request, a pre-defined expansion strategy is used to achieve a layer-by-layer dynamic expansion path, enabling progressive and purposeful relationship search. This avoids the problem of returning a large amount of irrelevant information at once, significantly reducing noise and lowering inference costs. When implementing the layer-by-layer dynamic path expansion, the type of relationships obtained through expansion is constrained by relationship matching conditions, and the scope and quality of expansion are controlled by path constraints. This ensures the accuracy and relevance of the response results, allowing the relationship expansion process to be effectively controlled by combining the question intent and path characteristics. This avoids adding a large number of irrelevant relationships to the context or missing key business paths due to using only vector similarity. Ultimately, it enables more accurate location of the information needed by the user and the generation of high-quality responses.
Smart Images

Figure CN122596263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an intelligent agent interaction method, electronic device, and readable storage medium. Background Technology
[0002] In handling user questions, intelligent agent systems suffer from a fundamental flaw in the context construction phase, primarily manifested in the lack of a progressive relationship search mechanism. Traditional methods typically employ a one-time retrieval strategy, directly returning a large number of candidate documents or entity sets, failing to dynamically adjust the depth and scope of relationship expansion based on the user's question intent. This static approach leads to a dilemma for the agent during interaction: over-reliance on keyword matching can miss crucial contextual information, resulting in incomplete responses or responses deviating from the user's actual needs; while unrestricted expansion of the complete ontology graph introduces numerous irrelevant nodes and relationships, significantly increasing computational resource consumption and inference latency, potentially exposing sensitive business data, and causing the final response to deviate from the core objective of the question. Furthermore, the relationship expansion process lacks unified expansion criteria, making it difficult to comprehensively evaluate multiple dimensions such as entity type compatibility, relationship type matching degree, path weight distribution, task intent adaptability, and historical interaction data. Existing solutions, when expanding with a fixed number of hops, often include a large number of low-relevance relationships in the context, diluting key information; when relying solely on vector similarity for expansion, they easily overlook business paths that play a decisive role in answering the question, resulting in the agent's inability to generate accurate and coherent responses. These shortcomings severely limit the practicality and reliability of intelligent agent systems in complex business scenarios. Summary of the Invention
[0003] The purpose of this application is to provide an intelligent agent interaction method, electronic device, and readable storage medium that can dynamically adjust the depth and scope of relationship expansion according to user intent, thereby improving the accuracy and consistency of responses.
[0004] This application provides an intelligent agent interaction method, including: Obtain the agent interaction request; the agent interaction request contains a user question; The user's question is identified to obtain the target entity and the question intent; Based on the target entity, locate the original starting node in the preset data ontology; Based on a preset expansion strategy, the relationship is expanded layer by layer from the original starting node. Each expansion adds the node or relationship obtained to the corresponding path until the expansion termination condition is met, resulting in at least one target path. The expansion strategy includes relationship matching conditions and path constraint conditions. The relationship matching conditions are used to determine whether the type of the expanded relationship matches the question intent, and the path constraint conditions are used to determine whether the expanded path satisfies compatibility constraints. Based on the target path, a response result is generated for the interaction request of the intelligent agent.
[0005] In some embodiments, the expansion strategy based on a preset approach extends the relationship layer by layer from the original starting node. Each expansion appends the resulting node or relationship to the corresponding path until the expansion termination condition is met, including: Based on the relationship matching conditions and the path constraints, the relationship of the node to be expanded is expanded to obtain several candidate paths obtained by the current expansion; the node to be expanded is the original starting node or the terminal node of the target path obtained by the previous expansion. The candidate paths obtained from the current expansion are evaluated, and the target path obtained from the current expansion is selected based on the evaluation results; Determine whether the relation extension for the original starting node meets the extension termination condition; If not, return to the step of performing relation expansion on the node to be expanded based on the relation matching conditions and the path constraints; If so, terminate the relationship extension for the original starting node.
[0006] In some embodiments, expanding the relationships of the nodes to be expanded based on the relationship matching conditions and the path constraints includes: Query the adjacent edges of the node to be expanded in the data body; Based on the relationship matching conditions and the path constraints, candidate adjacent edges that match the problem intent and whose expanded node type combinations meet the compatibility constraints are selected from the adjacent edges. Based on the original starting node and the candidate adjacent edges, the target path obtained by the current expansion is constructed, or the adjacent nodes corresponding to the candidate adjacent edges are appended to the target path obtained by the previous expansion to obtain the target path obtained by the current expansion.
[0007] In some embodiments, evaluating the candidate paths obtained from the current expansion includes: Based on the extension level, entity relationship weight, entity importance, time relevance factor, and path confidence, the relevance score of the candidate path obtained by the current extension is calculated; the contribution of the extension level to the relevance score is negatively correlated with the number of the extension levels. Candidate paths with relevance scores exceeding a threshold score, candidate paths with duplication with existing target paths exceeding a duplication threshold, and candidate paths with entity importance of the expanded nodes below an importance threshold are removed to obtain the currently expanded target path.
[0008] In some embodiments, evaluating the candidate paths obtained from the current expansion further includes: The data credibility, path length, and path timestamp of the conflicting path are obtained; the conflicting path is a target path that logically conflicts with another target path. A confidence propagation algorithm is used to iteratively update the path confidence of the conflicting paths based on the data confidence, the path length, and the path timestamp until convergence. Conflicting paths that have converged but whose confidence level is below the confidence threshold are removed.
[0009] In some embodiments, the step of performing relation expansion on the node to be expanded based on the relation matching conditions and the path constraints further includes: Configure the maximum expansion level based on the type of the problem intent; Based on the agent role or business scenario, limit the scalable data domain; Based on the contribution of the nodes obtained from the expansion to the answer to the question, the target path obtained from the current expansion is restricted from participating in the next relationship expansion.
[0010] In some embodiments, the step of performing relation expansion on the node to be expanded based on the relation matching conditions and the path constraints further includes: Obtain the information gain and noise ratio of the target path obtained by the current expansion; When the information gain is lower than the gain threshold or the noise ratio exceeds the noise ratio threshold, the similarity threshold in the relationship matching condition is increased or the range of allowed relationship types is narrowed; conversely, the similarity threshold in the relationship matching condition is decreased or the range of allowed relationship types is increased.
[0011] In some embodiments, generating a response result for the agent's interaction request based on the target path includes: Based on the nodes and relationships in the target path, construct an ontology context subgraph; Reasoning is performed based on the ontology context subgraph, and a response text for the user's question is generated based on the reasoning result.
[0012] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described intelligent agent interaction method.
[0013] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described intelligent agent interaction method.
[0014] The beneficial effects of this application are as follows: For the target entity of an intelligent agent's interaction request, a pre-defined expansion strategy is used to achieve a layer-by-layer dynamic expansion path, enabling progressive and purposeful relationship search. This avoids the problem of returning a large amount of irrelevant information at once, significantly reducing noise and lowering inference costs. When implementing the layer-by-layer dynamic path expansion, the type of relationships obtained through expansion is constrained by relationship matching conditions, and the scope and quality of expansion are controlled by path constraints. This ensures the accuracy and relevance of the response results, allowing the relationship expansion process to be effectively controlled by combining the question intent and path characteristics. This avoids adding a large number of irrelevant relationships to the context or missing key business paths due to using only vector similarity. Ultimately, it enables more accurate location of the information needed by the user and the generation of high-quality responses. Attached Figure Description
[0015] Figure 1 This is a diagram illustrating the application environment of the intelligent agent interaction method provided in the embodiments of this application.
[0016] Figure 2 This is a flowchart of the intelligent agent interaction method provided in the embodiments of this application.
[0017] Figure 3 This is a flowchart of a method for extending relationships layer by layer from the original starting node based on a preset extension strategy, as provided in this application embodiment.
[0018] Figure 4 This is a flowchart of a method for generating response results for agent-oriented interaction requests based on a target path, as provided in an embodiment of this application.
[0019] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0021] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and drawings are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application. Furthermore, the information, data, and signals involved in the embodiments of this application are all authorized by relevant parties or have been fully authorized by all parties, and the collection, use, and processing of related data comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0023] In traditional intelligent agent interaction processes, the lack of a progressive relationship search mechanism often results in a large number of candidate documents or entities being returned in a single retrieval. This makes it impossible to expand relationship edges layer by layer according to the question intent. Consequently, when the intelligent agent is dealing with user questions, it may suffer from missing context due to relying solely on keyword retrieval, or introduce excessive noise due to the lack of a complete ontology graph. This leads to increased reasoning costs, exposure of sensitive relationships, and answers that deviate from the question objective. At the same time, the relationship expansion process lacks a unified expansion criterion, making it difficult to comprehensively judge whether to continue expansion based on entity type, relationship type, path weight, task intent, and historical hit data. This makes fixed-hop expansion prone to including irrelevant relationships in the context, while relying solely on vector similarity may miss key business paths. As a result, the key performance indicators of the system in the context construction stage are significantly affected, including reduced context relevance, decreased reasoning efficiency, and impaired answer accuracy. For example, in intelligent consultation scenarios in the healthcare field, when a user asks a question about "management of complications in type 2 diabetes," existing technologies directly perform a full graph search on the data ontology, returning hundreds of relation edges at once, including drug interactions, genetic risk factors, and unrelated disease pathways. Among these, some pathways involve patient privacy data (such as specific medication records) or low-relevance content (such as the pathological mechanisms of type 1 diabetes), resulting in a constructed context that contains both sensitive information and a large amount of noise. Furthermore, because the expansion direction is not dynamically adjusted according to the intent of the question, the system cannot prioritize retaining core complication pathways such as cardiovascular disease or kidney disease, but instead includes irrelevant skin disease pathways in the reasoning process. This causes the generated response to deviate from the user's focus on complication management, and the reasoning process prolongs the response time due to processing redundant data.
[0024] If the above problems are not addressed, intelligent agents will continue to face the dual challenges of noise interference and missing critical paths in context construction in complex business scenarios. This will lead to a decrease in the credibility of the responses generated by the inference engine and a reduction in user trust in the system. At the same time, unconstrained relationship expansion may repeatedly expose sensitive data nodes, increasing data compliance risks, while inefficient context filtering mechanisms will consume additional computing resources, threatening the stability of the system in high-concurrency scenarios and ultimately affecting the feasibility of deploying intelligent agents in critical business areas.
[0025] Based on this, embodiments of this application provide an intelligent agent interaction method, an electronic device, and a readable storage medium. Through a preset expansion strategy, it realizes a layer-by-layer dynamic expansion path, accurately selects target paths to construct context, and can dynamically adjust the depth and scope of relationship expansion according to user intent, reducing computational resource consumption and inference latency, and improving the accuracy and consistency of response results.
[0026] Figure 1 This diagram illustrates the application environment of the intelligent agent interaction method provided in the embodiments of this application. (See attached diagram.) Figure 1 This method is applied to an intelligent agent interaction system. The system includes a terminal 101 and a server 102. Terminal 101 and server 102 are connected via a network. Terminal 101 can be at least one of a mobile phone, tablet, laptop, or in-vehicle terminal. Server 102 can be a standalone server or a server cluster consisting of several servers. Terminal 101 sends an intelligent agent interaction request to server 102, the request containing a user question. Server 102 receives the intelligent agent interaction request, identifies the user question, obtains the target entity and question intent, locates the original starting node in a preset data ontology based on the target entity, and expands the relationship layer by layer from the original starting node based on a preset expansion strategy. Each expansion appends the resulting node or relationship to the corresponding path until the expansion termination condition is met, resulting in at least one target path. Based on the target path, a response result is generated for the intelligent agent interaction request. The expansion strategy includes relationship matching conditions and path constraint conditions. The relationship matching conditions determine whether the type of the expanded relationship matches the question intent, and the path constraint conditions determine whether the expanded path satisfies compatibility constraints.
[0027] It should be understood that Figure 1 The application scenarios shown are merely examples. In practical applications, the intelligent agent interaction method provided in this application embodiment can also be applied to other scenarios. For example, the above-described intelligent agent interaction method can be directly applied to terminal 101. Terminal 101 is used to obtain intelligent agent interaction requests, identify user questions, obtain target entities and question intents, locate the original starting node in a preset data ontology based on the target entity, and expand the relationship layer by layer from the original starting node based on a preset expansion strategy. Each expansion adds the expanded nodes or relationships to the corresponding path until the expansion termination condition is met, obtaining at least one target path. Based on the target path, a response result for the intelligent agent interaction request is generated.
[0028] See Figure 2 In one embodiment, an intelligent agent interaction method is provided, wherein the execution subject of the method is a terminal or a server, including but not limited to steps S201 to S205.
[0029] Step S201: Obtain the intelligent agent interaction request.
[0030] The agent's interaction request includes user questions.
[0031] An agent interaction request refers to data input from a user to an agent that contains specific information or operational needs. This request can be in the form of text, voice, or other means, but its core is the question posed by the user.
[0032] A user question refers to a natural language expression contained in an agent's interaction request that the agent needs to understand and process. This question forms the basis for the agent's subsequent information retrieval and response generation.
[0033] Users can submit a question through a text input box or speak a question through a voice assistant. This request is then received by the executing entity and used as input for subsequent processing.
[0034] Step S202: Identify the user's question to obtain the target entity and the question intent.
[0035] A target entity is a key information point identified from a user's question that represents a specific concept, object, or event. For example, in the question "Who is the director of the movie 'The Wandering Earth'?", "The Wandering Earth" is the target entity.
[0036] Question intent refers to the fundamental purpose of a user asking a question or the type of information they expect to obtain. For example, in the question "Who is the director of the movie 'The Wandering Earth'?", "searching for the director" is the question intent.
[0037] After obtaining a user's question, the executing entity identifies the question to extract the target entity and question intent. For example, for a user asking "Who is the director of the movie 'The Wandering Earth'?", "The Wandering Earth" can be identified as the target entity and "search for the director" as the question intent through pre-defined keyword matching rules or simple syntactic analysis. Alternatively, rule-based pattern matching can be used. A series of question patterns and corresponding entity and intent types are predefined. When a user's question matches a certain pattern, the corresponding target entity and question intent can be extracted.
[0038] Step S203: Based on the target entity, locate the original starting node in the preset data ontology.
[0039] A data ontology is a structured representation of knowledge, typically existing in the form of a graph, which contains nodes (representing entities) and edges (representing relationships between entities). This data ontology provides an intelligent agent with a rich knowledge base for understanding and reasoning.
[0040] The original starting node refers to the initial node in the data ontology that corresponds to the target entity identified in the user's question. This node is the starting point for subsequent relation expansion.
[0041] Based on the identified target entity, the executing entity locates the original starting node within a predefined data ontology. For example, if the target entity is "The Wandering Earth," it searches for an entity node named "The Wandering Earth" in its knowledge graph and marks it as the original starting node. In one implementation, this location process can be achieved through a direct entity name lookup, i.e., searching for nodes in the entity index of the data ontology that exactly match the target entity name. If multiple matches exist, they can be selected based on predefined priority rules or simple contextual information.
[0042] Step S204: Based on the preset expansion strategy, expand the relationship layer by layer from the original starting node. Each expansion adds the node or relationship obtained to the corresponding path until the expansion termination condition is met, and at least one target path is obtained.
[0043] The expansion strategy includes relation matching conditions and path constraints.
[0044] Relationship matching criteria are used to determine whether the type of relationship obtained through expansion matches the question intent. Relationship matching criteria are a component of the expansion strategy, used to determine whether the relationship types discovered during the relationship expansion process match the user's question intent.
[0045] Path constraints are used to determine whether the expanded path satisfies compatibility constraints. Path constraints are another component of the expansion strategy, used to determine whether the path formed during the relationship expansion process meets preset compatibility requirements.
[0046] The target path refers to the knowledge path that is highly relevant to the user's problem, obtained after filtering by the expansion strategy, starting from the original starting node.
[0047] Starting from the original node, relationships are expanded layer by layer. Each expansion adds the resulting node or relationship to the corresponding path until the expansion termination condition is met, thus obtaining at least one target path. Relationship matching conditions determine whether the type of the expanded relationship matches the problem intent. Path constraints determine whether the expanded path satisfies compatibility constraints. For example, a path cannot contain cycles, or its length cannot exceed a preset maximum value. In one implementation, breadth-first search (BFS) or depth-first search (DFS) algorithms can be used for layer-by-layer expansion. During each expansion, the adjacency relationships of the current node are checked, and preliminary filtering is performed based on relationship matching conditions and path constraints. Simultaneously, the length of the current path is checked; if it reaches the preset maximum level, the expansion of that path stops.
[0048] Step S205: Based on the target path, generate a response result for the interaction request of the intelligent agent.
[0049] Based on the target path, a response to the agent's interaction request is generated. This can be achieved by using a pre-defined response template, filling in the entity and relationship information extracted from the target path into the template, thereby generating a natural language response. For example, for a question like "Who is Y of X?", the template "X's Y is Z" can be used.
[0050] The following example will provide a more detailed explanation of the above technical solution: Suppose user A asks the agent a question: "Who is the director of the movie 'The Wandering Earth'?"
[0051] First, we obtain the intelligent agent interaction request from user A, which includes the user's question: "Who is the director of the movie 'The Wandering Earth'?"
[0052] Next, the user's question was identified. Through the natural language processing module, "The Wandering Earth" was identified as the target entity, and "query director" was identified as the question intent.
[0053] Subsequently, based on the target entity "The Wandering Earth", the corresponding original starting node is located in the preset data ontology (such as a movie knowledge graph), which is the entity node representing the movie "The Wandering Earth".
[0054] Based on this, and using a pre-defined expansion strategy, the relationships are expanded layer by layer starting from this "Wandering Earth" node. This expansion strategy includes relationship matching conditions and path constraints.
[0055] In the first-level expansion, all adjacency relationships of the "The Wandering Earth" node are queried. Relationship matching conditions determine whether the types of these relationships match the intent of the query "Director". For example, relationships like "Director is" and "Director" are considered a match, while relationships like "Leading Actor is" and "Production Company" are not. Path constraints determine whether the expanded paths satisfy compatibility constraints, such as ensuring that the paths do not form cycles and that the current path length is within the allowed range. Suppose that in the first-level expansion, a relationship "Director is" is found connecting to the entity "Guo Fan". This relationship meets the relationship matching conditions, and the resulting path "The Wandering Earth -- Director is --> Guo Fan" also satisfies the path constraints. This path is appended to the target path set.
[0056] If the termination condition for expansion is met at this point (e.g., a sufficiently short path has been found), then the expansion stops. The path "The Wandering Earth -- Director is --> Guo Fan" is the obtained target path.
[0057] Finally, based on the target path "The Wandering Earth -- Director is --> Guo Fan", the response result for user A is generated: "The director of the movie 'The Wandering Earth' is Guo Fan". As can be seen from the above examples, the intelligent agent interaction method in this embodiment effectively solves the technical problems of "lack of a progressive relationship search mechanism" and "lack of a unified expansion criterion" existing in the prior art. In the prior art, when user A asks a similar question, it may only use keyword retrieval to return a large number of documents or entities related to "The Wandering Earth" and "director," which contain a lot of irrelevant information, resulting in missing context or excessive noise. Alternatively, it may expand the entire ontology graph without boundaries, causing the reasoning cost to increase, even exposing sensitive relationships, and the answer may deviate from the question's objective.
[0058] In contrast, this embodiment, by introducing the identification of "target entity" and "question intent," provides a clear starting point and direction for subsequent knowledge graph expansion. More importantly, through the mechanism of "expanding relationships layer by layer from the original starting node based on a preset expansion strategy," combined with "relationship matching conditions" and "path constraints," this method can achieve progressive and purposeful relationship search. In the above example, instead of blindly expanding all relationships, it prioritizes and filters relationships related to the "director" based on the "query director's" intent, and controls the scope and quality of expansion according to path constraints. This strategic, layer-by-layer expansion avoids the problem of returning a large amount of irrelevant information at once, significantly reduces noise, lowers inference costs, and ensures the accuracy and relevance of the response results. This method provides a unified judgment standard, enabling the relationship expansion process to be effectively controlled by combining question intent and path characteristics, thereby avoiding the problem of adding a large number of irrelevant relationships to the context or missing key business paths due to using only vector similarity. Ultimately, it can more accurately locate the information needed by the user and generate high-quality responses.
[0059] See Figure 3 In one embodiment, the method of expanding the relationship layer by layer from the original starting node based on a preset expansion strategy includes, but is not limited to, steps S301 to S304.
[0060] Step S301: Based on the relationship matching conditions and path constraints, perform relationship expansion on the node to be expanded to obtain several candidate paths obtained from the current expansion.
[0061] The node to be expanded is either the original starting node or the terminal node of the target path obtained in the last expansion.
[0062] During path expansion, firstly, based on relationship matching conditions and path constraints, the nodes to be expanded are expanded to obtain several candidate paths. Specifically, in the first relationship expansion, the node to be expanded is the original starting node; in subsequent expansions, the node to be expanded is the terminal node of the target path already selected in the previous iteration.
[0063] During the query process, adjacent edges and nodes are initially screened based on relationship matching conditions (e.g., determining whether the expanded relationship type matches the user's question intent) and path constraint conditions (e.g., determining whether the expanded path meets preset length, structure, or semantic compatibility requirements) to ensure that the generated candidate paths have a certain degree of relevance and effectiveness.
[0064] Step S302: Evaluate the candidate paths obtained from the current expansion, and select the target path obtained from the current expansion based on the evaluation results.
[0065] Evaluation can be based on various factors, such as path length, the weight of entities and relationships within the path, semantic matching with the question intent, and path confidence. By setting evaluation models and screening thresholds, low-quality and irrelevant paths can be eliminated from candidate paths, while high-quality paths can be retained as target paths for the current expansion and used in the next round of expansion. For example, a multi-factor weighted scoring model can be designed to score various attributes of the path, and then the total score can be compared with a preset threshold to determine whether a path should be retained or eliminated.
[0066] Step S303: Determine whether the relation extension for the original starting node meets the extension termination condition.
[0067] If not, return to step S301; if yes, proceed to step S304.
[0068] The conditions for ending the expansion can include reaching the preset maximum expansion level, finding a sufficient number of target paths, traversing all expandable paths, or no new valid paths being generated during the expansion process.
[0069] Step S304: End relation expansion for the original starting node.
[0070] This application's solution concretizes the abstract, layer-by-layer expansion relationship into operable steps by introducing an iterative path expansion, evaluation and screening, and termination mechanism. In each iteration, starting from the node to be expanded, candidate paths are generated based on relationship matching conditions and path constraints. These candidate paths are then evaluated, and high-quality target paths are selected. This evaluation and screening mechanism ensures that only high-quality paths highly relevant to the user's problem intent can continue to participate in the expansion, thereby effectively controlling the breadth and depth of expansion and avoiding the generation of invalid paths and the waste of computational resources. Simultaneously, a clear expansion termination condition guarantees the algorithm's convergence, preventing infinite loops and overexploration. Through this synergistic effect of iteration and screening, this application can efficiently and accurately discover target paths highly relevant to the user's problem intent in complex data ontology, significantly improving the efficiency and response quality of agent interaction.
[0071] In some embodiments, relational expansion of the node to be expanded is performed based on relational matching conditions and path constraints, including: querying the adjacent edges of the node to be expanded in the data ontology; selecting candidate adjacent edges from the adjacent edges whose types match the problem intent and whose expanded node type combinations meet compatibility constraints based on relational matching conditions and path constraints; constructing the target path obtained by the current expansion based on the original starting node and the candidate adjacent edges, or appending the adjacent nodes corresponding to the candidate adjacent edges to the target path obtained by the previous expansion to obtain the target path obtained by the current expansion.
[0072] This application's solution first comprehensively queries all adjacent edges of the node to be expanded, ensuring the completeness of potential relationships. Subsequently, it introduces relationship matching conditions and path constraints to perform dual filtering on these adjacent edges. The relationship matching condition ensures the semantic relevance of the expansion direction to the user's problem intent, while the path constraints guarantee the structural legality and type compatibility of the expanded path. This refined filtering mechanism ensures that only truly meaningful and logically consistent candidate adjacent edges can be used for path construction or extension. Finally, based on the selected candidate adjacent edges, a new target path is systematically constructed or adjacent nodes are added to an existing path, thus forming the target path obtained from the current expansion that meets the requirements. This series of steps, organically combined, enables the efficient and accurate identification and construction of effective paths highly relevant to the problem intent during the layer-by-layer expansion of relationships, laying a solid foundation for subsequent path evaluation.
[0073] The following is a concrete example to illustrate this. Suppose a user submits an agent interaction request containing the question, "Who is the director of the movie *Avatar*?" After identification, the target entity is determined to be "Avatar," and the intent of the question is "director." First, "Avatar" is located in the data ontology as the original starting node. When expanding the relationship, all adjacent edges of the "Avatar" node in the data ontology are queried, such as "starring," "director," "release year," and "genre." Next, based on the relationship matching conditions, adjacent edges matching the intent "director" are selected, i.e., the "director" relationship. Simultaneously, based on path constraints, it is checked whether the type of the adjacent node (i.e., the director entity) conforms to the "character" type if expanded through the "director" relationship, to ensure path compatibility. Suppose a candidate adjacent edge is selected connecting "Avatar" to "James Cameron" through the "director" relationship. Since this is the first expansion from the original starting node, based on "Avatar" and this candidate adjacent edge, a target path obtained from the current expansion is constructed: "Avatar" -- Director --> "James Cameron." This path will then be evaluated to determine whether it is the final target path.
[0074] In some embodiments, the candidate paths obtained from the current expansion are evaluated, including: calculating a relevance score for the candidate paths obtained from the current expansion based on the expansion level, entity relationship weight, entity importance, time relevance factor, and path confidence; eliminating candidate paths whose relevance scores exceed a threshold score, candidate paths whose duplication with existing target paths exceeds a duplication threshold, and candidate paths whose entity importance of expanded nodes is lower than an importance threshold, to obtain the target path obtained from the current expansion. The contribution of the expansion level to the relevance score is negatively correlated with the number of expansion levels.
[0075] The extended hierarchy refers to the number of hops or depth from the original starting node to the current path's terminal node. Its contribution to the relevance score is negatively correlated with the number of levels, meaning that the longer the path, the weaker its direct correlation with the original user problem may be, and therefore it has a lower weight in the score. This contribution can be quantified by setting a decay function, such as exponential decay or linear decay.
[0076] Entity relationship weight refers to the importance of relationships between specific entities in a data ontology. For example, in a knowledge graph, certain core relationships may be assigned higher weights. This can be achieved by pre-setting the weights during the data ontology construction or by dynamically adjusting and learning based on historical interaction data and expert experience.
[0077] Entity importance refers to the degree to which a particular entity node in a data ontology is central or receives attention within the overall knowledge system. For example, a well-known figure or core concept may have high entity importance. This can be calculated using the PageRank algorithm, centrality measures (such as degree centrality and betweenness centrality), or determined based on statistical data such as the frequency of entity citations and user query frequency.
[0078] The time relevance factor refers to the degree to which the information contained in the path matches the time dimension (if any) involved in the user's question. For example, if the user's question is about "recent events," then paths containing recent information should receive a higher factor. This can be achieved by comparing the creation / modification timestamps of entities or relationships in the path with the time constraints in the user's question.
[0079] Path confidence refers to the reliability or trustworthiness of a path as an answer, which may be related to the credibility of the data sources included in the path, the strength of the relationships, or the logical consistency of the path itself. It can be implemented through expert annotation, crowdsourcing evaluation, or pre-setting based on the reputation of the data source, or it can be dynamically updated through subsequent confidence propagation algorithms.
[0080] This application's solution employs a multi-dimensional evaluation mechanism. After generating candidate paths by expanding relationships layer by layer, it no longer relies solely on simple matching or constraints, but comprehensively considers multiple intrinsic attributes of the path. Specifically, for each candidate path obtained through expansion, a relevance score is calculated. This score is based on five key dimensions: expansion level, entity relationship weight, entity importance, time relevance factor, and path confidence. The expansion level reflects the path's length, and its contribution to the score is negatively correlated, meaning that longer paths generally have a weaker direct relevance to the user's problem, thus receiving a lower weight in the score. Entity relationship weight and entity importance evaluate the quality and value of information in the path from the perspectives of relationships and nodes, respectively. The time relevance factor ensures that the path's timeliness aligns with the user's problem requirements. Path confidence measures the path's overall reliability. By weighting and combining these factors, a comprehensive relevance score reflecting the path's quality is obtained. After obtaining the relevance score, a refined screening process is performed. First, candidate paths whose relevance scores do not reach a preset threshold are eliminated, ensuring that only high-quality paths are retained. Secondly, to avoid information redundancy, the duplication rate between the current candidate path and the existing target path is checked. If the duplication rate exceeds a preset threshold, the candidate path will be eliminated. Finally, to ensure the value of the path, candidate paths whose expanded nodes have an entity importance lower than the importance threshold will also be eliminated. Through this multi-dimensional and multi-stage screening mechanism, this application can efficiently and accurately identify the target path that best matches the user's question intent, has high information quality, and is free of redundancy from a massive number of candidate paths, thereby improving the accuracy of subsequent response results and user experience.
[0081] The following example illustrates this. Suppose a user asks, "What poems did Li Bai create?" First, the target entity is identified as "Li Bai," and the question's intent is "creating poems." "Li Bai" is located as the original starting node in the data ontology. During the process of expanding the relationship layer by layer, multiple candidate paths are generated, such as: Path A: "Li Bai" -- (creation) --> "Quiet Night Thoughts"; Path B: "Li Bai" -- (friend) --> "Du Fu" -- (creation) --> "Spring View"; Path C: "Li Bai" -- (birthplace) --> "Suyab"; Path D: "Li Bai" -- (creation) --> "Drinking Alone Under the Moon" -- (publication time) --> "Tang Dynasty". When evaluating these candidate paths, the following factors are considered: extension level (level 1 for paths A and D, level 2 for path B, and level 1 for path C), entity relationship weight (the weight of the "creation" relationship may be higher than that of "friend" or "birthplace"), entity importance (entities such as "Li Bai," "Quiet Night Thoughts," and "Drinking Alone Under the Moon" are of higher importance), time relevance factor (this factor may be neutral if the user's question does not have a specific time limit; if the user asks "Li Bai's poems created in his later years," paths containing his later works will receive a higher factor), and path confidence (if the information "Li Bai created Quiet Night Thoughts" is verified in multiple high-confidence data sources, its path confidence is high). Assume that path A has a relevance score of 0.95, path B has a relevance score of 0.60, path C has a relevance score of 0.40, and path D has a relevance score of 0.90. The relevance score threshold is set at 0.70, the repetition threshold at 0.8, and the importance threshold at 0.5. Based on these thresholds, paths A and D, with scores above 0.70, are retained; paths B and C, with scores below 0.70, are discarded. It is assumed that paths A and D do not meet the repetition threshold (because they are different poems). Entities in paths A and D (Li Bai, "Quiet Night Thoughts," and "Drinking Alone Under the Moon") have importance scores above 0.5 and are retained. Finally, paths A and D are selected as the target paths for the current expansion.
[0082] In some embodiments, evaluating the candidate paths obtained from the current expansion further includes: obtaining the data confidence, path length, and path timestamp of the conflicting paths; using a confidence propagation algorithm, iteratively updating the path confidence of the conflicting paths based on the data confidence, path length, and path timestamp until convergence; and eliminating conflicting paths whose path confidence is lower than a confidence threshold after convergence. Here, a conflicting path is a target path that logically conflicts with another target path.
[0083] Data credibility refers to the reliability or authenticity of the information carried by the various nodes and relationships that constitute a path. It can usually be quantitatively evaluated based on factors such as the authority of the data source, the frequency of data updates, expert annotations, or historical verification results. For example, it can be represented by a numerical value between 0 and 1, or divided into multiple levels such as high, medium, and low.
[0084] Path length refers to the number of edges or nodes traversed from the original starting node to the terminal node of the path, and is usually used to measure the directness and complexity of the path. Path timestamps record the creation and update times of key information or relationships in the path, reflecting the timeliness of the information.
[0085] This application's solution significantly enhances the robustness of path evaluation by introducing a mechanism for identifying and handling conflicting paths. After expanding the candidate paths, it not only considers conventional path evaluation metrics but also further identifies conflicting paths that may contain logical contradictions. For these conflicting paths, key attributes such as data credibility, path length, and path timestamp are comprehensively considered. Data credibility reflects the reliability of the information source, path length reflects the directness of information transmission, and path timestamp ensures the timeliness of the information. This multi-dimensional information is input into a confidence propagation algorithm, which simulates the mutual influence of information in a conflicting network. Through iterative updates, it dynamically adjusts the confidence of each conflicting path until a stable convergence state is reached. This iterative process fully utilizes all available evidence to conduct in-depth analysis and weighing of conflicting information. Finally, based on the converged path confidence, conflicting paths below a preset confidence threshold are eliminated, ensuring that only rigorously screened, logically consistent, and highly reliable target paths are used to generate response results. This mechanism, combined with the aforementioned path expansion and preliminary assessment, forms a more complete path selection process, effectively avoiding response errors caused by information conflicts and improving the overall quality of agent interaction.
[0086] The following example illustrates this. Suppose an agent receives a user question about "the manufacturer of product A". In the data ontology, there may be two potential response paths: path P1 indicates "product A is manufactured by company X", its data comes from the company's official website, has high data confidence (e.g., 0.9), a path length of 2 hops, and a recent timestamp (e.g., March 2024). Simultaneously, there may be another path P2 indicating "product A is manufactured by company Y", its data comes from an older news report, has lower data confidence (e.g., 0.6), a path length of 3 hops, and an older timestamp (e.g., January 2022). Since a product typically has only one main manufacturer, P1 and P2 are identified as conflicting paths. The data confidence, path length, and path timestamp of P1 and P2 are obtained respectively. Then, an evidence-weighted confidence propagation algorithm is used. This algorithm assigns initial confidence levels to P1 and P2 based on these attributes and performs multiple rounds of iterative updates. During the iteration process, P1's confidence is enhanced due to its higher credibility, shorter path, and more up-to-date timestamp, while simultaneously suppressing P2's confidence. Conversely, P2's lower attributes weaken its confidence. This process continues until the confidence changes of P1 and P2 stabilize, for example, P1's confidence converges to 0.88 and P2's confidence converges to 0.25. If the preset confidence threshold is 0.5, then P2 will be eliminated, and only P1 will be retained as the basis for generating the response result.
[0087] In some embodiments, the relationship expansion of nodes to be expanded based on relationship matching conditions and path constraints further includes: configuring a maximum expansion level based on the type of question intent; limiting the expandable data domain based on the agent role or business scenario; and restricting the target path obtained from the current expansion from participating in the next relationship expansion based on the contribution of the expanded node to the answer to the question.
[0088] This application's solution optimizes the process of obtaining the target path by introducing a refined expansion control mechanism. Specifically, each time a node to be expanded undergoes relationship expansion and several candidate paths are obtained, a maximum expansion level is dynamically set based on the type of user's question intent. This means that even if deeper relationships exist in the data ontology, the expansion of that path will stop once the path length reaches the preset maximum level, thus avoiding unlimited depth-first search. Secondly, during the expansion process, the data domain that can be expanded is strictly limited based on the agent's specific role or the current business scenario. This ensures that relationship expansion only occurs in the ontology subgraph highly relevant to the current task, effectively eliminating interference from irrelevant or sensitive data, making the generated candidate paths more focused and meaningful. Furthermore, for each node obtained from the expansion, its potential contribution to the answer to the question is evaluated. Only paths containing nodes deemed to have sufficient contribution are allowed to continue participating in the next relationship expansion. Path branches with low contribution are promptly pruned and no longer included in subsequent calculations. Through the synergistic effect of the above mechanisms, the solution of this application can intelligently guide the relationship expansion process, enabling it to efficiently discover target paths that are highly relevant to user problems and have practical value under limited computing resources, thus significantly improving the efficiency and response quality of agent interaction.
[0089] The following example illustrates this. Suppose an agent is deployed in an enterprise knowledge base to answer employee questions about project management. When a user asks, "Who is the person in charge of Project A? What other projects is he / she currently responsible for?", the intent is first identified as "querying project leaders and related projects," with the target entity being "Project A." As a specific implementation, the maximum expansion level is configured based on the type of the intent, "querying project leaders and related projects." For example, for such direct queries, the maximum expansion level can be set to 2 or 3 to avoid excessively delving into irrelevant project details or personnel background information. Simultaneously, based on the agent's role as a "project management assistant" in the enterprise knowledge base, the expandable data domain is limited. For example, the data domain will be restricted to ontology subgraphs directly related to project management, such as "project information," "personnel information," and "department structure," excluding irrelevant data such as "financial statements" and "customer contracts." During relationship expansion, when expanding from "Project A" to the "person in charge" relationship, resulting in the "Employee X" node, the contribution of "Employee X" to the answer to the question "Who is the person in charge of Project A?" is evaluated; clearly, its contribution is very high. When expanding from "Employee X" to the "Responsibility" relationship and arriving at the "Project B" node, the contribution of "Project B" to the answer to the question "What other projects is he / she currently responsible for?" is reassessed. If "Project B" is an archived old project or has low relevance to the current question context, its contribution may be deemed below a preset threshold. In this case, the path for further expansion from "Project B" will be restricted, and it will no longer participate in subsequent relationship expansions. In this way, it is possible to efficiently find responses such as "Employee X is the person in charge of Project A, and Employee X is also responsible for Projects C and D," without wasting resources exploring irrelevant information such as Employee X's educational background or home address.
[0090] In some embodiments, the relationship expansion of the node to be expanded based on the relationship matching conditions and path constraints further includes: obtaining the information gain and noise ratio of the target path obtained by the current expansion; when the information gain is lower than the gain threshold or the noise ratio exceeds the noise ratio threshold, increasing the similarity threshold in the relationship matching conditions or narrowing the range of allowed relationship types, and conversely, decreasing the similarity threshold in the relationship matching conditions or increasing the range of allowed relationship types.
[0091] Information gain refers to the amount of new, valuable information that the expanded target path brings relative to its parent path or the entire knowledge graph. It measures the contribution of the knowledge contained in the path to solving the user's problem. For example, information gain can be quantified by calculating the relevance score of newly added entities or relationships in the path to the user's problem intent, or by assessing the uniqueness and completeness of the answers provided by the path.
[0092] Noise ratio refers to the proportion of irrelevant, redundant, or erroneous information contained in the currently expanded target path. A high noise ratio can lead to inaccurate or inefficient generated responses. For example, the noise ratio can be estimated by analyzing the semantic relevance of entities and relationships in the path, data quality, or the degree of matching with known error patterns.
[0093] This application optimizes the process of layer-by-layer relationship expansion to generate target paths within an intelligent agent interaction method. Specifically, after expanding the relationships of the nodes to be expanded based on relationship matching conditions and path constraints, and obtaining several candidate paths from the current expansion, the information gain and noise ratio of these candidate paths are obtained. Information gain reflects the new knowledge carried by the path and its contribution to solving the user's problem, while the noise ratio measures the degree of redundancy or irrelevant information in the path. By comparing the obtained information gain with a preset gain threshold and the noise ratio with a preset noise ratio threshold, the effectiveness of the current expansion strategy can be determined. When it is found that the information gain of the target path obtained from the current expansion is lower than the gain threshold, or its noise ratio exceeds the noise ratio threshold, this indicates that the current expansion strategy may be too lenient, resulting in the generation of low-value or high-noise paths. To correct this situation, the similarity threshold in the relationship matching conditions is adaptively increased, thereby requiring subsequent expanded relationships to have a higher relevance to the problem intent; or the range of allowed relationship types is narrowed to focus on more core and direct relationship types. Conversely, if the information gain of the target path obtained from the current expansion is high and the noise ratio is low, it indicates that the current expansion strategy may be too strict, limiting the discovery of potentially useful paths. In this case, the similarity threshold in the relation matching conditions should be lowered accordingly to allow more relations with slightly lower relevance but still value to participate in the expansion; or the range of allowed relation types should be expanded to explore a broader knowledge graph space. This mechanism of dynamically adjusting the expansion strategy allows the path expansion process to be optimized based on real-time feedback, thereby ensuring path quality while taking into account both the breadth and depth of the paths, effectively improving the efficiency of agent interaction and the accuracy of response results.
[0094] The following example illustrates this. Suppose the user's question is "Who is the author of *The Three-Body Problem*?", identifying the target entity as "*The Three-Body Problem*", and the question intent as "searching for the author". Based on a preset expansion strategy, the relationship is expanded layer by layer from the original starting node "*The Three-Body Problem*", generating candidate paths. In one expansion, a candidate path is generated, for example: "*The Three-Body Problem* - (Author) - Liu Cixin - (Birthplace) - Yangquan". At this point, the information gain and noise ratio of this path are obtained. The information gain can be calculated by analyzing the matching degree between "Liu Cixin" and the "author" intent, and the irrelevance of "Yangquan" to the "author" intent. The noise ratio might be considered high because the "birthplace" relationship has a low correlation with the user's question intent "searching for the author". Suppose the calculated information gain of this path is lower than the preset gain threshold, and the noise ratio exceeds the preset noise ratio threshold. Based on this, the current expansion strategy is judged to be too lenient. To optimize subsequent expansions, measures might be taken, such as increasing the similarity threshold in the relationship matching criteria from 0.7 to 0.9. This means that only relationships with extremely high similarity to the "query author" intent would be considered. Simultaneously, the range of allowed relationship types might be narrowed. For example, explicitly allowing only relationship types directly indicating authorship, such as "the author is" or "created," while excluding indirect or irrelevant relationship types like "place of birth" or "graduated from." Conversely, if another expansion generates a path: "The Three-Body Problem - (author) - Liu Cixin," and evaluation reveals its information gain far exceeds the gain threshold with extremely low noise, this indicates the current expansion strategy might be too conservative and fail to fully explore relevant information. In this case, the similarity threshold in the relationship matching criteria might be lowered, for example, from 0.9 to 0.75, to allow more potentially relevant relationships to be considered; or the range of allowed relationship types might be expanded, for example, allowing relationships such as "representative works are" or "works include" in addition to "the author is," to discover richer relevant information.
[0095] See Figure 4 In one embodiment, the method for generating a response result for an agent interaction request based on a target path includes, but is not limited to, steps S401 to S402.
[0096] Step S401: Construct an ontology context subgraph based on the nodes and relationships in the target path.
[0097] Step S402: Perform reasoning based on the ontology context subgraph, and generate response text for the user's question based on the reasoning result.
[0098] This application's solution, based on obtaining at least one target path, first constructs an ontology context subgraph based on the nodes and relationships within the target path to improve the quality and accuracy of the response. This step effectively reduces the complexity of subsequent reasoning and ensures the relevance of the reasoning process by focusing on knowledge fragments directly related to the user's question. Subsequently, reasoning based on the constructed ontology context subgraph can extract implicit knowledge from explicit paths or perform deep semantic integration of existing information, thereby compensating for information deficiencies or misunderstandings that may result from relying solely on the original path. For example, the reasoning mechanism plays a crucial role when the user's question involves facts that require multi-hop relationships to deduce or when background knowledge needs to be considered. Finally, a response text for the user's question is generated based on the reasoning results, ensuring that the response content is not only based on facts in the data ontology but also incorporates deep logical analysis and semantic understanding, making the generated response text more accurate, comprehensive, and insightful. In this way, the solution of this application elevates the original target path from a simple information retrieval result to a knowledge representation that has undergone intelligent analysis and synthesis, significantly enhancing the agent's ability to understand and respond to complex user questions, thereby solving the problem that relying solely on the original path to generate a response may lead to incomplete information or semantic inaccuracies.
[0099] The following is a concrete example to illustrate this. Suppose the user's question is "Who is Zhang San's wife?", and through the aforementioned steps, the target entity is identified as "Zhang San," the question intent is "to query spousal relationships," and a target path is derived from the data ontology, for example: "Zhang San -> Spouse -> Li Si." Based on this, the solution in this application will first construct an ontology context subgraph based on the nodes "Zhang San," "Li Si," and the relationship "spouse" in this target path. This subgraph may contain the two entity nodes "Zhang San" and "Li Si," and the "spouse" relationship edge connecting them. In addition, if the data ontology also contains directly related information such as "Li Si's" gender being "female," this information may also be included in the ontology context subgraph to provide richer context. Next, inference will be performed based on this ontology context subgraph. For example, if the user's question is "Who is Zhang San's wife?", and the target path only gives "Zhang San -> Spouse -> Li Si," the inference engine may combine the semantics of the "spouse" relationship and the gender information of "Li Si" (if it exists in the subgraph) to infer that "Li Si" is "Zhang San's" wife. If the data ontology also contains information such as the marriage date of "Zhang San" and "Li Si," the reasoning can further confirm this spousal relationship. Finally, based on the reasoning result, a response text will be generated for the user's question. For example, based on the reasoned fact that "Li Si is Zhang San's wife," the response text "Zhang San's wife is Li Si." or "As far as I know, Zhang San's spouse is Li Si." This approach makes the response more accurate and natural, avoiding simply listing path information.
[0100] This application also provides an electronic device. Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. For example... Figure 5 As shown, the electronic device in this embodiment mainly includes a processor 501 and a memory 502. The memory 502 can be configured to store a program for executing the intelligent agent interaction method of the above-described method embodiments. The processor 501 can be configured to execute the program in the memory 502, which includes, but is not limited to, a program for executing the intelligent agent interaction method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application.
[0101] In some embodiments, the electronic device may include multiple processors 501 and multiple memories 502. The program executing the intelligent agent interaction method of the above method embodiments can be divided into multiple subroutines, each of which can be loaded and run by a processor 501 to perform different steps of the intelligent agent interaction method of the above method embodiments. Specifically, each subroutine can be stored in a different memory 502, and each processor 501 can be configured to execute programs in one or more memories 502 to jointly implement the intelligent agent interaction method of the above method embodiments; that is, each processor 501 executes different steps of the intelligent agent interaction method of the above method embodiments to jointly implement the intelligent agent interaction method of the above method embodiments.
[0102] The aforementioned multiple processors 501 can be processors deployed on the same device. For example, the aforementioned electronic device can be a high-performance device composed of multiple processors, and the aforementioned multiple processors 501 can be processors configured on that high-performance device. Alternatively, the aforementioned multiple processors 501 can also be processors deployed on different devices. For example, the aforementioned electronic device can be a server cluster, and the aforementioned multiple processors 501 can be processors on different servers within the server cluster.
[0103] This application also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to this application, the computer-readable storage medium can be configured to store a program that performs the intelligent agent interaction method of the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described intelligent agent interaction method. For ease of explanation, only the parts related to the embodiments of this application are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of this application. The computer-readable storage medium can be a memory formed by various electronic devices. Optionally, in the embodiments of this application, the computer-readable storage medium is a non-transitory computer-readable storage medium.
[0104] The intelligent agent interaction method, electronic device, and readable storage medium provided in this application, for the target entity of the intelligent agent interaction request, implement a layer-by-layer dynamic expansion path through a preset expansion strategy. This achieves a gradual and purposeful relationship search, avoiding the problem of returning a large amount of irrelevant information at once, significantly reducing noise, and lowering inference costs. When implementing the layer-by-layer dynamic expansion path, the type of relationship obtained by expansion is constrained according to relationship matching conditions, and the scope and quality of expansion are controlled according to path constraints. This ensures the accuracy and relevance of the response results, enabling the relationship expansion process to be effectively controlled by combining the question intent and path characteristics. This avoids adding a large number of irrelevant relationships to the context, or missing key business paths due to using only vector similarity. Ultimately, it can more accurately locate the information needed by the user and generate a high-quality response.
[0105] Exemplary embodiments of this disclosure have been specifically shown and described above. It should be understood that this disclosure is not limited to the detailed structures, arrangements, or implementations described herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.
Claims
1. A method for intelligent agent interaction, characterized in that, include: Obtain intelligent agent interaction requests; The agent interaction request includes a user question; The user's question is identified to obtain the target entity and the question intent; Based on the target entity, locate the original starting node in the preset data ontology; Based on a preset expansion strategy, the relationship is expanded layer by layer from the original starting node. Each expansion adds the node or relationship obtained to the corresponding path until the expansion termination condition is met, resulting in at least one target path. The expansion strategy includes relationship matching conditions and path constraint conditions. The relationship matching conditions are used to determine whether the type of the expanded relationship matches the question intent, and the path constraint conditions are used to determine whether the expanded path satisfies compatibility constraints. Based on the target path, a response result is generated for the interaction request of the intelligent agent.
2. The intelligent agent interaction method according to claim 1, characterized in that, The aforementioned expansion strategy, based on a preset approach, expands relationships layer by layer from the original starting node. Each expansion appends the resulting node or relationship to the corresponding path until the expansion termination condition is met, including: Based on the relationship matching conditions and the path constraints, the relationship of the node to be expanded is expanded to obtain several candidate paths obtained by the current expansion; the node to be expanded is the original starting node or the terminal node of the target path obtained by the previous expansion. The candidate paths obtained from the current expansion are evaluated, and the target path obtained from the current expansion is selected based on the evaluation results; Determine whether the relation extension for the original starting node meets the extension termination condition; If not, return to the step of performing relation expansion on the node to be expanded based on the relation matching conditions and the path constraints; If so, terminate the relationship extension for the original starting node.
3. The intelligent agent interaction method according to claim 2, characterized in that, The process of expanding the relationships of the nodes to be expanded based on the relationship matching conditions and the path constraints includes: Query the adjacent edges of the node to be expanded in the data body; Based on the relationship matching conditions and the path constraints, candidate adjacent edges that match the problem intent and whose expanded node type combinations meet the compatibility constraints are selected from the adjacent edges. Based on the original starting node and the candidate adjacent edges, the target path obtained by the current expansion is constructed, or the adjacent nodes corresponding to the candidate adjacent edges are appended to the target path obtained by the previous expansion to obtain the target path obtained by the current expansion.
4. The intelligent agent interaction method according to claim 2, characterized in that, The evaluation of the candidate paths obtained from the current expansion includes: Based on the extension level, entity relationship weight, entity importance, time relevance factor, and path confidence, the relevance score of the candidate path obtained by the current extension is calculated; the contribution of the extension level to the relevance score is negatively correlated with the number of the extension levels. Candidate paths with relevance scores exceeding a threshold score, candidate paths with duplication with existing target paths exceeding a duplication threshold, and candidate paths with entity importance of the expanded nodes below an importance threshold are removed to obtain the currently expanded target path.
5. The intelligent agent interaction method according to claim 4, characterized in that, The evaluation of the candidate paths obtained from the current expansion also includes: The data credibility, path length, and path timestamp of the conflicting path are obtained; the conflicting path is a target path that logically conflicts with another target path. A confidence propagation algorithm is used to iteratively update the path confidence of the conflicting paths based on the data confidence, the path length, and the path timestamp until convergence. Conflicting paths that have converged but whose confidence level is below the confidence threshold are removed.
6. The intelligent agent interaction method according to claim 2, characterized in that, The process of expanding the relationships of the nodes to be expanded based on the relationship matching conditions and the path constraints further includes: Configure the maximum expansion level based on the type of the problem intent; Based on the agent role or business scenario, limit the scalable data domain; Based on the contribution of the nodes obtained from the expansion to the answer to the question, the target path obtained from the current expansion is restricted from participating in the next relationship expansion.
7. The intelligent agent interaction method according to claim 2, characterized in that, The process of expanding the relationships of the nodes to be expanded based on the relationship matching conditions and the path constraints further includes: Obtain the information gain and noise ratio of the target path obtained by the current expansion; When the information gain is lower than the gain threshold or the noise ratio exceeds the noise ratio threshold, the similarity threshold in the relationship matching condition is increased or the range of allowed relationship types is narrowed; conversely, the similarity threshold in the relationship matching condition is decreased or the range of allowed relationship types is increased.
8. The intelligent agent interaction method according to claim 1, characterized in that, The step of generating a response result for the agent's interaction request based on the target path includes: Based on the nodes and relationships in the target path, construct an ontology context subgraph; Reasoning is performed based on the ontology context subgraph, and a response text for the user's question is generated based on the reasoning result.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the intelligent agent interaction method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the intelligent agent interaction method as described in any one of claims 1 to 8.