A hierarchical context management method

By generating local contexts associated with the global context and performing initialization and selective synchronization, the problem of distinguishing the scope of the main flow interaction content from that of the local interaction content is solved, enabling the isolated storage and controlled reuse of local interaction content, and maintaining the stability and flexibility of the interaction.

CN122431805APending Publication Date: 2026-07-21刘泽楷
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
刘泽楷
Filing Date
2026-05-24
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, it is difficult to effectively distinguish and manage the context scope of main process interaction content and local interaction content. This makes it easy for local interaction content to be continuously written to or directly merged into the main process context, affecting the stability and continuity of interaction. Furthermore, it is difficult for users to control the scope and form of local interaction content entering the global context.

Method used

A hierarchical context management method is provided, which generates local contexts associated with the global context and configures them through initialization data. Local interactive content is not merged into the global context by default. Users can issue synchronization control commands for selective synchronization processing, thereby achieving isolated storage and controlled reuse of local interactive content.

Benefits of technology

It achieves clear scope hierarchical management of local interactive content and global context, reduces the impact of temporary or unconfirmed content on the main process context, maintains interaction stability, and supports controlled reuse and flexible synchronization of local content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431805A_ABST
    Figure CN122431805A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer interaction, context management and conversation data management, and discloses a layered context management method. After receiving a local context creation instruction sent by a user, the method generates a local context associated with a global context, and initializes the local context based on configured initialization data; the method receives and saves local interaction content in the local context, so that the local interaction content is saved separately from the global context and is not incorporated into the global context by default; after receiving a synchronization control instruction sent by the user for the local context, the method performs selective synchronization processing on to-be-synchronized content associated with the local context, and the selective synchronization processing includes synchronizing the to-be-synchronized content to the global context or configuring the to-be-synchronized content to be accessible or referable to other local contexts. The method can support isolated saving, selective synchronization and controlled reuse of local interaction content in a continuous interaction process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer interaction, context management, and session data management, and in particular to a hierarchical context management method. Background Technology

[0002] In computer interaction, session data management, and continuous task processing scenarios, systems typically need to form context based on user input, system output, task status information, interim conclusions, and other interactive data to support the continuous advancement of subsequent interactions. For example, in interactive environments such as sessions, interaction instances, project discussions, long-chain tasks, or main workspace discussions, previous interactions often serve as references for subsequent interactions, enabling the system to maintain task status, preserve interaction connections, and continue the main discussion flow.

[0003] However, during extended interactions, users do not always progress linearly around the same main theme. Users frequently need to conduct ad-hoc analyses, compare solutions, perform partial verification, supplement background information, draft content, or engage in exploratory discussions regarding specific issues within the main flow. These localized interactions may only be relevant to the current local issue or are not suitable to directly impact the main flow context before user confirmation. If the system continuously writes or directly merges these localized interactions into the main flow context, it can easily lead to a continuous expansion of the main flow context, mixing ad-hoc, exploratory, or unconfirmed content into the main flow interaction data, thereby affecting the stability and continuity of subsequent interactions.

[0004] Some existing interactive systems offer users different interaction paths through methods such as session branching, generating new branches after editing historical messages, copying session content, or creating new sessions. While these methods can support the development of different discussion paths to some extent, they typically focus more on forming another session path or session version, lacking an independent scope management mechanism for local interactive content. Especially when users want to synchronize only some conclusions, fragments, or references from a local discussion back to the main flow context, or want to make them available for use in other local discussions, the ordinary session branching method struggles to provide structured selective synchronization, access control, or reference configuration capabilities.

[0005] In addition, various processing methods exist in some automated or intelligent interactive systems to reduce context length or maintain historical interaction information. For example, historical interaction content can be reduced, filtered, compressed, or reorganized through external storage, window truncation, sliding window retention, full or phased summarization, relevant content retrieval, on-demand projection during retrieval, and historical weight adjustment based on time decay. Historical information available for subsequent interactions can also be maintained through mechanisms such as long-term memory, short-term memory, or session memory banks. These methods typically focus on the system side filtering, extracting, compressing, recalling, or projecting historical content based on preset rules, model results, or relevance judgments. However, for users, it remains difficult to clearly control whether a particular part of the interaction content should enter the main flow context, the scope of its entry, the form it should take, and whether it is only accessible or referenced by other specific local contexts.

[0006] Therefore, in long-chain interactions, project discussions, main workspace discussions, or other interactive environments that require continuous maintenance of the main process context, there is still a need for a technical solution that can perform hierarchical management between the global context used to carry the main process interaction content and the local context used to carry the local interaction content, so as to form a clearer processing mechanism between the isolated storage of local interaction content, the stable maintenance of the main process context, and the controlled reuse of local content. Summary of the Invention

[0007] The present invention aims to at least solve the problem in the prior art that it is difficult to effectively distinguish and hierarchically manage the context scope corresponding to the main process interaction content and the local interaction content.

[0008] Specifically, the present invention aims to solve at least the following problems: First, in long-chain interactions, project discussions, main workspace discussions, or other continuous interaction scenarios, when faced with users' needs for local discussions during the main process of interaction, existing methods such as session branches, copying historical content, or creating new sessions can support the development of different discussion paths to a certain extent. However, these methods usually focus more on forming different session paths or session versions, making it difficult to effectively distinguish the context scope corresponding to the main process interaction content and the local interaction content in the same interaction environment. This makes it easy for local interaction content to be continuously written or directly merged into the main process context, resulting in the expansion of the main process context and causing temporary, exploratory, or unconfirmed content to have an unnecessary impact on subsequent main process interactions.

[0009] Second, existing methods such as automatic summarization, context compression, historical content retrieval, or memory maintenance typically involve the system filtering, extracting, compressing, recalling, or projecting historical content based on preset rules, model results, or relevance judgments. This makes it difficult for users to clearly control whether local interactive content enters the global context, the scope and expression of content entering the global context, and whether it is open to access or reference by other local contexts.

[0010] Therefore, a technical solution is still needed to manage the global context used to carry the main process interaction content and the local context used to carry the local interaction content in a hierarchical manner, so as to alleviate the problem that the local interaction content lacks independent scope, default isolation and controlled reuse mechanism.

[0011] To address the aforementioned technical problems, this invention provides a hierarchical context management method, the method comprising: Receive local context creation instructions from the user; In response to the local context creation instruction, a local context associated with the global context is generated; The local context is initialized based on the configured initialization data; Local interaction content is received and saved in the local context, wherein the local interaction content is saved separately from the global context, and the local interaction content is not merged into the global context by default; In response to a user's synchronization control command for the local context, selective synchronization processing is performed on the content to be synchronized associated with the local context; wherein, the selective synchronization processing includes at least one of the following: synchronizing the content to be synchronized to the global context; or, configuring the content to be synchronized as content accessible or referenced by other local contexts.

[0012] In some implementations, the global context is a set of context data or a context data structure used to carry the main process interaction content in the interaction environment. The interaction environment corresponds to at least one of a session, interaction instance, project discussion, long-chain task, main workspace discussion, or agent interaction scenario. The main process interaction content includes at least one of user input content, system output content, task status information, stage conclusion information, decision information, context reference information, or other interaction data used to continuously advance the main process. The local context is a context scope associated with and distinct from the global context, used to carry local interaction content formed independently of the main process interaction content.

[0013] In some implementations, the initialization data includes at least one of the following: at least a portion of the global context, guided input content for the local context, other context data specified by the user, at least a portion of other existing contexts, or reference information for other existing contexts.

[0014] In some implementations, initializing the local context includes: determining context content or context reference information for initializing the local context from the global context according to the context inheritance scope specified by the user; or, if the context inheritance scope specified by the user is not received, determining the context content or context reference information for initializing the local context based on a preset inheritance rule.

[0015] In some implementations, the content to be synchronized includes at least one of the following in the local context: original text fragments, summary content, conclusion items, decision items, prompt word fragments, contextual reference information, contextual index information, or custom synchronization content; wherein, the custom synchronization content is formed based on at least one of user-supplemented content and the local context content.

[0016] In some implementations, the synchronization control instruction carries at least one of the following: a content identifier to be synchronized, a synchronization target identifier, a synchronization processing method, an accessible range, or a referenceable range; the selective synchronization processing includes: determining the content to be synchronized and its corresponding synchronization target according to the synchronization control instruction, and synchronizing the content to be synchronized to the global context according to the synchronization target, or configuring it as content accessible or referenceable by other local contexts.

[0017] In some implementations, the content to be synchronized is configured to be accessible or referenced by other local contexts, including establishing access or reference relationships between the content to be synchronized and the other local contexts, or configuring reference identifiers or access permission information for the content to be synchronized to the other local contexts, so that the other local contexts can access or reference the content to be synchronized during initialization or subsequent interaction.

[0018] Compared with the prior art, the present invention has at least the following beneficial effects: By generating local contexts that are associated with and distinct from the global context, a relatively independent local context scope can be formed outside the global context used to carry the main process interaction content, thereby facilitating the carrying of local interaction content such as temporary analysis, local verification, scheme comparison, content drafting, or exploratory discussion.

[0019] By saving local interactive content separately from the global context, and by making local interactive content not merged into the global context by default, the automatic impact of temporary, exploratory, or unconfirmed content on the main flow context can be reduced. This helps to slow down the expansion of the main flow context and maintain the relative stability of the main flow interactive content.

[0020] By initializing local contexts with configuration-based initialization data, local contexts can engage in local interactions with the necessary prerequisite or guiding information, while avoiding the need for local contexts to inherit the entire global context, thereby improving the configuration flexibility of local context scope.

[0021] By responding to user synchronization control commands for local contexts, selective synchronization processing is performed on the content to be synchronized associated with the local context. This allows users to control whether local interaction results or associated content enter the global context, in what form they enter the global context, or whether they are made available to other local contexts for access or reference.

[0022] By synchronizing the content to be synchronized to the global context, or configuring it as content accessible or referenceable by other local contexts, it is possible to achieve controlled reuse of local interaction results or related content while keeping local interaction content isolated and saved, thus avoiding the local context existing only as an isolated interaction path.

[0023] The above technical solutions establish a clear scope hierarchy, default isolation, and selective synchronization mechanism between the global and local contexts, which is beneficial for adapting to the context management needs in long-chain tasks, project discussions, main workspace discussions, or other continuous interaction scenarios. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0025] Figure 1 A flowchart illustrating a hierarchical context management method provided in an embodiment of the present invention;

[0026] Figure 2 A schematic diagram illustrating the relationship between global and local context scopes provided in an embodiment of the present invention;

[0027] Figure 3 This is a schematic diagram illustrating the determination of the source and inheritance scope of local context initialization data provided in an embodiment of the present invention;

[0028] Figure 4 This is a schematic diagram illustrating a selective synchronization processing and access or reference configuration provided in an embodiment of the present invention. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort can all fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this invention are only used to distinguish similar objects and are not necessarily used to limit a specific order or sequence. It should be understood that the data, steps, or objects defined by these terms can be interchanged without violating logical relationships. The terms "comprising," "having," and their variations used in this specification are intended to cover non-exclusive inclusion, such as a method, apparatus, system, or device that includes a series of steps or units, and are not necessarily limited to the explicitly listed steps or units, but may also include other steps or units not explicitly listed.

[0031] It should also be noted that, unless otherwise specified, the various embodiments of the present invention and the technical features thereof can be combined with each other. The descriptions of a particular implementation method, data structure, interaction scenario, or processing flow in the following embodiments are only used to illustrate optional implementations of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0032] The hierarchical context management method provided in this invention can be executed by a terminal device, server, cloud system, interactive platform, session management system, context management system, or a combination of the above devices, systems, or platforms. Accordingly, the device, system, or platform used to execute the method may include a processor, memory, communication interface, and program modules, service modules, or data management modules for implementing context management logic. This invention does not limit the specific hardware and software deployment method, nor does it limit its operation to a particular type of application, model service, or interactive platform.

[0033] In this embodiment of the invention, the interactive environment can correspond to at least one of a session, interactive instance, project discussion, long-chain task, main workspace discussion, or agent interaction scenario. The interactive environment can maintain a global context for carrying the main flow of interactive content, and can generate local contexts that are associated with but distinct from the global context according to user instructions. The global context can be understood as a set of context data or a context data structure maintained by the system; the local context can be understood as a context scope that is associated with and distinct from the global context. The specific data carrying format of the global and local contexts can be configured according to the application scenario, storage method, and interactive system architecture.

[0034] In some implementations, global context, local context, local interactive content, content to be synchronized, access relationships, or reference relationships can be implemented using at least one of the following methods: context identifier, parent context identifier, context type field, content record, message record, index information, reference identifier, permission field, relationship table, linked list structure, tree structure, graph structure, or structured document. The above implementations are merely examples, and this invention does not require the use of a specific database, specific message format, or specific storage medium.

[0035] In some implementations, the global context can be used to carry the main process interaction content, which may include at least one of the following: user input, system output, task status information, interim conclusion information, decision information, contextual reference information, or other interaction data used to continuously advance the main process. The local context can be used to carry local interaction content that is independent of the main process interaction content, such as temporary analysis content, local verification content, scheme comparison content, background supplementary content, content drafting content, or exploratory discussion content.

[0036] In some implementations, the global context may correspond to a project-level context within a project workspace or project shared context, and the local context may correspond to a question-level context generated around a specific discussion task. In this case, the local context creation instruction may correspond to a user's operation of creating a specific discussion task or creating a local discussion task, the initialization data may correspond to the initial data used to initialize the question-level context, and the synchronization control instruction may correspond to a user's scope adjustment operation, content synchronization operation, or a machine-recognizable instruction formed by the above operations for the question-level context.

[0037] In this embodiment of the invention, the "association" between a local context and a global context can refer to the existence of a relationship between them that can be recognized by the system. For example, a local context may record a corresponding global context identifier, parent context identifier, initialization source identifier, local context identifier, reference relationship, access relationship, or other associated fields. This association indicates that the local context is generated based on a specific global context or has a management relationship with a specific global context, but it does not mean that the local interaction content in the local context will be automatically written to, merged, or promoted to the global context.

[0038] In this embodiment of the invention, local interactive content and the global context are stored separately, and local interactive content is not merged into the global context by default. "Not merged by default" can be understood as follows: before receiving user synchronization control instructions, scope adjustment instructions, or other explicit instructions to open, access, reference, or synchronize, the local interactive content in the local context is not automatically written to, merged, promoted, or synchronized to the global context, nor is it configured by default as content accessible or referenceable by other local contexts; however, the local interactive content can still be stored, accessed, and used within its own local context. Therefore, not merging by default does not mean that the local context content is deleted, nor does it mean that the local context content cannot be used subsequently, but rather that its default scope of application differs from the global context.

[0039] In this embodiment of the invention, a user can issue a synchronization control command for a local context. After the system responds to the synchronization control command, it can perform selective synchronization processing on the content to be synchronized associated with that local context. Selective synchronization processing may include synchronizing the content to be synchronized to the global context, or configuring the content to be synchronized as accessible or referable by other local contexts. The above two types of processing results can be executed individually or in combination if permitted by the synchronization control command.

[0040] In some implementations, the content to be synchronized may include at least one of the following: original text fragments, summary content, conclusion items, decision items, prompt word fragments, contextual citation information, contextual index information, or custom synchronization content within the local context. The content to be synchronized may originate from local interactive content within the local context, or it may be formed based on at least one of user-supplemented content and local contextual content. The system can determine the content to be synchronized and its corresponding synchronization target using information such as content identifier, citation identifier, index information, user selection range, synchronization target identifier, synchronization processing method, accessible range, or referential range.

[0041] In some implementations, configuring the content to be synchronized as accessible or referenceable by other local contexts can be achieved by establishing access or reference relationships between the content to be synchronized and the other local contexts, or by configuring reference identifiers or access permission information for the content to be synchronized to the other local contexts. Other local contexts can access or reference the content to be synchronized during initialization, or they can access or reference the content to be synchronized during subsequent interactions based on the corresponding access relationships, reference relationships, or permission information. This configuration does not mean that all content in a local context is automatically made available to all other local contexts, nor does it mean that the content of a local context is automatically merged into the global context.

[0042] In some implementations, to determine the initialization data or scope of a local context, the system can process information based on user-specified context inheritance scope, preset inheritance rules, guided input content, other context data, or content or reference information already existing in the local context. This processing can be determined based on the local discussion topic carried or associated with the local context creation instruction, the initialization data source identifier, the context inheritance scope, or local configuration instructions.

[0043] The following is combined with Figures 1 to 4 The hierarchical context management method provided in the embodiments of the present invention will be further described. Example 1

[0044] This embodiment provides a hierarchical context management method. This method can be applied to interactive environments where a global context already exists or has been configured. The global context can be used to carry the main process interaction content, such as user input, system output, task status information, interim conclusion information, decision information, contextual reference information, or other interactive data used to continuously advance the main process. During the main process interaction, users can create local contexts that are related to but distinct from the global context, targeting specific local issues, conducting temporary analyses, comparing solutions, drafting content, supplementing background information, or engaging in exploratory discussions.

[0045] like Figure 1 As shown, the hierarchical context management method provided in this embodiment may include the following steps.

[0046] S101, Receive local context creation instruction.

[0047] Specifically, the system can receive local context creation instructions issued by the user. These instructions can be issued by the user within the interactive environment, targeting the current main flow interaction content, a specific historical interaction content, a specific historical interaction position, a specific task stage, or a user-specified range. The local context creation instructions instruct the system to create a local context based on the current global context, in order to carry local interactive content that is independent of the main flow interaction content.

[0048] In some implementations, the local context creation instruction may carry or be associated with the local context name, local discussion topic, guided input content, context inheritance scope, initialization rule identifier, associated global context identifier, parent context identifier, local context identifier to be created, or other information used to create the local context. The above information does not need to be present simultaneously; the system can determine the required information based on the specific interaction scenario and user operation method.

[0049] S102, Generate a local context associated with the global context.

[0050] Specifically, in response to the local context creation instruction, the system generates a local context associated with the global context. The local context is used to carry local interactive content that is formed independently of the main flow interaction content. The local context and the global context can be associated through a global context identifier, a parent context identifier, a local context identifier, an initialization source identifier, a content record identifier, a reference relationship, or other related fields.

[0051] Combination Figure 2 As shown, both the global context and the local context reside in the same interactive environment. The global context is used to carry the main flow interaction content, while the local context can include one or more local contexts such as local context A and local context B. Figure 2 The term "associated" in this context indicates that there is a system-recognizable management relationship, source relationship, or reference relationship between the local context and the global context. However, this association does not mean that the local interactive content in the local context is automatically written into or merged into the global context.

[0052] In other words, a local context is not an isolated session completely detached from the global context, nor is it an alternative session path that replaces the main flow in the general sense; a local context is a context scope generated on the basis of the global context and distinct from the global context, used to carry local interactive content formed during local discussions, local verification, or exploratory processing.

[0053] S103, initialize the local context based on the initialization data.

[0054] Specifically, the system can initialize the local context based on configured initialization data, so that the local context has an initial contextual basis for carrying out local interactions after its creation. The initialization data may include at least a portion of the content in the global context, guiding input content for the local context, other context data specified by the user, at least a portion of the content in other existing contexts, or reference information of other existing contexts.

[0055] In some implementations, the system can determine the context content or context reference information used to initialize the local context from the global context, based on the context inheritance scope specified by the user. For example, the user can specify that a certain stage conclusion in the current main process discussion, a certain problem description, a certain historical interaction segment, or content before a certain historical interaction position is used as the initialization data.

[0056] In other implementations, if the system does not receive a user-specified context inheritance scope, it can determine the context content or context reference information used to initialize the local context based on preset inheritance rules. For example, the system can determine the initialization data based on the current interaction position, the current task stage, the content of the most recent rounds of main process interactions, the local discussion topic associated with the local context creation instruction, the content record or initialization data source identifier, or pre-configured inheritance scope rules.

[0057] It's important to note that initializing a local context does not mean that the local context must copy the entire global context, nor does it mean that the local context inherently inherits all historical interactions from the global context. A local context can be initialized based on only a portion of the global context, the initial input, context references, or other configuration data.

[0058] S104, receive and save local interaction content in the local context.

[0059] Specifically, after the local context is generated and initialized, the system can receive and save local interactive content within the local context. This local interactive content may include content input by the user in the local context, content output by the system in the local context, local analysis processes, local conclusions, local decisions, local reference information, local drafts, or other interactive data formed independently of the main flow interactive content.

[0060] Local interactive content is stored separately from the global context, and local interactive content is not merged into the global context by default. Specifically, without receiving user synchronization control instructions, scope adjustment instructions, or other explicit instructions to open, access, reference, or synchronize, local interactive content in the local context is not automatically written to, merged, promoted, or synchronized to the global context, nor is it configured by default to be accessible or referenceable by other local contexts; however, local interactive content can still be stored, accessed, and used within the scope of that local context itself.

[0061] Combination Figure 2 As shown, although there is a relationship between the local context and the global context, the local interactive content in the local context is not merged into the global context by default. Figure 2 The blocking flag and "default not merged" are used to indicate this default isolation relationship. This approach ensures that temporary, exploratory, or unconfirmed content carried by the local context will not directly enter the main flow interaction content without user confirmation or specification, thus maintaining the relative stability of the global context.

[0062] S105 responds to the synchronization control command and performs selective synchronization processing on the content to be synchronized.

[0063] Specifically, the system can receive synchronization control instructions from the user regarding the local context, and in response to these instructions, perform selective synchronization processing on the content to be synchronized associated with the local context. The content to be synchronized may include at least one of the following from the local context: original text fragments, summary content, conclusion items, decision items, prompt word fragments, contextual reference information, contextual index information, or custom synchronization content.

[0064] In some implementations, the content to be synchronized can be content already saved in the local context, or content formed during the synchronization process based on at least one of the local context content and content supplemented by the user for the local context. This content can be associated with the local context through source relationships, reference relationships, identifier associations, user-specified associations, or synchronization operation associations, thereby serving as the content to be synchronized associated with the local context.

[0065] Combination Figure 4 As shown, the synchronization control command issued by the user can provide local context A with information about the content to be synchronized or the object to be synchronized. In response to the synchronization control command, the system can determine or form the content to be synchronized based on the content in local context A and the information carried or associated with the synchronization control command, and determine the corresponding synchronization target and synchronization processing method according to the synchronization control command.

[0066] In some implementations, selective synchronization may include synchronizing the content to be synchronized to the global context. In this case, the system may write or record the user-specified or confirmed content to be synchronized in the global context, or establish a reference or index relationship pointing to the content to be synchronized in the global context, making the content to be synchronized become context content or context reference information that can be used in subsequent main process interactions.

[0067] In other implementations, selective synchronization may include configuring the content to be synchronized as accessible or referenceable by other local contexts. In this case, the content to be synchronized may not be directly incorporated into the global context, but rather configured as accessible or referenceable by local context B, local context C, or other local contexts. In this way, portions of content formed in a local context can be controlled and reused by other local contexts without directly entering the global context.

[0068] In some other implementations, the system may also perform the above processes in combination, provided that the synchronization control instructions allow, for example, synchronizing the content to be synchronized to the global context while configuring it as content accessible or referenced by one or more other local contexts.

[0069] In this embodiment, selective synchronization processing is performed in response to user synchronization control commands for the local context, rather than automatic full synchronization of the local context content, nor is it the system automatically writing local interactive content into the global context without receiving explicit user commands. Therefore, while local interactive content is stored in isolation by default, users can select certain local content to enter the global context, or make it accessible or referenced by other local contexts, as needed.

[0070] The method provided in this embodiment allows the system to generate a local context outside the global context to carry local interactive content. This local interactive content is saved separately from the global context by default, and selective synchronization is performed on the content to be synchronized when the user issues a synchronization control command. Therefore, while the main process interaction continues, a relatively independent context scope can be provided for local analysis, temporary verification, scheme comparison, or exploratory discussions. It also supports the synchronization of local content to the global context under user control or its controlled reuse by other local contexts. Example 2

[0071] This embodiment, based on Embodiment 1, further illustrates the data object relationships and scope relationships between global and local contexts. The hierarchical context management method described in this embodiment can be applied to at least one interactive environment in scenarios such as sessions, interaction instances, project discussions, long-chain tasks, main workspace discussions, or agent interaction. It should be understood that the above-described interactive environments are only used to illustrate the applicable scenarios of this invention and do not imply that this invention must rely on a specific type of agent system, session system, or workspace system.

[0072] like Figure 2 As shown, the interactive environment can include a global context and one or more local contexts. The global context can be used to carry the main flow of interactive content, while the local context can be used to carry local interactive content that is independent of the main flow of interactive content. Figure 2 The local contexts A and B shown are merely illustrative of local context instances and are not intended to limit the number, name, hierarchy, or specific creation method of local contexts.

[0073] In some implementations, the global context can be a collection of context data or a context data structure maintained by the system. The global context may correspond to the main flow content in a specific session thread, interaction instance, project discussion, long-chain task, main workspace discussion, or agent interaction scenario. The main flow interaction content carried in the global context may include at least one of the following: user input, system output, task status information, phased conclusion information, decision information, context reference information, or other interaction data used to continuously advance the main flow.

[0074] Specifically, user input can include text, instructions, questions, requirement descriptions, or scope-limiting information entered by the user during the main process interaction; system output can include response content, processing results, prompts, or phased feedback returned by the system during the main process interaction; task status information can include the current stage of the task, completed items, pending items, process status, or interaction progress information; phased conclusion information and decision information can include conclusions, solutions, rules, selection results, or confirmation results formed during the main process interaction and confirmed by the user or recorded by the system; contextual reference information can include reference identifiers, index identifiers, or associated fields used to point to other contextual content, historical interaction segments, external data objects, or local contextual content.

[0075] In some implementations, a local context can serve as a context scope that is associated with but distinct from the global context, used to carry local interactive content that is formed independently of the main flow of interactions. For example, during the main flow of interactions, users can create local contexts for specific local issues, ad-hoc analyses, solution comparisons, background supplements, content drafting, dispute verification, or exploratory discussions. After obtaining the necessary initialization data, this local context can carry input content, output content, intermediate analyses, local conclusions, local drafts, local reference information, or other local interactive data related to that local issue.

[0076] In this embodiment, the "association" between a local context and a global context can refer to a system-recognizable relationship between them. This association can be achieved through global context identifiers, parent context identifiers, local context identifiers, initialization source identifiers, content record identifiers, reference identifiers, access relationships, source relationships, user-specified associations, or other association fields. Through these associations, the system can determine the global context, initialization source, creation location, or management scope corresponding to a given local context.

[0077] Meanwhile, local contexts are distinguished from global contexts. This distinction can be reflected in at least one of the following: context scope, content storage range, default access range, synchronization processing rules, or subsequent reuse methods. Specifically, the global context is used to carry the main flow interaction content and serves as the context basis for subsequent main flow interactions; the local context is used to carry local interaction content, which, by default, is not automatically written to, merged, promoted, or synchronized to the global context, nor is it configured by default to be accessible or referenceable by other local contexts.

[0078] Combination Figure 2 As shown, although there is an "association" between the global context and the local context, this association is not the same as an automatic content merging relationship. Figure 2 The text uses dashed lines, blocking markers, and the "not merged by default" label to indicate that local interactions within a local context are not merged into the global context by default. This default isolation distinguishes the main workflow interactions carried by the global context from the local interactions carried by the local context. This ensures that local analysis, local verification, solution comparison, or exploratory discussions do not directly affect the main workflow interactions in the global context unless explicitly synchronized to the global context by the user or configured to be accessible or referenced by other local contexts.

[0079] In some implementations, global contexts and local contexts can correspond to different sets of context records, different context fields, different scope identifiers, or different access control relationships. For example, the system can set a global context identifier for the global context and a local context identifier for each local context; the local context record can contain its associated global context identifier or parent context identifier to indicate its management relationship with the global context. The system can also distinguish between main process interaction content and local interaction content through a context type field, and maintain the content and access relationships within different context scopes through a content record table, index table, reference relationship table, or permission field.

[0080] In other implementations, global and local contexts can also be organized using structured documents, message chains, tree structures, graph structures, relational structures, or hierarchical structures. Regardless of the specific data carrier format, the system can distinguish the scope of global and local contexts through context identifiers, type fields, index information, or associations, and perform corresponding processing on the content to be synchronized in the local context according to synchronization control instructions or other explicit open, access, reference, or synchronization instructions.

[0081] It should be noted that the local context in this embodiment differs from a simple new session or a regular session branch. Regular session branches typically focus more on forming another session path or session version. In some session branching implementations, although different branches fork in the interaction path, they may still belong to the same session instance and share session instance-level public state or other session-level context information. In this case, new terms, constraints, temporary requirements, or exploratory content generated in one branch may affect other branches under the same session instance through the aforementioned public information, making it difficult to establish stable content scope isolation between different branches.

[0082] In contrast, the local context in this embodiment is not merely a fork in the session path or session version, but a context scope that is associated with and distinct from the global context. Local interactive content within a local context is not automatically merged into the global context by default, nor is it configured by default to be accessible or referenced by other local contexts. Only upon receiving a synchronization control command or other explicit open, access, reference, or synchronization command will the system perform corresponding processing on the content to be synchronized associated with that local context.

[0083] It should also be noted that the hierarchical context management method in this embodiment does not preclude the existence of a session branching mechanism. In some implementations, users can create session branches within the main flow interaction corresponding to the global context, or within a local interaction process corresponding to a local context. Session branches can be used to form different interaction paths or versions, while the local context provides a context scope that is associated with and distinct from the global context. Both can coexist; the creation of a session branch does not necessarily change the rules of separately storing local and global contexts, not merging them by default, and selectively synchronizing them.

[0084] It should also be noted that the global context and local context in this embodiment should not be understood as a fixed hierarchical relationship between long-term memory and short-term memory. The main difference between the global context and the local context lies in the interaction scope and content management rules, rather than the length of time the content is saved, the size of the storage capacity, or the internal memory hierarchy of the model. The local context can be continuously saved and used for a certain period of time, and the global context can also be updated, maintained, or referenced according to the configuration of the interaction environment; the core difference between the two is whether it carries the main flow interaction content, and whether the local interaction content enters the main flow context by default.

[0085] Through the data object and scope settings described in this embodiment, the system can distinguish between the global context used to carry the main flow interaction content and the local context used to carry the local interaction content within the same interactive environment. This allows the local context to maintain a recognizable association with the global context while also maintaining a distinct content scope from the global context by default. This provides a foundation for subsequent local context initialization, local interaction content saving, selective synchronization, and cross-local context access or referencing configurations. Example 3

[0086] This embodiment, based on Embodiments 1 and 2, further illustrates the source of initialization data for the local context and the method for determining the initialization scope. Through this embodiment, after creating a local context, the system can configure an initial context foundation suitable for local interactions, while avoiding the requirement for the local context to inherit the entire global context. This allows the local context to conduct local discussions within the necessary information range.

[0087] like Figure 3 As shown, in some implementations, the initialization data for a local context can be determined from a plurality of candidate sources. The candidate sources may include at least a portion of the global context, guided input content for the local context, other context data specified by the user, at least a portion of other existing contexts, or reference information to other existing contexts. Figure 3The various candidate sources shown are only for illustrating the optional data sources that can be used for initialization data, and do not imply that all sources must be used at the same time every time a local context is created.

[0088] In some implementations, at least a portion of the global context may include user input, system output, task status information, interim conclusion information, decision information, context reference information, or at least one of other interactive data used to continuously advance the main process. For example, when a user creates a local context for a certain interim conclusion during the main process interaction, the system can use that interim conclusion and its related problem description as candidate initialization data, without having to copy all historical interaction content from the global context to that local context.

[0089] In some implementations, the guided input content for the local context may include local discussion topics, problem descriptions, analysis objectives, constraints, expected output formats, or other information entered by the user when creating the local context to guide the development of local interactions. This guided input content can be used alone to initialize the local context, or it can be used in combination with parts of the global context, other context data, or context reference information.

[0090] In some implementations, the additional context data specified by the user may include historical interaction fragments specified by the user when creating the local context, external context descriptions, existing interim materials, previously compiled conclusions, user-supplemented background information, or other data that can serve as initial content for the local context. At least a portion of the content of the other existing contexts may include partial local interaction content from other local contexts, context content from other interaction instances, or other context data associated with the current interaction environment. The reference information of the other existing contexts may include reference identifiers, index identifiers, content record identifiers, context identifiers, or other reference information recognizable by the system that points to other context content.

[0091] It should be noted that initialization data can be specific context content or context reference information. When initializing using context reference information, the system can record the corresponding reference identifier, index information, or association information indicating its initialization source in the local context. This allows the local context to access or reference the corresponding content when needed, without having to copy all referenced content when creating the local context. This reduces the amount of data copying during local context initialization while maintaining the association between the referenced content and the source context.

[0092] It should be noted that the initialization data source is used to limit the data types or sources that can be used for local context initialization; the initialization scope determination is used to determine the context content or context reference information actually used to initialize the local context within the corresponding data source. Taking the global context as an example, at least part of the content of the global context indicates that the global context can be used as an initialization data source, while the user-specified context inheritance scope or preset inheritance rules are used to further determine which content or reference information in the global context is used to initialize the local context.

[0093] like Figure 3 As shown, after determining the candidate source or candidate initialization data, the system can further determine the initialization scope of the local context. In some implementations, the system can determine the context content or context reference information used to initialize the local context from the global context based on the context inheritance scope specified by the user. The context inheritance scope can be determined by the user by selecting historical interaction segments, selecting content records, specifying time ranges, specifying round ranges, specifying interim conclusions, specifying topic ranges, or specifying reference objects, etc.

[0094] For example, in project discussions or long-chain tasks, users can specify to inherit only the main process interaction content from several rounds prior to the current stage, or they can specify to inherit the conclusion of a certain stage and its corresponding problem description. After receiving the context inheritance scope, the system can determine the corresponding context content or context reference information from the global context based on this scope and use it for local context initialization.

[0095] In other implementations, if the system does not receive a user-specified context inheritance scope, it can determine the context content or context reference information used to initialize the local context based on preset inheritance rules. These preset inheritance rules may include determining the initialization scope based on the current interaction position, based on the content of the most recent main process interactions, based on the current task stage, based on the local discussion topic associated with the local context creation instruction, content records, or initialization data source identifiers, or based on preset content type filtering rules.

[0096] For example, the system can use the main process interaction content from several rounds prior to the local context creation command as initialization data. Alternatively, it can select corresponding stage conclusions, task status information, or context reference information as initialization data based on the topic information, content type identifiers, or reference relationships carried or associated in the local context creation command. The system can also combine specific context content and context reference information to initialize the local context according to preset rules.

[0097] It should be noted that determining the initialization scope based on preset inheritance rules does not mean that the system must perform semantic compression, automatic summarization, or long-term memory extraction on historical content. Preset inheritance rules can be context scope determination rules based on interaction position, interaction round, content record relationship, content type, user configuration, or system configuration. Their purpose is to determine the context content or context reference information required for local context initialization.

[0098] In this embodiment, initializing the local context does not change the default isolation relationship between the local and global contexts. That is, even if the local context is initialized based on a portion of the global context's content or context reference information, subsequent local interactions within the local context are still stored separately from the global context and are not merged into the global context by default. Only upon receiving a user synchronization control command or other explicit open, access, reference, or synchronization command will the system perform appropriate selective synchronization processing on the content to be synchronized associated with that local context.

[0099] Through this embodiment, the system can flexibly determine the initialization data and scope of the local context under different interaction requirements. On the one hand, the local context can obtain the pre-interaction or guiding information required to carry out local interactions; on the other hand, the local context does not need to inherit the entire global context, which is beneficial for controlling the content scope of the local context and maintaining the distinction between the scope of the global context and the local context. Example 4

[0100] This embodiment, based on embodiments one through three, further explains the type of content to be synchronized, the method of forming custom synchronized content, and the information carried or associated with the synchronization control command. This embodiment mainly combines... Figure 4 This document provides an explanation and focuses on supporting the implementation methods for the content to be synchronized and the synchronization control commands.

[0101] like Figure 4 As shown, in some implementations, a user can issue a synchronization control command for a local context A. The synchronization control command can be used to instruct the system to perform selective synchronization processing on content to be synchronized associated with local context A. The content to be synchronized can be content already saved in the local context, or content formed during the synchronization process based on at least one of the local context content and content supplemented by the user for that local context.

[0102] In some implementations, the content to be synchronized may include at least one of the following in the local context: original text fragments, summary content, conclusion items, decision items, prompt word fragments, contextual reference information, contextual index information, or custom synchronization content. The above-described types of content to be synchronized are only used to illustrate content forms that can be selectively synchronized and do not imply that every synchronization control command must involve all types simultaneously.

[0103] The original text fragments may include fragments of user input, system output, local analysis, local drafts, or other local interactions already saved in the local context. The summary content may include content formed by summarizing the local context content. The conclusion items may include interim conclusions formed during local discussions, problem-solving results, or inductive content available for subsequent interactions. The decision items may include the user's confirmed choice of solution, rule, processing path, or other decision results in the local context. The prompt word fragments may include instruction fragments, task description fragments, constraint fragments, or output format requirement fragments formed in the local context and available for subsequent interactions. The context reference information and context index information may include reference identifiers, index identifiers, content record identifiers, context identifiers, or other location information recognizable by the system for pointing to local context content, other context content, or related interaction records.

[0104] In some implementations, the synchronization control commands can be formed by user operations such as adjusting the scope of a local context, synchronizing content, selecting a synchronization target, setting an accessible scope, or setting a referable scope. The system can convert these user operations into machine-recognizable synchronization control commands to determine the content to be synchronized, the synchronization target, or the accessible scope.

[0105] In some implementations, the custom synchronization content can be formed based on at least one of user-supplemented content and the local context content. The user-supplemented content may include supplementary notes, revisions, confirmations, tag information, synchronization comments, external resource references, supplementary task items, items to be adjusted, or other information used to form the content to be synchronized, entered by the user during the synchronization process. The local context content may include local input content, local output content, local interaction records, local reference information, local intermediate conclusions, local drafts, or other local interaction data within the local context.

[0106] In some implementations, custom synchronization content can be formed by user-added information specific to the local context. For example, when issuing a synchronization control command, the user can enter supplementary information about the local context, or enter a supplementary task item for reference by other local contexts. The system can then use this user-added content as custom synchronization content and associate it with the corresponding local context.

[0107] In other implementations, custom synchronization content can be formed from local context content. For example, a user can specify in the synchronization control command to organize several original text fragments in the local context. The system can then form conclusion items, summary content, prompt word fragments, or context index information based on the original text fragments, and use the formed content as the content to be synchronized.

[0108] In other implementations, custom synchronization content can also be formed by a combination of user-supplemented content and local context content. For example, during synchronization, a user can specify several discussion fragments within a local context and supplement them with details regarding the scope of conclusions, expressions, or citations to be retained. The system can then generate corresponding custom synchronization content based on these local discussion fragments and user-supplemented content.

[0109] It should be noted that the custom synchronized content should have an association with the corresponding local context that can be determined by the system based on identifiers, fields, reference information, synchronization operation records, or other related information. This association may include source relationships, reference relationships, identifier associations, user-specified associations, synchronization operation associations, or other information that can indicate the relationship between the custom synchronized content and the local context. Therefore, custom synchronized content formed based on user-supplemented content does not mean that any unrelated external content can be synchronized independently of the local context, but rather that the content has established an association with a specific local context during the synchronization control or content confirmation process.

[0110] like Figure 4 As shown, synchronization control instructions can provide local context A with information about the content to be synchronized or the object to be synchronized. Here, "providing information about the content to be synchronized / synchronization object" can be understood as: synchronization control instructions can carry or associate information used to determine the content to be synchronized, the synchronization target, the synchronization processing method, the accessible scope, or the referential scope. Figure 4 The annotation in the text is only used to illustrate the definite relationship between the synchronization control command, local context A, and the content to be synchronized, and does not limit the synchronization control command to provide the above information in a specific data format.

[0111] In some implementations, the synchronization control command may carry at least one of the following: a content identifier to be synchronized, a synchronization target identifier, a synchronization processing method, an accessible range, or a referential range.

[0112] The identifier for the content to be synchronized may include a content number, segment identifier, content record identifier, index identifier, citation identifier, user selection range identifier, or other information used to identify the content to be synchronized. Through this identifier, the system can determine the original text segment, conclusion item, decision item, prompt word segment, citation information, index information, or custom content that the user wishes to selectively synchronize.

[0113] The synchronization target identifier can be used to indicate the processing target of the content to be synchronized. For example, the synchronization target identifier can indicate synchronizing the content to be synchronized to the global context, or it can indicate configuring the content to be synchronized as accessible or referenceable by one or more other local contexts, or it can indicate multiple targets simultaneously if the synchronization control command allows.

[0114] The synchronization processing method can be used to instruct the system what processing to perform on the content to be synchronized. For example, the synchronization processing method may include directly synchronizing specified content, synchronizing citation information, synchronizing index information, synchronizing after organization, synchronizing after summarization, synchronizing after extracting conclusion items, synchronizing after forming prompt word fragments, or synchronizing after forming custom synchronization content according to a user-specified format. The above processing methods are used to assist in determining or forming the content to be synchronized and do not imply that the system automatically writes local interactive content into the global context or exposes it to other local contexts without receiving synchronization control instructions.

[0115] The accessible scope can be used to indicate which other local contexts can access the content to be synchronized. The referential scope can be used to indicate which other local contexts can reference the content to be synchronized. The specific configuration methods for the accessible scope and the referential scope can include specifying a local context identifier, specifying a context type, specifying a task scope, specifying a user-selected scope, or specifying other scope information that can be recognized by the system.

[0116] In some implementations, the system can respond to a synchronization control command, determine or form content to be synchronized based on the content in local context A and the information carried or associated with the synchronization control command, and determine the synchronization target corresponding to the content to be synchronized. Specifically, the system can first determine the original text fragments, conclusion items, decision items, citation information, or index information already saved in local context A based on the identifier of the content to be synchronized, the user selection range, or the information associated with the synchronization control command; alternatively, when indicated by the synchronization control command or permitted by preset synchronization processing rules, the system can extract, organize, summarize, format, or index the content in local context A according to the synchronization processing method to form the content to be synchronized; or it can form custom synchronization content based on user-supplemented content and local context content.

[0117] In some implementations, the system can determine the synchronization target of the content to be synchronized based on a synchronization target identifier. When the synchronization target identifier points to a global context, the system can treat the content to be synchronized as content to be synchronized to the global context. When the synchronization target identifier points to other local contexts, the system can treat the content to be synchronized as content to be configured to be accessible or referenced by other local contexts. When the synchronization target identifier points to both a global context and other local contexts, the system can combine and execute corresponding processes within the scope allowed by the synchronization control instructions.

[0118] In some implementations, synchronization control commands can be issued by the user through selecting controls, confirming operations, entering commands, selecting content ranges, specifying synchronization targets, or setting accessible or referential ranges. Synchronization control commands can also be generated by the system based on user actions within the interactive interface, forming corresponding machine-recognizable instructions. Regardless of the form, synchronization control commands should enable the system to identify at least one of the following: content to be synchronized, synchronization target, synchronization processing method, accessible range, or referential range.

[0119] It should be noted that, in this embodiment, the process by which the system determines or forms the content to be synchronized based on synchronization control commands may include auxiliary processing such as content extraction, summarization, organization, formatting, index generation, or citation information generation. However, the aforementioned auxiliary processing is not the fundamental inventive point of this invention, nor does it imply that this invention must employ a specific summarization algorithm, compression algorithm, or content filtering model. The focus of this embodiment is that the system responds to the user's synchronization control commands for a local context, determines or forms the content to be synchronized associated with the local context, and provides a content basis and target basis for subsequent selective synchronization processing.

[0120] It should also be noted that the synchronization control instructions described in this embodiment are not equivalent to the system's automatic full synchronization of local context content. Before receiving a synchronization control instruction or other explicit open, access, reference, or synchronization instructions, the local interactive content in the local context is not merged into the global context by default, nor is it configured by default as content accessible or referenceable by other local contexts. Only when the synchronization control instruction instructs corresponding processing does the system determine or form the content to be synchronized and its corresponding synchronization target based on the synchronization control instruction.

[0121] Through this embodiment, the system can determine the content to be synchronized, the synchronization target, and the synchronization processing method based on the synchronization control commands issued by the user, while maintaining the local context content in isolation by default. Therefore, users can either directly select content already saved in the local context for synchronization, or create custom synchronization content based on the local context content or user-added content during the synchronization process. This improves the flexibility of how the content to be synchronized is generated and provides a foundation for subsequent synchronization to the global context or configuration as accessible or referable by other local contexts. Example 5

[0122] This embodiment, based on Embodiment 4, further explains the specific method by which the system performs selective synchronization processing on the content to be synchronized after responding to the synchronization control command. This embodiment mainly combines... Figure 4 This document provides explanations and focuses on supporting implementation methods for synchronizing content to be synchronized to the global context and configuring the content to be synchronized to be accessible or referenced by other local contexts.

[0123] like Figure 4 As shown, after determining or forming the content to be synchronized and identifying the corresponding synchronization target according to the method described in Embodiment 4, the system can perform selective synchronization processing according to the synchronization target. The selective synchronization processing may include synchronizing the content to be synchronized to the global context, or configuring the content to be synchronized as content accessible or referenced by other local contexts.

[0124] In some implementations, when a synchronization control command instructs that content to be synchronized be synchronized be synchronized to the global context, the system can write or record the content to be synchronized in the global context, or establish a reference relationship or index relationship pointing to the content to be synchronized in the global context, so that the content to be synchronized becomes context content or context reference information that can be used in subsequent main process interactions. For example, the system can add a content record, conclusion record, decision record, reference record, or index record in the global context, or it can record a reference identifier or index information pointing to the content to be synchronized in the global context.

[0125] In some implementations, when content to be synchronized is synchronized to the global context, the system can record its source local context identifier, synchronization time, synchronization operation identifier, user identifier that issued the synchronization control command, original content identifier, synchronization processing method, or other synchronization metadata. Through this synchronization metadata, the system can identify the source, formation method, or synchronization relationship of the content in subsequent main process interactions, and can backtrack to the corresponding local context or corresponding local interaction content when needed.

[0126] It should be noted that synchronizing content to be synchronized to the global context does not mean that all local interactions in the local context will be synchronized to the global context. The system can synchronize only the content to be synchronized as indicated, confirmed, or allowed by the synchronization control command to the global context. Other local interactions not covered by the synchronization control command can remain in their respective local contexts and continue to be excluded from the global context by default.

[0127] In other implementations, when a synchronization control command instructs that content to be synchronized be configured to be accessible or referenced by other local contexts, the system can establish a corresponding configuration relationship between the content to be synchronized and other local contexts, enabling other local contexts to access or reference the content to be synchronized during initialization or subsequent interactions. For example, a conclusion item formed in local context A may not be directly synchronized to the global context, but may be configured to be accessible by local context B; a prompt word fragment or contextual reference information formed in local context A may also be configured to be referenced by local context C.

[0128] In some implementations, configuring the content to be synchronized as accessible or referenceable by other local contexts may include establishing access relationships between the content to be synchronized and the other local contexts. These access relationships can be used to instruct one or more other local contexts to read, load, or access the content to be synchronized within a specified scope. For example, the system may record the identifier of the content to be synchronized, the identifier of the source local context, the identifier of the authorized local context, the scope of accessible content, the access status, or other access control information in the access relationships.

[0129] In some implementations, the access relationship can be used in the local context initialization process. Specifically, when the system creates or initializes another local context, it can determine whether the local context can access the content to be synchronized based on the context identifier, initialization rules, or accessibility range configured in the synchronization control instructions corresponding to that local context. If the local context is within the accessibility range, the system can include the content to be synchronized as part of the initialization data, or include reference information pointing to the content to be synchronized as part of the initialization data.

[0130] In some implementations, the access relationship can also be used for subsequent interactions within a local context. Specifically, when the conditions defined by the access relationship or access permission information are met, the system can provide the content to be synchronized or its reference information to the local context based on user actions, context reference requests, or preset access rules. Thus, other local contexts can access or reference the content without changing the source relationship of the content to be synchronized.

[0131] In other implementations, configuring the content to be synchronized as accessible or referenceable by other local contexts may include establishing reference relationships between the content to be synchronized and the other local contexts. These reference relationships allow other local contexts to reference the content to be synchronized without having to copy the entire content to be synchronized to the other local contexts. For example, the system may record a reference relationship in local context B pointing to a piece of content to be synchronized in local context A, enabling local context B to access the corresponding content through this reference relationship when needed.

[0132] In some implementations, the reference relationship may include an identifier of the content to be synchronized, a source local context identifier, a referencing local context identifier, a reference scope, a reference status, a reference time, or other information used to determine the reference relationship. Through the reference relationship, the system can maintain the correspondence between the content to be synchronized and its source local context, and enable other local contexts to access or reference the content based on this reference relationship.

[0133] In some implementations, the system can also configure reference identifiers for the content to be synchronized, pointing to other local contexts. These reference identifiers may include content identifiers, context reference identifiers, content record identifiers, index identifiers, link identifiers, or other identifying information that points to the content to be synchronized. Other local contexts can locate, read, or reference the corresponding content to be synchronized through these reference identifiers during initialization or subsequent interactions.

[0134] In some implementations, the system can also configure access permission information for the content to be synchronized, targeting other local contexts. This access permission information may include identifiers of allowed local contexts, identifiers of allowed local contexts, accessible scope, referential scope, access time period, permission status, access method, referencing method, or other information related to access or referencing control. The system can determine whether a particular local context can access or reference the content to be synchronized based on this access permission information.

[0135] It should be noted that access relationships, reference relationships, reference identifiers, and access permission information can be used individually or in combination. For example, the system can establish an access relationship between the content to be synchronized and local context B, while configuring a reference identifier for local context C; alternatively, access permission information can be used to restrict local context B to read the full text of the content to be synchronized, while local context C can only use the reference identifier pointing to that content. The above configuration methods are only used to illustrate different implementation approaches and do not limit the use of a specific data structure or permission model.

[0136] In some implementations, configuring the content to be synchronized as accessible or referenceable by other local contexts does not necessarily mean that the content to be synchronized will enter the global context. In other words, the content to be synchronized can maintain its association with the source local context, while being made available to other local contexts through access relationships, reference relationships, reference identifiers, or access permission information. Thus, controlled reuse between local contexts can be achieved without changing the content of the global context.

[0137] In some implementations, configuring the content to be synchronized as accessible or referenceable by other local contexts does not mean that all other local contexts can access or reference the content to be synchronized. The system can determine which other local contexts can access or reference the content to be synchronized based on the accessibility scope, reference scope, synchronization target identifier, or access permission information carried or associated in the synchronization control instructions. For local contexts that do not belong to the corresponding scope, the system may not provide them with the content to be synchronized or its reference information.

[0138] In some implementations, synchronization control instructions can also indicate combined processing methods. For example, the system can synchronize a piece of content to be synchronized to the global context, while simultaneously configuring that content or its reference identifier as accessible or referential to one or more other local contexts. The system can also synchronize a portion of the content to be synchronized to the global context, while configuring another portion as accessible or referential to other local contexts. The specific processing method can be determined based on the synchronization target identifier, synchronization processing method, accessibility range, or referential range carried or associated with the synchronization control instructions.

[0139] It should also be noted that the selective synchronization processing in this embodiment is a process executed in response to user synchronization control commands for a local context. Before receiving synchronization control commands or other explicit open, access, reference, or synchronization commands, the system does not automatically synchronize local interactive content in the local context to the global context, nor does it configure local interactive content as accessible or referenceable by other local contexts by default. In this way, controlled reuse of local interactive results or related content can be achieved while maintaining the default isolation and storage of local contexts.

[0140] Through this embodiment, the system can perform different selective synchronization processes on the content to be synchronized, which is associated with a local context, based on the different synchronization targets of the synchronization control command. On the one hand, the system can synchronize the content to be synchronized to the global context, making it usable content or reference information in subsequent main process interactions; on the other hand, the system can also configure the content to be synchronized to be accessible or referenced by other local contexts, enabling local contexts to reuse local interaction results within a controlled scope. Thus, a relatively clear processing mechanism can be formed between default isolation and controlled reuse.

Claims

1. A hierarchical context management method, characterized in that, include: S1 receives a local context creation command from the user; S2 responds to the local context creation instruction to generate a local context associated with the global context; S3 initializes the local context based on the configured initialization data; S4 Receive and save local interaction content in the local context, wherein the local interaction content and the global context are saved separately, and the local interaction content is not merged into the global context by default; S5 responds to a user's synchronization control command for the local context and performs selective synchronization processing on the content to be synchronized associated with the local context. The selective synchronization processing includes at least one of the following: synchronizing the content to be synchronized to the global context; or configuring the content to be synchronized as content accessible or referenced by other local contexts.

2. The method according to claim 1, characterized in that, The global context is a set of context data or a context data structure used to carry the main process interaction content in the interaction environment. The interaction environment corresponds to at least one of the following: a session, an interaction instance, a project discussion, a long chain task, a main discussion in the workspace, or an agent interaction scenario. The main process interaction content includes at least one of the following: user input content, system output content, task status information, phase conclusion information, decision information, contextual reference information, or other interactive data used to continuously advance the main process; The local context is a context scope that is associated with but distinct from the global context, and is used to carry local interactive content that is formed independently of the main flow interactive content.

3. The method according to claim 1, characterized in that, The initialization data includes at least one of the following: at least a portion of the content in the global context, guided input content for the local context, other context data specified by the user, at least a portion of the content in other existing contexts, or reference information of other existing contexts.

4. The method according to claim 1, characterized in that, The initialization of the local context based on the configuration initialization data includes: Based on the context inheritance scope specified by the user, determine the context content or context reference information used to initialize the local context from the global context; Alternatively, if the user-specified context inheritance scope is not received, the context content or context reference information used to initialize the local context is determined based on preset inheritance rules.

5. The method according to claim 1, characterized in that, The content to be synchronized includes at least one of the following in the local context: original text fragments, summary content, conclusion items, decision items, prompt word fragments, contextual reference information, contextual index information, or custom synchronization content; wherein, the custom synchronization content is formed based on at least one of user-supplemented content and the local context content.

6. The method according to claim 1, characterized in that, The synchronization control command carries at least one of the following: the identifier of the content to be synchronized, the identifier of the synchronization target, the synchronization processing method, the accessible range, or the referential range. The selective synchronization processing of the content to be synchronized associated with the local context includes: The synchronization control command determines the content to be synchronized and its corresponding synchronization target, and synchronizes the content to be synchronized to the global context according to the synchronization target, or configures it as content accessible or referenced by other local contexts.

7. The method according to claim 1, characterized in that, The step of configuring the content to be synchronized as accessible or referential to other local contexts includes establishing access or reference relationships between the content to be synchronized and the other local contexts, or configuring reference identifiers or access permission information for the content to be synchronized to the other local contexts, so that the other local contexts can access or reference the content to be synchronized during initialization or subsequent interactions.