Processing method and device for dialogue memory of large language model, equipment and medium

By segmenting and updating dialogue information in the large language model and creating a long-term memory box, the lack of memory and perception in the emotional companion scene of the large language model is solved, personalized and accurate dialogue response is achieved, and the anthropomorphism of the agent is enhanced ability to transform.

CN119003728AActive Publication Date: 2024-11-22BEIJING FACE WALL INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411097797.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-22
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

Large language models are difficult to achieve memory and perception across long cycles in scenarios such as emotional companionship and psychological counseling, resulting in a lack of anthropomorphism, incomplete memory retrieval and inaccurate response.

Method used

By splitting and packing the conversation information between the agent and the user into conversation information, and creating and updating long-term memories in the long-term memory box, using environmental information to build long-term memory prompts to achieve personalization and accuracy of the conversation.

Benefits of technology

Anthropomorphic long-term memory storage and update mechanism has been established to provide memory simulations that are more like humans, ensure the timeliness and accuracy of memory, and enhance the dialogue capabilities and user experience of the agent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003728A_ABST
    Figure CN119003728A_ABST
Patent Text Reader

Abstract

The invention discloses a big language model dialogue memory processing method and device, equipment and a medium. The method comprises the following steps: segmenting and packaging dialogue information of an intelligent agent and a user to obtain dialogue information; the conversation information comprises multiple pieces of conversation information belonging to the same round of conversation; creating a long-term memory or updating the long-term memory in a long-term memory box according to the session information and environmental information from other systems; and obtaining a target long-term memory from the long-term memory box, and constructing a long-term memory prompt of the large language model generation request according to the target long-term memory. The embodiment of the invention can improve the long-term dialogue ability of the intelligent agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for processing dialogue memory of a large language model. Background Art

[0002] Large language models (LLMs) used for chatting are essentially a stateless service mechanism. Unless state information is carried in the request of the large language model, the large language model has no memory or perception of the state. In order to make up for this deficiency, the historical dialogue messages of the current session are generally placed in the context of the request to obtain multi-round dialogue capabilities. However, since the large language model has a length limit on the context of the request, it is difficult to obtain long-term memory across sessions using this solution. Especially in scenarios such as emotional companionship and psychological counseling, it is difficult to make the intelligent agent built on the large language model reflect the feeling of growing in interaction with users over a long period of time.

[0003] Although some studies have explored the ultra-long context of large language models and achieved certain results, the introduction of ultra-long context still cannot meet the needs of memory for scenarios such as emotional companionship. Typical problems include: the lack of memory updating and forgetting mechanisms, resulting in a lack of anthropomorphism; the randomness of the ChitChat scenario, where interrelated memories are often scattered and interspersed in the conversation history, making it difficult to ensure the integrity of long-term memory retrieval results; the retrieval mechanism introduces too much noise (such as conversation information about the same event at different times), which poses a great challenge to the accuracy of generation. Summary of the invention

[0004] The present invention provides a method, device, equipment and medium for processing dialogue memory of a large language model to improve the long-term dialogue ability of an intelligent agent.

[0005] According to one aspect of the present invention, a method for processing a large language model dialogue memory is provided, comprising:

[0006] The conversation information between the agent and the user is divided and packaged to obtain session information; the session information includes multiple conversation information belonging to the same round of conversation;

[0007] creating long-term memory or updating long-term memory in the long-term memory box based on the session information and environmental information from other systems;

[0008] A target long-term memory is obtained from the long-term memory box, and a large language model is constructed according to the target long-term memory to generate a requested long-term memory prompt.

[0009] According to another aspect of the present invention, there is provided a processing device for large language model dialogue memory, comprising:

[0010] A dialogue segmentation module is used to segment and package the dialogue information between the agent and the user to obtain session information; the session information includes multiple dialogue information belonging to the same round of dialogue;

[0011] A memory management module, for creating long-term memory or updating long-term memory in the long-term memory box according to the session information and environmental information from other systems;

[0012] A memory use module is used to obtain a target long-term memory from the long-term memory box and construct a large language model based on the target long-term memory to generate a requested long-term memory prompt.

[0013] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for processing a large language model dialogue memory according to any embodiment of the present invention.

[0014] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for processing large language model dialogue memory described in any embodiment of the present invention.

[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the processing method for large language model dialogue memory described in any embodiment of the present invention when executed.

[0016] The embodiments of the present invention establish an anthropomorphic long-term memory storage, update and recall mechanism, which is applied to scenarios such as anthropomorphic companionship, so that the intelligent agent can provide a more human-like memory mechanism through the simulation of memory, thereby realizing the personalization of user services; at the same time, it captures the latest conversation information and updates the long-term memory in real time to ensure the timeliness and accuracy of the long-term memory, and avoids inaccurate or incomplete responses of the intelligent agent due to information lag.

[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 is a flowchart of a method for processing a large language model dialogue memory according to an embodiment of the present invention;

[0020] Figure 2A is a flowchart of a method for processing large language model dialogue memory according to another embodiment of the present invention;

[0021] Figure 2B is a schematic diagram of an interaction process of various components provided according to another embodiment of the present invention;

[0022] Figure 3 is a structural diagram of a method for processing large language model dialogue memory according to another embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Figure 1This is a flowchart of a method for processing a large language model dialogue memory provided by an embodiment of the present invention. This embodiment can be applied to designing an overall framework covering long-term and short-term memory, memory update mechanism, and memory call mechanism, designing the process and interface for the interaction between the long-term memory box and the intelligent agent and other systems, and thereby improving the intelligent agent's dialogue ability. This method can be executed by a processing device for large language model dialogue memory, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device with corresponding data processing capabilities. Figure 1 As shown, the method includes:

[0027] S110, dividing and packaging the dialogue information between the agent and the user to obtain session information;

[0028] S120. Create long-term memory or update long-term memory in the long-term memory box according to the session information and environmental information from other systems.

[0029] S130, obtaining a target long-term memory from the long-term memory box, and constructing a large language model according to the target long-term memory to generate a requested long-term memory prompt.

[0030] Among them, the session message contains multiple chat messages belonging to the same round of conversation. Other systems are systems involved in the conversation content in the chat message, and environment information is the information referenced when generating the conversation content. For example, if the conversation content is a movie recommendation, the other system is a third-party movie review website, and the environment information is the movie review information, actor information, and director information of the recommended movie. The long-term memory box is a specially established memory processing unit that is used to dynamically update the memory based on the various information collected to ensure the timeliness and accuracy of the memory and reflect the latest communication situation.

[0031] Specifically, when a user is talking to a (pan-chat) agent, a large amount of conversation information will be generated. This conversation information will be collected in real time and divided and packaged into one or more conversation information according to the conversation. The conversation information and environmental information from other systems will be used by the long-term memory box to update its existing long-term memory or create new long-term memory (Memory Reflection).

[0032] When a user is talking to an agent, the agent initiates a memory retrieval request (MemoryRecall) to the long-term memory box. The long-term memory box retrieves its own stored long-term memory according to the retrieval request and returns the retrieval result to the agent as the target long-term memory. The agent splices the target long-term memory as a long-term memory prompt (memoryaugmented prompt) into the context of the request generated by the large language model, thereby providing users with a more personalized and historical communication service.

[0033] The embodiments of the present invention establish an anthropomorphic long-term memory storage, update and recall mechanism, which is applied to scenarios such as anthropomorphic companionship, so that the intelligent agent can provide a more human-like memory mechanism through the simulation of memory, thereby realizing the personalization of user services; at the same time, it captures the latest conversation information and updates the long-term memory in real time to ensure the timeliness and accuracy of the long-term memory, and avoids inaccurate or incomplete responses of the intelligent agent due to information lag.

[0034] Based on the above embodiment, optionally, the method further includes: regularly organizing the long-term memory in the long-term memory box based on the granularity of the agent.

[0035] Specifically, in order to further optimize the organization and management of memory, periodic tasks are set with the agent as the granularity to regularly organize the long-term memory in the long-term memory box, remove redundant and invalid information, and improve the quality and availability of memory.

[0036] Based on the above embodiment, optionally, the long-term memory includes important information memory between the user and the agent, and setting information memory of the agent.

[0037] Specifically, long-term memory can contain a variety of content, generally including: user's personal portrait memory (name, title, age, occupation, hobbies, social and family relationships, personality traits, emotional state, etc.); important information memory between the user and the intelligent agent (such as the relationship between the user and the intelligent agent, the degree of intimacy, major events); intelligent agent setting information memory (such as the intelligent agent's identity setting, plot line setting, etc.).

[0038] Figure 2A This is a flowchart of a method for processing a large language model dialogue memory provided by another embodiment of the present invention. This embodiment is optimized and improved on the basis of the above embodiment. Figure 2A As shown, the method includes:

[0039] S210, acquiring and storing the dialogue information between the agent and the user in real time through the dialogue center; publishing the dialogue information to the dialogue message agent through the dialogue center; and dividing and packaging the dialogue information through the dialogue message agent to obtain the dialogue information.

[0040] Specifically, Figure 2B As shown in the figure, the conversation information between the user and the agent is updated to the conversation center in real time to ensure that the latest communication information can be captured in time. The conversation center is responsible for real-time processing and storage of conversation information. In order for the long-term memory box to obtain the conversation message in time to create or update the long-term memory, the conversation center publishes the conversation message to the conversation message broker through the message queue (real-time message queue and / or delayed message queue) when receiving the conversation message. The conversation message broker divides and packages the received conversation message stream to obtain the conversation information, which helps to effectively manage and process a large amount of conversation information.

[0041] S220, publishing the session information to the observation message queue through the session message agent; publishing the environmental information from other systems to the observation message queue; creating long-term memory or updating long-term memory in the long-term memory box through the session information and environmental information in the observation message queue.

[0042] For details, please refer to Figure 2B , the session information generated by the session message agent and the environmental information generated by other systems will be published to the observation message queue as information related to the agent's memory, realizing the centralization and integration of information. The long-term memory box reads messages from the observation message queue and uses them to create or update memory, so that the memory in the box can be continuously improved and accurate. Creating a unified message queue to collect and summarize various related information can realize the centralized management of information, avoid information dispersion and omission, and provide a basis for comprehensive and accurate memory creation; at the same time, various specialized processing modules can manage and optimize a large number of message flows in an orderly manner, which can improve the efficiency and quality of message processing and make subsequent memory creation and updating more organized.

[0043] Optionally, the number of dialogue messages included in the session information is not greater than a set number and the interaction time between any two adjacent dialogue messages is not greater than a set time.

[0044] Specifically, in data evaluation and training, annotation and training are usually performed in units of conversations. So far, there is no concept of conversation in intelligent products for individual users. When performing online reasoning, directly attaching a preset number (N) of conversations in the past as the context of a large model request will cause some problems. Therefore, the present invention provides the following method for segmenting conversations:

[0045] a. When a user resets or deletes a conversation, all conversations and memories are deemed to be cleared, and a new conversation channel and conversation are generated.

[0046] b. When there is no dialogue interaction between the user and the agent for more than a set time, a new session is generated, and the dialogue information between the end of the last session and the most recent dialogue history is packaged into one session information.

[0047] c. If the user continues to talk to the agent and the number of dialogue messages exceeds the set number, but there is no time interval without interaction, then the set number of dialogue messages are packaged into one session message. However, when the large language model is inferring, we still attach the previous set number of dialogues of this session as context information. (This will cause the same information to exist in both long-term memory and dialogue history, but this problem can be solved through model training).

[0048] In addition, for other roles in cooperation: After splitting the session, use a relatively non-stiff way to increase the user's perception, such as adding active prompts from the agent such as "It's been a while since we last talked, let's talk about something new." The "backtracking" function performs re-consideration, but do not backtrack across sessions.

[0049] S230, obtaining a target long-term memory from the long-term memory box, and constructing a large language model according to the target long-term memory to generate a requested long-term memory prompt.

[0050] S240. Combining the long-term memory prompt and other prompts to generate a context for a large language model generation request; inputting the context and the large language model generation request into the large language model in the agent to obtain the output of the large language model and new dialogue information.

[0051] For details, please refer to Figure 2B , long-term memory prompts and other prompts, such as system prompts (SystemPrompt), retrieval enhanced generation prompts (RAG Prompt), short-term memory (In-session ChatHistory) are spliced ​​together into the context of the large language model generation request, and the context and the large language model generation request are input into the large language model in the agent, so that the large language model follows the memory generation content and outputs. The large language model generation request and the corresponding output are recorded and sent to the dialogue center as new dialogue information.

[0052] In addition, long-term memory is essentially a special type of "knowledge", and we can use prompts similar to retrieval-enhanced generation to prompt the large language model to generate responses. Currently, retrieval-enhanced generation has not been specifically optimized for long-term memory. We can first use instructions similar to long-term memory to evaluate the generation effect. To train the model, you need to label<Instructions,RelatedMemories,GenrationResult> The triplets are used to fine-tune the model.

[0053] For example, an example based on the conversation content is as follows:

[0054] User: Hello.

[0055] Agent: Hello, how can I help you?

[0056] User: Any movie recommendations?

[0057] Agent: Have you seen the movie A that I recommended to you last time?

[0058] User: I have seen it.

[0059] Agent: I think we should watch <Movie B> this time.

[0060] User: OK.

[0061] In this example, the agent retrieves the long-term memory from the long-term memory box and obtains the user's just watched movie A and the user's long-term viewing preferences, and recommends movie B to the user based on these two. By establishing an anthropomorphic long-term memory mechanism, the present invention provides users with a more intimate, coherent and personalized communication experience, meeting the user's needs for deep interaction and companionship in these scenarios, thereby attracting more users to choose the company's services. Secondly, the anthropomorphic long-term memory mechanism helps to expand the application scenarios of the company's products. It makes the large language model not only suitable for short-term, general communication, but also able to perform well in complex scenarios that require long-term memory and deep understanding, such as educational counseling, medical consultation, etc., to open up new markets and customer groups for the company. Furthermore, the anthropomorphic long-term memory mechanism improves user satisfaction and loyalty to the company's products. Better memory processing capabilities can allow users to experience smarter and more humane services, enhance the emotional connection between users and products, reduce user churn, and promote long-term use and word-of-mouth communication of users.

[0062] The embodiment of the present invention creates a unified message queue to collect and summarize various related information, which can realize centralized management of information, avoid information dispersion and omission, and provide a basis for comprehensive and accurate memory creation; at the same time, various specialized processing modules manage and optimize a large number of message streams in an orderly manner, which can improve the efficiency and quality of message processing and make subsequent memory creation and updating more organized.

[0063] Figure 3 A schematic diagram of a processing device for a large language model dialogue memory according to another embodiment of the present invention. Figure 3 As shown, the device comprises:

[0064] The dialogue segmentation module 310 is used to segment and package the dialogue information between the agent and the user to obtain session information; the session information includes multiple dialogue information belonging to the same round of dialogue;

[0065] A memory management module 320 for creating long-term memory or updating long-term memory in a long-term memory box according to the session information and environmental information from other systems;

[0066] The memory use module 330 is used to obtain the target long-term memory from the long-term memory box, and construct a large language model based on the target long-term memory to generate the requested long-term memory prompt.

[0067] The processing device for large language model dialogue memory provided in the embodiment of the present invention can execute the processing method for large language model dialogue memory provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0068] Optionally, the conversation segmentation module 310 includes:

[0069] A dialogue storage unit, used to obtain and store dialogue information between the agent and the user in real time through the dialogue center;

[0070] A conversation publishing unit, used for publishing the conversation information to the conversation message agent through the conversation center;

[0071] A conversation segmentation unit is used to segment and package the conversation information through the conversation message agent to obtain conversation information

[0072] Optionally, the memory management module 320 includes:

[0073] A session publishing unit, configured to publish session information to an observation message queue through the session message agent;

[0074] An information publishing unit, used to publish environmental information from other systems to the observation message queue;

[0075] The memory management unit is used to create or update long-term memory in the long-term memory box by observing the session information and the environment information in the message queue.

[0076] Optionally, the number of dialogue messages included in the session information is not greater than a set number and the interaction time between any two adjacent dialogue messages is not greater than a set time.

[0077] Optionally, the long-term memory includes important information memory between the user and the agent, and setting information memory of the agent.

[0078] Optionally, the device further comprises:

[0079] The memory arrangement module is used to regularly arrange the long-term memory in the long-term memory box at the granularity of the agent.

[0080] Optionally, the device further comprises:

[0081] A context generation module, configured to combine the long-term memory prompt and other prompts to generate a context for a large language model to generate a request;

[0082] The context using module is used to input the context and the large language model generation request into the large language model in the agent to obtain the output of the large language model and new dialogue information.

[0083] The processing device for large language model dialogue memory further described can also execute the processing method for large language model dialogue memory provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0084] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0085] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In RAM43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, ROM42 and RAM43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0086] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0087] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as the processing method of the large language model dialogue memory.

[0088] In some embodiments, the processing method of the large language model dialogue memory may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the processing method of the large language model dialogue memory described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the processing method of the large language model dialogue memory in any other appropriate manner (e.g., by means of firmware).

[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0090] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0091] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0092] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0093] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0094] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0095] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0096] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A processing system for large language model dialogue memory, characterized in that: The method comprises: The conversation information between the agent and the user is divided and packaged to obtain session information; the session information includes multiple conversation information belonging to the same round of conversation; creating long-term memory or updating long-term memory in the long-term memory box based on the session information and environmental information from other systems; A target long-term memory is obtained from the long-term memory box, and a large language model is constructed according to the target long-term memory to generate a requested long-term memory prompt.

2. The method according to claim 1, characterized in that The step of dividing and packaging the dialogue information between the agent and the user to obtain the session information includes: Acquire and store the conversation information between the agent and the user in real time through the conversation center; Publishing the conversation information to the conversation message agent through the conversation center; The conversation information is segmented and packaged by the conversation message agent to obtain the conversation information.

3. The method according to claim 2, characterized in that The creating long-term memory or updating long-term memory in the long-term memory box according to the session information and the environment information from other systems comprises: Publishing the session information to the observation message queue through the session message agent; Publish environmental information from other systems to the observation message queue; Long-term memory is created or updated in the long-term memory box by observing the session information and the environment information in the message queue.

4. The method according to any one of claims 1 to 3, characterized in that: The number of dialogue messages included in the session information is not greater than a set number and the interaction time between any two adjacent dialogue messages is not greater than a set time.

5. The method according to claim 1, characterized in that The long-term memory includes important information memory between the user and the agent, and setting information memory of the agent.

6. The method according to claim 1, characterized in that The method further comprises: The long-term memory in the long-term memory box is regularly sorted out based on the granularity of the agent.

7. The method according to claim 1, characterized in that After constructing the long-term memory prompt of the user question according to the target long-term memory, the method further includes: Combining the long-term memory prompt with other prompts to generate a context for a large language model to generate a request; The context and the large language model generation request are input into the large language model in the agent to obtain the output of the large language model and new dialogue information.

8. A processing device for large language model dialogue memory, characterized in that: The device comprises: A dialogue segmentation module is used to segment and package the dialogue information between the agent and the user to obtain session information; the session information includes multiple dialogue information belonging to the same round of dialogue; A memory management module, for creating long-term memory or updating long-term memory in the long-term memory box according to the session information and environmental information from other systems; A memory use module is used to obtain a target long-term memory from the long-term memory box and construct a large language model based on the target long-term memory to generate a requested long-term memory prompt.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for processing large language model dialogue memory according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for processing large language model dialogue memory according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Service quality management system based on community system

    CN110414999A

  • Data processing method for chat and related device

    CN114003702A

  • Interaction method and device, medium and electronic equipment

    CN117959715A

  • Implementation method of large model memory mechanism

    CN118095349A

  • Human-computer interaction method and device, electronic equipment and storage medium

    CN118098217A

Cited By

  • Human-computer interaction method and device, electronic equipment and storage medium

    CN118098217A

  • Long text processing method and related device

    CN119204234A

  • Universal memory management method and system based on language model

    CN119962574A

  • Virtual human stylized interactive long-term emotion accompanying dialogue generation method

    CN121168497A

  • Dynamic memory and context management system for AI chat agent

    CN121478924A