Skip to content

fix(control-plane): coalesce dates for timelines - #3516

Open
mdbenito wants to merge 1 commit into
vectorize-io:mainfrom
mdbenito:control-plane/coalesce-times-for-entities
Open

fix(control-plane): coalesce dates for timelines#3516
mdbenito wants to merge 1 commit into
vectorize-io:mainfrom
mdbenito:control-plane/coalesce-times-for-entities

Conversation

@mdbenito

@mdbenito mdbenito commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

The entity timeline in the control plane plotted each memory only by occurred_start, a content date the LLM sets on a small fraction of memories, so most entities showed "No Timeline Data" despite every memory carrying mention and ingest timestamps.

This PR makes it so that timelines plot each row by an effective date computed in the UI as occurred_startmentioned_atoccurred_endcreated_atevent_date, replicating the backend's COALESCE order for a unit's effective time and extending it with system fields that are always populated. Only rows with no usable date at all are excluded. Filtering, sorting, grouping, and labels all use this date.

Additionally:

  • the date partition and granularity grouping are extracted into pure helpers (with unit tests)\
  • the empty-state message was reworded across locales
  • the graph endpoint's non-ISO YYYY-MM-DD HH:MM date is parsed explicitly as UTC since it falls outside the ECMAScript date grammar.

Note: The backend actually shows two different date policies (this PR follows the 2nd one):

  1. "Effective time": COALESCE(occurred_start, mentioned_at, occurred_end), used by temporal retrieval (retrieval.py::_coalesce_date) and recency reranking (reranking.py:156, but inlined instead of calling the helper).
  2. Display/any-time: the extended chain including created_at/event_date, used by get_memories_timeseries and now by the timeline view.

This PR adds more behaviour by handling the graph endpoint's non-ISO date format, which no backend helper currently does, but it does mean the display chain now exists in three places.

Two follow-ups worth considering:

  1. Move _coalesce_date to a shared module and have reranking.py use it, eliminating the inline duplicate.
  2. Compute effective_date server-side on /list and /graph endpoints

The timeline only plotted rows with occurred_start, a content date the
LLM sets on a fraction of memories, so most entity timelines rendered
"No Timeline Data". Coalesce the unit's effective time like the backend
does (COALESCE(occurred_start, mentioned_at, occurred_end)), extended
with created_at and the legacy event_date, so every row with any usable
date appears; reword the empty-state message across locales.

Extract date partition and granularity grouping into pure helpers with
unit tests. The graph endpoint's space-separated "YYYY-MM-DD HH:MM"
date is parsed explicitly as UTC because it falls outside ECMA-262's
date grammar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant