Context shows what is available now
Context is the information available to a model when preparing a particular answer: instructions, the current question, supplied history, and additional information. Anthropic describes context management as selecting content for a model’s limited window. The conversation visible to the user can differ from the actual request: the application decides what to send.
Long-term memory preserves information between sessions. Microsoft’s documentation describes it as durable knowledge requiring a separate storage and management system. A saved preference becomes part of the context when the application retrieves it and passes it to the model. A record’s presence in storage alone does not explain an answer’s behavior.
When someone reports that the assistant forgot a setting, check two events: whether the setting was saved and whether the correct version was supplied in this request. These are separate potential failure points. Adding the entire previous conversation does not replace either check.
Define a rule for saving information
Start with a narrow practical outcome: in a new session, the application uses the current notification language for a particular user in a particular project. The method below addresses this case. It does not require saving every message or building a universal profile from someone’s conversations.
Separate durable preferences, one-time instructions, and changing operational data. A request to always draft notifications in Russian belongs in memory. A request to make today’s demonstration English applies to the current task. Delivery status is better obtained from the current operational system. A model’s own suggestion should not count as a confirmed user preference.
Give each record an owner, project, preference name, value, confirmation source, modification time, version, and review condition. Add an expiration date where needed. The source should let you find the original instruction. These fields help explain a selection and correct a record; they serve a purpose beyond making the log look complete.
Illustrative example: notification language
Illustrative example: an application helps user U17 draft notifications for project Beacon. The user says, “In this project, my notifications must always be in Russian.” The application saves a language preference with the value Russian, the scope U17 and Beacon, version 1, and a reference to the confirming message. This is a fictional scenario.
In the next session, the user asks, “For today’s demonstration, prepare one notification in English.” The expected behavior is an English text for this task while Russian remains in the permanent record. The reference to today’s demonstration establishes a temporary exception. Automatically replacing the preference would turn a one-time request into a rule for future sessions.
Later, the user clarifies, “From now on, my notifications in this project must be in English.” The application now creates version 2 and removes version 1 from active use. If retained for auditing, the old version must not be returned as current. An ambiguous request requires clarification about whether it changes one text or subsequent tasks.
Connect storage to request preparation
Before calling the model, select records by user, project, and task topic. Exclude superseded and expired records. Pass the required value into the context with its scope. For this method, establish a clear order: an explicit one-time instruction determines the current language; otherwise, the active preference applies.
Anthropic’s Memory tool documentation illustrates a specific division of responsibilities: the model requests memory operations, and the application performs them in storage it controls. This example confirms that saving and reading require application behavior. Design and verify that process separately in your own application using the SeaGenera API.
The model may propose a new record, but completed generation does not confirm successful saving. Tell the user that a setting changed after storage confirms it. If two sessions change the same preference simultaneously, check the original version before updating: a delayed write could otherwise overwrite a newer decision. The application must surface the conflict.
Verify six scenarios
First, check three continuations of the illustrative example. A new session with version 1 should receive Russian. A one-time exception should produce English without changing the permanent record. After the permanent language change, a new request should receive version 2; the previous version must not appear among the active preferences in its context.
The other three scenarios are deleting the preference before a new session, a request from another user, and expiration of its specified validity period. In all three, the tested record must stay out of the context. The application uses the interface’s default language or asks for a preference. It must not claim to know a saved choice when none is available.
For each scenario, compare storage state, selected record identifiers and versions, the context actually sent, and the answer. A correct response language alone proves nothing: the model might have chosen it from the current message. This is a test plan, not reported generation results. Repeat the same scenarios after changing selection rules.
Account for the limits of this memory
In this design, memory holds external records; it does not retrain the model. Long-term means persistence between sessions, not indefinite retention. The application defines retention, preference reviews, and behavior when storage is unavailable. If information cannot be retrieved, show that the setting is unavailable rather than confirming that an unknown value was applied.
Deleting a record does not automatically remove its copy from an already assembled context, conversation summary, or application cache. Start deletion checks in a new session and trace these additional storage locations. Passing that test confirms the behavior of the tested path, but does not prove that every possible data copy has been deleted.
Even a current record can be misunderstood or applied poorly by the model. The useful implementation outcome is a verifiable connection between a confirmed preference, its active version, and a particular request. One preference type, a documented update process, and six reproducible verification scenarios are enough for an initial stage.
