graphify icon indicating copy to clipboard operation
graphify copied to clipboard

Feature: temporal validity on facts + recency weighting in query (living corpora return stale facts at full weight)

Open Ns2384-star opened this issue 4 months ago • 0 comments

Version: graphifyy 0.9.5. Context: living, CRM-like documentary corpus (people join/leave, RFPs open/close), 289 real queries logged over one month.

Problem

serve._query_graph_text ranks purely by term-overlap + IDF + confidence — no time factor at all. On a living corpus, stale facts weigh exactly as much as fresh ones: a query about a person returns their old assignment and their current one with equal standing, and nothing marks which edge is superseded.

reflect.py already has the half-life mechanics (30 days) but only applies it to Q&A reputation, not to graph facts.

Proposal

Three composable pieces:

  1. Optional temporal fields valid_from / valid_to / superseded_by on nodes/edges, populated by extraction when the source states them.
  2. --recency flag on query that weights results by captured_at / mtime of the source_file.
  3. Invalidation mechanism: when a new extraction states "X left Y", mark the existing employment edge as closed (don't delete it — history stays queryable).

Even just (2) would be a big win: today we have to re-check every time-sensitive answer against the raw source files.

Ns2384-star avatar Jul 04 '26 16:07 Ns2384-star