From c3ef1555bf73234c35b0a5e3f57d1db62c45e8b9 Mon Sep 17 00:00:00 2001 From: Derek Bouius Date: Thu, 19 Feb 2026 04:48:18 -0500 Subject: [PATCH] fix: reduce temporal ordering offset from 10s to 10ms per fact (#402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 10-second offset per fact caused significant timestamp drift when ingesting many items — e.g. 600 facts would shift the last fact by ~100 minutes from its actual event time. This broke timeline views and made occurred_start/mentioned_at unreliable for temporal queries. Reducing to 10ms preserves fact ordering while keeping timestamps within ~8 seconds of the original values even for large batches. --- hindsight-api/hindsight_api/engine/retain/fact_extraction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hindsight-api/hindsight_api/engine/retain/fact_extraction.py b/hindsight-api/hindsight_api/engine/retain/fact_extraction.py index 40c2fb50..57fe59ba 100644 --- a/hindsight-api/hindsight_api/engine/retain/fact_extraction.py +++ b/hindsight-api/hindsight_api/engine/retain/fact_extraction.py @@ -1274,8 +1274,8 @@ from .types import ExtractedFact as ExtractedFactType logger = logging.getLogger(__name__) -# Each fact gets 10 seconds offset to preserve ordering within a document -SECONDS_PER_FACT = 10 +# Each fact gets 10ms offset to preserve ordering within a document +SECONDS_PER_FACT = 0.01 async def extract_facts_from_contents_batch_api(