Knowledge graph and cognitive search agent-based long-term memory construction and retrieval method and system

By constructing a long-term memory mechanism based on knowledge graphs and cognitive search agents, the problems of semantic silos and cognitive modality confusion in long-term memory of large language models are solved, dynamic reasoning and multi-resolution memory are realized, and cognitive ability and accuracy in complex scenarios are improved.

CN122432353APending Publication Date: 2026-07-21SHENZHEN FUTURE QINGYAN INTELLIGENT TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FUTURE QINGYAN INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-06-22
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing large language models suffer from semantic silos, temporal loss, cognitive modality confusion, and static retrieval rigidity in long-term memory, resulting in insufficient accuracy and consistency in multi-hop reasoning, temporal understanding, and social cognition scenarios.

Method used

We construct a long-term memory mechanism based on knowledge graphs and cognitive search agents, store atomic information through the PEC2F architecture, scan high-frequency event clusters offline and synthesize high-level fact nodes, and use cognitive search agents for dynamic reasoning and iterative updates.

Benefits of technology

It achieves structured, dynamic, and intelligent long-term memory, improving the cognitive understanding and reasoning accuracy of large language models in complex scenarios, and approaching the human social cognitive model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432353A_ABST
    Figure CN122432353A_ABST
Patent Text Reader

Abstract

The application provides a long-term memory construction and retrieval method and system based on a knowledge graph and a cognitive search agent, and relates to the technical field of artificial intelligence and natural language processing.The application constructs a knowledge graph following the PEC2F architecture, introduces a memory consolidation mechanism and a cognitive search agent, and the three work together to construct a structured long-term memory model that supports automatic induction of abstract facts from specific events and has multi-resolution tracing capability, and based on the long-term memory model, an iterative exploration reasoning mechanism is used for query response, thereby effectively solving the technical problems of semantic information islanding, lack of deep reasoning capability and rigid retrieval process caused by unstructured storage and static retrieval mode in the prior art, and significantly improving the understanding and response capability for complex queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a method, system, and storage medium for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents. Background Technology

[0002] With the rapid development of Large Language Models (LLMs), their application in dialogue systems is becoming increasingly widespread. However, existing LLMs face significant challenges in handling long-term memory. Traditional Retrieval-Augmented Generation (RAG) methods primarily rely on vector retrieval techniques. By segmenting text into fragments and storing them as vectors, relevant fragments are recalled during retrieval by calculating semantic similarity. This method has two main drawbacks: Semantic silos and loss of temporal sequence: Vector retrieval breaks down structured dialogue streams into isolated fragments, losing the temporal order and causal relationships between events, making it difficult to support complex multi-hop reasoning.

[0003] Cognitive modality confusion: Existing methods cannot distinguish between "objective reality" and "subjective mind." For example, when user A claims that "user B is untrustworthy," traditional systems often store it directly as an objective attribute, leading to memory contamination and hallucinations.

[0004] Furthermore, while existing knowledge graph-based methods (such as GraphRAG) introduce structured information, their graph schemas are typically generic entity-relationship models, lacking modeling of the nuanced "episodic memory" and "theory of mind" in dialogues. Meanwhile, static graph retrieval algorithms (such as PageRank) cannot understand the implicit intent in natural language queries, making flexible and proactive retrieval difficult.

[0005] Therefore, existing dialogue systems based on large language models lack a structured long-term memory mechanism that can distinguish between subjective and objective factors and perform dynamic reasoning, resulting in insufficient accuracy, consistency, and reliability in multi-hop reasoning, temporal understanding, and social cognition scenarios. Summary of the Invention

[0006] In view of this, the core technical problem to be solved by the present invention is: how to construct a structured long-term memory mechanism that can distinguish between subjective and objective factors and perform dynamic reasoning, so as to improve the cognitive ability, reasoning accuracy and long-term consistency of large language model dialogue systems in complex scenarios.

[0007] On the one hand, this invention provides a method for building and retrieving long-term memory based on knowledge graphs and cognitive search agents, including the following steps: S1, Knowledge Graph Construction: Receive raw dialogue data, extract atomized information using an information extraction model, whereby the atomized information includes Person, Event, Concept, Fact, and Claim. Normalize the extracted atomized information to build a knowledge graph following the PEC2F architecture, storing the atomized information as nodes or edges in the knowledge graph; S2, Memory Consolidation: Perform offline scanning of the knowledge graph to identify high-frequency event clusters related to Person and Concept; use the information extraction model to summarize the high-frequency event clusters and synthesize high-level fact nodes; establish a support relationship between high-level fact nodes and original event nodes; S3, Cognitive Retrieval: Receive user queries, instantiate a cognitive search agent, and the cognitive search agent dynamically calls a cognitive operator toolkit to explore the knowledge graph based on a reasoning and action loop, iteratively updating the reasoning state based on the exploration results until a final answer is generated.

[0008] Optionally, in step S1, the declaration nodes in the PEC2F architecture are stored using a double-hop topology. The double-hop topology includes a person node pointing to a declaration node, and a declaration node pointing to a target person node or a target concept node. The declaration node is used to store at least one of subjective evaluations, declarations, and beliefs, and is physically isolated from the fact nodes that represent objective attributes.

[0009] Optionally, in step S1, normalizing the atomized information specifically includes: normalizing the extracted atomized information using vector similarity; normalizing the extracted atomized information using vector similarity specifically includes: executing through the concept manager; calculating the vector embedding of the newly extracted atomized information; searching in the existing node library and calculating the cosine similarity; if the similarity exceeds a preset threshold, mapping the new node to an existing node ID; if it does not exceed the threshold, creating a new node and storing it in the node library.

[0010] Optionally, in step S2, synthesizing high-level fact nodes specifically includes: traversing the person nodes in the graph, retrieving event nodes connected by participation relationships, and grouping and clustering them according to the concepts involved in the events; when the number of events under a certain concept exceeds a preset threshold, triggering the inductive generation process, using an information extraction model to generate fact nodes describing the person's habits or attributes; obtaining the earliest and latest timestamps in the event cluster, calculating the effective time range of the fact nodes, and writing them as attributes into the high-level fact nodes.

[0011] Optionally, establishing the support relationship between the high-level fact node and the original event node specifically includes: after generating the fact node, instead of deleting the original event node, creating a support relationship edge from the high-level fact node to the original event node.

[0012] Optionally, the cognitive operator toolkit includes one of the following operators: an anchor point location operator, used to map unstructured queries to entry node IDs in a knowledge graph; an association walk operator, used to traverse neighbor nodes starting from a known node and filtering based on edge type; an intersection operation operator, used to calculate the neighborhood intersection of multiple entity nodes to discover commonalities; a spatiotemporal scanning operator, used to filter event nodes based on natural language time constraints; and an evidence tracing operator, used to retrieve the original text fragments corresponding to nodes.

[0013] Optionally, the anchor point positioning operator adopts a hybrid scoring mechanism, and its scoring formula is as follows: in, Represents a node Compared to query The rating, For fuzzy keyword matching indicator functions, For vector embedding functions, For cosine similarity calculation, These are the weighting coefficients.

[0014] Optionally, the intersection operator is used to handle multi-hop common reasoning, and its computational logic is formalized as follows: in, For a common foundation subgraph, For the input of the first One entity node, Represents a node In a specific set of semantic relations The set of neighboring nodes below, This represents the intersection operation of sets.

[0015] On the other hand, this invention provides a long-term memory construction and retrieval system based on knowledge graphs and cognitive search agents, comprising: an indexing module for receiving dialogue data, performing atomic information extraction, concept normalization, and constructing and storing a PEC2F graph; a consolidation module, communicatively connected to the indexing module, for offline graph scanning, performing event clustering, fact synthesis, and evidence mounting, and updating the graph structure; a retrieval module, communicatively connected to the consolidation module, including a graph service interface and a cognitive search agent; the cognitive search agent is configured with a cognitive operator toolkit for performing multi-step reasoning based on user queries and calling the graph service interface to obtain data; and a storage module, communicatively connected to the indexing module, consolidation module, and retrieval module, for storing graph structure data, node vector indexes, and raw text data.

[0016] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the long-term memory construction and retrieval method based on knowledge graphs and cognitive search agents as described above.

[0017] Implementing this invention has the following beneficial effects: By constructing a knowledge graph that follows the PEC2F architecture and introducing a memory consolidation mechanism and a cognitive search agent, this invention achieves the structuring, dynamic and intelligentization of long-term memory. First, the PEC2F architecture achieves structured storage of dialogue information by classifying and storing atomic information. It stores discrete atomic information as nodes or edges in a knowledge graph based on their inherent semantic relationships, breaking down information silos and solving the problem of subjective and objective information confusion at the root of data representation. This avoids memory contamination and provides a reliable data foundation for subsequent reasoning. Second, the memory consolidation mechanism simulates the transformation process of human memory from context to semantics by offline scanning and summarizing high-frequency event clusters into high-level fact nodes and establishing supporting relationships with the original events. This not only compresses storage and improves retrieval efficiency but, more importantly, forms a multi-resolution memory structure that retains detailed evidence while generating abstract knowledge that can be quickly reasoned about, thus enhancing memory stability. Finally, the cognitive search agent dynamically invokes cognitive operators based on a reasoning and action loop framework to actively explore and iteratively update the reasoning state of the knowledge graph, replacing traditional static retrieval. This allows for a more flexible understanding of user intent, autonomous formulation of retrieval strategies, and more effective execution of complex cognitive tasks such as multi-hop reasoning, temporal analysis, and commonality discovery. In summary, the knowledge graph of the PEC2F architecture provides optimized objects for memory consolidation and a rich semantic relationship network for cognitive search agent retrieval. The memory consolidation process optimizes the knowledge graph structure, improving the efficiency and quality of cognitive search agent retrieval. The proactive retrieval capability of the cognitive search agent fully explores and utilizes the value of the memory system constructed and optimized by the former two. The three work together to construct a structured long-term memory model that supports the automatic induction of abstract facts from specific events and has multi-resolution tracing capabilities. Based on this long-term memory model, an iterative exploration reasoning mechanism is used for query response. This effectively solves the technical problems of semantic information silos, lack of deep reasoning capabilities, and rigid retrieval processes caused by unstructured storage and static retrieval methods in existing technologies. It significantly improves the cognitive understanding, reasoning accuracy, and consistency of long-term interactions of large language models in complex multi-turn dialogues, making them closer to human social cognition and memory patterns. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the long-term memory construction and retrieval method based on knowledge graphs and cognitive search agents according to the present invention.

[0019] Figure 2 This is a schematic diagram of the pattern structure of the PEC2F (Person-Event-Concept-Claim-Fact) knowledge graph in an embodiment of the present invention.

[0020] Figure 3 This is a schematic diagram of the memory consolidation process in an embodiment of the present invention.

[0021] Figure 4 This is a schematic diagram of the reasoning process of the cognitive search agent in an embodiment of the present invention. Detailed Implementation

[0022] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.

[0023] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of 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.

[0024] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0025] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0026] Example 1 In this embodiment, as Figure 1 The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents, as shown, includes the following steps: S1. Knowledge Graph Construction Stage: Receive raw dialogue data and use the information extraction model to extract atomic information. Atomic information includes Person, Event, Concept, Fact, and Claim. Normalize the extracted atomic information and construct a knowledge graph that follows the PEC2F architecture. Store the atomic information as nodes or edges in the knowledge graph, thus forming Person nodes, Event nodes, Fact nodes, Claim nodes, and Concept nodes. S2. Memory Consolidation: Regularly scan the knowledge graph offline to identify high-frequency event clusters related to people and concepts; use a large language model to summarize the high-frequency event clusters, synthesize high-level fact nodes, and calculate the effective time range of the facts; establish support relationships (SUPPORTED_BY) between high-level fact nodes and original event nodes to form a multi-resolution memory structure from abstract semantics to specific scenarios. S3. Cognitive Retrieval: Receives user queries, explores the knowledge graph, iteratively updates the reasoning state based on the exploration results, until the final answer is generated.

[0027] In this embodiment, the information extraction model is the Large Language Model (LLM).

[0028] In this embodiment, person nodes serve as core anchors; event nodes connect person nodes through participation relationships and record time information to form contextual memory; concept nodes connect event nodes and fact nodes, serving as semantic anchors; fact nodes represent objective attributes and directly connect person nodes and concept nodes; declaration nodes connect person nodes through a "source-declaration-target" double-hop structure to isolate subjective declarations. These entities derived from atomic information have pointing relationships, which are indicated by fields, allowing the extracted atomic information to naturally form a knowledge graph.

[0029] In this embodiment, the original event nodes are generated during the construction of the knowledge graph.

[0030] In this embodiment, a "wide entry" strategy is adopted, requiring LLM to extract only atomic statements, i.e., subject-verb-object structures. The content extracted by LLM from atomic information is categorized into the following five node types: Person: A participant in the conversation or a person mentioned.

[0031] Event: A specific behavior with a spatiotemporal marker (e.g., "Jon went dancing yesterday").

[0032] Fact: An objective attribute or a self-reported preference (e.g., "Jon is a dancer").

[0033] Claim: A subjective evaluation or statement (e.g., "Gina thinks Jon works very hard").

[0034] Concept: An abstract entity or topic (e.g., "dancing", "stress").

[0035] In one possible implementation, a large language model is used to extract prompt words from the raw dialogue data in an atomic manner, as follows: You are a professional information extraction specialist, tasked with extracting structured information from conversations.

[0036] The following three types of content need to be extracted: 1. **Event**: The specific event mentioned in the dialogue. - Must include: participants, event, and time (if mentioned); - Format: {"type": "event", "title": "...", "participants": [...], "time": "...", "concepts": [...]} - The title should concisely describe the event, for example: "Caroline participated in the XX group support group". - In the concept section, fill in the core activity / theme phrase, for example: ["XX Group Mutual Aid Group", "Community Support"] 2. **Objective Facts**: Objective information about a person, their characteristics, preferences, or state. - Must include: subject, predicate, and object - Format: {"type": "fact", "subject": "...", "predicate": "...", "object": "..."} 3. **Subjective Statements**: The speaker's subjective statements, opinions, or thoughts. - Must include: speaker, target audience, and specific statement content. - Format: {"type": "claim", "source": "...", "target": "...", "content":"..."} Extraction rules: - Precise extraction, selecting only content explicitly stated in the original text or that can be reasonably inferred from the context. - Strictly adhere to the original names and expressions used in the dialogue. - If it is a relative time (such as yesterday, last week), retain the original time expression. - Output only standard JSON format; do not use Markdown formatting.

[0037] In one possible embodiment, the prompt word template extracted by the user terminal is as follows: Extract structured information from the following dialogue: Dialogue content: {text} Session date: {session_date} The final output is a JSON object containing three arrays: events, facts, and claims.

[0038] When extracting events, prioritize using the title field and do not use custom description text.

[0039] In this embodiment, step S1, which involves normalizing the atomic information, specifically includes: normalizing the extracted atomic information using vector similarity. During the extraction of atomic information, the participant is a structured field of the event, which is automatically added during extraction; confidence is a structured field of the fact, which is automatically added during extraction; and sentiment is a structured field of the statement, which is automatically added during extraction.

[0040] Specifically, because the extracted original concepts often have inconsistent expressions (such as "Dancing", "Dance", "Salsa"), a Concept Manager is introduced when constructing the knowledge graph. This allows for the use of vector similarity clustering techniques to perform the following operations: Calculate the vector embedding of the newly extracted atomic information. Search the existing node database. If the similarity exceeds the threshold (e.g., 0.85 based on experience), map the new node to the existing normalized node ID; otherwise, create a new node and store it in the node database.

[0041] Based on the normalized atomic information, nodes and edges are constructed in graph databases (such as NetworkX or Neo4j).

[0042] In this embodiment, in step S1, the declaration nodes in the PEC2F architecture are stored using a double-hop topology. The double-hop topology includes a person node pointing to a declaration node, and a declaration node pointing to a target person node or a target concept node, thereby separating subjective evaluations from objective attributes in the topology. The declaration node is used to store at least one of subjective evaluations, declarations, and beliefs, and is physically isolated from the fact nodes representing objective attributes.

[0043] Specifically, such as Figure 2 As shown, the knowledge graph topology of the PEC2F architecture specifically includes: Objective layer: Person nodes are connected to event nodes through participation (PARTICIPATED_IN); Person nodes are connected to fact nodes and concept nodes through likes (LIKES) / belongings (IS_A).

[0044] Subjective Layer: To address the issue of "subjective-objective confusion," the knowledge graph does not directly store declared attributes. Instead, it stores the declaration in a claim node (Claim ID) and isolates subjective bias topologically through a double-hop structure. Specifically, confusion is avoided by explicitly injecting prompt words, and the claim node can access the prompt words through a cognitive search agent. For example, the knowledge graph does not directly store the declared attribute "Gina is lazy," but instead stores a claim node. The double-hop structure of the claim node is: Jon (source) → Claim (content: "Gina lazy") → Gina (target).

[0045] In this embodiment, in step S2, since LLM memory is not static but evolves over time, the memory consolidation stage uses a complementary learning method that simulates human complementary learning systems (CLS) to rapidly construct knowledge graphs and offline organize them, thereby achieving the transformation from contextual memory to semantic memory.

[0046] In this embodiment, step S2, synthesizing high-level fact nodes specifically includes: traversing the person nodes in the graph, retrieving event nodes connected by participation relationships, and grouping and clustering them according to the concepts involved in the events; when the number of events under a certain concept exceeds a preset threshold, triggering the inductive generation process, using a large language model to generate fact nodes describing the person's habits or attributes; obtaining the earliest and latest timestamps in the event cluster, calculating the effective time range of the fact nodes, and writing them as attributes into the high-level fact nodes.

[0047] In this embodiment, establishing the support relationship between the high-level fact node and the original event node specifically includes: after generating the fact node, instead of deleting the original event node, creating a support relationship edge from the high-level fact node to the original event node.

[0048] Specifically, such as Figure 3 As shown, the memory consolidation phase runs offline in the background and includes the following: Clustering: Scanning high-frequency interactions in the knowledge graph. For example, discovering a large number of repeated event interactions between a person and a concept (e.g., Jon went to the gym 10 times in the past month).

[0049] Abstraction: When the number of events exceeds a threshold (e.g., 3 times), the LLM is called to summarize these events and generate a new Fact Node with the content "Jon has a habit of exercising".

[0050] Time envelope calculation: Based on the timestamp of the original event, calculate the effective time range [t] of the fact node. start ,t end ].

[0051] Evidence mounting: Establishing support edges (SUPPORTED_BY) between fact nodes and the original event nodes. This enables multi-resolution retrieval: it allows for quick retrieval of high-level facts while also enabling backtracking to specific details when needed, avoiding information loss.

[0052] In this embodiment, step S3, exploring the knowledge graph specifically includes: instantiating a cognitive search agent, dynamically calling a set of cognitive operators to explore the knowledge graph based on the reasoning + acting (ReAct) loop, and iteratively updating the reasoning state based on the observation results returned by the cognitive operator tools until the final answer is generated.

[0053] In this embodiment, as Figure 4 As shown, the reasoning process of a cognitive search agent includes: intent understanding and operator selection, cognitive operator execution, and iterative reasoning.

[0054] In this embodiment, intent understanding and operator selection include: The cognitive search agent receives user queries (such as "What do Jon and Gina have in common?"), analyzes the query intent, and selects appropriate cognitive operators from the cognitive operator toolkit.

[0055] In this embodiment, the cognitive operator toolkit for knowledge graphs includes one of the following cognitive operators: Anchor point location operator is used to map unstructured queries to entry node IDs in a knowledge graph; specifically, it uses hybrid retrieval (keyword matching + vector similarity) to locate entry nodes in the knowledge graph.

[0056] The association walk operator is used to traverse neighbor nodes starting from a known node and filtering them according to edge type. Specifically, it selectively traverses edges of a specific type related to the query intent (such as query declaration or query facts).

[0057] The intersection operator is used to calculate the neighborhood intersection of multiple entity nodes in order to discover commonalities or paths.

[0058] Spatiotemporal scanning operator is used to filter event nodes based on natural language temporal constraints; Evidence tracing operator, used to retrieve the original text fragment corresponding to a node.

[0059] In this embodiment, the cognitive operator execution includes: The Anchoring Operator, employing a hybrid scoring mechanism, identifies entry points into the knowledge graph. Its scoring formula is as follows: Formula (1); in, Represents a node Compared to query The rating, For keyword matching indicator functions, For vector embedding functions, For cosine similarity calculation, This is the weighting coefficient. It incorporates precise keyword matching (…). The system uses fuzzy cosine similarity (cos) to ensure that the correct node (i.e., anchor point, such as person node or concept node) can be found even when the entity name is misspelled.

[0060] Traversal Operator: The process starts from the anchor point and traverses neighboring nodes. The key is to support epistemic filtering: if the query is for a "statement", the agent only traverses statement edges; if the query is for a "fact", it traverses fact edges.

[0061] Intersection Operator: The intersection operator is used to handle multi-hop commonality reasoning. For multi-hop commonality problems (such as "common points"), it calculates the intersection of the neighborhoods of two entities, thus solving the problem that traditional vector retrieval is difficult to handle logical intersections. Its computational logic is formalized as follows: Formula (2); in, For a common foundation subgraph, For the input of the first One entity node, Represents a node In a specific set of semantic relations The set of neighboring nodes below, This represents the intersection operation of sets.

[0062] Temporal Scanning Operator: Based on natural language time constraints (such as "last month"), filter the earliest time of event nodes (i.e., start time, time_start, t). start ) attribute, rebuild the time sequence chain.

[0063] Evidence Grounding Operator: Before generating the final answer, the original text chunks corresponding to each node are retrieved for fact-checking to reduce illusions.

[0064] In this embodiment, iterative reasoning includes: The cognitive search agent determines whether the information is sufficient based on the observations returned by the cognitive operators. If insufficient, it generates a new thought and calls the next operator; if sufficient, it generates the final answer.

[0065] For example, in response to the query "How do Jon and Gina relieve stress?", the cognitive search agent first locates two anchor points (i.e., person nodes) named Jon and Gina. Then, it calls the intersection operator and finds that they are both connected to the concept node "Dancing". Next, the cognitive search agent confirms through traversal that Jon relieves stress by dancing (i.e., uses dancing for stress), while Gina likes dancing (i.e., likes dancing), and finally synthesizes the answer (usually a list of nodes).

[0066] Example 2 Based on Embodiment 1, this embodiment provides a system for implementing the above-described method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents.

[0067] In this embodiment, the long-term memory construction and retrieval system based on knowledge graphs and cognitive search agents includes: an indexing module, used to receive dialogue data, perform atomic information extraction, concept normalization, and knowledge graph construction and storage; The consolidation module is connected to the index module for offline scanning of the knowledge graph in the index module, performing event clustering, fact synthesis and evidence mounting, and updating the structure of the knowledge graph. The retrieval module is connected to the consolidation module. The retrieval module includes a graph service interface and a cognitive search agent. The cognitive search agent is configured with a cognitive operator toolkit to perform multi-step reasoning based on user queries and call the graph service interface to obtain data from the consolidation module. The storage module is connected to the indexing module, consolidation module, and retrieval module. The storage module is used to store graph structure data, node vector indexes, and raw text data.

[0068] Example 3 This embodiment provides a computer-readable storage medium based on the above embodiments.

[0069] In this embodiment, a computer-readable storage medium stores a computer program, which, when executed by a processor, implements the long-term memory construction and retrieval method based on knowledge graphs and cognitive search agents as described in the above embodiments.

[0070] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents, characterized in that, Includes the following steps: S1. Knowledge Graph Construction: Receive raw dialogue data, extract atomic information using an information extraction model, the atomic information includes Person, Event, Concept, Fact, and Claim, normalize the extracted atomic information, construct a knowledge graph following the PEC2F architecture, and store the atomic information as nodes or edges in the knowledge graph; S2. Memory Consolidation: The knowledge graph is scanned offline to identify high-frequency event clusters related to people and concepts; the high-frequency event clusters are summarized using an information extraction model to synthesize high-level fact nodes; and a support relationship is established between the high-level fact nodes and the original event nodes. S3. Cognitive Retrieval: Receive user queries, instantiate a cognitive search agent, and the cognitive search agent dynamically calls a set of cognitive operators to explore the knowledge graph based on a reasoning and action loop. Iteratively update the reasoning state based on the exploration results until the final answer is generated.

2. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 1, characterized in that, In step S1, the declaration nodes in the PEC2F architecture are stored using a double-hop topology structure, which includes a person node pointing to a declaration node, and a declaration node pointing to a target person node or a target concept node. The statement node is used to store at least one of subjective evaluations, statements, and beliefs, and is physically isolated from the fact nodes that represent objective attributes.

3. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 1, characterized in that, In step S1, the normalization process for the atomized information specifically includes: normalizing the extracted atomized information using vector similarity. Normalizing the extracted atomized information using vector similarity specifically includes: Executed via the concept manager; Calculate the vector embedding of the newly extracted atomized information; Search within the existing node database and calculate the cosine similarity. If the similarity exceeds a preset threshold, the new node is mapped to an existing node ID; if it does not exceed the threshold, a new node is created and stored in the node library.

4. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 1, characterized in that, In step S2, synthesizing the high-level fact node specifically includes: Traverse the person nodes in the graph, retrieve the event nodes connected by participation relationships, and group and cluster them according to the concepts involved in the events; When the number of events under a certain concept exceeds a preset threshold, the inductive generation process is triggered, and the information extraction model is used to generate fact nodes that describe the person's habits or attributes. Obtain the earliest and latest timestamps in the event cluster, calculate the effective time range of the fact node, and write it as an attribute to the higher-level fact node.

5. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 4, characterized in that, Establishing the support relationship between the high-level fact nodes and the original event nodes specifically includes: After generating the fact node, instead of deleting the original event node, support relationship edges are created from the higher-level fact node to the original event node.

6. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 1, characterized in that, The cognitive operator toolkit includes one of the following operators: An anchor point positioning operator is used to map unstructured queries to entry node IDs in the knowledge graph; The association walk operator is used to traverse neighbor nodes starting from a known node and filtering based on edge type. The intersection operator is used to calculate the neighborhood intersection of multiple entity nodes in order to discover commonalities; Spatiotemporal scanning operator is used to filter event nodes based on natural language temporal constraints; Evidence tracing operator, used to retrieve the original text fragment corresponding to a node.

7. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 6, characterized in that, The anchor point positioning operator adopts a hybrid scoring mechanism, and its scoring formula is as follows: in, Represents a node Compared to query The rating, For fuzzy keyword matching indicator functions, For vector embedding functions, For cosine similarity calculation, These are the weighting coefficients.

8. The method for constructing and retrieving long-term memory based on knowledge graphs and cognitive search agents according to claim 6, characterized in that, The intersection operator is used to handle multi-hop common reasoning, and its computational logic is formalized as follows: in, For a common foundation subgraph, For the input of the first One entity node, Represents a node In a specific set of semantic relations The set of neighboring nodes below, This represents the intersection operation of sets.

9. A long-term memory construction and retrieval system based on knowledge graphs and cognitive search agents, used to implement the long-term memory construction and retrieval method based on knowledge graphs and cognitive search agents as described in any one of claims 1 to 8, characterized in that, include: The indexing module is used to receive dialogue data, perform atomic information extraction, concept normalization, and construct and store the PEC2F graph; The consolidation module, communicatively connected to the index module, is used for offline graph scanning, performing event clustering, fact synthesis, and evidence mounting, and updating the graph structure. The retrieval module, communicatively connected to the consolidation module, includes a graph service interface and a cognitive search agent; the cognitive search agent is configured with a cognitive operator toolset for performing multi-step inference based on user queries and calling the graph service interface to retrieve data. The storage module, communicatively connected to the index module, consolidation module, and retrieval module, is used to store graph structure data, node vector indexes, and raw text data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the long-term memory construction and retrieval method based on knowledge graphs and cognitive search agents as described in any one of claims 1 to 8.