Understand first
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Understand → Implement → Debug → Design
Connect deletion to recovery and handle old state with undo versioning, provenance verification, physical cleanup, and failure testing.
Knowledge content check2026-10-03 · Check the source of the original question2026-10-02
It is recommended to understand first:
Memory scopes and trusted authorization context →Idempotency, unknown outcomes, and task recovery →Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Prepare to write the principles into code
Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.
View the code example →Need to handle failures and changes in conditions
Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.
Continue to delve deeper into the problem →Need to design or review plans
Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.
Analyze engineering scenarios →LEARN · PRACTICE · REFLECT
First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.
Can be practiced directly. After logging in, answers, favorites, and notes will be saved to your account.
Log in and saveEach modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.
Core concept · Revoke memories, clean up derivatives, and prevent stale data from returning
Preparatory concepts:Copy and derive data, Version condition writing, Checkpoint recovery
Deleting the text and prohibiting its reuse are separate steps. The authoritative revocation state must participate in reads and writebacks before the old replica, otherwise old checkpoints, backfills, or caches will reintroduce deleted facts.
Memory may appear in summaries, vectors, answer caches, and checkpoints. A store delete handles its specified item without finding every derivative. Recovery can write an old summary back after deletion. This resurrection reflects missing cross-copy revocation rules.
Record revocation and a new version in authoritative metadata. Filter revoked references before reads and model dispatch, checking versions on writeback. Then clean text, vectors, and caches through source dependencies and track each confirmation. Tombstones retain only the non-payload information needed to prevent resurrection, under the retention policy. Audit convenience cannot justify indefinite retention of deleted text.
A scope epoch invalidates all earlier context at the cost of broad rebuilding. Per-item versions are more precise but require summary dependencies and additional checks. Combine item revocations with scope changes for major authorization events. This is application design, not automatic end-to-end erasure by a framework.
Database deletion cannot recall data already sent remotely. Define when revocation takes effect, future-use prevention, and cleanup progress. Hidden UI content does not establish that every copy disappeared. Restored backups, offline indexes, and retries must merge current revocations before serving data. Serving yesterday’s restored database directly can resurrect later deletions.
Deleting a store row does not erase summaries, checkpoints, vectors, or caches. Record revocation and advance the scope version, checking references before recovery and use. Reject stale writeback of revoked facts. Invalidate use first, then clean copies asynchronously and report progress. Database deletion cannot recall data already sent to remote models or tools.
Long-term memory may be copied into summaries, checkpoints, retrieval caches, vector indexes, derived facts, and debug traces. If the recovery logic trusts the complete memory text in the old checkpoint, it can bypass the deletion of the long-term store. A more insidious situation is when a background fetch task reads an old conversation, then writes out the same facts again after the deletion is complete. The delete interface of LangGraph store is responsible for deleting the key; checkpoint is another state persistence mechanism, and it cannot be inferred that all derived data will disappear automatically. This requires the application to establish its own deletion and recovery contracts.
Maintain memory_epoch on user or project scope. When deleting, write the tombstone in the transaction, increase the epoch, and make the main database record unreadable. Checkpoint only saves the memory_id, source version and reading epoch. After recovery, the current epoch is queried first; if there is any inconsistency, the summary containing the memory is recalled and reconstructed. Background writes also carry the epoch when reading, the current version must be compared when submitting, and old task writes are rejected. The epoch only prevents old generation submissions; new tasks must also check tombstones bound to stable memory identifiers, sources, and derivation relationships, and cannot change IDs to reconstruct revoked facts. Exclude revoked source clips when extracting. Record-by-record undo can be more granular, and scoped epochs are easier to implement but invalidate the entire cache for that scope; the choice depends on the amount of data and frequency of deletions.
The API can return "discontinued" before cleaning up deletable copies in vector indexes, caches, summaries, historical states, and backups. Each cleanup target has job status and failure retries, and you cannot just set a deleted boolean and declare that all replicas have been cleared. Avoid writing sensitive original text to the log again when retaining deletion receipts and necessary audit metadata. When restoring old backups, synchronize the undo records first, otherwise the historical copies will re-enter the service. The retention policy and allowed cleanup scope should be defined by product and data management requirements. The mechanism in this article belongs to engineering design and does not replace specific compliance judgment.
Create a preference, form a checkpoint and summary, then delete it and restore it from the old checkpoint. Neither the request recovery context nor the final answer nor the newly generated summary contain it. Concurrency tests have background fetches stop before writes and continue after deletions, requiring epoch comparisons to reject old writes. Also covers vector cleanup failures, cache not flushed, and backup restores. The example only demonstrates the rejection of old content after version mismatch; there is still a race condition between pre-call verification and actual sending, and strong semantics require unified submission coordination. Remote requests that have been sent and results that have been read by the user cannot be reversed through the delete operation.
The Python standard library works. The demonstration logic is rejected and does not demonstrate physical deletion, index cleaning or cross-system sending coordination; production still needs to deal with the race condition of verification and calling.
import sqlite3
c = sqlite3.connect(':memory:')
c.executescript("CREATE TABLE scopes(id TEXT PRIMARY KEY, epoch INTEGER); CREATE TABLE memory(id TEXT PRIMARY KEY, scope TEXT, body TEXT, deleted INTEGER); INSERT INTO scopes VALUES('u1',1); INSERT INTO memory VALUES('m1','u1','prefer email summaries',0);")
checkpoint = {'scope':'u1', 'epoch':1, 'memory_id':'m1'}
with c:
c.execute("UPDATE memory SET deleted=1 WHERE id='m1'")
c.execute("UPDATE scopes SET epoch=epoch+1 WHERE id='u1'")
def restore(cp):
epoch = c.execute('SELECT epoch FROM scopes WHERE id=?',(cp['scope'],)).fetchone()[0]
if epoch != cp['epoch']: return 'rebuild context'
row = c.execute('SELECT body FROM memory WHERE id=? AND scope=? AND deleted=0',(cp['memory_id'],cp['scope'])).fetchone()
return row[0] if row else 'rebuild context'
print(restore(checkpoint))
expected output
rebuild contextContinue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.
Level 1How should the product commitment be defined if the removal coincides with tool shipping?
Delete from the copy and continue to investigate the race between undo and send.
Clearly define the submission boundary: after the revocation takes effect, calls that have not yet been sent will be rechecked at the sending gateway and rejected; calls that have been submitted to the remote end will enter the sent state and cannot be claimed to be withdrawn. If strict ordering is required, have undo and send commits ordered at the same coordination level. Notify users which copies have been cleaned and which remote storage needs to be processed according to the provider mechanism.
Level 1How to prevent tombstone loss during backup and restore?
Beyond physical cleanup, the recovery path may reverse undo knowledge.
Undo logs or authoritative versions cannot just be rolled back along with old business backups. After recovery, the undo records after the backup are synchronized first, and then read and re-indexed; old events are replayed and the undo version is also checked. Add recovery drills for acceptance to confirm that deleted memories will not be visible again. Specific backup retention and erasure policies need to be formulated based on business requirements.
Follow this answer further
Level 2The backup contains deleted text. When restoring, is it enough to first add the tombstone and then delete the text?
After the parent asks to retain the undo log, it further requests the service startup sequence for recovery.
It is also prohibited to provide queries, generate indexes, or trigger old tasks before completing the undo; otherwise, deleted text may be re-derived within a short window. Restore the default isolation of the environment, first merge the revocation and authorization status, and then complete the necessary cleanup and verification. The presence of a tombstone is only valid if all read and writeback paths check it.
Follow this answer further
Level 3The undo log is also damaged. Can you guess which ones were deleted based on the current text?
After the authoritative revocation basis is lost, the problem becomes information agnostic and the failure status needs to be clarified.
cannot be reliably inferred. Stop recovery reads of affected scopes and look for independent undo backups, audit events, or user confirmations; old private content that cannot be proven valid is not put back into use. Restoring availability cannot rely on models to guess the privacy state. Subsequent designs need to independently protect the undo log and practice joint damage scenarios.
Level 1What are the costs of the full-scope epoch and the itemized versions?
Deepen the anti-resurgence mechanism into implementable performance trade-offs.
Epoch verification is cheap and can completely block the old state, but a change will cause a lot of irrelevant memory to be reloaded. The item-by-item version can be accurately invalidated, but summary dependencies and item-by-item verification need to be maintained. Select or combine based on scale and revocation frequency; independent historical summaries that cannot be accurately purified should be discarded conservatively to prevent the model from guessing which sentences originated from deleted records.
First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.
Changing conditions:The user changed "Use Java" to "Use Go for the current project"
Extended question:Can I directly overwrite the string and keep the old digest?
No. New fact records specify scope and validity time, invalidating conflicting old facts and allowing summaries, indexes, and caches that depend on the old facts to be rebuilt. If the new fact only applies to the current project, other project memories should not be accidentally deleted. Keep the source of corrections to avoid old Checkpoints rewriting Java to current facts.
The principles that remain unchanged:Both correction and revocation require controlling the propagation of old versions, but the scope of invalidation is determined by the fact scope.
Changing conditions:Old memory copies exist outside the system
Extended question:The deleted memory appears in the imported file again. Do you want to restore it?
When importing, the stable identity, source generation and revocation records are checked, and the resurrection of old records is refused by default. When the user explicitly requests to resave, it can be processed according to the new authorization and new generation, and the old deletion is still valid; the content cannot be regarded as a new fact just because the file was recently uploaded. Sensitive imports that cannot be associated with identities require more conservative admissions.
The principles that remain unchanged:Arrival time cannot override authoritative revocation, and legal re-creation must have a new and explicit basis.
It is designed based on public technical information; the reference materials support the technical mechanism, and the scenarios and scoring standards are designed by this website and do not represent the original interview questions of a certain company. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.
After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.
View verification records for independent examples
Transferring pre-retrieval filtered ideas to memory versions and recovery. Observe how existing drafts become invalid after cancellation.
Read full text and fault analysis → · Download Reliability Experiment v3 ↓
python3 cli.py memory-put --db memory.sqlite
python3 cli.py submit --db memory.sqlite
python3 cli.py run --db memory.sqlite --lease-seconds 2 --fault after_draft
python3 cli.py memory-forget --db memory.sqlite
# 等待至少 2 秒后分别执行
python3 cli.py run --db memory.sqlite
python3 cli.py inspect --db memory.sqliteVerify local scope, version, and undo blocking; old checkpoints remain, no complete deletion of logs, backups, or checkpoints is provided.
Recovering from an old checkpoint with revoked memories, illustrating the filtering and rebuilding process.