Why can't your AI agent answer 'how did we get here?' even when it has all the data?
Two failure modes of LLM temporal reasoning, and why long context isn't the fix.
LLMs can retrieve facts but can't natively order them by time. Cosine similarity doesn't respect chronology. Without a curated causal slice — events on the actual chain leading to the current state — 'how did we get here' collapses into 'what is semantically similar to here.'
Six months into a complex platform migration, the team gathers for a postmortem.
Someone proposes letting the new AI agent draft the timeline. The agent has access to all the data — every PR, every Slack message, every incident report, every deploy log. The team feeds it the question: "Reconstruct the sequence of decisions that led to this final architecture."
Twenty seconds later, it returns a list. Fourteen events. They're real events. They're related to the migration. They are in completely random order.
The team stares at it for a moment. Someone says: "Wait, this doesn't help at all."
What are the two temporal failure modes of LLMs?
LLMs struggle with temporal reasoning in two distinct ways. Knowing which one you're hitting determines what to do.
Failure mode 1: ordering without timestamps. When retrieved chunks lack reliable timestamps, the model has no signal for "what came first." Cosine similarity doesn't respect chronology — it pulls semantically similar content regardless of when it happened.
Failure mode 2: causal vs. coincidental adjacency. Even with timestamps, the model can't distinguish "A happened before B" from "A caused B." Temporal ordering is necessary but not sufficient for causal reasoning.
The agent in the postmortem above hit both. Some of its events had timestamps; some didn't. Even the timestamped ones were ordered by retrieval score, not by time. The "causal chain" it produced was a list of semantic neighbors, not a chain.
What is a curated causal slice?
The fix isn't a longer context window — it's a different shape of input.
A curated causal slice is a timeline view that includes only the events directly on the causal chain leading to the current state. Contrast with a raw timeline: every event in chronological order, regardless of relevance.
Raw timelines look comprehensive but degrade rapidly. The classic Lost in the Middle result (Liu et al, 2023) shows that LLMs accurately use information from the start and end of a long context, and lose track of the middle. A 200-event timeline becomes a 20-event timeline that the model actually leverages — and 180 events of noise.
A curated causal slice trades coverage for precision. The system pre-walks the causal graph, returns the 10–20 events on the actual chain, and lets the model reason about a tractable input.
How do you build a timeline index that helps?
Three structural commitments matter:
1. Capture events as structured nodes, not as prose. An event node has: timestamp, actor, action, context, source-document, causal-predecessors, linked-events. PRs, deploys, incident reports, decision RFCs, and Slack pinned messages all become nodes. The richness of the graph determines the quality of the slices you can produce.
2. Mark causal edges explicitly. Don't infer causation from time-adjacency. When the system writes a node, ask: which prior events caused this? Capture the answer as edges. Most causal failures are because the graph has nodes but no edges.
3. Slice before you summarize. When a query asks "how did we get here," walk the graph backward from the current state. Return the slice as structured context, not as flattened prose. Let the model reason; don't reason for it.
Can long-context models just read the whole history?
This is the honest counter-argument. If GPT-5 or Claude Sonnet 4.5 can take 1M+ tokens, why not just dump the whole event log in?
The answer is that long context isn't free, and it isn't infinite. The Lost-in-the-Middle effect, the cost of long-context inference, and the latency of multi-turn reasoning over 1M tokens all push back. Curated slices outperform raw dumps even when both fit in the context window — because the model spends its reasoning budget on the right events instead of filtering noise.
Long context is a tool for cases where you genuinely don't know which events matter. Once you do — or once you have a graph that can compute it — slicing wins.
The full pattern (event schema, causal edge capture, slicing strategies, and the failure modes we cataloged) is in the Temporal Reasoning Sleuth skill — a Claude Code skill that engineers temporal reasoning so agents can trace decision chains and reconstruct causal sequences.
The team in the postmortem ran the same question again, this time against the curated causal slice. Twenty events came back, in order, with explicit causal edges. The exec asked one follow-up question — "why did we choose this over the rollback path?" — and got an answer that referenced two earlier events the team had forgotten about.
That's what answering "how did we get here" actually looks like.
Frequently asked questions
Why can't I just sort the retrieved chunks by date?
Does this require a graph database or can I do it in Postgres?
How do I capture causal edges if my team isn't doing it now?
Related skill
Turn this guide into a skill your agent can run
Stop re-explaining the same workflow. Loreto packages it as a Claude Code skill from any source.