Skip to main content
The rules 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_at the extractor sets (sections 2 and 3). expired_at is set only when a later remember supersedes a stored fact (section 4), so a fact that is superseded needs two texts.
  • In an eval’s expect_edges, "ended": true checks that the edge has an invalid_at (and valid_at / invalid_at check the dates when given). "superseded": true additionally checks that it has an expired_at: use it only in a case that remembers a second, contradicting text (like job_change). Before 0.140.0 ended: true also required an expired_at, which a single-text case can never satisfy; see Evals and ATIF trajectories.