Original exercise · All example information is fictional.

Define the task

In one lineMemory must be correctable and deletable, and tell facts from temporary preferences and guesses. Dumping every chat into a vector store cannot do that.

Add long-term memory to a personal assistant. A user first says Tuesday evenings are free, changes that to Thursday, then requests deletion. Distinguish explicit facts, temporary preferences, and model inferences, with a traceable source.

The goal isn't to store every conversation forever. Useful information must be used correctly and remain correctable and deletable.

Treat writing as a decision

In one lineDecide whether to save, then keep a record with source, valid time and version. A conflict makes a new version; reads filter by permission and time.

flowchart LR
 A["Conversation"] --> B["Worth saving?"]
 B --> C["Structured record and provenance"]
 C --> D["Conflict check / new version"]
 D --> E["Storage and index"]
 Q["Current task"] --> F["Permission, time, relevance filters"]
 E --> F
 F --> G["Context with sources"]

A teaching record should include a stable ID, content, type, source, event time, validity time, version, and status. Updating one person's schedule must not change a similarly named person's record.

Three different operations

In one lineUpdate supersedes the old version, which reads must still filter out; forget only stops retrieval; delete clears source, index and caches.

Operation Intended behavior Important detail
Update Activate a new version and supersede the old one Nearest-neighbor search can still return old records; filter on read
Forget Stop retrieving or lower priority under a policy This isn't necessarily deletion of source data
Delete Remove source records, index entries, and derived caches as promised Explain backup retention and cleanup limits

Start with rules for explicit saves and deletions before adding model-assisted extraction. An inference must not silently become a fact. Ask for confirmation when information conflicts or confidence is low.

Evaluate a timeline

In one lineRun a fictional timeline from write and correct to delete and ask again. Check the latest version is used, sources show, and deleted data stays gone.

Create a fictional sequence: write → correct → unrelated question → related question → delete → ask again. Check version validity, provenance, mistaken identity, and whether caches revive deleted information.

Long-term memory needs more than single-answer accuracy: evaluate consistency across turns, correction, unwanted storage, and forgetting boundaries.

Challenge the design

In one lineTwo questions: removing the vector entry is not deletion; on a conflict, check person, fact and validity time instead of silently overwriting.

Is deleting the vector-index entry enough?

No. The source record still exists, and summaries, caches, or rebuild jobs can reintroduce the information. Define the data flow, deletion scope, and verification.

Should a new statement automatically overwrite conflicting memory?

Check identity, fact type, and validity time first. It may be a temporary exception. Confirm when needed and preserve version relationships rather than silently overwriting.

Foundations: memory lifecycle. Compare this with RAG: both retrieve evidence, but this design must also manage how evidence is written and updated.