Knowledge question and answer method and device based on graph structure arrangement, equipment and medium

CN120873116BActive Publication Date: 2026-09-22DIGITAL CHINA SYST INTEGRATION SERVICE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510824959.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2026-09-22
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

[0005]本发明提供一种基于图结构编排的知识问答方法、装置、设备及介质,解决了如何提升LLM驱动的知识问答系统的灵活性与可控性的问题

Benefits of technology

支持图结构建模,表达能力强、逻辑清晰;提供可视化交互界面,降低配置门槛;支持节点模块注册与扩展,具备高可插拔性;全面提升了知识问答系统流程编排的智能性、灵活性和可控性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873116B_ABST
    Figure CN120873116B_ABST
Patent Text Reader

Abstract

The application discloses a knowledge question and answer method and device based on a graph structure arrangement, equipment and a medium, and relates to the technical field.The method comprises the following steps: receiving an interactive operation based on a front-end interactive interface, constructing a flowchart based on a preset semantic node library in response to the interactive operation, and serializing the flowchart into a description file; receiving and analyzing the description file by a back-end, constructing an executable graph structure; driving the graph structure to run based on a LangGraph engine; configuring a node system to inject and a module to register to support node expansion; and performing question and answer, and pushing intermediate results and final answers generated by nodes to the interactive interface in real time.The application improves the intelligence, flexibility and controllability of the knowledge question and answer system process arrangement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a knowledge question-answering method, apparatus, device, and medium based on graph structure arrangement. Background Technology

[0002] To enhance the flexibility and controllability of LLM-driven knowledge question answering systems in complex question answering scenarios, related technologies can be broadly categorized into the following types of knowledge question answering process orchestration schemes: 1. Fixed-sequence execution chain-based process orchestration: The knowledge question-and-answer process is defined in a fixed order and implemented through hard-coded code, solidifying the process logic into a fixed module call order. Suitable for simple scenarios, but its applicability is limited.

[0003] 2. Process orchestration based on a general workflow engine: A general workflow engine is used to manage the execution flow of knowledge question answering tasks. The process nodes are usually composed of modules, and intermediate variables can be passed during execution. However, its original design is not geared towards semantic understanding tasks. The workflow engine does not support context state management and lacks semantic abstraction of components such as LLM, RAG, and intent recognition, making it difficult to apply in knowledge question answering scenarios based on large language model LLM.

[0004] 3. Workflow orchestration based on a visual drag-and-drop LLM module orchestration platform: This provides a node-edge based graphical interface, allowing users to drag and drop related components to assemble knowledge-based question-and-answer workflows and publish them as applications. It offers good user visibility and customizability, making it suitable for non-technical users. However, the available modules are coarse-grained, lacking fine-grained semantics and struggling to express complex workflow structures. Furthermore, the component system of such tools has high coupling; adding custom nodes or modifying execution logic often requires modifying the core framework code, resulting in poor scalability. Summary of the Invention

[0005] This invention provides a knowledge question answering method, apparatus, device, and medium based on graph structure arrangement, which solves the problem of how to improve the flexibility and controllability of LLM-driven knowledge question answering systems.

[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, a knowledge question answering method based on graph structure arrangement is provided, including: The front-end interactive interface receives interactive operations, and in response to the interactive operations, it constructs a flowchart based on a pre-set semantic node library and serializes it into a description file. The backend receives and parses the description file to construct an executable graph structure; The graph structure is driven by the LangGraph engine. Configure node system injection and module registration to support node expansion; The question-and-answer process pushes the intermediate results and final answers generated by the nodes to the interactive interface in real time.

[0007] Secondly, a knowledge question answering device based on graph structure arrangement is provided, including: The front-end flowchart construction module is used to receive interactive operations based on the front-end interactive interface, and in response to the interactive operations, construct a flowchart based on a preset semantic node library and serialize it into a description file. The backend graph structure parsing module is used to receive and parse the description file and construct an executable graph structure. An orchestration and execution module is used to drive the graph structure to run based on the LangGraph engine. The node system injection and module registration module is used to configure node system injection and module registration to support node expansion. The question-and-answer and result push module is used to perform question-and-answer operations and push the intermediate results and final answers generated by the nodes to the interactive interface in real time.

[0008] Thirdly, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the knowledge question-answering method based on graph structure arrangement as described in the first aspect.

[0009] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the knowledge question-answering method based on graph structure arrangement as described in the first aspect.

[0010] The knowledge question answering method based on graph structure arrangement of the present invention has the following advantages: It supports graph structure modeling, has strong expressive power and clear logic; provides a visual interactive interface to reduce the configuration threshold; supports node module registration and expansion, and has high pluggability; and comprehensively improves the intelligence, flexibility and controllability of the knowledge question answering system's process orchestration.

[0011] The apparatus, electronic device, and readable storage medium corresponding to the knowledge question answering method based on graph structure arrangement of the present invention can achieve the same technical effect, and will not be described in detail here to avoid duplication. Attached Figure Description

[0012] Figure 1 A schematic flowchart illustrating a knowledge question-answering method based on graph structure arrangement provided in this application embodiment; Figure 2A schematic flowchart illustrating another knowledge question-answering method based on graph structure arrangement provided in this application embodiment; Figure 3 A schematic diagram of a graph structure arrangement for a knowledge question-answering process based on intent recognition, provided in an embodiment of this application; Figure 4 This application provides a system diagram structure arrangement interface and execution schematic diagram for embodiments of the present application; Figure 5 A schematic diagram of a knowledge question-answering device based on graph structure arrangement provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the technical solutions in the embodiments of this application are clearly described. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art are within the scope of protection of this application.

[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0015] The steps described in the specification and the flowcharts in the accompanying drawings of this invention are not necessarily strictly executed according to the step numbers; the execution order of the method steps can be changed. Furthermore, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be broken down into multiple steps.

[0016] The following detailed description, in conjunction with the accompanying drawings and preferred embodiments, describes the knowledge question-answering method, apparatus, device, and medium based on graph structure arrangement provided in this application.

[0017] Large Language Model (LLM) driven knowledge question answering systems are increasingly being used in various industries such as government, enterprise, finance, and manufacturing, and users are placing higher demands on their flexibility and controllability.

[0018] In related technologies: Fixed-sequence execution chain-based process orchestration (static process): In this type of solution, the knowledge question-answering process is defined in a fixed order, such as intent recognition → retrieval → answer. This solution is implemented by hard-coding in code, solidifying the process logic into a fixed module call order, and is suitable for simple scenarios; Workflow orchestration based on general workflow engines: This type of solution uses general workflow engines (such as Apache Airflow, Node-RED, etc.) to manage the execution flow of knowledge question answering tasks. Workflow nodes are typically composed of modules, and intermediate variables can be passed during execution. Workflow orchestration based on a visual drag-and-drop LLM module orchestration platform: Some platforms (such as Dify and LangFlow) provide a node-edge based graphical interface, allowing users to arrange related components into a knowledge-based question-and-answer workflow by dragging and dropping, and then publish the workflow as an application. This approach offers good user visibility and customizability, making it suitable for non-technical users.

[0019] The limitations of the above solution are: 1. Process orchestration based on fixed-sequence execution links: This type of solution defines the process statically with code, resulting in a fixed process and limited adaptability. It is suitable for simple scenarios but lacks flexibility, makes it difficult to dynamically control process branches, and cannot be understood or modified by non-technical users.

[0020] 2. Process orchestration based on general workflow engines: This type of solution uses a general DAG workflow engine for LLM process control. While it can provide node connection, scheduling, and execution mechanisms, its native design is not geared towards semantic understanding tasks. These traditional workflow engines do not support context state management and lack semantic abstraction of components such as LLM, RAG, and intent recognition, making them difficult to apply in LLM-based knowledge question answering scenarios.

[0021] 3. Workflow orchestration based on a visual drag-and-drop LLM module orchestration platform: Most existing tools of this type are still in the exploratory stage, with coarse-grained modules lacking fine-grained semantics, making it difficult to express complex workflow structures. Furthermore, these tools have high component coupling; adding custom nodes or modifying execution logic often requires modifying the core framework code, resulting in poor scalability.

[0022] Existing knowledge question-answering process orchestration technologies have not yet formed a universal solution that is both developer-friendly, facilitating component development and expansion, and features a visual drag-and-drop interface for easy understanding and use by non-technical personnel. Therefore, this application provides an improved method for orchestrating the workflow of a knowledge question-answering system. This method integrates multiple capabilities such as intent recognition, module registration, state management, and streaming output, possesses good node scalability, and, combined with a front-end drag-and-drop interface, allows users to intuitively design question-answering flows. This enhances the intelligence, flexibility, and controllability of the knowledge question-answering system's workflow orchestration.

[0023] Please see Figure 1-2 This application provides a knowledge question answering method based on graph structure arrangement, such as... Figure 1-2 As shown, it includes: Step S1: Receive interactive operations based on the front-end interactive interface, and in response to the interactive operations, construct a flowchart based on a preset semantic node library and serialize it into a description file.

[0024] The semantic node library includes node types such as intent recognition, document retrieval, answer generation, and tool invocation. Based on this node component library, users can select semantic nodes such as "intent recognition," "document retrieval," "answer generation," and "tool invocation."

[0025] The interactive operations include: selecting nodes, configuring node running parameters, and visually connecting different nodes to build logical paths; The description file includes: node definitions, edge definitions between nodes, edge connection relationships, and node parameters.

[0026] Specifically, this step involves constructing the front-end flowchart. The interactive interface is configured as a drag-and-drop graphical interface. Visual connections between different nodes are configured as arrow connections, supporting the construction of logical paths (such as conditional branches, parallel execution, etc.) between nodes. Each node supports configuration parameters, such as: prompt word templates, model selection, knowledge base retrieval, etc. The system serializes the graph structure corresponding to the entire flowchart into a unified JSON format, which includes a list of nodes and their types, node parameters, and the start and end points of edges (i.e., execution order).

[0027] Step S2: The backend receives and parses the description file to construct an executable graph structure.

[0028] In practice, this step involves the backend component graph parser, LangGraphBuilder, parsing the flowchart represented in JSON format from the frontend into an executable graph structure. Step S2 specifically includes: Step S21: Extract the node definition and edge definition.

[0029] Step S22: Verify the validity of the graph structure (e.g., whether there is a cycle or an entry node).

[0030] Step S23: Load the corresponding execution class for each node.

[0031] Step S24: Construct a directed graph topology (i.e., a state graph). This state graph is used by the orchestration engine.

[0032] Step S3: Drive the graph structure (i.e., the state graph) to run based on the LangGraph engine.

[0033] This step involves node-by-node execution of the graph structure driven by the LangGraph execution engine, including: Step S31: Initialize the state and load the entry node.

[0034] Step S32: Execute node jumps and state transitions according to the paths defined by the directed edges of the directed graph topology. The configuration supports process features such as conditional judgment, loop control, and multi-path parallelism; it also supports advanced control behaviors such as mid-process interruption, state saving, and subgraph invocation.

[0035] Step S33: Configure each node to access the global context to achieve state awareness.

[0036] Step S4: Configure node system injection and module registration to support node expansion.

[0037] To support different types of question-answering behaviors (such as knowledge base RAG question answering, NL2SQL question answering, etc.), this step designs a unified node module registration mechanism, specifically including: Step S41: Configure all node classes to inherit from the BaseNode abstract class, ensuring a unified node execution interface. All node classes inherit from the BaseNode abstract class and have a unified interface.

[0038] Step S42 involves registering the custom node to the node factory using the `@register_node_type` decorator. This allows developers to add new node types as needed without modifying the core execution framework; they simply need to inherit the base class and register it.

[0039] Step S43: Dynamically synchronize the newly added node types and parameters to the interactive interface.

[0040] In the specific implementation of this step, the front end calls the interface to obtain all node types and their parameter definitions supported by the current system when loading, and renders them into the drag-and-drop component library for users to drag and drop.

[0041] Step S5: Perform the question and answer process, pushing the intermediate results and final answers generated by the nodes to the interactive interface in real time.

[0042] In the specific implementation of this step, during execution, the system will push the final answer generated to the front end in real time via the SSE (Server-SentEvents) protocol. This allows users to obtain streaming LLM content in real time during the process, achieving a fast response experience.

[0043] This application supports the flexible definition of knowledge question-and-answer processes using a graph structure. For example... Figure 3 As shown, an exemplary graph structure diagram of a knowledge question-answering process based on intent recognition is presented, suitable for scenarios with a unified entry point, categorized processing, and multiple question-answering paths. The overall process includes the following nodes and paths: 1. Start Node: The process is triggered by the system's unified entry node. The graph structure orchestration process is started after the user raises a question or inputs a request.

[0044] 2. Intent Classifier Node: The system first enters the intent recognition module to perform semantic classification of the user input. This node determines, through a model, that the user's intent belongs to one of the following three categories and distributes it to different sub-paths accordingly: casual conversation input, knowledge base question-and-answer requests, and file update notification requests. The descriptions of each intent path are as follows: 1) Path 1: Casual conversation intent. When the intent recognition result is "casual conversation", the process jumps to the large language model node. This node calls the language model to generate a natural language response that matches the casual conversation scenario. After generating the response, it jumps directly to the end node to complete the process.

[0045] 2) Path Two: Knowledge Base Question Answering Intent. When the intent recognition result is "Knowledge Base Question Answering," the process sequentially enters two nodes: knowledge retrieval and large language model. The retrieval node performs knowledge retrieval based on the question content and returns highly relevant text blocks. The large language model node sends the retrieval results and question input into the language model to generate the answer. Finally, it jumps to the end node.

[0046] 3) Path Three: File Update Prompt Diagram. When the intent recognition result is "File Update", the process jumps to the file update prompt node. This node is used to inform the user that there are document changes in the knowledge base, successful upload, synchronization, etc., and then the process ends.

[0047] Figure 4 An exemplary system operation instance interface is shown. The left side displays the question-and-answer flowchart structure built by the user through drag-and-drop, including intent branches and multiple functional nodes; the right side displays the response content generated by the system under different intent paths, demonstrating the question-and-answer result output capability based on flow control.

[0048] Based on the above technical solution, this application has the following advantages: 1. Supports graph structure modeling, with strong expressive power and clear logic. This solution uses a graph structure to represent the question-and-answer process, with nodes representing semantic operation modules and edges representing execution paths. It can flexibly support complex process structures such as serial, parallel, branching, and looping; and supports dynamic multi-path jumps and conditional control. Compared with the traditional linear chain-style calling method, this solution has stronger logical expressiveness and business adaptability.

[0049] 2. Provides a visual interactive interface to lower the configuration threshold. This solution provides a front-end graphical workflow editor, allowing for quick workflow construction via drag-and-drop, and the ability to define complex question-and-answer logic without writing code. This significantly lowers the technical barrier for non-technical personnel to configure the question-and-answer system.

[0050] 3. Supports node module registration and expansion, with high pluggability. This solution supports dynamic registration of node types via a node registry mechanism. All nodes inherit from a unified abstract class and possess standard runtime interfaces. New nodes can be developed independently without intrusive integration; node types and parameter definitions can be synchronously provided to the front end for dynamic rendering. This mechanism builds a loosely coupled, highly scalable question-and-answer plugin ecosystem, supporting the rapid evolution of new capabilities.

[0051] It comprehensively enhances the intelligence, flexibility, and controllability of the knowledge question-and-answer system's workflow arrangement.

[0052] See Figure 5 Corresponding to the above-described knowledge question answering method embodiment based on graph structure arrangement, this application embodiment provides a knowledge question answering device based on graph structure arrangement, including: The front-end flowchart construction module 1001 is used to receive interactive operations based on the front-end interactive interface, and in response to the interactive operations, construct a flowchart based on a preset semantic node library and serialize it into a description file. The backend graph structure parsing module 1002 is used to receive and parse the description file and construct an executable graph structure. The orchestration and execution module 1003 is used to drive the graph structure to run based on the LangGraph engine; The node system injection and module registration module 1004 is used to configure node system injection and module registration to support node expansion. The question-and-answer and result push module 1005 is used to perform question-and-answer operations and push the intermediate results and final answers generated by the nodes to the interactive interface in real time.

[0053] Furthermore, the node types in the semantic node library include: intent recognition, document retrieval, answer generation, and tool invocation; The interactive operations include: selecting nodes, configuring node running parameters, and visually connecting different nodes to build logical paths; The description file includes: node definitions, edge definitions between nodes, edge connection relationships, and node parameters.

[0054] Furthermore, the backend graph structure parsing module 1002 is specifically used for: Extract the node and edge definitions; Verify the validity of the graph structure; Load the corresponding execution class for each node; Construct a directed graph topology.

[0055] The above-described knowledge question answering device based on graph structure arrangement implements the steps and processes of the above-described knowledge question answering method based on graph structure arrangement, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0056] See Figure 6 Corresponding to the above-described knowledge question answering method embodiment based on graph structure arrangement, this application embodiment provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps and processes of the above-described knowledge question answering method embodiment based on graph structure arrangement, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0057] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback function, image playback function, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0058] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.

[0059] Corresponding to the above-described knowledge question answering method embodiment based on graph structure arrangement, this application embodiment also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps and processes of the above-described knowledge question answering method embodiment based on graph structure arrangement, and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0060] The processor is the processor in the electronic device described in the above embodiments of this application. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.

[0061] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0063] It is understood that the embodiments of this application have been described above in conjunction with the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. As those skilled in the art will know, various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, those skilled in the art, under the guidance or instruction of this application, can modify these features and embodiments to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, this invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of this invention.

Claims

1. A knowledge question-answering method based on graph structure arrangement, characterized in that, include: The front-end interactive interface receives interactive operations, and in response to the interactive operations, it constructs a flowchart based on a pre-set semantic node library and serializes it into a description file. The semantic node library includes node types such as intent recognition, document retrieval, answer generation, and tool invocation. The backend receives and parses the description file to construct an executable graph structure; the backend component, the graph parser LangGraphBuilder, parses the flowchart represented in JSON format from the frontend into an executable graph structure, including: extracting node and edge definitions; verifying the validity of the graph structure; loading the corresponding execution class for each node; and constructing a directed graph topology. The graph structure is driven by the LangGraph engine. Configure node system injection and module registration to support node expansion; including: configuring all node classes to inherit from the BaseNode abstract class to unify the node execution interface; registering custom nodes to the node factory through the @register_node_type decorator; and dynamically synchronizing newly added node types and parameters to the interactive interface. The question-and-answer process pushes the intermediate results and final answers generated by the nodes to the interactive interface in real time.

2. The knowledge question answering method based on graph structure arrangement according to claim 1, characterized in that, The interactive operations include: selecting nodes, configuring node running parameters, and visually connecting different nodes to build logical paths; The description file includes: node definitions, edge definitions between nodes, edge connection relationships, and node parameters.

3. The knowledge question answering method based on graph structure arrangement according to claim 1, characterized in that, The graph structure is driven by the LangGraph engine, including: Initialize the state and load the entry node; Execute node jumps and state transitions according to the paths defined by the directed edges of the directed graph topology; Configure each node to access the global context to achieve state awareness.

4. A knowledge question-answering device based on graph structure arrangement, characterized in that, include: The front-end flowchart construction module is used to receive interactive operations based on the front-end interactive interface, and in response to the interactive operations, construct a flowchart based on a preset semantic node library and serialize it into a description file. The semantic node library includes node types such as intent recognition, document retrieval, answer generation, and tool invocation. The backend graph structure parsing module is used by the backend to receive and parse the description file, and construct an executable graph structure. The backend component, the graph parser LangGraphBuilder, parses the flowchart represented by the frontend JSON into an executable graph structure. This includes: extracting node and edge definitions; verifying the validity of the graph structure; loading the corresponding execution class for each node; and constructing a directed graph topology. An orchestration and execution module is used to drive the graph structure to run based on the LangGraph engine. The node system injection and module registration module is used to configure node system injection and module registration to support node expansion; it includes: configuring all node classes to inherit from the BaseNode abstract class to unify the node execution interface; registering custom nodes to the node factory through the @register_node_type decorator; and dynamically synchronizing newly added node types and parameters to the interactive interface. The question-and-answer and result push module is used to perform question-and-answer operations and push the intermediate results and final answers generated by the nodes to the interactive interface in real time.

5. The knowledge question-answering device based on graph structure arrangement according to claim 4, characterized in that, The interactive operations include: selecting nodes, configuring node running parameters, and visually connecting different nodes to build logical paths; The description file includes: node definitions, edge definitions between nodes, edge connection relationships, and node parameters.

6. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the knowledge question answering method based on graph structure arrangement as described in any one of claims 1 to 3.

7. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the knowledge question-answering method based on graph structure arrangement as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Intention recognition and question answering method and device, electronic equipment and storage medium

    CN117194730A

  • Question-answering system, device, method, server device, and program

    JP6467678B1