An agent-oriented hierarchical memory storage, calling and management method

CN122902942APending Publication Date: 2026-10-13SHANXI BONN WENLE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611209906.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

该方式中用户不连接该平台时记忆能力不可用或明显下降;同一协作对象在多个平台出现时平台身份容易混淆;平台登录状态、平台对象、用户画像和长期记忆耦合过深不利于迁移和扩展

Benefits of technology

本发明通过分层存储和按需召回,系统无需在每轮任务中注入整份用户画像或全部历史对话,减少上下文长度,降低模型调用成本,并提高任务处理效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122902942A_ABST
    Figure CN122902942A_ABST
Patent Text Reader

Abstract

The application is suitable for the field of artificial intelligence technology, and provides a layered memory storage, calling and management method for intelligent agents, which establishes a layered memory storage structure in the local machine, identifies the types and classifies the layers according to the properties of the candidate memory information, establishes an independent relationship card for each collaborative object, generates a memory recall plan before task execution, executes the memory recall according to the priority and constructs the task context to inject the intelligent agent, records the memory usage feedback, supports user error correction, forgetting, merging and pause learning, performs life cycle review and confirmatory governance and compression archiving, establishes a local memory database and performs access control before the main write switching, and keeps platform-independent and local priority. The application solves the problems of context expansion, old memory pollution, object rule confusion, untraceable source, difficult user error correction, difficult long-term memory governance, easy sensitive information leakage and deep platform binding in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically a hierarchical memory storage, retrieval, and management method for intelligent agents. Background Technology

[0002] With the development of large language models and intelligent agent technology, office-related intelligent agents have evolved from one-off question-and-answer tools into long-running systems capable of handling local document processing, task planning, work communication assistance, cross-platform information retrieval, long-term preference memory, tool invocation, and task recovery. In these long-running intelligent agent systems, memory capability is one of the fundamental abilities. The intelligent agent needs to gradually learn the user's identity, work preferences, common expressions, collaborators, communication boundaries, historical task results, tool invocation experience, and user error correction information through multiple rounds of use. For example, users want the system to remember their work role, common output formats, and communication style; they want the system to remember the communication boundaries of a client, colleague, or group chat; they want the system to reuse past experience in subsequent tasks, but not to treat old facts as current facts; they want to be able to view what the system has remembered and delete erroneous memories or pause learning; and they also want sensitive data stored locally, preventing leakage to external platforms due to memory limitations. For office-related intelligent agents, the memory system also needs to work collaboratively with task execution, tool invocation, work platform adaptation, message evidence, action deduplication prevention, and diagnostic recovery.

[0003] Existing intelligent agent memory solutions typically fall into the following technical categories. First, there's the method of directly concatenating historical dialogues, which involves directly appending user history, system prompts, user profiles, and tool results into the large model context. This method suffers from several drawbacks: rapid expansion of context length leads to increased costs and decreased response speed; historical content contains a large amount of temporary information that can contaminate the current task; the lack of time boundaries between old and new messages means the model might treat information from days ago as recently occurred; mixing rules from different contacts, clients, projects, and group chats can cause object confusion; and users cannot clearly understand which historical information has been used and why. Second, there's the method of single long-term memory or vector retrieval, which involves writing historical dialogues or document slices into a long-term memory or vector database, retrieving similar fragments in subsequent tasks and injecting them into the context. In this approach, similar text may not necessarily equal the facts required for the current task, easily leading to the recall of irrelevant content; search results lack clear sources, times, confidence levels, and reasons for adoption; old facts, erroneous facts, and facts corrected by users may be repeatedly recalled; recall results are usually sorted by text similarity, making it difficult to reflect the priority of user corrections and current tool facts; relying solely on vector retrieval makes it difficult to express structured rules such as object relationships, communication boundaries, and taboos. Third, the fixed user profile approach, which maintains a fixed text containing user identity, preferences, and work rules and injects it into each round of tasks. In this approach, user profiles become increasingly longer, affecting contextual efficiency; user profiles are suitable for recording global preferences but not for recording rules of a specific collaborating object; some information is only applicable to specific clients, projects, group chats, or tasks, and is easily misused after being written into the global profile; old profile content may not be promptly overwritten or downgraded after user corrections; the profile itself lacks fine-grained source tracking and lifecycle governance. Fourth, the platform-bound memory approach, which binds memory capabilities to a single work platform. In this approach, the user's memory capacity is unavailable or significantly reduced when the user is not connected to the platform; the platform identity is easily confused when the same collaborative object appears on multiple platforms; and the deep coupling between platform login status, platform objects, user profiles, and long-term memory is not conducive to migration and expansion.

[0004] Existing technologies suffer from the following drawbacks: rapid expansion of context length leads to increased model invocation costs and decreased response speed; historical content contains a large amount of temporary information, which can easily pollute the current task, and old and new messages lack time boundaries; rules from different contacts, clients, projects, and group chats are mixed together, which can easily cause object confusion; similar text retrieval may not be equivalent to the facts required for the current task, and irrelevant content can be easily recalled; search results lack clear sources, times, confidence levels, and reasons for adoption, and facts that have been corrected by users may be repeatedly recalled; increasingly longer user profiles affect context efficiency, and some information is only applicable to specific collaborating objects, which can be easily misused after being written into the global profile; when the same collaborating object appears on multiple platforms, the platform identity can be easily confused, and the deep coupling between the platform and the memory system is not conducive to migration and expansion; users cannot see what the system has remembered, nor can they delete or correct memories for a specific object, and duplicate, obsolete, conflicting, and low-confidence memories persist for a long time; compressing long-term memory may directly lose original evidence; the lack of access control mechanisms during memory migration or master-slave switching can easily cause data inconsistency; sensitive information can easily be leaked to external platforms. Therefore, in view of the above situation, there is an urgent need to provide a hierarchical memory storage, retrieval and management method for intelligent agents to overcome the shortcomings in current practical applications. Summary of the Invention

[0005] The purpose of this invention is to provide a hierarchical memory storage, retrieval, and management method for intelligent agents, aiming to solve the problems in the background art mentioned above.

[0006] This invention is implemented as follows: a hierarchical memory storage, retrieval, and management method for intelligent agents, comprising: A hierarchical memory storage structure is established on the user's local machine. The hierarchical memory storage structure includes at least the current context layer, the user profile layer, the collaborative object memory layer, and the long-term memory layer. When candidate memory information is generated, it is classified according to its nature and written into the corresponding storage level. Before the agent executes a task, a memory recall plan is generated based on the current task information; According to the memory retrieval plan, memory information is retrieved from the hierarchical memory storage structure according to a preset priority, wherein current facts and user immediate instructions have a higher priority than historical memories. The recalled memory information is injected into the task context of the agent; In addition, in response to user commands, it performs governance operations on the stored memory information.

[0007] As a further aspect of the present invention: the hierarchical memory storage structure further includes a hot memory layer, which stores information extracted from the user profile layer for rapid injection; The memory layer of the collaborative object stores an independent relationship card corresponding to each collaborative object. The relationship card contains the identification information and interaction rules of the collaborative object.

[0008] As a further aspect of the present invention: the collaborative object is an individual user, group, customer, project, or platform object; The information in the relationship card has a higher priority during retrieval than memory information stored at other levels that is not specific to the collaborating object.

[0009] As a further aspect of the present invention: the preset priority is configured as follows: The current facts and immediate user instructions have the highest priority; The stable rules in the user profile layer have the second highest priority. The information corresponding to the current collaborative object in the memory layer of the collaborative object has intermediate priority; Among them, the specific rules in the current collaboration object relationship card take precedence over the global rules in the user profile layer that are not specific to the collaboration object; Historical information in the long-term memory layer has a lower priority; Context-based inferences from the model have the lowest priority.

[0010] As a further aspect of the present invention: classifying and writing candidate memory information into corresponding storage levels based on their properties, including: Determine whether the candidate memory information is a stable fact, whether it is only applicable to the current task, whether it belongs to a specific collaborating object, whether it contains sensitive information, whether it is an unconfirmed inference, or whether it conflicts with existing memories; Based on the judgment result, the candidate memory information is written into the user profile layer, the collaboration object memory layer, the long-term memory layer, or the tool experience memory layer.

[0011] As a further aspect of the present invention: the governance operation includes: View, add, correct, delete, merge, export, import, back up, or pause learning.

[0012] As a further aspect of the present invention, it also includes: Perform lifecycle review on stored memory information to identify repetitive, obsolete, or low-confidence memories; For memories that have been reviewed and confirmed to be subject to governance, a preview is generated and the user is asked to confirm before the governance action is performed.

[0013] As a further aspect of the present invention, it also includes: A local memory database is established as the read / write engine for the hierarchical memory storage structure. Before switching the primary write source of the memory data of the storage structure to the database, an access control is performed, which includes at least verifying the consistency of the data source and the integrity of the data structure. In addition, when recalling memory information, the recalled long-term memory information is accompanied by information such as source, time, confidence level, reason for hit, reason for skipping, and whether it has been adopted; it also includes recording the usage feedback of the recalled memory information, the usage feedback including whether it has been adopted, ignored, corrected, conflicts with the current task, or skipped due to expiration, low confidence, or object mismatch.

[0014] As a further aspect of the present invention: a shadow database is established as the read / write engine of the hierarchical memory storage structure, wherein the shadow database is used to carry the memory read model, audit events, relational fact rows, and recovery capabilities; The switching of memory data to the shadow database adopts a phased strategy. In the initial stage, JSON or user-readable profiles are used as the primary fact source. Low-risk audit events and low-risk relationship fact rows are first entered into the database for primary writing, while complete object relationship cards continue to retain editable and rollbackable sources.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention reduces context length, lowers model call costs, and improves task processing efficiency by using hierarchical storage and on-demand recall, eliminating the need for the system to inject the entire user profile or all historical dialogues in each round of tasks.

[0016] This invention, through recall planning, time stamping, source stamping, confidence level, skipping reasons, and conflict handling, enables the system to distinguish between current facts, historical evidence, user corrections, and model inferences, thereby reducing the probability of old memories misleading the current task.

[0017] This invention uses a collaborative object relationship card, which allows the system to save independent communication styles, taboos, common issues, and user error corrections for different people, groups, customers, and projects, thus avoiding the mixing of rules for different objects.

[0018] Users can view, correct, delete, merge, pause learning, back up, import, export, and compress memories, making the memory system no longer an invisible and uncontrollable black box.

[0019] The system records the source, time, usage status, error correction status, and governance status of memories, enabling users and diagnostic personnel to explain "why the system remembered this event," "why this memory was used," and "why a memory was skipped."

[0020] Through lifecycle review, confirmatory governance, and compressed archiving, the system can identify duplicate, obsolete, low-reliability, and compressed memories, and perform non-destructive governance while preserving the original evidence.

[0021] User profiles, collaboration relationships, long-term memory, tool experience, and audit information are preferentially stored locally. Sensitive information is not included in long-term profiles, diagnostic packages are anonymized, and platform data is only used as a source or action channel after user authorization.

[0022] By using a local memory database shadow library, relational fact rows, audit events, and access control, the system can gradually evolve its database write capabilities without disrupting the existing memory source, thus reducing migration risks. Attached Figure Description

[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of the overall architecture of the hierarchical memory system of the present invention.

[0025] Figure 2 This is a schematic diagram of the memory writing and hierarchical classification process of the present invention.

[0026] Figure 3 This is a schematic diagram of the memory recall plan generation process of the present invention.

[0027] Figure 4 This is a schematic diagram of the selective memory injection process of the present invention.

[0028] Figure 5 This is a schematic diagram of the user error correction and memory management process of the present invention.

[0029] Figure 6 This is a schematic diagram of the long-term memory compression and original evidence preservation process of the present invention.

[0030] Figure 7 This is a schematic diagram of the local memory database and access control process of the present invention. Detailed Implementation

[0031] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] The present invention will be further explained below with reference to specific embodiments.

[0033] This method aims to address issues in existing intelligent agent memory schemes such as context bloat, old memory contamination, object rule confusion, untraceable source, difficulty in user error correction, difficulty in managing long-term memory, easy leakage of sensitive information, and excessive platform binding.

[0034] Please see Figures 1-7 The present invention provides a hierarchical memory storage, retrieval, and management method for intelligent agents, comprising: (I) Establishment of a hierarchical memory storage structure like Figure 1 As shown, the present invention establishes a hierarchical memory storage structure on the user's machine, with different levels storing data of different properties.

[0035] This hierarchical structure includes at least: The current context layer stores the current dialogue, the current tool call results, the immediate inference state, and temporary information about the current task.

[0036] The short-term session layer stores the most recently displayed session, allowing the user to continue the context when they reopen the software.

[0037] The user profile layer stores a user's viewable and editable identity, long-term preferences, stable rules, and global work habits. The information stored in this layer belongs to the user's global attributes, such as the user's job role, commonly used output formats, and language style preferences.

[0038] The hot memory layer extracts a small amount of high-frequency, stable, and absolutely accurate information from user profiles for rapid injection into the current task. The information in the hot memory layer consists of core rules extracted from the user profile layer, such as high-frequency information like the user's name, job title, and company name, which are injected into the context of each task with extremely low latency and priority.

[0039] The collaborative object memory layer establishes relationship cards based on collaborative objects such as people, groups, customers, projects, and platform objects. These cards store object relationships, communication styles, common issues, boundary rules, user corrections, sources, and learning status. Each relationship card corresponds to a collaborative object, and information in the relationship card has higher priority during retrieval than non-collaboration-specific memory information stored in other layers. This layer achieves object isolation in memory, which is key to solving the "object confusion" problem in this invention.

[0040] The long-term memory layer stores historical tasks, long-term facts, user corrections, old dialogue slices, and searchable indexes. It stores historical task reports, long-term factual knowledge, refined summaries of old dialogues, and local lightweight semantic features for retrieval. The data in this layer is typically processed and filtered to some extent, and is not simply a collection of raw logs.

[0041] The local memory database layer establishes a local memory database or shadow database for synchronizing hot memory, collaborative object memory, long-term memory, recall auditing, relational fact execution, and governance status.

[0042] The tool experience memory layer saves successful or failed tool calls, available parameter shapes, reasons for failure, and retry suggestions. It records the agent's successful and failed experiences in calling various external tools, which helps the agent avoid repeated trial and error.

[0043] The task state memory layer stores task plans, task checkpoints, job queues, and recovery states, and is the foundation for achieving task persistence and fault recovery.

[0044] The message evidence caching layer stores the latest message evidence and pending events in the work communication scenario, ensuring that the agent does not ignore the latest messages due to memory delays.

[0045] The action ledger layer stores the reservation, completion, and anti-duplication records of external side effect actions to prevent repeated execution.

[0046] The diagnostic audit layer stores memory recall, lifecycle governance, database access control, task logs, and diagnostic summaries, providing an audit chain for system operation and maintenance and problem investigation.

[0047] Among them, user profiles, hot memory, collaborative object memory, long-term memory, and tool experience are used for agent context construction; task status, message evidence, and action ledger are used to ensure the timeliness, security, and anti-duplication of memory usage; and the diagnostic audit layer is used to interpret the source of memory and system status.

[0048] (II) Memory Writing and Hierarchical Classification Process like Figure 2 As shown, when the system generates new candidate memory information, it first determines the nature of the information and then decides on the writing level. Candidate memory sources include: information that the user explicitly requests the system to remember; user corrections of old memories; long-term preferences or communication rules set by the user; relationships, styles, taboos, or boundaries related to a collaborating partner; stable conclusions that can be reused after the task is completed; successful or unsuccessful experiences with tool calls; message evidence from work communication scenarios; and system diagnostics or memory management results.

[0049] The system evaluates candidate memory information based on the following criteria: whether it is a stable fact; whether it applies only to the current task; whether it belongs to a specific collaborating object; whether it belongs to the user's global profile; whether it belongs to long-term historical facts; whether it belongs to tool experience; whether it contains sensitive information; whether it is an unverified model inference; and whether it conflicts with existing memories. Based on the evaluation results, the system writes the information to the corresponding level. User global preferences are written to the user profile and hot memories; communication taboos for a specific customer are written to the collaborating object relationship card; conclusions from old tasks are written to the long-term memory index; tool failure parameters are written to the tool experience memory; CAPTCHAs, keys, and one-time task details are not entered into long-term memory.

[0050] (III) Establishment and Management of Collaboration Object Relationship Cards Establish collaboration object relationship cards for individuals, groups, customers, projects, or platform objects. Each relationship card should include at least: object identifier; object display name; platform reference or local object reference; relationship with the user; communication style; common issues; taboos or boundaries; user error correction records; source summary and source list; last update time; learning status, such as normal learning, paused learning, pending merging, pending governance.

[0051] When objects with the same name exist on multiple platforms, the system does not automatically merge them. Instead, it distinguishes them based on information such as platform reference, source type, object ID, organization ID, and recent context. Only after user confirmation will the system merge multiple objects into the same collaborative object relationship card. When a user corrects object relationships or communication rules, the system writes the correction information into the relationship card, giving it higher priority than old memories and model inference.

[0052] (iv) Generation of the memory recall plan like Figure 3 As shown, before the agent executes a task, the system generates a memory retrieval plan based on the current task. This retrieval plan is used to determine which memory levels the current task needs to access.

[0053] The inputs to the recall plan include: the current user request; the current task type; the current dialogue context; the current tool facts; the current collaborating partner; whether a history recall is explicitly requested; whether it involves local documents, work platforms, communication partners, or diagnostic recovery; and the user's recent error correction and memory governance status.

[0054] The outputs of the recall plan include: whether to inject hot memories; whether to read collaboration object relationship cards; whether to retrieve long-term memories; whether to read tool experience memories; whether to read task status or message evidence; recall keywords, objects, projects, task types, and time ranges; and the reasons for skipping certain memories.

[0055] For example, when the task is a simple question and answer, the system can read only the current context and a small amount of hot memory; when the task involves responses from a certain customer group, the system reads the customer group's relationship card and the latest message evidence; when the user explicitly asks "how was that project handled last time", the system retrieves long-term memory and marks the historical source.

[0056] (v) Execute memory recall according to priority. like Figure 4 As shown, the system performs memory retrieval according to the retrieval plan and processes information from different sources according to priority. The priority order includes: facts read by the current tool; explicit statements or corrections made by the user in this round; stable rules in hot memory; relationship cards of the current collaborating objects; among which, specific rules in the relationship cards of the current collaborating objects take precedence over global rules in the user profile layer that are not specific to the collaborating object; long-term memory retrieval results; and inferences based on the model's context.

[0057] When high-priority information conflicts with low-priority information, the system uses the high-priority information and records the reason for the conflict or skipping. Long-term memory retrieval uses a hybrid ranking of structured tags, keywords, and local lightweight semantic features. Search results include information such as source, time, confidence level, reason for hit, and whether the information was used. For archived or compressed raw long-term memory, the system prioritizes compressed summaries by default, but still retains the ability to trace the original evidence.

[0058] (vi) Constructing the task context and injecting the agent The system transforms the recall results into task context and injects them into the agent. The injection process includes: summarizing hot memories; injecting only fields related to the current object into the collaborative object relationship card; labeling long-term memories as historical evidence and not using them directly as current facts; injecting only successful or failed experiences related to the current tool call into the tool experience; separately indicating the priority of user error correction; providing reasons for skipping or adopting conflicting memories; and excluding sensitive information and information that should not enter the context. Through these methods, the system avoids injecting the entire user profile, all historical dialogues, or irrelevant object memories into the model context.

[0059] (vii) Recording and Memory Usage Feedback When a memory is used for the current task, the system records feedback on memory usage. Feedback status includes: adopted; ignored; corrected; conflicts with the current task; skipped due to expiration, low confidence, or object mismatch. If the user points out a memory error, the system will recall the feedback marked as "corrected" and update the corresponding collaboration object relationship card, user profile, or long-term memory governance flag.

[0060] (viii) Support users in correcting errors, forgetting, merging, and pausing learning. like Figure 5As shown, the system provides user-controllable memory management operations, including: adding or updating memories; correcting erroneous memories; deleting or forgetting specified memories; merging duplicate collaborative objects; pausing or resuming the learning of a specific object; pausing or resuming global automatic learning; viewing memory sources; and exporting, importing, or backing up local memories. User error correction, deletion, merging, and learning pause operations are written to the local audit log. The system prioritizes reading these audit results during subsequent recalls to prevent old memories from continuing to affect the current task.

[0061] (ix) Perform memory lifecycle review The system performs lifecycle reviews of memories periodically or upon user request. The reviews include: duplicate memories; obsolete memories; low-reliability memories; empty object relation cards; long-term memories that have been corrected but may still be recalled; inconsistencies between the shadow database and the JSON source; and long-term memory candidates requiring compression. By default, lifecycle reviews only generate reports and do not automatically delete, merge, or overwrite memories. If governance actions are required, the system first provides a preview, then requires user confirmation, and exports a backup before execution.

[0062] (x) Implement confirmatory governance and compress archives like Figure 6 As shown, for manageable or compressible memories, the system employs a confirmatory governance process. The governance process includes: generating a governance candidate report; displaying the memory entries to be processed and the processing method; obtaining user confirmation; exporting a backup before governance; writing non-destructive governance markers, such as pending review, de-weighting, or pending compression; and rebuilding or synchronizing the local memory database.

[0063] The long-term memory compression process includes: selecting compression candidates by object, project, task type, source, or semantic similarity; generating a compressed summary; exporting a backup before compression; marking the original long-term memory slices as archives; preserving the original evidence without directly deleting the original text; and using the compressed summary by default for subsequent retrieval, while supporting tracing back to the original source.

[0064] (xi) Establish a local memory database and write it into the access control system. like Figure 7 As shown, the system establishes a local memory database or shadow database to host the memory read model, audit events, relational fact rows, and recovery capabilities. Database writes employ a phased strategy: initially, JSON or user-readable profiles remain the primary fact source; low-risk audit events can be written to the primary database first; low-risk fact rows in collaborative object relationships can be written to the database fact table; complete object relationship cards retain editable and rollbackable sources; access control must be executed before switching to primary database write.

[0065] Access control measures include: whether the database exists; whether the table structure is complete; whether the JSON source and database mirror are consistent; whether relationship cards are missing, outdated, or conflicting; whether there are governance risks in long-term memory; and whether the current table is suitable for primary write access. The system avoids switching all memory to primary write access to the database at once, instead proceeding gradually through layers such as audit events, relationship fact rows, and object cards.

[0066] (xii) Maintain platform independence and local priority The memory method of this invention is decoupled from specific working platforms. Platforms such as DingTalk, Lark, and WeChat Work only provide object IDs, names, message evidence, and action channels; the memory layer uniformly stores user profiles, collaboration object relationships, long-term memory, tool experience, and governance status. Even if a user is not connected to any working platform, the system can still maintain the local user profile, collaboration object memory, long-term memory, and tool experience. After connecting to a platform, only the platform object source and message evidence are added, without changing the underlying structure of the memory system.

[0067] In summary, this method is applicable to systems such as personal office intelligent agents, work assistant intelligent agents, and cross-platform collaborative intelligent agents running on user's local machine or enterprise terminal environment. This method utilizes hierarchical storage, on-demand retrieval, source tracing, user error correction, lifecycle governance, and compressed archiving of information such as current context, user profile, hot memory, collaborative object memory, long-term memory, tool experience, task status, message evidence, action records, and diagnostic auditing. This enables the intelligent agent to stably remember user preferences, collaborative relationships, task rules, and historical facts during long-term use, while avoiding old memories contaminating the current task, avoiding confusion between different object memories, and preventing the leakage of sensitive information. Furthermore, it supports users in viewing, modifying, deleting, pausing learning, backing up, importing, exporting, and compressing local memories.

[0068] The objectives of this invention include: 1. Establish a local hierarchical memory system suitable for office intelligent agents, storing information of different natures at different levels.

[0069] 2. Generate a memory retrieval plan based on the current task type, collaborating partners, time range, source, confidence level, and user intent.

[0070] 3. Inject only the necessary memories into the current task to avoid the full history entering the model context.

[0071] 4. Solve the memory boundary problem between different people, groups, customers, and projects by using collaborative object relationship cards.

[0072] 5. Improve memory reliability through user actions such as error correction, deletion, merging, and pausing learning.

[0073] 6. Achieve auditable and governable memory through source tracing, lifecycle review, confirmatory governance, and compressed archiving.

[0074] 7. Protect user privacy through local storage, sensitive information exclusion, and diagnostic de-identification.

[0075] 8. Improve the stability of memory system evolution by using a shadow library of memory databases, gray-scale master writing of fact tables, and readiness gates.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A hierarchical memory storage, retrieval, and management method for intelligent agents, characterized in that, include: A hierarchical memory storage structure is established on the user's local machine. The hierarchical memory storage structure includes at least the current context layer, the user profile layer, the collaborative object memory layer, and the long-term memory layer. When candidate memory information is generated, it is classified according to its nature and written into the corresponding storage level. Before the agent executes a task, a memory recall plan is generated based on the current task information; According to the memory retrieval plan, memory information is retrieved from the hierarchical memory storage structure according to a preset priority, wherein current facts and user immediate instructions have a higher priority than historical memories. The recalled memory information is injected into the task context of the agent; In addition, in response to user commands, it performs governance operations on the stored memory information.

2. The method according to claim 1, characterized in that, The hierarchical memory storage structure also includes a hot memory layer, which stores information extracted from the user profile layer for rapid injection; The memory layer of the collaborative object stores an independent relationship card corresponding to each collaborative object. The relationship card contains the identification information and interaction rules of the collaborative object.

3. The method according to claim 2, characterized in that, The collaborating objects can be individual users, groups, customers, projects, or platform objects; The information in the relationship card has a higher priority during retrieval than memory information stored at other levels that is not specific to the collaborating object.

4. The method according to claim 1, characterized in that, The preset priority is configured as follows: The current facts and immediate user instructions have the highest priority; The stable rules in the user profile layer have the second highest priority. The information corresponding to the current collaborative object in the memory layer of the collaborative object has intermediate priority; Among them, the specific rules in the current collaboration object relationship card take precedence over the global rules in the user profile layer that are not specific to the collaboration object; Historical information in the long-term memory layer has a lower priority; Context-based inferences from the model have the lowest priority.

5. The method according to claim 1, characterized in that, Candidate memory information is categorized and written into the corresponding storage level based on its nature, including: Determine whether the candidate memory information is a stable fact, whether it is only applicable to the current task, whether it belongs to a specific collaborating object, whether it contains sensitive information, whether it is an unconfirmed inference, or whether it conflicts with existing memories; Based on the judgment result, the candidate memory information is written into the user profile layer, the collaboration object memory layer, the long-term memory layer, or the tool experience memory layer.

6. The method according to claim 1, characterized in that, The governance operations include: View, add, correct, delete, merge, export, import, back up, or pause learning.

7. The method according to claim 1, characterized in that, Also includes: Perform lifecycle review on stored memory information to identify repetitive, obsolete, or low-confidence memories; For memories that have been reviewed and confirmed to be subject to governance, a preview is generated and the user is asked to confirm before the governance action is performed.

8. The method according to claim 1, characterized in that, Also includes: A local memory database is established as the read / write engine for the hierarchical memory storage structure. Before switching the primary write source of the memory data of the storage structure to the database, an access control is performed, which includes at least verifying the consistency of the data source and the integrity of the data structure. In addition, when recalling memory information, the recalled long-term memory information is accompanied by information such as source, time, confidence level, reason for hit, reason for skipping, and whether it has been adopted; it also includes recording the usage feedback of the recalled memory information, the usage feedback including whether it has been adopted, ignored, corrected, conflicts with the current task, or skipped due to expiration, low confidence, or object mismatch.

9. The method according to claim 8, characterized in that, A shadow database is established as the read / write engine of the hierarchical memory storage structure. The shadow database is used to carry the memory read model, audit events, relational fact rows, and recovery capabilities. The switching of memory data to the shadow database adopts a phased strategy. In the initial stage, JSON or user-readable profiles are used as the primary fact source. Low-risk audit events and low-risk relationship fact rows are first entered into the database for primary writing, while complete object relationship cards continue to retain editable and rollbackable sources.