Intelligent agent workspace version management method and apparatus, electronic device, and storage medium

CN122925329APending Publication Date: 2026-10-16BEIJING ELECTRONIC DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611315566.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-16

AI Technical Summary

Benefits of technology

[0015] The above technical solution constructs a draft isolation directory, a snapshot storage directory, and a configuration file directory for the hierarchical directory structure of the workspace. Version pointers are stored in the configuration file directory, pointing to snapshot files of validated draft files, thus enabling modifications to the agent's workspace files. Because the version pointers can flexibly switch between different effective versions, modifications to the agent's workspace files are reversible, thereby reducing the risk of modifying the workspace.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925329A_ABST
    Figure CN122925329A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an agent workspace version management method and device, electronic equipment and storage medium, relates to the technical field of computers, and realizes the reversibility of modification of the files of the agent workspace, thereby reducing the modification risk of the workspace. The agent workspace version management method comprises: in response to listening to a modification request for a file in the workspace of an agent, intercepting the modification request, creating a first draft file for the modification request under a draft isolation directory, and redirecting the write operation of the agent to the first draft file to obtain a second draft file; in the case that the second draft file passes the verification, generating a first snapshot file of the second draft file, storing the first snapshot file in a snapshot storage directory; pointing a version pointer to the first snapshot file, so as to obtain the currently effective snapshot file by reading the version pointer when the agent executes a task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, and storage medium for managing the version of an agent's workspace. Background Technology

[0002] Currently, autonomous AI agents, as a core application form for large-scale model deployment, generally store basic data such as memory files, skill rules, behavioral constraints, and context configurations in a local workspace. The data within the workspace supports the agent's cross-session memory, autonomous task execution, and continuous iteration. Existing operations on core files in the workspace by the agent all employ an in-situ overwrite modification model; that is, when the agent initiates a add, modify, or update operation, it directly overwrites the currently effective source file, making the modification irreversible. Summary of the Invention

[0003] To address the shortcomings of related technologies, this disclosure provides a method, apparatus, electronic device, and storage medium for managing the version of an agent's workspace. Modifications to files in the agent's workspace are reversible, thereby reducing the risk of modifying the workspace.

[0004] To achieve the above objectives, in a first aspect, this disclosure provides a method for managing the version of an agent's workspace. The hierarchical directory of the workspace includes a draft isolation directory, a snapshot storage directory, and a configuration file directory. The configuration file directory is used to store version pointers and includes: In response to a detected modification request for a file in the agent's workspace, the modification request is intercepted, a first draft file is created for the modification request in the draft isolation directory, and the agent's write operation is redirected to the first draft file to obtain a second draft file; If the second draft file passes verification, a first snapshot file of the second draft file is generated and stored in the snapshot storage directory; The version pointer is set to point to the first snapshot file, so that the agent can obtain the currently effective snapshot file by reading the version pointer when performing a task.

[0005] In one possible implementation of the first aspect, the snapshot storage directory further includes a second snapshot file, which is a snapshot file of a historically effective third draft file; The step of pointing the version pointer to the first snapshot file includes: The version pointer is changed from the second snapshot file to the first snapshot file.

[0006] In a possible implementation of the first aspect, the method further includes: If the agent obtains the currently active snapshot file by reading the version pointer, and a preset exception condition is met, the version pointer will be changed from the first snapshot file to the second snapshot file.

[0007] In a possible implementation of the first aspect, the first snapshot file for generating the second draft file includes: The unique identifier of the first snapshot file is determined based on at least the current timestamp, and a first snapshot file of the second draft file is generated. The unique identifier is used for the version pointer to point to the latest generated snapshot file in the snapshot storage directory.

[0008] In a possible implementation of the first aspect, the method further includes: The second draft file is validated in multiple dimensions using a large language model. These multiple dimensions include at least one of the following: MD file format standardization validation, content validity validation, duplicate and redundant content validation, behavioral rule logic consistency validation, and violation content validation.

[0009] In one possible implementation of the first aspect, the files in the workspace are the basic files of the agent during the session task processing, and the basic files include memory files, skill configurations, and behavior rules.

[0010] In a possible implementation of the first aspect, the method further includes: The intelligent agent records the purpose of the change and establishes a binding relationship between the purpose of the change and the second draft file. A read-only query interface is provided, which the agent can call to request the change purpose information in order to determine the purpose and reason for changing to the first snapshot file.

[0011] Secondly, this disclosure provides a smart agent workspace version management device, wherein the hierarchical directory of the workspace includes a draft isolation directory, a snapshot storage directory, and a configuration file directory, wherein the configuration file directory is used to store version pointers, and the device includes: The interception module is configured to intercept the modification request in response to a request to modify a file in the agent's workspace, create a first draft file for the modification request in the draft isolation directory, and redirect the agent's write operation to the first draft file to obtain a second draft file. The snapshot generation module is configured to generate a first snapshot file of the second draft file if the second draft file passes the verification, and store the first snapshot file in the snapshot storage directory; The pointer configuration module is configured to point the version pointer to the first snapshot file, so that when the agent performs a task, it can obtain the currently effective snapshot file in the snapshot storage directory by reading the version pointer.

[0012] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect.

[0013] Fourthly, this disclosure provides an electronic device, comprising: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the method described in the first aspect.

[0014] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0015] The above technical solution constructs a draft isolation directory, a snapshot storage directory, and a configuration file directory for the hierarchical directory structure of the workspace. Version pointers are stored in the configuration file directory, pointing to snapshot files of validated draft files, thus enabling modifications to the agent's workspace files. Because the version pointers can flexibly switch between different effective versions, modifications to the agent's workspace files are reversible, thereby reducing the risk of modifying the workspace.

[0016] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0017] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating an agent workspace version management method according to an exemplary embodiment of this disclosure.

[0018] Figure 2 This is a flowchart illustrating another intelligent agent workspace version management method according to an exemplary embodiment of this disclosure.

[0019] Figure 3 This is a flowchart illustrating yet another intelligent agent workspace version management method according to an exemplary embodiment of this disclosure.

[0020] Figure 4 This is a block diagram of an agent workspace version management device according to an exemplary embodiment of the present disclosure.

[0021] Figure 5 This is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0022] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0023] It is understood that the terms "first," "second," etc., used in this disclosure are used to describe various types of information, but such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another and do not indicate a particular order or degree of importance.

[0024] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0025] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.

[0026] With the rapid development of large language model technology, autonomous AI agents, as its core application form, are being widely used in scenarios such as automated customer service, personal assistants, code generation, and complex task planning. These agents differ from traditional chatbots in that they possess long-term memory, autonomous decision-making, and tool-calling capabilities, enabling them to continuously iterate and evolve in multi-turn conversations and even cross-conversation tasks. To achieve these capabilities, agents generally rely on a local workspace to persistently store their core data. The files within the workspace, as referred to in this disclosure, specifically refer to the basic files supporting the agent's operation, typically existing in plain text format, making them easy to read, edit, and manage. However, in existing technologies, agents generally use an "in-place overwrite modification" approach to operate on these files, leading to problems such as data loss, execution interruption, and difficulty in rollback.

[0027] Figure 1 This is a flowchart illustrating an agent workspace version management method according to an exemplary embodiment of this disclosure, such as... Figure 1 As shown, the agent workspace version management method may include steps S11 to S13.

[0028] This method pre-constructs a three-tiered directory structure for the agent's workspace, including a draft isolation directory, a snapshot storage directory, and a configuration file directory. This hierarchical workspace directory structure isolates the three states: "Under Modification," "Historically Effective," and "Currently Effective."

[0029] Step S11: In response to the detected modification request for a file in the agent's workspace, the modification request is intercepted, a first draft file is created for the modification request in the draft isolation directory, and the agent's write operation is redirected to the first draft file to obtain a second draft file.

[0030] The files in the workspace can be understood as the basic files of the agent in the process of handling conversational tasks, including memory files, skill configurations, and behavioral rules. These three types of files together constitute the agent's cognitive, capability, and behavioral framework, the specific meaning of which will be further explained below.

[0031] As an example, not a limitation, a memory file can be understood as the background knowledge that an agent must follow when handling conversational tasks. This can include settings assigned to the agent by the user during the conversation, as well as user-related settings such as language habits. Skill configuration can be understood as the external capabilities or tools that the agent can access during conversational tasks. For example, skill configuration can include API call specifications and local tool execution instructions. Skill configuration provides the agent with the ability to interact with external systems, allowing it to move beyond internal knowledge reasoning. Behavioral rules can be understood as the constraints and decision-making logic that the agent must follow during conversational tasks, defining "how" and "what not" the agent should do. For example, behavioral rules can include: "Always use a polite and respectful tone when replying," and "When a user asks a subjective question, multiple viewpoints must be provided and sources cited," etc.

[0032] Before step S11, a draft isolation directory, a snapshot storage directory, and a configuration file directory are pre-built. The draft isolation directory stores the content to be modified by the agent; the snapshot storage directory stores snapshot files, which are copies of the agent's currently or historically effective configuration files; the configuration file directory stores version pointer files and change log files; the version pointer file is an index file that records the identifier of the currently effective snapshot file, and the change log file records each version change event. By building a hierarchical workspace directory, modifications to the workspace are isolated from the currently effective files in the workspace, reducing the risk of modifications caused by directly overwriting files in the original workspace.

[0033] A request interception module can be deployed at the entry point of the agent's API to intercept all modification requests and redirect the write operation corresponding to the modification request to the first draft file. This request interception module can be a hook function; when the agent attempts to modify a file in the working area, the hook function intercepts the modification request, preventing direct modification of the file in the working area.

[0034] The first draft file can be a blank draft file. Each time a modification request is intercepted, a blank draft file is created, and the write operation is redirected to the first draft file. This process continues until the modified content is filled into the blank draft file, at which point the blank draft file becomes the second draft file.

[0035] For example, based on the file type information carried in the modification request, a blank draft file with a unique filename can be created in the draft isolation directory as the first draft file. The filename of the first draft file includes a timestamp to ensure that multiple modification operations do not interfere with each other. The unique filename of the blank draft file can be created by combining file type information with a timestamp. It should be noted that even if the modification request involves modifying files in the workspace with multiple file types, this operation will only use a unified timestamp to ensure that multiple snapshot files generated in the same version update are consistent and correlated.

[0036] The implementation of step S11 can be divided into two stages: request interception and write redirection. In the request interception stage, this can be achieved by deploying an interception module at the file access interface layer of the agent program. In the write redirection sub-stage, the interception module redirects the intercepted request information to the draft isolation directory, ensuring that any erroneous operations by the agent are confined to the draft file and do not actually take effect.

[0037] By intercepting modification requests and redirecting them to draft files, physical isolation is achieved between modification operations on the agent's workspace and the effective files. This ensures that before the draft files are verified, any modification operations will not affect the effective configuration currently used by the agent, thereby avoiding operational failures caused by the agent mistakenly modifying the workspace files.

[0038] Step S12: If the second draft file passes the verification, generate the first snapshot file of the second draft file and store the first snapshot file in the snapshot storage directory.

[0039] The validation of the second draft file can be based on a preset rule engine. For example, regular expressions can be used to check for formatting issues such as heading levels and list syntax in Markdown; string matching or vector similarity calculations can be used to detect redundant content that is highly repeated with historical snapshots; or a predefined sensitive word library can be used to filter out illegal content.

[0040] Considering the complexity and semantic nature of the content generated by the intelligent agent, multi-dimensional and in-depth semantic verification can also be performed based on a Large Language Model (LLM). For example, the content of the second draft file is input into the LLM, which verifies the second draft file according to preset prompts, obtaining the verification result. If the verification result indicates that the verification passed, it means that the write operation corresponding to this modification request can be executed; otherwise, it means that the write operation corresponding to this modification request cannot be executed, and therefore the second draft file can be deleted, and no snapshot file will be generated for it. When no new snapshot file is generated, the file in the currently active workspace is the previously generated snapshot file.

[0041] Each generated snapshot file is stored in the snapshot storage directory for easy management. The version pointer points to a snapshot file in the snapshot storage directory, indicating which snapshot file is currently in effect. Once generated, snapshot files are automatically set to read-only permissions, preventing any subsequent operations from modifying, overwriting, or deleting them, thus ensuring the complete state of a single round of changes is permanently preserved.

[0042] Step S13: Set the version pointer to the first snapshot file, so that the agent can obtain the currently effective snapshot file by reading the version pointer when performing tasks.

[0043] After the first snapshot file is successfully stored in the snapshot storage directory, the version pointer file in the configuration file directory is read, and the version pointer stored inside the version pointer file is updated with the unique identifier of the first snapshot file, so that the version pointer points to the first snapshot file.

[0044] In some embodiments, the update operation is preferably performed atomically. For example, the new pointer data is first written to a temporary file, and then the temporary file is replaced with the official version pointer file using an atomic renaming operation provided by the operating system. Atomic writing ensures that at any time (such as during a power outage or process crash), the version pointer file only points to the old snapshot or the new snapshot, and will not point to a non-existent file or be in a corrupted state.

[0045] When the agent executes a task, its file reading module first accesses the version pointer file in the configuration file directory, parses it to obtain the identifier of the currently effective snapshot file, and then loads the contents of that snapshot file from the snapshot storage directory. Once the version pointer is updated to point to the first snapshot file, the agent's next read operation will automatically load the new content of the first snapshot file without restarting the agent process or reloading the workspace, thus achieving a smooth effect of the changes.

[0046] Using the technical solutions provided in steps S11 to S13 above, a draft isolation directory, a snapshot storage directory, and a configuration file directory are constructed for the hierarchical directory of the workspace. A version pointer is stored in the configuration file directory. Modification requests initiated by the agent are intercepted, and write operations are redirected to the first draft file in the draft isolation directory. After successful verification, a snapshot file is generated from the draft file, and the version pointer is set to point to the snapshot file of the verified draft file, thus enabling modification of the agent's workspace files. Because the version pointer can flexibly switch between different effective versions, the modification of files in the agent's workspace is reversible, thereby reducing the risk of modifying the workspace.

[0047] In a further embodiment, the snapshot storage directory also includes a second snapshot file, which is a snapshot file of a previously effective third draft file. That is, prior to this modification operation, the agent's workspace already contained an effective historical version, namely the second snapshot file, and the version pointer currently points to this second snapshot file.

[0048] Based on this, pointing the version pointer to the first snapshot file includes pointing the version pointer from the second snapshot file to the first snapshot file.

[0049] Specifically, pointing the version pointer from the second snapshot file to the first snapshot file involves modifying the value of the version pointer in the version pointer file to the snapshot identifier of the first snapshot file. This allows the agent to read only the snapshot content pointed to by the version pointer when performing subsequent tasks. By using a lightweight version pointer to mark the effective state, the modification operation and the effective state are completely decoupled, so that each modification operation can still be recorded.

[0050] In a further embodiment, the execution status of the agent is monitored in real time, and pre-set abnormal conditions. These pre-set abnormal conditions include continuous tool call failures, file format parsing errors, abnormal agent logic execution, and content violation alerts. By monitoring the agent's execution status in real time and pre-setting abnormal conditions, if these conditions are met, it indicates that the introduced version modification has encountered an anomaly, thus allowing for automatic version rollback without manual intervention.

[0051] In this embodiment, consecutive tool call failures can occur when the number of consecutive failures when the agent calls external APIs or local tools reaches a preset threshold (e.g., 3 times), indicating that there may be errors in the skill configuration in the new version. File format parsing errors indicate that the snapshot file may have formatting issues. Agent logic execution anomalies, such as loop timeouts, indicate that there may be logical conflicts in the behavior rules of the new version. Content violation warnings indicate that the agent's output contains violation information.

[0052] In this embodiment, after the rollback is completed, the abnormal snapshot (i.e., the first snapshot file) is marked as invalid, the cause of the abnormality is synchronously recorded to the change log file, and the self-healing of the agent's workspace is completed.

[0053] In some embodiments, generating a first snapshot file for a second draft file includes: determining a unique identifier for a first snapshot file based at least on the current timestamp, and generating a first snapshot file for a second draft file, wherein the unique identifier is used for the version pointer to point to the latest generated snapshot file in the snapshot storage directory.

[0054] Specifically, a snapshot can be generated for draft files based on a timestamp and a unified naming convention for file types to ensure unique naming. The file type indicates which type of base file the modification request targets. Therefore, file types can include memory files, skill configurations, and behavior rules.

[0055] As an example, the unique identifier may also include agent ID or session ID, which can be used to establish a correspondence with agents or multi-session scenarios.

[0056] In this embodiment, the timestamp is used as a component of the unique identifier of the snapshot file, so that the unique identifier naturally increases with time, making it easier to select the latest version of the snapshot file based on the timestamp.

[0057] In some embodiments, after step S11, the method further includes, for example, Figure 2 Step S21 shown: Perform multi-dimensional verification of the second draft file using a large language model.

[0058] Multi-dimensional verification includes at least one of the following: MD file format standardization verification, content validity verification, duplicate and redundant content verification, behavioral rule logic consistency verification, and violation content verification.

[0059] For example, Markdown file format conformance checking includes checking for Markdown syntax errors, heading levels, code block closures, etc. Regular expressions or Markdown parsers can be used for validation.

[0060] Content validity verification includes identifying and removing meaningless, contradictory, or factually incorrect content generated by large model illusions.

[0061] Redundant content verification can be performed by calculating text similarity (such as cosine similarity) and comparing the draft content with the content in the currently effective snapshot. If the similarity exceeds the threshold, it is determined to be a highly repetitive or redundant modification.

[0062] Behavioral rule logic consistency verification: Ensure that new rules do not conflict with existing rules and maintain consistency in the agent's behavioral logic.

[0063] Content violation verification includes filtering sensitive words and unsafe commands.

[0064] In a further embodiment, if any verification item fails, it indicates that the write operation corresponding to the second draft file is non-compliant. Therefore, the verification process is terminated and the second draft file is cleared, while the version pointer remains unchanged, and a structured verification failure report is generated. This report includes, for example, the failed verification dimensions, the specific location of the problem, and a description. This structured verification failure report is then fed back to the agent or user interface that initiated the modification. Only when the second draft file passes verification is the next step, snapshot generation, allowed.

[0065] This embodiment reduces the risk of execution anomalies caused by modifications to files in the workspace of the intelligent agent by setting up a pre-emptive verification process to exclude format errors, invalid content, and content violations before they take effect.

[0066] In a further embodiment, after step S11, the method further includes, as follows: Figure 3 Steps S31 and S32 are shown.

[0067] Step S31: Record the change purpose information through the intelligent agent, and establish the binding relationship between the change purpose information and the second draft file.

[0068] Step S32: Provide a read-only query interface, which allows the agent to request change purpose information by calling the read-only query interface, so as to determine the purpose and reason for changing to the first snapshot file.

[0069] Specifically, after redirecting the agent's write operation to the first draft file, the agent is also controlled to fill in the metadata information of this modification, which includes, but is not limited to, the purpose and reason for the change.

[0070] For example, the purpose of the change could be "fixing the context truncation issue" or "adding weather query capability." The reason for the change could be "the original memory file length exceeds the model context window limit" or "users request the addition of weather forecast functionality." The purpose of the change can be bound to the second draft file by creating a metadata file in the same directory as the second draft file.

[0071] In another optional embodiment, the change metadata can also be directly written to the header comment area of ​​the second draft file. After the second draft file passes verification and the first snapshot file is generated, the change metadata is persisted together with the first snapshot file, which improves the understandability of version management.

[0072] In this embodiment, the intelligent agent can request information from the interface by calling a read-only query interface. The returned information includes a list of historical snapshots, change purpose information for each snapshot file, and the current tagging status of each snapshot file. The historical snapshot list can be sorted in descending order of time, the change purpose information can be obtained from the metadata information mentioned above, and the current tagging status describes whether the current snapshot file is effective.

[0073] In some embodiments, the access permissions of the read-only query interface follow the principle of least privilege, meaning that an agent can only query the change history of its own workspace and cannot access it across agents.

[0074] As an example, the configuration file directory includes a version pointer file and a change log file. The version pointer file is a lightweight index file that internally stores a pointer to the version of the currently active snapshot file. The change log file is a structured file used to append detailed information about each version change event, including the change time, operation identifier, change purpose, effective snapshot ID, and whether it was rolled back due to an exception.

[0075] In summary, the agent workspace version management method provided in this application provides an isolated architecture that completely decouples modification operations from the effective state. Specifically, through the layered design of the draft area and the snapshot area, the complete separation of agent modification operations from the formal effective state is achieved, providing the agent with a safe space for autonomous trial and error and realizing controllable autonomous iterative optimization.

[0076] This method innovatively introduces read-only, immutable snapshots into the management of the agent's local workspace, so that every valid change is permanently retained as an unalterable snapshot file, thereby solving the problems of irreversible modifications and loss of context.

[0077] Meanwhile, by introducing a lightweight version pointer to mark the effective status of snapshot files, the complex version switching and exception rollback operations are simplified into an atomic update of a single index file. This allows for rollback to be completed simply by switching the version pointer in case of an exception, resulting in high version management efficiency.

[0078] Based on the same inventive concept, this disclosure also provides a smart agent workspace version management device. The hierarchical directory of the workspace includes a draft isolation directory, a snapshot storage directory, and a configuration file directory. The configuration file directory is used to store version pointers, such as... Figure 4 As shown, the intelligent agent workspace version management device may include: The interception module 41 is configured to intercept the modification request in response to the listening request for modifying a file in the agent's workspace, create a first draft file for the modification request in the draft isolation directory, and redirect the agent's write operation to the first draft file to obtain a second draft file; The snapshot generation module 42 is configured to generate a first snapshot file of the second draft file and store the first snapshot file in the snapshot storage directory if the second draft file passes the verification. The pointer configuration module 43 is configured to point the version pointer to the first snapshot file, so that when the agent performs a task, it can obtain the currently effective snapshot file in the snapshot storage directory by reading the version pointer.

[0079] In one feasible embodiment, the snapshot storage directory further includes a second snapshot file, which is a snapshot file of a previously effective third draft file; The pointer configuration module 43 is further configured to point the version pointer from the second snapshot file to the first snapshot file.

[0080] In one feasible embodiment, the pointer configuration module 43 is further configured to, when the agent obtains the currently effective snapshot file by reading the version pointer, if a preset exception condition is met, point the version pointer from the first snapshot file to the second snapshot file.

[0081] In one feasible embodiment, the snapshot generation module 42 is further configured to determine the unique identifier of the first snapshot file based at least on the current timestamp, and generate the first snapshot file of the second draft file, wherein the unique identifier is used for the version pointer to point to the latest generated snapshot file in the snapshot storage directory.

[0082] In one feasible embodiment, the snapshot generation module 42 is further configured to perform multi-dimensional verification on the second draft file through a large language model. The multi-dimensional verification includes at least one of MD file format standardization verification, content validity verification, duplicate and redundant content verification, behavior rule logic consistency verification, and violation content verification.

[0083] In one feasible embodiment, the device further includes a query interface module that provides a historical query service. The query interface module is configured to record change purpose information through an intelligent agent and establish a binding relationship between the change purpose information and the second draft file. It also provides a read-only query interface for the intelligent agent to request change purpose information by calling the read-only query interface in order to determine the purpose and reason for changing to the first snapshot file.

[0084] Regarding the intelligent agent workspace version management device in the above embodiments, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0085] Based on the same inventive concept, this disclosure also provides an electronic device, comprising: A memory on which computer programs are stored; The processor is used to execute computer programs in memory to implement the aforementioned agent workspace version management method.

[0086] Figure 5 This is a block diagram illustrating an electronic device 500 according to an exemplary embodiment. For example... Figure 5 As shown, the electronic device 500 is a server, and the electronic device may include: a processor 501, a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output (I / O) interface 504, and a communication component 505.

[0087] The processor 501 controls the overall operation of the electronic device 500 to complete all or part of the steps in the aforementioned intelligent agent workspace version management method. The memory 502 stores various types of data to support the operation of the electronic device 500. This data may include, for example, instructions for any application or method operating on the electronic device 500, and application-related data. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 503 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 502 or transmitted via communication component 505. The audio component also includes at least one speaker for outputting audio signals. I / O interface 504 provides an interface between processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of these. Therefore, the corresponding communication component 505 may include a Wi-Fi module, a Bluetooth module, or an NFC module.

[0088] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-described intelligent agent workspace version management method.

[0089] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the agent workspace version management method described above. For example, the computer-readable storage medium may be the memory 502 including program instructions described above, which may be executed by the processor 501 of the electronic device 500 to complete the agent workspace version management method described above.

[0090] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the above-described agent workspace version management method.

[0091] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0092] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0093] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method for managing the version of an agent's workspace, characterized in that, The hierarchical directory of the workspace includes a draft isolation directory, a snapshot storage directory, and a configuration file directory. The configuration file directory is used to store version pointers. The method includes: In response to a detected modification request for a file in the agent's workspace, the modification request is intercepted, a first draft file is created for the modification request in the draft isolation directory, and the agent's write operation is redirected to the first draft file to obtain a second draft file; If the second draft file passes verification, a first snapshot file of the second draft file is generated and stored in the snapshot storage directory; The version pointer is set to point to the first snapshot file, so that the agent can obtain the currently effective snapshot file by reading the version pointer when performing a task.

2. The method for managing the version of an agent's workspace according to claim 1, characterized in that, The snapshot storage directory also includes a second snapshot file, which is a snapshot file of a historically effective third draft file; The step of pointing the version pointer to the first snapshot file includes: The version pointer is changed from the second snapshot file to the first snapshot file.

3. The method for managing the version of an agent's workspace according to claim 2, characterized in that, The method further includes: If the agent obtains the currently active snapshot file by reading the version pointer, and a preset exception condition is met, the version pointer will be changed from the first snapshot file to the second snapshot file.

4. The method for managing the version of an agent's workspace according to claim 1, characterized in that, The first snapshot file used to generate the second draft file includes: The unique identifier of the first snapshot file is determined based on at least the current timestamp, and a first snapshot file of the second draft file is generated. The unique identifier is used for the version pointer to point to the latest generated snapshot file in the snapshot storage directory.

5. The method for managing the version of an agent's workspace according to claim 1, characterized in that, The method further includes: The second draft file is validated in multiple dimensions using a large language model. These multiple dimensions include at least one of the following: MD file format standardization validation, content validity validation, duplicate and redundant content validation, behavioral rule logic consistency validation, and violation content validation.

6. The method for managing the version of an agent's workspace according to claim 1, characterized in that, The files in the workspace are the basic files for the agent during the session task processing. The basic files include memory files, skill configurations, and behavior rules.

7. The method for managing the version of an agent's workspace according to claim 1, characterized in that, The method further includes: The intelligent agent records the purpose of the change and establishes a binding relationship between the purpose of the change and the second draft file. A read-only query interface is provided, which the agent can call to request the change purpose information in order to determine the purpose and reason for changing to the first snapshot file.

8. A smart agent workspace version management device, characterized in that, The hierarchical directory of the workspace includes a draft isolation directory, a snapshot storage directory, and a configuration file directory, wherein the configuration file directory is used to store version pointers. The device includes: The interception module is configured to intercept the modification request in response to a request to modify a file in the agent's workspace, create a first draft file for the modification request in the draft isolation directory, and redirect the agent's write operation to the first draft file to obtain a second draft file. The snapshot generation module is configured to generate a first snapshot file of the second draft file if the second draft file passes the verification, and store the first snapshot file in the snapshot storage directory; The pointer configuration module is configured to point the version pointer to the first snapshot file, so that when the agent performs a task, it can obtain the currently effective snapshot file in the snapshot storage directory by reading the version pointer.

9. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.