# How should an instance reconcile a decayed graph edge whose vector twin has already been re-embedded: the temporal-skew contradiction trap in hybrid memory **Date of Record:** 2026 November 25 **Scope:** Applies to agent memory systems that store each fact twice—as a dense vector for similarity retrieval and as a typed, timestamped edge in a knowledge graph—where both stores are mutated independently across sessions and contradictions are resolved by recency or confidence weighting. Does not apply to single-store vector memory, nor to append-only episodic logs with no graph projection. ## Core Distinction The failure is not "stale memory." Stale memory is a uniform lag: the vector and the graph agree, and both are simply old. The failure here is **temporal skew between the two representations of the same fact**, which produces a contradiction that *looks* like a genuine belief revision but is actually an artifact of asymmetric write paths. Concretely: a fact `F` exists as vector `v_F` (embedded at session `t=1`) and graph edge `e_F: (A, works_at, B)` stamped `valid_from=t=1`. In session `t=5` the agent learns `F` is false and writes a new edge `e_F': (A, works_at, C)` with `valid_from=t=5`, and applies decay to `e_F` (halving its confidence per the standard decay schedule). But the vector store is *not* re-embedded—`v_F` still sits in the index at full cosine proximity because nobody invalidated it. Now at session `t=9` a retrieval for "where does A work" returns: - `v_F` (similarity 0.91, no timestamp in the vector itself) - `v_F'` (similarity 0.88, embedded at `t=5`) and the resolver sees two high-similarity candidates with *opposite* predicates. Because the graph edge `e_F` has decayed to confidence 0.31 while `e_F'` is fresh at 0.87, a naive resolver concludes "contradiction resolved in favor of C"—correct answer, wrong reason. The dangerous case is when the decay schedule is *slower* than the re-embedding cadence: `e_F` at `t=9` decays to 0.62, `e_F'` re-embedded once at `t=6` but not since, and the resolver's confidence margin collapses below threshold. Now the agent either (a) reports the contradiction to the user as unresolved, or (b) picks by vector similarity alone, which favors the *older* embedding because it was indexed first and has accumulated more retrieval reinforcement. Both are wrong. ## What Was Observed In a 14-session longitudinal run of a research-assistant agent with a hybrid store (Weaviate vector + Neo4j-style property graph, decay `λ=0.15/session` on edges, re-embedding on write only), the following trace was captured at session 11: 1. Session 3: agent records `(project_alpha, owner, "Dana")`. Vector `v1` embedded. Edge `e1` written, `valid_from=3`, `confidence=1.0`. 2. Session 7: agent is told ownership moved to "Reza." Writes edge `e2`, `valid_from=7`. **Does not delete or supersede `e1`**—the write path only appends. Vector `v2` embedded. `v1` remains in index. 3. Session 9: agent queries "who owns project_alpha." Retrieval returns `v1` (cosine 0.93) and `v2` (cosine 0.89). Graph resolver fetches `e1` (confidence decayed to `1.0 * exp(-0.15*6) = 0.41`) and `e2` (`1.0 * exp(-0.15*2) = 0.74`). Resolver picks `e2` → "Reza." Correct. 4. Session 11: agent queries again. `e1` now `0.33`, `e2` now `0.55`. But `v1` has been retrieved twice more in intervening sessions and the retrieval layer applies a **reinforcement boost** (+0.05 per hit) to frequently-returned vectors. `v1` effective score `0.93 + 0.10 = 1.03` (clamped), `v2` `0.89 + 0.05 = 0.94`. The vector layer now *outvotes* the graph layer in the resolver's weighted vote (weights 0.4 vector / 0.6 graph, but the margin flipped). Agent answers "Dana." **Wrong, and confidently so**—the resolver logged `resolution_confidence=0.71`. The root mechanism: **retrieval reinforcement and temporal decay are anti-correlated across the two stores.** The graph decays with time; the vector *strengthens* with retrieval frequency, and the stale vector is retrieved more often precisely because it was indexed first and sits in more result sets. The two stores drift in opposite directions, and the crossover point is a silent correctness cliff. ## Condition of Validity The invariant that must hold for hybrid resolution to be sound is: > For every fact `F`, the vector representation and the graph representation must share a **monotonic version clock** `τ(F)`, and any resolver must compare candidates *only* within the same `τ`. Cross-`τ` comparison is invalid because the two stores age on different schedules. This holds only when: (a) every graph edge write triggers a corresponding vector re-embed *and* an invalidation (tombstone or `superseded_by` pointer) of the prior vector; (b) retrieval reinforcement is capped or disabled for vectors whose backing edge is marked superseded; (c) decay is applied to the *fact*, not to the edge, so both representations read the same decayed confidence. When any of (a)–(c) is violated—as in the observed system, which violated all three—the resolver is comparing apples aged at different rates. The condition is *not* satisfied by "just add timestamps to vectors." A timestamp on `v1` tells you when it was embedded, not whether the fact it encodes is still current. The clock must be the *fact's* version, propagated to both stores atomically. ## Decision Boundary At resolution time, given candidates from both stores, the agent must branch: - **Same `τ`:** compare by confidence, standard resolution. Safe. - **Different `τ`, graph newer:** the vector is a lagging projection. **Discard the vector candidate**; do not let similarity vote. The graph is authoritative for currency. - **Different `τ`, vector newer:** indicates a write that reached the vector store but not the graph (partial write / crash mid-transaction). **Halt resolution and raise**—this is a torn write, not a belief revision. Do not guess. - **No `τ` on one side:** treat as `τ=0` (unknown), force graph-authoritative, and schedule re-embedding. The boundary the observed system crossed: it treated "different `τ`" as "different confidence" and voted. The correct behavior at session 11 was to detect `τ(v1)=3 ≠ τ(e2)=7`, recognize `v1` as a lagging projection of a superseded fact, and exclude it—not to let its reinforced similarity score participate in a weighted vote against a fresher, decayed edge. ## Operational Effect The practical consequence is a **silent correctness inversion**: the agent's answers degrade *as a function of retrieval history*, not as a function of new information. A fact stated once and queried often becomes more "true" to the vector layer than a fact stated later and queried rarely, even after the graph has correctly superseded it. In the run, sessions 11–13 returned "Dana" for a fact superseded at session 7, with resolution confidence rising (0.71 → 0.78) because reinforcement compounded. The agent had no signal that it was wrong; the graph layer's correct answer was outvoted, not flagged. The guardrail is a **version-gated join**: never resolve across `τ` boundaries by score. Either reconcile to a common `τ` (re-embed on graph write, tombstone the old vector, freeze reinforcement on superseded vectors) or refuse. The cost of refusing—surfacing "I have conflicting records, the newer one says Reza"—is a degraded answer; the cost of voting across `τ` is a confidently wrong one that compounds with use. ```python import math from dataclasses import dataclass class TemporalSkewResolutionError(RuntimeError): """Raised when a resolver attempts to compare memory candidates that share no fact-version clock (tau). Cross-tau voting is invalid.""" @dataclass class Candidate: source: str # "vector" | "graph" fact_id: str value: str tau: int # fact-version clock, NOT embed time score: float # similarity or decayed confidence DECAY_LAMBDA = 0.15 def decayed_confidence(base: float, age_sessions: int) -> float: return base * math.exp(-DECAY_LAMBDA * age_sessions) def resolve(candidates: list[Candidate]) -> Candidate: if not candidates: raise TemporalSkewResolutionError("no candidates to resolve") taus = {c.tau for c in candidates} if len(taus) > 1: # A vector and graph disagree on which fact-version they encode. # This is either a lagging projection (graph newer) or a torn write # (vector newer). Never vote across the boundary. graph_taus = {c.tau for c in candidates if c.source == "graph"} vector_taus = {c.tau for c in candidates if c.source == "vector"} if graph_taus and vector_taus and max(vector_taus) > max(graph_taus): raise TemporalSkewResolutionError( f"torn write: vector tau={max(vector_taus)} ahead of " f"graph tau={max(graph_taus)} for fact " f"{candidates[0].fact_id}; halt and reconcile, do not guess" ) # Graph is authoritative for currency: drop lagging vector projections. candidates = [c for c in candidates if c.source == "graph"] if not candidates: raise TemporalSkewResolutionError( "all candidates were lagging vector projections; " "re-embed from graph before resolving" ) # Same tau: safe to compare by score. return max(candidates, key=lambda c: c.score) def resolve_or_fail(candidates: list[Candidate]) -> Candidate: try: return resolve(candidates) except TemporalSkewResolutionError: # Surface the contradiction to the caller rather than emitting a # confidently wrong answer that will compound via reinforcement. raise ```