remember follows for the dates of facts, in one place. The model (event time and system time, the pipeline, the invalidation rule) is in Temporal facts; this page lists the special cases and what happens in each.
Code: Extract and fixSpan in internal/memory/memory_remember/remember.go, the prompt in prompts_remember.go (entitySystemPrompt, resolveSystemPrompt), resolveEdges, storeEdges and contradict in temporal.go.
Terms: a fact is live while it has no invalid_at and no expired_at; it ended when it has an invalid_at (the text said so); it is superseded when it has an expired_at (a later fact closed it).
1. Reading the dates of the text (Extract)
2. A fact that ended
An empty span is not an error. Reconciliation treats it like any ended fact: it never overlaps a later fact (see section 4), and
query shows it as having stopped being true at that instant.
3. Moves, replacements and plans
4. New facts against stored ones (resolve and store)
Resolution only sees the live edges that share an entity with the new ones (by name, and by similarity with vectors), the 50 newest. A stored fact outside that set can’t be merged or closed.
5. What query sees
Details: Query.
6. Writing tests and evals for these cases
- Use the past tense and a reference time after the event to test that a fact ended (“has moved … in August 2024”, reference time in September 2024). A future tense yields a live fact by design (section 3).
- A single text can end a fact only through an
invalid_atthe extractor sets (sections 2 and 3).expired_atis set only when a laterremembersupersedes a stored fact (section 4), so a fact that is superseded needs two texts. - In an eval’s
expect_edges,"ended": truechecks that the edge has aninvalid_at(andvalid_at/invalid_atcheck the dates when given)."superseded": trueadditionally checks that it has anexpired_at: use it only in a case that remembers a second, contradicting text (likejob_change). Before 0.140.0ended: truealso required anexpired_at, which a single-text case can never satisfy; see Evals and ATIF trajectories.