Intelligent agent-based session method and device, storage medium and electronic equipment
Through the agent-based conversation method and dynamic LangGraph graph framework, the problems of low efficiency of existing medical consultation systems and lack of flexibility in rule-driven systems are solved, efficient multi-task collaboration and personalized health management are achieved, and medical quality and user experience are improved.
Patent Information
- Application Number
- CN202510172589.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-03-14
AI Technical Summary
The existing medical consultation system is inefficient and difficult to dynamically adapt to cross-domain task requirements. The rule-driven medical management system lacks flexibility and is difficult to deal with multimodal data or complex logical relationships.
Using an agent-based conversation method, the user input health description information is received through the conversation window, multiple agents are called to construct a dynamic LangGraph graph, execute the graph and reply to the rehabilitation plan information. This method realizes task decomposition and collaboration through multi-agent collaboration and LangGraph framework, and dynamically adjusts task processes.
It improves the efficiency of online consultation, can cover multiple scenarios of diagnosis, recovery and health management, and provides accurate and personalized services, which significantly improves medical quality and user experience.
Smart Images

Figure CN119626459A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an agent-based conversation method and device, a storage medium, and an electronic device. Background Art
[0002] Among related technologies, intelligent medical assistant technology has become an important direction for solving pain points in the medical industry.
[0003] In solution one of the related technology, the medical consultation system based on a single large language model uses the large language model to parse user input and generates diagnosis or recommendation results through model reasoning. The disadvantages are: low efficiency when reasoning complex tasks, lack of task decomposition and independent processing capabilities. It is difficult to dynamically adapt to cross-domain task requirements, which limits medical application scenarios. In solution two of the related technology, the rule-driven medical management system uses predefined rules to complete health management tasks. The disadvantages are: the system lacks flexibility and has difficulty processing multimodal data or complex logical relationships. The task is single and it is difficult to cover the multi-scenario requirements of diagnosis, recovery and health management.
[0004] With respect to the above-mentioned problems existing in the related technologies, no efficient and accurate solutions have been found yet. Summary of the invention
[0005] The present invention provides an agent-based conversation method and device, a storage medium, and an electronic device to solve technical problems in related technologies.
[0006] According to one embodiment of the present invention, there is provided an agent-based conversation method, comprising: receiving health description information input by a user through a conversation window; calling multiple agents according to the health description information, wherein each agent encapsulates an application with corresponding functions; constructing a dynamic LangGraph graph using the multiple agents; executing the dynamic LangGraph graph, and replying with rehabilitation plan information of the health description information in the conversation window.
[0007] Optionally, calling multiple agents according to the health description information includes: parsing the health description information and generating multiple subtasks according to the health description information; searching and calling multiple agents matching the multiple subtasks in a preset agent set.
[0008] Optionally, using the multiple agents to construct a dynamic LangGraph graph includes: determining the logical relationship between the multiple agents; and constructing a dynamic LangGraph graph with each of the agents as a node and each of the logical relationships as a directed edge between adjacent nodes.
[0009] Optionally, executing the dynamic LangGraph and replying the rehabilitation plan information of the health description information in the conversation window includes: inputting the health description information into the first agent of the dynamic LangGraph; executing the first agent to obtain the diagnosis result information output by the first agent; inputting the diagnosis result information into the second agent of the dynamic LangGraph; executing the second agent to obtain the rehabilitation plan information output by the second agent; inputting the rehabilitation plan information into the third agent of the dynamic LangGraph; executing the third agent to obtain the rehabilitation plan information output by the third agent, and outputting the diagnosis result information and rehabilitation plan information in the conversation window, wherein the dynamic LangGraph includes the first agent, the second agent, and the third agent connected in sequence based on a directed graph.
[0010] Optionally, inputting the diagnosis result information into the second agent of the dynamic LangGraph graph includes: calling the task management agent of the dynamic LangGraph graph to monitor the task execution status of the first agent; after the first agent completes the execution, passing the diagnosis result information to the second agent through the directed edge between the first agent and the second agent.
[0011] Optionally, after obtaining the diagnosis result information output by the first agent, the method further includes: inputting the health description information and the diagnosis result information into a fourth agent of the dynamic LangGraph; executing the fourth agent to obtain a case report obtained by the fourth agent using the diagnosis result information for analysis; and storing the case report in a database.
[0012] Optionally, receiving health description information input by the user through the conversation window includes at least one of the following: receiving first health description information in text format input by the user in the conversation window; receiving second health description information in picture format input by the user in the conversation window; receiving third health description information in voice format input by the user in the conversation window.
[0013] According to another embodiment of the present invention, there is provided an agent-based conversation device, comprising: a receiving module for receiving health description information input by a user through a conversation window; a calling module for calling multiple agents according to the health description information, wherein each agent encapsulates an application with corresponding functions; a building module for building a dynamic LangGraph using the multiple agents; and a reply module for executing the dynamic LangGraph and replying with rehabilitation plan information of the health description information in the conversation window.
[0014] Optionally, the calling module includes: a generating unit, used to parse the health description information and generate multiple subtasks according to the health description information; and a calling unit, used to search and call multiple agents matching the multiple subtasks in a preset agent set.
[0015] Optionally, the construction module includes: a determination unit, used to determine the logical relationship between the multiple agents; a construction unit, used to construct a dynamic LangGraph graph with each of the agents as a node and each of the logical relationships as a directed edge between adjacent nodes.
[0016] Optionally, the reply module includes: a first input unit, used to input the health description information into the first agent of the dynamic LangGraph; a first execution unit, used to execute the first agent to obtain the diagnosis result information output by the first agent; a second input unit, used to input the diagnosis result information into the second agent of the dynamic LangGraph; a second execution unit, used to execute the second agent to obtain the rehabilitation plan information output by the second agent; a third input unit, used to input the rehabilitation plan information into the third agent of the dynamic LangGraph; a third execution unit, used to execute the third agent, obtain the rehabilitation plan information output by the third agent, and output the diagnosis result information and rehabilitation plan information in the session window, wherein the dynamic LangGraph includes the first agent, the second agent, and the third agent connected in sequence based on a directed graph.
[0017] Optionally, the second input unit includes: a monitoring subunit, used to call the task management agent of the dynamic LangGraph graph to monitor the task execution status of the first agent; and a transmission subunit, used to transmit the diagnosis result information to the second agent through the directed edge between the first agent and the second agent after the first agent completes the execution.
[0018] Optionally, the reply module also includes: a fourth input unit, used to input the health description information and the diagnosis result information into the fourth agent of the dynamic LangGraph after the first execution unit obtains the diagnosis result information output by the first agent; a fourth execution unit, used to execute the fourth agent to obtain a case report obtained by the fourth agent using the diagnosis result information for analysis; and a storage unit, used to store the case report in a database.
[0019] Optionally, the receiving module includes at least one of the following: a first receiving unit, used to receive first health description information in text format input by a user in a conversation window; a second receiving unit, used to receive second health description information in picture format input by a user in a conversation window; a third receiving unit, used to receive third health description information in voice format input by a user in a conversation window.
[0020] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0021] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0022] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned device embodiments when running.
[0023] Through the embodiments of the present invention, health description information input by a user is received through a conversation window; multiple agents are called according to the health description information, wherein each agent encapsulates an application with corresponding functions; a dynamic LangGraph graph is constructed using the multiple agents; the dynamic LangGraph graph is executed, and rehabilitation plan information of the health description information is replied in the conversation window. By combining the agent and the LangGraph framework, task decomposition and collaboration are achieved through directed edges between nodes of the dynamic LangGraph graph, and data flow and decision signals are transmitted through directed edges between nodes in the dynamic LangGraph graph to achieve efficient collaboration of multiple tasks, thereby solving the technical problem of low efficiency of online consultation in related technologies and covering multiple scenarios of diagnosis, recovery and health management during online medical consultation. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 It is a hardware structure block diagram of a server in an embodiment of the present application; Figure 2 is a flow chart of an agent-based conversation method according to an embodiment of the present invention; Figure 3is a system flow chart of an embodiment of the present invention; Figure 4 It is a structural block diagram of an agent-based conversation device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Example 1 The method embodiment provided in the first embodiment of the present application can be executed in a server, a computer, a mobile phone, or a similar computing device. Taking running on a server as an example, Figure 1 is a hardware structure block diagram of a server in an embodiment of the present application. Figure 1 As shown, the server may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the server may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store server programs, for example, software programs and modules of application software, such as a server program corresponding to an agent-based conversation method in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the server program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] In this embodiment, a conversation method based on an intelligent agent is provided. Figure 2 is a flow chart of an agent-based conversation method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps: Step S202, receiving health description information input by the user through the conversation window; In this embodiment, the health description information input by the user through the conversation window can be, but is not limited to: receiving the first health description information in text format input by the user in the conversation window; receiving the second health description information in picture format input by the user in the conversation window; receiving the third health description information in voice format input by the user in the conversation window.
[0031] The conversation window of this embodiment can be a human-computer conversation window of an online medical assistant, chat software, search software, etc. For example, a user inputs health description information in the form of text, picture, or voice through a conversation with a WeChat friend, a mini program, or a public account.
[0032] Optionally, the health description information may include physical examination reports, hospital test reports (such as CT, blood test reports, etc.), and medical consultation description information (such as frequent headaches, insomnia, etc.).
[0033] Step S204, calling multiple agents according to the health description information, wherein each agent encapsulates an application program with a corresponding function; Step S206, constructing a dynamic LangGraph using the multiple agents; Step S208, executing the dynamic LangGraph, and replying the rehabilitation plan information of the health description information in the conversation window.
[0034] This embodiment combines multi-agent and LangGraph framework to achieve the following technical effects: Convenience and comfort: With the accelerated pace of life and increased pressure, people's demand for convenient medical services continues to increase. Through the multi-agent collaborative medical assistant system, patients can directly consult health, describe symptoms or submit cases through familiar instant messaging tools such as WeChat, without downloading additional applications, which greatly reduces the threshold for use. In addition, the system supports multimodal data input (such as voice and pictures), further improving the user experience and avoiding medical barriers caused by long waiting times and complex processes in traditional medical processes.
[0035] Personalized service and medical quality, using multi-agent collaboration and LangGraph graph framework design, complex medical tasks can be decomposed into multiple nodes, which can be completed independently and efficiently by each agent. For example, the diagnostic agent focuses on symptom analysis and disease reasoning, the recovery agent generates personalized recovery plans, and the diet and exercise agent customizes health plans for patients. This division of labor and collaboration model, combined with the powerful reasoning ability of the large language model and the professionalism of the segmented medical knowledge base, can provide patients with accurate and personalized services, significantly improving the accuracy of diagnosis and the effectiveness of recovery.
[0036] Efficient doctor assistance tools. Medical assistant technology not only serves patients, but also provides strong auxiliary support for doctors. For example, the case material management agent can automatically classify and store important information such as patient imaging materials and diagnostic records, providing doctors with efficient case call and analysis tools during follow-up visits and remote consultations. The LangGraph framework significantly improves doctors' work efficiency, reduces medical error rates, and optimizes medical resource allocation through task graph design and efficient collaboration between agents.
[0037] Health management and disease prevention. The multi-agent medical assistant system also plays an important role in the field of health management and disease prevention. Through diet, exercise and basic health management agents, the system can dynamically adjust the health plan according to the user's health goals and actual situation, provide daily task reminders and progress tracking. The health education agent pushes personalized popular science content to help patients understand disease prevention measures and develop healthy living habits, thereby reducing potential health risks.
[0038] The necessity of technical collaboration. Traditional medical assistant systems usually adopt a single model or rule-driven approach, which makes it difficult to cope with cross-domain tasks or complex logical relationships. The LangGraph framework designs multi-agent collaboration in the form of a task graph, making full use of node distributed computing and edge transfer mechanisms to achieve dynamic task allocation and optimal path planning. Combining a large language model with enhanced retrieval generation technology (RAG), the system can quickly retrieve the required information from a massive medical knowledge base to ensure the real-time and accuracy of the model output.
[0039] Social and economic value: The promotion of multi-agent collaborative medical assistant systems can significantly alleviate the problem of tight medical resources. Patients can complete preliminary diagnosis and health management through online services, reducing the pressure of offline medical treatment, and providing technical support for medical services in remote areas. In addition, the system also improves work efficiency for medical institutions and doctors, establishes a closer connection between patients and doctors, improves patient satisfaction, and creates higher social and economic value.
[0040] In summary, the combination of multi-agent collaboration technology and the LangGraph graph framework is an important means to improve the efficiency and intelligence level of the medical assistant system. Through accurate diagnostic suggestions, personalized health management, and convenient user interaction experience, the system has significant advantages in meeting patient needs, improving medical quality, and optimizing the use of medical resources, representing the development direction of intelligent medical technology.
[0041] Through the above steps, the health description information input by the user is received through the conversation window; multiple agents are called according to the health description information, wherein each agent encapsulates an application with corresponding functions; a dynamic LangGraph graph is constructed using the multiple agents; the dynamic LangGraph graph is executed, and the rehabilitation plan information of the health description information is replied in the conversation window. By combining the agent and the LangGraph framework, task decomposition and collaboration are realized through directed edges between the nodes of the dynamic LangGraph graph, and data flow and decision signals are transmitted through the directed edges between the nodes in the dynamic LangGraph graph to realize efficient collaboration of multiple tasks, thereby solving the technical problem of low efficiency of online consultation in related technologies and covering multiple scenarios of diagnosis, recovery and health management during online medical consultation.
[0042] In one implementation of this embodiment, calling multiple agents based on the health description information includes: parsing the health description information and generating multiple subtasks based on the health description information; searching and calling multiple agents matching the multiple subtasks in a preset agent set.
[0043] Optionally, the preset agent set includes multiple callable agents, which are exemplified here, such as general and caring agents: perform daily conversations with users. Diagnostic agent: perform symptom analysis and diagnostic reasoning. Recovery agent: generate personalized recovery plans. Health guidance agent: push disease prevention and health management guidance content. Diet exercise and basic health management agent: generate diet plans and exercise recommendations, and monitor the completion of health goals. Case material management agent: classify and store case materials, and support fast retrieval and calling of other agents. Task management agent: build and schedule LangGraph graph framework, dynamically assign tasks and monitor node execution status.
[0044] Optionally, each subtask corresponds to a type of intelligent agent, and the task volume of the subtask can also be analyzed, and the number of matching intelligent agents can be called according to the task volume. For example, the health description information can be divided into subtask 1, subtask 2, and subtask 3, corresponding to intelligent agent 1, intelligent agent 2, and intelligent agent 3 respectively. Among them, the task volume of subtask 2 is larger, so the number of intelligent agents 2 called is greater than 1.
[0045] Optionally, the agent set also includes a general agent for executing unknown tasks that do not match any agent in the preset agent set. The general agent can be a large artificial intelligence model in a general field, an artificial customer service module, etc. When there is an unknown task in multiple subtasks that does not match any agent in the preset agent set, a general agent is assigned to the unknown task in the multiple subtasks.
[0046] Optionally, using the multiple agents to construct a dynamic LangGraph graph includes: determining the logical relationship between the multiple agents; and constructing a dynamic LangGraph graph with each of the agents as a node and each of the logical relationships as a directed edge between adjacent nodes.
[0047] The dynamic LangGraph of this embodiment consists of nodes and directed edges. Each node corresponds to an agent representing a different operation or step, such as calling a large language model (LLM), accessing a database, processing user input, etc., which is the basic building block of the graph. Directed edges represent the relationship or process between steps, such as data flow, decision path, etc. LangGraph supports conditional edges, which can dynamically determine the next node to be executed based on the current state of the graph.
[0048] In the dynamic LangGraph, each node corresponds to an independent agent that handles a specific task. Data flows are transmitted between nodes through directed edges (such as diagnostic results are transmitted to recovery nodes). The task management agent dynamically adjusts the task flow according to the node output signal to ensure that the process execution completes the goal.
[0049] The dynamic LangGraph graph has conditional edges (directed edges). The judgment of conditional edges (determining which agent module to execute, that is, the flow of tasks) is based on the task planning return of the large model. The master control agent classifies the specific responsibilities and functions of each agent according to the function, so that the needs of each conversation can be implemented on a specific single or multiple agents.
[0050] The functions of the preset intelligent agent set in this embodiment correspond to a professional medical team. For example, the team members include: team managers (analyzing the patient's needs each time and finding corresponding team members to deal with the problem), doctors (responsible for analyzing and summarizing the patient's health information), health record managers (classifying, analyzing and recording patient health reports for doctors to analyze and use), information collectors (talking with users to obtain and collect effective information and information needed by doctors), and health recovery specialists (responsible for making plans for the patient's health status and tracking the plans).
[0051] In one implementation of the present embodiment, executing the dynamic LangGraph and replying the rehabilitation plan information of the health description information in the conversation window includes: inputting the health description information into the first agent of the dynamic LangGraph; executing the first agent to obtain the diagnosis result information output by the first agent; inputting the diagnosis result information into the second agent of the dynamic LangGraph; executing the second agent to obtain the rehabilitation plan information output by the second agent; inputting the rehabilitation plan information into the third agent of the dynamic LangGraph; executing the third agent to obtain the rehabilitation plan information output by the third agent, and outputting the diagnosis result information and rehabilitation plan information in the conversation window, wherein the dynamic LangGraph includes the first agent, the second agent, and the third agent connected in sequence based on a directed graph.
[0052] In this implementation, the first agent is a diagnostic record agent: based on the health needs and health description information such as the examination report entered by the user, a preliminary diagnosis result is generated. The second agent is a recovery agent, which is connected to the knowledge base module: used to generate health plan information for rehabilitation recommendations in combination with the knowledge base. The knowledge base of this embodiment can also include multiple sub-databases such as case database, health management database, and user personalized information database, and combined with enhanced retrieval generation technology (RAG) for data search. . The third agent is a health management agent: used to generate periodic rehabilitation plans for health goals, such as diet plans, exercise plans, medication plans, follow-up plans, etc., and return summary results after the task is completed. After the dynamic LangGraph graph is executed, the system feedbacks the results to the user in the form of WeChat dialogue, including diagnostic recommendations, recovery plans and health plans. In addition to responding to the user's health inquiries, daily reminders will be given to the user's health plan, such as: three meals a day, taking medicines, exercise rehabilitation, sleep and work schedule, etc.
[0053] In an application scenario based on this implementation, a user uploads a copy of his or her own examination report (health description information) in a WeChat conversation; the task management agent receives the report uploaded by the user, and completes the specific task planning of this task through internal large-scale model analysis. It is expected to first call the case material management agent to store the user's case, then call the diagnosis agent to update the user's disease data, and finally call the general and care agent to reply to the user based on the user's examination report and previous health data, thus completing the dynamic task execution process of this conversation.
[0054] In one example, inputting the diagnosis result information into the second agent of the dynamic LangGraph graph includes: calling the task management agent of the dynamic LangGraph graph to monitor the task execution status of the first agent; after the first agent completes the execution, passing the diagnosis result information to the second agent through the directed edge between the first agent and the second agent.
[0055] In an implementation scenario, after obtaining the diagnosis result information output by the first agent, the method further includes: inputting the health description information and the diagnosis result information into a fourth agent of the dynamic LangGraph; executing the fourth agent to obtain a case report obtained by the fourth agent using the diagnosis result information for analysis; and storing the case report in a database.
[0056] The fourth agent in this embodiment is a case storage agent, which is used to store health description information and diagnosis results input by the user.
[0057] This technical solution introduces the LangGraph graph framework to design multi-agents into a collaborative graph based on task nodes, where each node represents a specific medical task (such as diagnosis, recovery recommendation, health plan generation, etc.). The system uses task management agents to dynamically build task graphs, and transmits data flow and decision signals through directed edges between nodes to achieve efficient multi-task collaboration. The LangGraph framework supports modular expansion and flexible scheduling of agents, and combines the core large model and segmented knowledge base to complete the entire process from user input to diagnosis results and health advice generation. Figure 3 is a system flow chart of an embodiment of the present invention, including: Build and schedule the LangGraph graph framework; Dynamically assign tasks: user dialogue goals, task assignment and execution plan to achieve the goals (specifically, the execution subtasks assigned to each agent, and the execution steps of multiple agents). This solution is implemented using LangGraph graphs and conditional edges to generate a dynamic graph. Monitor node execution status: monitor and record the task completion status and return results of each agent; Perform symptom analysis and diagnostic reasoning: autonomously analyze and record the medical records and reports provided by users, and update the user's health records; Generate personalized rehabilitation plan: Design a rehabilitation plan based on the user's disease, basic information and expected goals, and track reminders and record the user's health status at different stages according to the year, month and day; Push disease prevention and health management science content: Recommend appropriate science content based on the user's health status; Generate diet and exercise plans: Generate plans and tracking reminders based on health conditions; Completion of health goals: revisit users and track and monitor their goal completion; Classified storage of case materials: Extract the content of the medical reports provided by patients in the chat records, store them in categories, and support external retrieval.
[0058] This embodiment adopts the LangGraph graph framework design, and the nodes realize task decomposition and collaboration through directed edges, supporting dynamic adjustment of task processes. It supports modular expansion, and nodes can be added or modified according to needs. Each node corresponds to an independent intelligent agent, responsible for a single task (such as task management, diagnosis, recovery recommendation, health management). The data flow and signal transmission between nodes optimize the efficiency and accuracy of task execution.
[0059] The LangGraph graph framework is used to achieve multi-agent collaboration and support the decomposition and efficient execution of complex medical tasks. The core big model and knowledge base are combined to complete the processing of multi-modal (pictures: report sheets, case reports and other health examination reports) health description information. The big model classifies and recognizes pictures and summarizes health reports to improve diagnostic accuracy and health management capabilities, and realizes a convenient user interaction experience through conversations.
[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0061] Example 2 In this embodiment, an agent-based conversation device is also provided, which is used to implement the above embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and hardware for the reservation function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, can also be conceived.
[0062] Figure 4 is a structural block diagram of an agent-based conversation device according to an embodiment of the present invention. Figure 4 As shown, including: The receiving module 40 is used to receive health description information input by the user through the conversation window; A calling module 42, configured to call a plurality of agents according to the health description information, wherein each agent encapsulates an application program with a corresponding function; A construction module 44, configured to construct a dynamic LangGraph using the plurality of agents; The reply module 46 is used to execute the dynamic LangGraph and reply the rehabilitation plan information of the health description information in the conversation window.
[0063] Optionally, the calling module includes: a generating unit, used to parse the health description information and generate multiple subtasks according to the health description information; and a calling unit, used to search and call multiple agents matching the multiple subtasks in a preset agent set.
[0064] Optionally, the construction module includes: a determination unit, used to determine the logical relationship between the multiple agents; a construction unit, used to construct a dynamic LangGraph graph with each of the agents as a node and each of the logical relationships as a directed edge between adjacent nodes.
[0065] Optionally, the reply module includes: a first input unit, used to input the health description information into the first agent of the dynamic LangGraph; a first execution unit, used to execute the first agent to obtain the diagnosis result information output by the first agent; a second input unit, used to input the diagnosis result information into the second agent of the dynamic LangGraph; a second execution unit, used to execute the second agent to obtain the rehabilitation plan information output by the second agent; a third input unit, used to input the rehabilitation plan information into the third agent of the dynamic LangGraph; a third execution unit, used to execute the third agent, obtain the rehabilitation plan information output by the third agent, and output the diagnosis result information and rehabilitation plan information in the session window, wherein the dynamic LangGraph includes the first agent, the second agent, and the third agent connected in sequence based on a directed graph.
[0066] Optionally, the second input unit includes: a monitoring subunit, used to call the task management agent of the dynamic LangGraph graph to monitor the task execution status of the first agent; and a transmission subunit, used to transmit the diagnosis result information to the second agent through the directed edge between the first agent and the second agent after the first agent completes the execution.
[0067] Optionally, the reply module also includes: a fourth input unit, used to input the health description information and the diagnosis result information into the fourth agent of the dynamic LangGraph after the first execution unit obtains the diagnosis result information output by the first agent; a fourth execution unit, used to execute the fourth agent to obtain a case report obtained by the fourth agent using the diagnosis result information for analysis; and a storage unit, used to store the case report in a database.
[0068] Optionally, the receiving module includes at least one of the following: a first receiving unit, used to receive first health description information in text format input by a user in a conversation window; a second receiving unit, used to receive second health description information in picture format input by a user in a conversation window; a third receiving unit, used to receive third health description information in voice format input by a user in a conversation window.
[0069] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0070] Example 3 An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0071] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for executing: S1, receiving health description information input by the user through the conversation window; S2, calling multiple agents according to the health description information, wherein each agent encapsulates an application program with corresponding functions; S3, constructing a dynamic LangGraph graph using the multiple agents; S4, executing the dynamic LangGraph, and replying the rehabilitation plan information of the health description information in the conversation window.
[0072] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0073] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0074] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0075] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S1, receiving health description information input by the user through the conversation window; S2, calling multiple agents according to the health description information, wherein each agent encapsulates an application program with corresponding functions; S3, constructing a dynamic LangGraph graph using the multiple agents; S4, executing the dynamic LangGraph, and replying the rehabilitation plan information of the health description information in the conversation window.
[0076] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0077] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0078] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, controller or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., various media that can store program codes.
[0083] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An agent-based conversation method, characterized in that: include: Receive health description information input by the user through the session window; Calling multiple intelligent agents according to the health description information, wherein each intelligent agent encapsulates an application program with corresponding functions; Constructing a dynamic LangGraph using the multiple agents; The dynamic LangGraph is executed, and the rehabilitation plan information of the health description information is replied in the conversation window.
2. The method according to claim 1, characterized in that Calling multiple agents according to the health description information includes: Parsing the health description information, and generating multiple subtasks according to the health description information; Search and call multiple agents matching the multiple subtasks in a preset agent set.
3. The method according to claim 1, characterized in that Using the multiple agents to construct a dynamic LangGraph graph includes: Determining logical relationships among the plurality of agents; A dynamic LangGraph is constructed with each of the intelligent agents as a node and each of the logical relationships as a directed edge between adjacent nodes.
4. The method according to claim 1, characterized in that Executing the dynamic LangGraph and replying the rehabilitation plan information of the health description information in the conversation window includes: Inputting the health description information into a first agent of the dynamic LangGraph; executing the first agent to obtain the diagnosis result information output by the first agent; Inputting the diagnosis result information into a second agent of the dynamic LangGraph; executing the second agent to obtain rehabilitation plan information output by the second agent; A third agent inputting the rehabilitation program information into the dynamic LangGraph; Execute the third agent, obtain the rehabilitation plan information output by the third agent, and output the diagnosis result information and the rehabilitation plan information in the conversation window, wherein the dynamic LangGraph graph includes the first agent, the second agent, and the third agent connected in sequence based on a directed graph.
5. The method according to claim 4, characterized in that The second agent inputting the diagnosis result information into the dynamic LangGraph graph includes: Calling the task management agent of the dynamic LangGraph graph to monitor the task execution status of the first agent; After the first agent completes execution, the diagnosis result information is transmitted to the second agent through the directed edge between the first agent and the second agent.
6. The method according to claim 4, characterized in that After obtaining the diagnosis result information output by the first agent, the method further includes: Inputting the health description information and the diagnosis result information into a fourth agent of the dynamic LangGraph; executing the fourth agent to obtain a case report obtained by the fourth agent through analysis using the diagnosis result information; The case report is stored in a database.
7. The method according to claim 1, characterized in that Receiving health description information input by the user through the conversation window includes at least one of the following: Receiving first health description information in text format input by a user in the conversation window; Receiving the second health description information in a picture format input by the user in the conversation window; The third health description information in voice format input by the user is received in the conversation window.
8. An agent-based conversation device, characterized in that: include: A receiving module, used for receiving health description information input by a user through a conversation window; A calling module, used to call multiple agents according to the health description information, wherein each agent encapsulates an application program with a corresponding function; A construction module, configured to construct a dynamic LangGraph using the plurality of agents; The reply module is used to execute the dynamic LangGraph and reply the rehabilitation plan information of the health description information in the conversation window.
9. A storage medium, characterized in that: A computer program is stored in the storage medium, wherein the computer program is configured to execute the steps of the agent-based conversation method described in any one of claims 1 to 7 when run.
10. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface, and the memory communicate with each other via a communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the steps of the agent-based conversation method according to any one of claims 1 to 7 by running a program stored in a memory.
Citation Information
Patent Citations
Intelligent agent-based medical question and answer method and system and electronic equipment
CN118152544A
Cited By
Knowledge question-answering method and device based on graph structure arrangement, equipment and medium
CN120873116A