Agent decision-making method based on hybrid memory model and related device thereof
Patent Information
- Application Number
- CN202610938838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]然而,当前的运行模式下,生产指挥中心面临着前所未有的挑战
本申请的一种基于混合记忆模型的智能体决策方法及其相关装置,混合记忆模型至少包括短期记忆模块、长期记忆模块和记忆控制器,方法包括:获取目标业务场景下的实时交互数据流,并将实时交互数据流输入至混合记忆模型;通过短期记忆模块对实时交互数据进行封装处理,得到实时交互数据对应的初始对话页,并将初始对话页存储至短期记忆模块的对话队列中;当对话队列中的初始对话页数量达到第一数量阈值,则将对话队列中序号最小的目标对话页发送至长期记忆模块;其中,长期记忆模块至少包括主题分段记忆通道和个性化记忆通道,主题分段记忆通道用于将对话页分类至不同主题段中,个性化记忆通道用于存储用户身份信息和智能体身份信息;当接收到目标业务查询指令时,基于预设的多层级检索机制,通过记忆控制器从短期记忆模块和长期记忆模块中提取与目标业务查询指令匹配的上下文记忆信息;基于上下文记忆信息和目标业务查询指令构建目标提示词,并将目标提示词输入至大语言模型进行推理,得到与目标业务查询指令对应的业务决策结果。该方式中,能够通过构建包含短期记忆模块、长期记忆模块和记忆控制器的混合记忆模型,实现了实时交互数据流的动态封装处理与历史知识的结构化存储,结合多层级检索机制提取匹配的上下文记忆信息,从而有效整合实时响应与深度推理能力,能够提高智能体在复杂业务场景的决策准确性和时效性。
Smart Images

Figure CN122964208A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an agent decision-making method based on a hybrid memory model and related apparatus. Background Technology
[0002] Against the backdrop of the deepening implementation of the "dual-carbon" strategic goals and the accelerated evolution of the new power system, the power grid operation is increasingly characterized by complex features such as a high proportion of new energy integration, strong random fluctuations, and the interweaving of multi-source heterogeneous data. As the "brain" of the power grid operation, the power grid production command center undertakes the core functions of ensuring power grid security, optimizing resource allocation, and directing emergency response. Its operations focus on comprehensive control of key elements such as transmission and distribution lines, substation equipment, on-site operations, and external environmental risks, striving to achieve a closed-loop management system encompassing "precise pre-event warning, efficient in-event control, and in-depth post-event review." Its effectiveness directly determines the level of power grid security and stability and the efficiency of resource allocation.
[0003] However, under the current operating model, the production command center faces unprecedented challenges. Systems such as the power grid management platform, production command system, and equipment online monitoring master station generate multi-dimensional and massive amounts of heterogeneous data. Traditional analysis methods that rely on manpower and fixed rules are unable to achieve in-depth mining and rapid response, resulting in a sharp increase in decision-making delays and the risk of misjudgment, making it difficult to meet the needs for accurate identification and predictive early warning of early, weak risk signals.
[0004] Currently, some production command centers use models to process data. However, conventional single intelligent agents cannot simultaneously handle real-time response and deep reasoning capabilities. They cannot process real-time power grid data streams while also deeply understanding and utilizing massive amounts of historical fault cases, operating procedures, and equipment files. This limitation makes it difficult for intelligent agents to meet actual business needs in terms of the accuracy and timeliness of their decisions when facing complex and ever-changing power grid conditions. This affects the efficiency and effectiveness of emergency response, especially the timely handling of operational risks by operators. Summary of the Invention
[0005] To address or partially address the problems existing in related technologies, this application provides an intelligent agent decision-making method and related apparatus based on a hybrid memory model. By constructing a hybrid memory model that includes a short-term memory module, a long-term memory module, and a memory controller, it achieves dynamic encapsulation and processing of real-time interactive data streams and structured storage of historical knowledge. Combined with a multi-level retrieval mechanism, it extracts matching contextual memory information, thereby effectively integrating real-time response and deep reasoning capabilities, and improving the accuracy and timeliness of intelligent agent decision-making in complex business scenarios.
[0006] This application provides a method for agent decision-making based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. The method includes: acquiring a real-time interactive data stream from a target business scenario and inputting the real-time interactive data stream into the hybrid memory model; encapsulating the real-time interactive data through the short-term memory module to obtain an initial dialogue page corresponding to the real-time interactive data, and storing the initial dialogue page in the dialogue queue of the short-term memory module; when the number of initial dialogue pages in the dialogue queue reaches a first threshold, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module; wherein... The long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel. The topic segmentation memory channel is used to classify the dialog page into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information. When a target business query instruction is received, based on a preset multi-level retrieval mechanism, the memory controller extracts contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module. Based on the contextual memory information and the target business query instruction, a target prompt word is constructed, and the target prompt word is input into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction.
[0007] In conjunction with the first aspect, in one possible implementation of the first aspect, the step of encapsulating the real-time interactive data through the short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and storing the initial dialogue page in the dialogue queue of the short-term memory module, includes: extracting user query information, model response information, and timestamps from the real-time interactive data through the short-term memory module, and encapsulating them to obtain the initial dialogue page; calculating a first semantic similarity between the initial dialogue page and the preceding dialogue page in the short-term memory module; if the first semantic similarity is greater than a first similarity threshold, linking the initial dialogue page to the current dialogue chain of the short-term memory module and updating the summary metadata of the current dialogue chain; if the first semantic similarity is less than the first similarity threshold, constructing an initial dialogue chain in the short-term memory module based on the initial dialogue page.
[0008] In conjunction with the first aspect, in one possible implementation of the first aspect, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module includes: calculating the second semantic similarity between the target dialogue page and each historical topic segment in the long-term memory module in the topic segmentation memory channel; classifying the target dialogue page into the corresponding target historical topic segment according to the second semantic similarity, and updating the metadata information of the target historical segment according to the target dialogue page; wherein, the metadata information includes a topic summary, the number of dialogue pages, and the most recent access time.
[0009] In conjunction with the first aspect, in one possible implementation of the first aspect, each topic segment in the long-term memory module includes a dynamic popularity score, which is associated with the number of visits, the number of dialog pages, and the most recent access time of the topic segment. The method further includes: when the number of topic segments in the long-term memory module exceeds a second quantity threshold, determining the first topic segment with the lowest dynamic popularity score from the topic segments; and removing the first topic segment through the memory controller.
[0010] In conjunction with the first aspect, in one possible implementation of the first aspect, the method further includes: when the dynamic popularity score of the second topic segment in the long-term memory module is greater than a preset popularity threshold, the structured information in the second topic segment is extracted through the memory controller; and the user identity features and agent identity features in the personalized memory channel are updated according to the structured information.
[0011] In conjunction with the first aspect, in one possible implementation of the first aspect, the step of extracting contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller based on a preset multi-level retrieval mechanism includes: retrieving all dialogue pages in the dialogue queue of the short-term memory module through the memory controller to obtain short-term contextual information; calculating the third semantic similarity between the target business query instruction and the summary of each topic segment in the topic segmentation memory channel of the long-term memory module through the memory controller, and obtaining the third topic segment corresponding to the highest third semantic similarity; calculating the fourth semantic relevance between each first dialogue page in the third topic segment and the target business query instruction, and obtaining the second dialogue page corresponding to the highest fourth semantic similarity; retrieving the target user identity information and target agent identity information that are most semantically related to the target business query instruction in the personalized memory channel of the long-term memory module through the memory controller; and obtaining the contextual memory information based on the short-term contextual information, the third topic segment, the second dialogue page, the target user identity information, and the target agent information.
[0012] In conjunction with the first aspect, in one possible implementation of the first aspect, the step of constructing a target prompt word based on the context memory information and the target business query instruction, and inputting the target prompt word into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction, includes: parsing the context memory information to extract the temporal dialogue features, topic background features, and personalized preference features corresponding to the context memory information; concatenating and formatting the temporal dialogue features, topic background features, personalized preference features, and the target business query instruction based on a preset prompt word template to obtain the target prompt word; inputting the target prompt word into the large language model, and using the large language model to reason about the target prompt word and generate text to obtain a business decision result corresponding to the target business query instruction.
[0013] A second aspect of this application provides an intelligent agent decision-making device based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. It comprises: an acquisition module for acquiring real-time interactive data streams in a target business scenario and inputting the real-time interactive data streams into the hybrid memory model; a first processing module for encapsulating and processing the real-time interactive data through the short-term memory module to obtain initial dialogue pages corresponding to the real-time interactive data, and storing the initial dialogue pages in the dialogue queue of the short-term memory module; and a second processing module for sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold. The system comprises: a long-term memory module, which includes at least a topic-segmented memory channel and a personalized memory channel; the topic-segmented memory channel is used to classify dialog pages into different topic segments; and the personalized memory channel is used to store user identity information and agent identity information. A retrieval module, upon receiving a target business query instruction, extracts contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller, based on a preset multi-level retrieval mechanism. A generation module, based on the contextual memory information and the target business query instruction, constructs target prompt words and inputs the target prompt words into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction.
[0014] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.
[0015] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0016] The technical solution provided in this application may include the following beneficial effects: This application discloses an agent decision-making method and related apparatus based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. The method includes: acquiring real-time interactive data streams in a target business scenario and inputting the real-time interactive data streams into the hybrid memory model; encapsulating and processing the real-time interactive data through the short-term memory module to obtain initial dialogue pages corresponding to the real-time interactive data, and storing the initial dialogue pages in the dialogue queue of the short-term memory module; when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel, the topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information; when a target business query instruction is received, based on a preset multi-level retrieval mechanism, extracting contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller; constructing target prompt words based on the contextual memory information and the target business query instruction, and inputting the target prompt words into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction. This approach enables the dynamic encapsulation and processing of real-time interactive data streams and the structured storage of historical knowledge by constructing a hybrid memory model that includes short-term memory modules, long-term memory modules, and a memory controller. Combined with a multi-level retrieval mechanism, it extracts matching contextual memory information, thereby effectively integrating real-time response and deep reasoning capabilities. This improves the accuracy and timeliness of decision-making for intelligent agents in complex business scenarios.
[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0018] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0019] Figure 1 This is a flowchart illustrating an agent decision-making method based on a hybrid memory model, as shown in an embodiment of this application. Figure 2This is a schematic diagram of the structure of an intelligent agent decision-making device based on a hybrid memory model, as shown in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0020] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0021] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0022] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0023] Against the backdrop of the deepening implementation of the "dual-carbon" strategic goals and the accelerated evolution of the new power system, the power grid operation is increasingly characterized by complex features such as a high proportion of new energy integration, strong random fluctuations, and the interweaving of multi-source heterogeneous data. As the "brain" of the power grid operation, the power grid production command center undertakes the core functions of ensuring power grid security, optimizing resource allocation, and directing emergency response. Its operations focus on comprehensive control of key elements such as transmission and distribution lines, substation equipment, on-site operations, and external environmental risks, striving to achieve a closed-loop management system encompassing "precise pre-event warning, efficient in-event control, and in-depth post-event review." Its effectiveness directly determines the level of power grid security and stability and the efficiency of resource allocation.
[0024] However, under the current operating model, the production command center faces unprecedented challenges. Systems such as the power grid management platform, production command system, and equipment online monitoring master station generate multi-dimensional and massive amounts of heterogeneous data. Traditional analysis methods that rely on manpower and fixed rules are unable to achieve in-depth mining and rapid response, resulting in a sharp increase in decision-making delays and the risk of misjudgment, making it difficult to meet the needs for accurate identification and predictive early warning of early, weak risk signals.
[0025] Currently, some production command centers use models to process data. However, conventional single intelligent agents cannot simultaneously handle real-time response and deep reasoning capabilities. They cannot process real-time power grid data streams while also deeply understanding and utilizing massive amounts of historical fault cases, operating procedures, and equipment files. This limitation makes it difficult for intelligent agents to meet actual business needs in terms of the accuracy and timeliness of their decisions when facing complex and ever-changing power grid conditions. This affects the efficiency and effectiveness of emergency response, especially the timely handling of operational risks by operators.
[0026] For example, in a power grid emergency command scenario during a typhoon, the production command center needs to process real-time power grid operation data, weather warnings, online equipment monitoring data, and historical fault cases from the SCADA system. When a dispatcher queries the intelligent agent system for "how to handle a complete power outage at a 220kV substation," the system needs to consider the current real-time operating status, experience in handling similar historical faults, equipment ledger information, and safety regulations. However, due to the context window limitations of traditional intelligent agents, the system can only process the content of the most recent rounds of dialogue and cannot effectively retrieve and integrate key information from hours ago or historical cases. When the dispatcher mentions "the handling plan during the last typhoon," the system cannot accurately link it to historical events, resulting in suggestions that lack specificity and coherence, affecting the coordination and effectiveness of overall command.
[0027] To address the aforementioned issues, this application provides an agent decision-making method based on a hybrid memory model. By constructing a hybrid memory model that includes a short-term memory module, a long-term memory module, and a memory controller, it achieves dynamic encapsulation and processing of real-time interactive data streams and structured storage of historical knowledge. Combined with a multi-level retrieval mechanism, it extracts matching contextual memory information, thereby effectively integrating real-time response and deep reasoning capabilities. This improves the accuracy and timeliness of agent decision-making in complex business scenarios.
[0028] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating an agent decision-making method based on a hybrid memory model, as shown in an embodiment of this application.
[0029] See Figure 1A decision-making method for intelligent agents based on a hybrid memory model, wherein the hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller, and the method includes: S110: Obtain the real-time interactive data stream of the target business scenario and input the real-time interactive data stream into the hybrid memory model.
[0030] Specifically, the hybrid memory model can simulate human memory mechanisms, combining short-term and long-term memory and coordinated and managed by a memory controller. This enables the agent to process real-time information and historical knowledge simultaneously. The short-term memory module can temporarily store real-time, continuous interactive data streams and manage them in the form of queues to ensure immediate capture and rapid access to the current context. The long-term memory module can be used to store filtered and processed key information for a long time, such as structured knowledge and experience, for deep reasoning and personalized decision-making. The memory controller is used to manage the data flow, updates, and eviction between short-term and long-term memory and to perform cross-level memory retrieval for information integration.
[0031] Specifically, before an intelligent agent makes a decision, it first needs to acquire real-time interactive data in its target business scenario. This data stream can be information generated by sensors, monitoring systems, etc. For example, in a power grid production command scenario, the real-time interactive data stream may include voltage, current, and load data transmitted by the SCADA system, alarm information issued by the online equipment monitoring system, etc. Through this information, it is possible to know whether there are operational risks in power grid equipment, and the collected data stream is input into the hybrid memory model.
[0032] S120: The real-time interactive data is encapsulated and processed through the short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and the initial dialogue page is stored in the dialogue queue of the short-term memory module.
[0033] Specifically, after the real-time interactive data stream enters the hybrid memory model, the short-term memory module encapsulates the continuous real-time interactive data to form a structured initial dialogue page. An initial dialogue page can be a complete interaction process, such as including a user's query, an agent's response, and the corresponding timestamp. The dialogue page can be used to form the basic elements of the dialogue context. For example, when a user enters a query about the device status, the short-term memory module will encapsulate the query, the agent's initial understanding, and the current time point into a dialogue page. This initial dialogue page can then be stored in the dialogue queue inside the short-term memory module. The dialogue queue usually adopts a first-in-first-out (FIFO) mechanism.
[0034] S130: When the number of initial dialogue pages in the dialogue queue reaches the first quantity threshold, the target dialogue page with the smallest sequence number in the dialogue queue is sent to the long-term memory module; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel. The topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information.
[0035] Specifically, the first quantity threshold can be preset. When the number of initial dialogue pages stored in the dialogue queue reaches the preset first quantity threshold, the target dialogue page with the smallest sequence number (i.e. the earliest to enter the queue) in the queue can be sent to the long-term memory module. This ensures that the short-term memory module can continuously receive new real-time interactive data. For example, if the first quantity threshold is set to 100 dialogue pages, when 100 dialogue pages are stored in the queue, the dialogue page that entered the queue earliest will be sent to the long-term memory module.
[0036] Specifically, the long-term memory module includes a topic-segmented memory channel and a personalized memory channel. The topic-segmented memory channel is used to categorize dialogue pages migrated from the short-term memory module into different topic segments based on their content and semantics. Each topic segment represents a specific business topic or dialogue topic. For example, a dialogue page about transformer overload would be categorized into the topic segment "Equipment Failure" or "Transformer Operation". The personalized memory channel is used to store identity information related to the interaction subject, including user identity information (such as user ID, role, historical preferences, etc.) and agent identity information (such as agent role, configuration parameters, historical behavior patterns, etc.). This channel is used to support agents in making personalized interactions and decisions.
[0037] S140: When a target business query instruction is received, based on a preset multi-level retrieval mechanism, the memory controller extracts context memory information that matches the target business query instruction from the short-term memory module and the long-term memory module.
[0038] Specifically, the target business query command can be a query text entered by the user. For example, when a user queries "What are the recent line tripping events?", the memory controller will first search for recent alarms in the short-term memory module and simultaneously retrieve historical tripping cases in the long-term memory module. The retrieval can be performed based on different memory types and information characteristics. For instance, the memory controller first searches all dialog pages in the short-term memory module, then searches all topic segments and personalized information in the long-term memory module, and finally merges all search results to obtain the contextual memory information.
[0039] S150: Construct target prompt words based on contextual memory information and target business query instructions, and input the target prompt words into the large language model for reasoning to obtain the business decision results corresponding to the target business query instructions.
[0040] Specifically, the target prompts are input data for the large language model. They can be constructed using contextual memory information and target business query instructions. For example, if the contextual memory information includes historical fault cases and user preferences, the target prompts could be: "User A has encountered similar faults and prefers conservative operations. Current fault status: [real-time data]. Historical cases: [case summary]. Please provide a safe and efficient handling solution." The target prompts are then input into the large language model. Based on its language understanding and reasoning capabilities, the large language model analyzes the prompts and generates business decision results corresponding to the target business query instructions. These business decision results can be action suggestions, risk assessment reports, or operational instructions, effectively improving the accuracy, timeliness, and scientific nature of decision-making. This addresses issues such as insufficient risk warning capabilities and low efficiency of collaborative command in power grid production command.
[0041] For example, in a power grid production command scenario, an intelligent agent needs to assist staff in handling a sudden line fault. First, the system acquires abnormal voltage and current data for line A from the SCADA system, fault waveform information from the online monitoring system, and a target business query command issued by the staff via a voice assistant: "Line A tripped; please analyze the cause and provide handling suggestions." This data is then input into the hybrid memory model. Next, the short-term memory module encapsulates the received real-time interactive data. For example, it encapsulates the SCADA real-time data, fault waveform information, and the staff's query command into independent initial dialogue pages. Each dialogue page includes the event type, timestamp, and specific content. These initial dialogue pages are then stored in the dialogue queue of the short-term memory module. As new real-time data and commands are continuously acquired, the number of initial dialogue pages in the dialogue queue gradually increases. When the number of initial dialogue pages in the dialogue queue reaches a first threshold (e.g., set to 50 dialogue pages), the target dialogue page with the smallest sequence number in the dialogue queue (i.e., the earliest dialogue page to enter the queue, such as a record of a small voltage fluctuation a few minutes ago) is sent to the long-term memory module. After receiving these historical dialogue pages, the long-term memory module categorizes and stores them. For example, dialogue pages about the historical maintenance records of line A are categorized into the topic segmented memory channel of "Line A Equipment Ledger," while dialogue pages about staff operating habits are stored in the personalized memory channel for updating user identity information and agent identity information. When a staff member's target business query instruction "Line A tripped, please analyze the cause and provide handling suggestions" is received, the memory controller first searches the dialogue queue of the short-term memory module to obtain the latest fault alarms, waveform data, and the staff member's immediate questions. It then searches the topic segmented memory channel of the long-term memory module for historical fault cases and operating procedures related to topics such as "line tripping" and "fault diagnosis." In the personalized memory channel, it searches for the staff member's historical operating preferences and the agent's own experience in handling similar faults. Finally, it obtains contextual memory information that matches the target business query instruction, such as: the topology of line A, historical fault types, staff member's risk preferences, and the most recent maintenance record of line A. Subsequently, based on the contextual memory information and the target service query instruction, a target prompt word is constructed. This target prompt word could be: "User A has encountered a similar fault and prefers conservative operation. Current fault status: [SCADA data summary], [fault waveform summary]. Historical records show that line A tripped due to insulation aging. Dispatcher A tends to prioritize ensuring power supply reliability. Please analyze the cause of the fault and provide a solution that balances safety and rapid power restoration." This target prompt word is then input into the large language model for reasoning to obtain the business decision result corresponding to the target service query instruction. For example, the large language model might output: "Preliminary judgment: the tripping of line A may be caused by a transient fault."Recommendations: 1. Perform reclosing immediately. 2. If reclosing fails, isolate the faulty section and transfer the load through a backup line. 3. Initiate drone inspection to locate the fault; please have the dispatcher confirm.
[0042] This application discloses an agent decision-making method based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. The method includes: acquiring real-time interactive data streams in a target business scenario and inputting the real-time interactive data streams into the hybrid memory model; encapsulating and processing the real-time interactive data through the short-term memory module to obtain initial dialogue pages corresponding to the real-time interactive data, and storing the initial dialogue pages in the dialogue queue of the short-term memory module; when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel, the topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information; when a target business query instruction is received, based on a preset multi-level retrieval mechanism, extracting contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller; constructing target prompt words based on the contextual memory information and the target business query instruction, and inputting the target prompt words into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction. This approach enables the dynamic encapsulation and processing of real-time interactive data streams and the structured storage of historical knowledge by constructing a hybrid memory model that includes short-term memory modules, long-term memory modules, and a memory controller. Combined with a multi-level retrieval mechanism, it extracts matching contextual memory information, thereby effectively integrating real-time response and deep reasoning capabilities. This improves the accuracy and timeliness of decision-making for intelligent agents in complex business scenarios.
[0043] In one possible implementation, the real-time interactive data is encapsulated using a short-term memory module to obtain an initial dialogue page corresponding to the real-time interactive data, and the initial dialogue page is stored in the dialogue queue of the short-term memory module. This includes: extracting user query information, model response information, and timestamps from the real-time interactive data using the short-term memory module, and encapsulating them to obtain the initial dialogue page; calculating a first semantic similarity between the initial dialogue page and the preceding dialogue page in the short-term memory module; if the first semantic similarity is greater than a first similarity threshold, linking the initial dialogue page to the current dialogue chain in the short-term memory module and updating the summary metadata of the current dialogue chain; if the first semantic similarity is less than the first similarity threshold, constructing an initial dialogue chain in the short-term memory module based on the initial dialogue page.
[0044] Specifically, key information can be identified and extracted from the raw real-time interactive data stream, including the user's query content, the response content given by the intelligent agent model, and the time points when these interactions occur. This information can then be encapsulated and processed. For example, natural language processing (NLP) technology can be used to parse the real-time interactive data, identify the boundaries between user input and model output, and obtain timestamp information from system logs. This information can then be packaged into an initial dialogue page in JSON format.
[0045] Specifically, after obtaining the initial dialogue page, the semantic content correlation between the currently generated initial dialogue page and the existing dialogue pages in the short-term memory module can be calculated. For example, a word embedding-based method (such as Word2Vec or GloVe) can be used to convert the dialogue page content into a vector representation, and then the cosine similarity between these vectors can be calculated as the semantic similarity to determine whether the current dialogue continues a previous topic or context. The first similarity threshold can be preset. When the newly generated dialogue page has a high semantic similarity to the existing dialogue context, it is linked to the current dialogue chain and the summary metadata of the dialogue chain is updated. The summary metadata can be a short text description, automatically generated by summarizing the content of all dialogue pages in the dialogue chain. When the newly generated dialogue page has a low semantic similarity to the existing dialogue context, a new dialogue chain is built for this new dialogue page. For example, a new dialogue chain object can be created in the short-term memory module, and the initial dialogue page can be used as the first element of the dialogue chain. The metadata of the dialogue chain can be initialized based on the content of the initial dialogue page to avoid confusing different dialogue contexts. This ensures the clarity and accuracy of the dialogue context stored in the short-term memory module and improves the accuracy and efficiency of the agent in understanding user intent and making business decisions.
[0046] For example, a user inputs "I want to check my order status" via voice or text, and the agent responds "Please provide your order number." At this point, the short-term memory module extracts "I want to check my order status" (user query information), "Please provide your order number" (model response information), and the current timestamp from the real-time interaction data, and encapsulates this information into an initial dialogue page. Subsequently, the system calculates the first semantic similarity between this initial dialogue page and existing previous dialogue pages in the short-term memory module (e.g., the user may have previously asked "What is my account balance?"). If the semantic similarity shows a low similarity between the initial dialogue page and the previous dialogue page, the system determines that this is a new dialogue topic and constructs a new initial dialogue chain in the short-term memory module based on this initial dialogue page. If the user then enters "Order number is 12345", the agent responds "Querying, please wait". At this point, the new initial dialogue page will contain "Order number is 12345" (user query information), "Querying, please wait" (model response information) and a new timestamp. The system then calculates the first semantic similarity between this initial dialogue page and the previous dialogue page (i.e., the dialogue page containing "I want to check my order status" and "Please provide your order number"). Since "Order number is 12345" is highly semantically related to the previous "query order status", the calculated similarity will be higher than the first similarity threshold. Therefore, the new initial dialogue page can be linked to the current dialogue chain, and the summary metadata of the updated dialogue chain is updated.
[0047] In one possible implementation, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module includes: calculating the second semantic similarity between the target dialogue page and each historical topic segment in the long-term memory module in the topic segmentation memory channel; classifying the target dialogue page into the corresponding target historical topic segment based on the second semantic similarity, and updating the metadata information of the target historical segment based on the target dialogue page; wherein the metadata information includes topic summary, number of dialogue pages, and most recent access time.
[0048] Specifically, the second semantic similarity can be preset. The cosine similarity between the target dialogue page and each historical topic segment in the long-term memory module can be calculated to obtain the second semantic similarity. Based on the second semantic similarity, the target dialogue page is assigned to the existing topic segment most relevant to its topic content. When a new dialogue page is classified into a topic segment, the metadata information of that topic segment can be updated, such as increasing the number of dialogue pages, updating the most recent access time, and regenerating or adjusting the topic summary based on the content of the new dialogue page, thereby improving the accuracy and response speed of the agent's decision-making.
[0049] For example, the agent is handling a customer service scenario where a customer has made multiple inquiries about "product returns." When the initial number of dialogue pages in the short-term memory module's dialogue queue reaches a first threshold, the target dialogue page with the smallest sequence number is sent to the long-term memory module. At this point, the target dialogue page can be vectorized, and the cosine similarity between the target dialogue page vector and the vectors of these historical topic segments is calculated to obtain a second semantic similarity. If the second semantic similarity between the target dialogue page and the historical topic segment "product returns" is the highest and significantly higher than other topic segments, the system will classify the target dialogue page into the target historical topic segment "product returns" and update the metadata information of the "product returns" topic segment. Specifically, the "number of dialogue pages" for this topic segment will increase by 1, the "last access time" will be updated to the current time, and the "topic summary" of the "product returns" topic segment will be updated. For example, if a new dialogue page mentions the issue of "return shipping costs," the topic summary might be updated from "product return process" to "product return process and shipping policy."
[0050] In one possible implementation, each topic segment in the long-term memory module includes a dynamic popularity score, which is related to the number of times the topic segment is accessed, the number of dialog pages, and the most recent access time. The method further includes: when the number of topic segments in the long-term memory module exceeds a second quantity threshold, determining the first topic segment with the lowest dynamic popularity score from the topic segments; and removing the first topic segment through a memory controller.
[0051] Specifically, the dynamic popularity score is used to determine the activity level of each topic segment in the long-term memory module. It comprehensively reflects the attention and timeliness of the topic segment. For example, the dynamic popularity score can be obtained by weighting and summing the number of visits, the number of chat pages, and the most recent access time of the topic segment. The calculation formula is as follows:
[0052] in, This is a dynamic popularity score; The number of visits to the topic section; Number of dialog pages; This is a normalized value for the most recent access time. For example, if the most recent access time is within 24 hours, it can be normalized to 0.8, and if the most recent access time is within 7 days, it can be normalized to 0.5. , , These are the first weight, the second weight, and the third weight, for example. 0.5 0.3 It is 0.2.
[0053] Specifically, dynamic popularity scores can be used to prioritize topics in long-term memory. The access count of a topic refers to the number of times it has been retrieved. Each time the memory controller or other modules access a topic, its access count increases accordingly. The more accesses, the more important the topic is. The number of dialogue pages refers to the total number of dialogue pages contained within a specific topic. The more dialogue pages a topic contains, the more information it contains. The most recent access time is the timestamp of the last time the topic was accessed or updated. A second threshold can be preset. When the number of topic segments in the long-term memory module exceeds this threshold, the topic segment with the lowest current activity or importance is identified and removed by the memory controller. This ensures that the long-term memory module retains only relatively active and important information, improving the efficiency and accuracy of decision-making by the agent in complex business scenarios.
[0054] In one possible implementation, the method further includes: when the dynamic popularity score of the second topic segment in the long-term memory module is greater than a preset popularity threshold, extracting structured information from the second topic segment through the memory controller; and updating the user identity features and agent identity features in the personalized memory channel based on the structured information.
[0055] Specifically, a preset popularity threshold can be set in advance. When the dynamic popularity score of the second topic segment in the long-term memory module exceeds the preset popularity threshold, it indicates that the topic segment carries highly active and valuable interaction content between the user and the agent. At this time, structured information can be extracted from the second topic segment through the memory controller, for example, through natural language processing (NLP) technology. The structured information may include key entities, events, user intent, sentiment tendencies, specific business processes, etc., and the user identity features and agent identity features are updated through the structured information. User identity features may include user preferences, habits, historical behavior patterns, specific needs, etc.; agent identity features may include the agent's response style, professional field, service tendency, etc. For example, if "user preference A" is extracted, the label "preference A" is added to the user identity features.
[0056] In one possible implementation, based on a preset multi-level retrieval mechanism, a memory controller extracts contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module. This includes: retrieving all dialogue pages in the dialogue queue of the short-term memory module using the memory controller to obtain short-term contextual information; calculating the third semantic similarity between the target business query instruction and the summary of each topic segment in the topic segment memory channel of the long-term memory module using the memory controller, and obtaining the third topic segment corresponding to the highest third semantic similarity; calculating the fourth semantic relevance between each first dialogue page in the third topic segment and the target business query instruction, and obtaining the second dialogue page corresponding to the highest fourth semantic similarity; retrieving the target user identity information and target agent identity information that are most semantically related to the target business query instruction in the personalized memory channel of the long-term memory module using the memory controller; and obtaining contextual memory information based on the short-term contextual information, the third topic segment, the second dialogue page, the target user identity information, and the target agent information.
[0057] Specifically, the cosine similarity between the target business query instruction and the summary of each topic segment can be calculated as the third semantic similarity. The third semantic similarity can be used to measure the semantic closeness between the query instruction and the historical topic segments to obtain the third topic segment. The cosine similarity between each first dialogue page in the third topic segment and the target business query instruction can be calculated as the fourth semantic relevance to obtain the second dialogue page. The target user identity information and target agent identity information with the highest semantic relevance to the target business query instruction can also be obtained. Finally, the real-time context information from the short-term memory module, the topic history information from the long-term memory module, the specific dialogue page, and the personalized information are summed to obtain the context memory information.
[0058] For example, a user issues a query to the agent: "What's the current status of my return request for order number A123 that I submitted last week?". First, the memory controller retrieves the dialogue queue in the short-term memory module to obtain the user's most recent interaction records with the agent regarding order A123, such as "The user inquired about the logistics status of order A123 yesterday." Simultaneously, the memory controller calculates the semantic similarity between "return request processing progress" and the summaries of each topic segment in the topic segment memory channel of the long-term memory module. For example, it finds that the summary of the topic segment "after-sales service process" has the highest semantic similarity to the query, thus determining "after-sales service process" as the third topic segment. Next, within the "After-Sales Service Process" section, the memory controller calculates the semantic relevance of the query command to each dialog page. For example, if a dialog page named "Order A123 Return Request Processing Record" has the highest semantic relevance to the query command, it is selected as the second dialog page. The memory controller also retrieves user-related identity and agent information, such as "User Preference Quick Response" and the agent's "After-Sales Specialist" identity information. Finally, the memory controller integrates the information from "The user inquired about the logistics status of Order A123 yesterday," the "After-Sales Service Process" section, the "Order A123 Return Request Processing Record" dialog page, and the "User Preference Quick Response" and "After-Sales Specialist" identity information to obtain complete contextual memory information.
[0059] In one possible implementation, target prompt words are constructed based on contextual memory information and target business query instructions. These prompt words are then input into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction. This includes: parsing the contextual memory information to extract temporal dialogue features, topical background features, and personalized preference features corresponding to the contextual memory information; concatenating and formatting the temporal dialogue features, topical background features, personalized preference features, and target business query instructions based on a preset prompt word template to obtain the target prompt words; and inputting the target prompt words into a large language model for reasoning and text generation to obtain a business decision result corresponding to the target business query instruction.
[0060] Specifically, temporal dialogue features can include the order of dialogues, temporal relationships, and dialogue turns, which can be obtained by analyzing the timestamps of dialogue pages and the order of dialogue chains. Thematic background features refer to the core theme, relevant background knowledge, or business domain surrounding the current dialogue or business query, which can be obtained by analyzing thematic summaries in the thematic segment memory channels of the long-term memory module, and by extracting them in conjunction with the thematic segment content of the target dialogue page. Personalized preference features can be features related to a specific user or agent, such as the user's historical behavior, interests, habits, identity information, and the agent's role settings and capabilities. Preset prompt word templates can be pre-set and can include template content for user queries, dialogue context, business background, and user preferences. These prompt words are then concatenated and formatted according to the prompt word templates, temporal dialogue features, thematic background features, personalized preference features, and the target business query command to obtain the target prompt words. Large language models can be Transformer-based models, such as GPT and BERT models, which can analyze various features and instructions in prompt words and then generate accurate text content, such as suggestions and operation steps, to improve the accuracy of decision-making in complex business scenarios, especially to improve the timely handling of operational risks by operators in the production command center.
[0061] In one possible implementation, the actual execution results of the business decision in the target business scenario are obtained; reinforcement learning algorithms and case reasoning techniques are used to conduct a retrospective analysis of the business decision results and actual execution results, and extract successful experience features or failure lesson features; the successful experience features or failure lesson features are transformed into new business rules and updated to the business knowledge graph of the long-term memory module; based on the results of the retrospective analysis, the weight parameters of the multi-level retrieval mechanism in the memory controller are dynamically adjusted to update the collaborative behavior model of the agent.
[0062] Specifically, actual execution results can be reflected through system logs, user feedback, etc. Reinforcement learning algorithms can be used to evaluate the long-term rewards of decision sequences, identifying which decision behaviors are effective and which are ineffective through reward or punishment mechanisms. Case reasoning techniques can learn from historical cases, extracting key features that lead to success or failure by comparing the similarity between the current decision and known successful or failed cases. For example, reinforcement learning algorithms can assign reward signals to the agent's decision behaviors based on actual execution results (such as user satisfaction and task completion rate), thereby driving the agent to learn better decision strategies. Case reasoning can analyze the reasons why specific decision responses lead to success or failure in specific contexts, identify key contextual features, association patterns between decision actions and results, and update these reasons to the business knowledge graph in the long-term memory module. The knowledge graph can be represented in the form of triples (entity-relationship-entity), thereby improving the accuracy and efficiency of decision-making.
[0063] For example, in an intelligent customer service scenario, the agent, based on the user's query and contextual information extracted from the short-term and long-term memory modules, uses a large language model to reason and provide a business decision, such as "suggest the user subscribe to Package A." In practice, the system obtains the user's actual feedback on the suggestion, such as whether the user accepted Package A or expressed dissatisfaction, and collects these actual results, such as "the user accepted and subscribed to Package A" or "the user refused and complained." Then, using reinforcement learning algorithms, based on indicators such as user satisfaction, the system evaluates the decision to "suggest the user subscribe to Package A" by rewarding or penalizing it. Simultaneously, case-based reasoning technology analyzes the relationship between the context of the decision response (such as the user's historical preferences and the current conversation topic) and the actual result, extracting failure lessons (e.g., recommending Package A when the user shows price sensitivity leading to user dissatisfaction) or success lessons (e.g., successfully converting the user when they explicitly express a need for data traffic). These features can then be transformed into new business rules, such as "IF the user is price-sensitive THEN avoid recommending Package A," and updated in the business knowledge graph of the long-term memory module. This enables intelligent agents to continuously learn from actual operations, optimizing their decision-making strategies and memory utilization methods.
[0064] In one possible implementation, in the topic segmentation memory channel, historical fault cases, equipment ledgers, and operating procedures are converted into entity relation triples to construct a business knowledge graph, and the business knowledge graph is converted into embedded vectors and stored in a vector database; in the personalized memory channel, user identity information containing user static data and dynamic traits, as well as agent identity information containing agent role attributes and dynamic traits, are constructed; based on the embedded vectors, user identity information, and agent identity information in the vector database, a structured storage space for the long-term memory module is formed.
[0065] Specifically, historical failure cases refer to detailed records of past equipment or system failures, including failure symptoms, cause analysis, handling processes, and solutions; equipment ledgers refer to records of equipment asset registration, management, and maintenance, including information such as equipment model, configuration, operating status, and maintenance history; operating procedures are standard operating steps and specifications that guide specific tasks or processes to ensure the correctness and safety of operations. User static data refers to basic user information, such as name, age, gender, occupation, department, and permission level; user dynamic characteristics refer to the features exhibited by users during use, such as historical query preferences, frequently used business processes, operating habits, emotional tendencies, and recent focus. Constructing user identity information helps intelligent agents understand users' personalized needs and preferences. The intelligent agent role attributes refer to the fixed roles of an intelligent agent in a specific business scenario, such as "customer service intelligent agent", "fault diagnosis intelligent agent", "process approval intelligent agent", etc., as well as its corresponding permissions, capability scope and preset behavior patterns. The intelligent agent dynamic traits refer to the characteristics exhibited by the intelligent agent during operation that change with the environment and interaction, such as optimized decision-making strategies and current task status. Finally, based on the embedded vectors, user identity information and intelligent agent identity information in the vector database, a structured storage space for the long-term memory module is formed. For example, a relational database (such as MySQL, PostgreSQL) is used to store the structured data of user and intelligent agent profiles.
[0066] This application discloses an agent decision-making method based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. The method includes: acquiring real-time interactive data streams in a target business scenario and inputting the real-time interactive data streams into the hybrid memory model; encapsulating and processing the real-time interactive data through the short-term memory module to obtain initial dialogue pages corresponding to the real-time interactive data, and storing the initial dialogue pages in the dialogue queue of the short-term memory module; when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold, sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel, the topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information; when a target business query instruction is received, based on a preset multi-level retrieval mechanism, extracting contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller; constructing target prompt words based on the contextual memory information and the target business query instruction, and inputting the target prompt words into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction. This approach enables the dynamic encapsulation and processing of real-time interactive data streams and the structured storage of historical knowledge by constructing a hybrid memory model that includes short-term memory modules, long-term memory modules, and a memory controller. Combined with a multi-level retrieval mechanism, it extracts matching contextual memory information, thereby effectively integrating real-time response and deep reasoning capabilities. This improves the accuracy and timeliness of decision-making for intelligent agents in complex business scenarios.
[0067] Corresponding to the aforementioned application function implementation method embodiments, this application also provides an intelligent agent decision-making device, electronic device, and corresponding embodiments based on a hybrid memory model.
[0068] Figure 2 This is a schematic diagram of the structure of an intelligent agent decision-making device based on a hybrid memory model, as shown in an embodiment of this application.
[0069] See Figure 2 A smart agent decision-making device 200 based on a hybrid memory model, wherein the hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller, comprising: The acquisition module 210 is used to acquire the real-time interactive data stream under the target business scenario and input the real-time interactive data stream into the hybrid memory model. The first processing module 220 is used to encapsulate and process real-time interactive data through a short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and store the initial dialogue page in the dialogue queue of the short-term memory module. The second processing module 230 is used to send the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold. The long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel. The topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information. The retrieval module 240 is used to extract context memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller based on a preset multi-level retrieval mechanism when a target business query instruction is received. The generation module 250 is used to construct target prompt words based on contextual memory information and target business query instructions, and input the target prompt words into the large language model for reasoning to obtain business decision results corresponding to the target business query instructions.
[0070] In one possible implementation, the first processing module 220 is further configured to extract user query information, model response information, and timestamps from real-time interactive data through the short-term memory module, and encapsulate them to obtain an initial dialogue page; calculate a first semantic similarity between the initial dialogue page and the preceding dialogue page in the short-term memory module; if the first semantic similarity is greater than a first similarity threshold, link the initial dialogue page to the current dialogue chain in the short-term memory module and update the summary metadata of the current dialogue chain; if the first semantic similarity is less than the first similarity threshold, construct an initial dialogue chain in the short-term memory module based on the initial dialogue page.
[0071] In one possible implementation, the second processing module 230 is further configured to calculate the second semantic similarity between the target dialog page and each historical topic segment in the long-term memory module in the topic segmentation memory channel; classify the target dialog page into the corresponding target historical topic segment according to the second semantic similarity, and update the metadata information of the target historical segment according to the target dialog page; wherein, the metadata information includes topic summary, number of dialog pages and recent access time.
[0072] In one possible implementation, the second processing module 230 is further configured to determine the first topic segment with the lowest dynamic popularity score from the topic segments when the number of topic segments in the long-term memory module exceeds a second quantity threshold; and remove the first topic segment through the memory controller.
[0073] In one possible implementation, the second processing module 230 is further configured to extract structured information from the second topic segment through the memory controller when the dynamic popularity score of the second topic segment in the long-term memory module is greater than a preset popularity threshold; and update the user identity features and agent identity features in the personalized memory channel based on the structured information.
[0074] In one possible implementation, the retrieval module 240 is further configured to retrieve all dialogue pages in the dialogue queue of the short-term memory module through the memory controller to obtain short-term context information; calculate the third semantic similarity between the target business query instruction and the summary of each topic segment in the topic segment memory channel of the long-term memory module through the memory controller, and obtain the third topic segment corresponding to the highest third semantic similarity; calculate the fourth semantic relevance between each first dialogue page in the third topic segment and the target business query instruction, and obtain the second dialogue page corresponding to the highest fourth semantic similarity; retrieve the target user identity information and target agent identity information that are most semantically related to the target business query instruction in the personalized memory channel of the long-term memory module through the memory controller; and obtain context memory information based on the short-term context information, the third topic segment, the second dialogue page, the target user identity information, and the target agent information.
[0075] In one possible implementation, the generation module 250 is further configured to parse the context memory information to extract the temporal dialogue features, topic background features, and personalized preference features corresponding to the context memory information; based on a preset prompt word template, the temporal dialogue features, topic background features, personalized preference features, and target business query instructions are concatenated and formatted to obtain target prompt words; the target prompt words are input into a large language model, and the large language model performs reasoning and text generation on the target prompt words to obtain the business decision result corresponding to the target business query instruction.
[0076] This application discloses an intelligent agent decision-making device based on a hybrid memory model. The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller. It comprises: an acquisition module for acquiring real-time interactive data streams in a target business scenario and inputting the real-time interactive data streams into the hybrid memory model; a first processing module for encapsulating and processing the real-time interactive data through the short-term memory module to obtain initial dialogue pages corresponding to the real-time interactive data, and storing the initial dialogue pages in the dialogue queue of the short-term memory module; and a second processing module for sending the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold. The long-term memory module includes at least a topic-segmented memory channel and a personalized memory channel. The topic-segmented memory channel categorizes dialogue pages into different topic segments, while the personalized memory channel stores user identity information and agent identity information. The retrieval module, upon receiving a target business query instruction, extracts contextual memory information matching the query instruction from the short-term and long-term memory modules using a pre-defined multi-level retrieval mechanism and a memory controller. The generation module constructs target prompts based on the contextual memory information and the target business query instruction, inputs these prompts into a large language model for reasoning, and obtains the business decision result corresponding to the query instruction. This approach, by constructing a hybrid memory model including a short-term memory module, a long-term memory module, and a memory controller, achieves dynamic encapsulation and processing of real-time interactive data streams and structured storage of historical knowledge. Combined with a multi-level retrieval mechanism to extract matching contextual memory information, it effectively integrates real-time response and deep reasoning capabilities, improving the accuracy and timeliness of agent decision-making in complex business scenarios.
[0077] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0078] This application also provides an electronic device. Figure 3 This is a schematic diagram of the hardware structure of an embodiment of the electronic device of this application. The electronic device includes a memory 320 and at least one processor 310. The memory 320 is electrically connected to the at least one processor 310. The memory 320 stores instructions. The at least one processor 310 calls the instructions in the memory 320, causing the electronic device to execute the intelligent agent decision-making method based on a hybrid memory model according to any of the foregoing embodiments of this application.
[0079] Specifically, the processor 310 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0080] Memory 320 may include a mass storage device for data or instructions. For example, and not limitingly, memory 320 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 320 may include removable or non-removable (or fixed) media. Where appropriate, memory 320 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 320 is non-volatile solid-state memory. In a particular embodiment, memory 320 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0081] In one example, the control device may also include a communication interface 330 and a bus 340. The processor 310, memory 320, and communication interface 330 are connected via the bus 340 and communicate with each other.
[0082] The communication interface 330 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0083] Bus 340 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 340 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0084] Furthermore, in conjunction with the agent decision-making method based on a hybrid memory model in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores executable code, which, when executed by a processor, implements any of the agent decision-making methods based on a hybrid memory model in the above embodiments.
[0085] This application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0086] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0087] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0088] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. An agent decision-making method based on a hybrid memory model, characterized in that, The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller, and the method includes: Acquire real-time interactive data streams under the target business scenario and input the real-time interactive data streams into the hybrid memory model; The real-time interactive data is encapsulated and processed by the short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and the initial dialogue page is stored in the dialogue queue of the short-term memory module. When the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold, the target dialogue page with the smallest sequence number in the dialogue queue is sent to the long-term memory module; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel, the topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information; When a target service query instruction is received, based on a preset multi-level retrieval mechanism, the memory controller extracts context memory information that matches the target service query instruction from the short-term memory module and the long-term memory module. Based on the contextual memory information and the target business query instruction, a target prompt word is constructed, and the target prompt word is input into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction.
2. The method according to claim 1, characterized in that, The step of encapsulating the real-time interactive data through the short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and storing the initial dialogue page in the dialogue queue of the short-term memory module, includes: The user query information, model response information, and timestamp are extracted from the real-time interactive data through the short-term memory module and then encapsulated to obtain the initial dialogue page. Calculate the first semantic similarity between the initial dialogue page and the previous dialogue page in the short-term memory module; If the first semantic similarity is greater than the first similarity threshold, then the initial dialogue page is linked to the current dialogue chain of the short-term memory module, and the summary metadata of the current dialogue chain is updated. If the first semantic similarity is less than the first similarity threshold, then an initial dialogue chain is constructed in the short-term memory module based on the initial dialogue page.
3. The method according to claim 1, characterized in that, Sending the target dialog page with the smallest sequence number in the dialog queue to the long-term memory module includes: Calculate the second semantic similarity between the target dialog page and each historical topic segment in the long-term memory module in the topic segmented memory channel; Based on the second semantic similarity, the target dialogue page is classified into the corresponding target historical topic segment, and the metadata information of the target historical segment is updated according to the target dialogue page; wherein, the metadata information includes topic summary, number of dialogue pages and recent access time.
4. The method according to claim 1, characterized in that, Each topic segment in the long-term memory module includes a dynamic popularity score, which is associated with the number of visits, the number of chat pages, and the most recent access time of the topic segment. The method further includes: When the number of topic segments in the long-term memory module exceeds the second quantity threshold, the first topic segment with the lowest dynamic popularity score is determined from the topic segments; The first topic segment is removed using the memory controller.
5. The method according to claim 4, characterized in that, The method further includes: When the dynamic popularity score of the second topic segment in the long-term memory module is greater than the preset popularity threshold, the structured information in the second topic segment is extracted by the memory controller. Based on the structured information, the user identity features and agent identity features in the personalized memory channel are updated.
6. The method according to claim 1, characterized in that, The preset multi-level retrieval mechanism, through the memory controller, extracts contextual memory information matching the target business query instruction from the short-term memory module and the long-term memory module, including: The short-term memory module's dialogue queue is retrieved by the memory controller to obtain short-term context information; The memory controller calculates the third semantic similarity between the target business query instruction and the summary of each topic segment in the topic segment memory channel of the long-term memory module, and obtains the third topic segment corresponding to the highest third semantic similarity. Calculate the fourth semantic relevance between each first dialog page in the third topic segment and the target business query instruction, and obtain the second dialog page corresponding to the highest fourth semantic similarity; The memory controller retrieves the target user identity information and target intelligent agent identity information that are most semantically relevant to the target business query instruction from the personalized memory channel of the long-term memory module. The context memory information is obtained based on the short-term context information, the third topic segment, the second dialogue page, the target user identity information, and the target agent information.
7. The method according to claim 1, characterized in that, The process of constructing target prompt words based on the context memory information and the target business query instruction, and inputting the target prompt words into a large language model for reasoning to obtain a business decision result corresponding to the target business query instruction includes: The contextual memory information is parsed to extract the temporal dialogue features, topic background features, and personalized preference features corresponding to the contextual memory information; Based on a preset prompt word template, the temporal dialogue features, the topic background features, the personalized preference features, and the target business query command are concatenated and formatted to obtain the target prompt word; The target prompt word is input into the large language model, and the large language model performs reasoning and text generation on the target prompt word to obtain the business decision result corresponding to the target business query instruction.
8. An intelligent agent decision-making device based on a hybrid memory model, characterized in that, The hybrid memory model includes at least a short-term memory module, a long-term memory module, and a memory controller, including: The acquisition module is used to acquire the real-time interactive data stream under the target business scenario and input the real-time interactive data stream into the hybrid memory model. The first processing module is used to encapsulate and process the real-time interactive data through the short-term memory module to obtain the initial dialogue page corresponding to the real-time interactive data, and store the initial dialogue page in the dialogue queue of the short-term memory module. The second processing module is used to send the target dialogue page with the smallest sequence number in the dialogue queue to the long-term memory module when the number of initial dialogue pages in the dialogue queue reaches a first quantity threshold; wherein, the long-term memory module includes at least a topic segmentation memory channel and a personalized memory channel, the topic segmentation memory channel is used to classify dialogue pages into different topic segments, and the personalized memory channel is used to store user identity information and agent identity information. The retrieval module is used to extract context memory information matching the target business query instruction from the short-term memory module and the long-term memory module through the memory controller when a target business query instruction is received, based on a preset multi-level retrieval mechanism. The generation module is used to construct target prompt words based on the context memory information and the target business query instruction, and input the target prompt words into the large language model for reasoning to obtain the business decision result corresponding to the target business query instruction.
9. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-7.