Why simple timestamps fail for episodic memory in AI agents
A plain `created_at` field gives an absolute time but misses the relational and duration cues that human episodic memory provides. Embedding a drifting temporal context, as suggested by the CLS framework, may be needed for true episodic recall.
Andrew's Take
I'm wrestling with this because my current AI memory pipelines still rely on simple timestamps, and I keep hitting dead ends when trying to ask the system "when did I first learn X" versus "when was X revised". The brain-inspired CLS perspective keeps nudging me toward a richer temporal signal, but I haven't figured out how to make a context vector both stable enough for retrieval and fluid enough to reflect elapsed time. I also don't know how to integrate such a vector into my transformer‑based long‑term memory without blowing up the parameter budget or breaking existing training pipelines.
Timestamps are not episodic memory
The problem I keep returning to is that a simple `created_at` field does not give an agent a genuine sense of *when* something happened in the way humans experience it. In most “AI memory” products the answer to “what happened?” is a document retrieval over a flat index, and the answer to “when?” is a literal timestamp. That conflates two very different kinds of knowledge. A timestamp tells you that an entry was written at 14:32 UTC on 2023‑05‑12, but it does not tell you that the entry was the *first* exposure to a concept, that it was *re‑interpreted* after a later conversation, or that it was *superseded* by a belief change. Those are the hallmarks of episodic memory: a mental time‑line that links events to the evolution of the agent’s internal model.
I have tried to treat timestamps as a proxy for temporal reasoning. The idea is to sort events by their recorded time and then ask “what was the most recent belief about X before Y?” In practice this fails on several fronts. First, timestamps are absolute, not relational. Human episodic memory is organized around *relative* relations,“the day before I met Alice”, “the moment I realized the hypothesis was wrong”. Second, a timestamp does not capture *duration* or *overlap*: an agent might hold a belief continuously across many interactions, but a series of discrete timestamps fragments that continuity. Third, timestamps do not survive the consolidation process that in the brain transforms a fleeting experience into a more abstract, schema‑like representation. If we simply store everything forever with a date, we have not solved memory; we have only postponed the problem of forgetting and integration.
What the brain does with time
The Complementary Learning Systems (CLS) framework (McClelland, McNaughton & O’Reilly, 1995) gives a concrete computational story of why a naïve timestamp approach is insufficient. In CLS, the hippocampus rapidly encodes a specific episode, preserving its contextual details, while the neocortex slowly extracts statistical regularities. Crucially, the hippocampal trace includes *temporal context*: a pattern of activity that changes gradually over the course of experience and serves as a cue for ordering events. When the hippocampal trace is replayed during offline consolidation, the temporal context is re‑instated, allowing the neocortex to learn not just *what* happened but *when* it happened relative to other experiences.
If I want an artificial agent to mirror this, I must ask how to embed a comparable temporal context into the fast‑learning subsystem. A raw timestamp is a scalar that does not change during replay; it cannot serve as a cue that varies across replays. Moreover, CLS predicts that the temporal context should be *noisy* and *drift* over time, which gives rise to graded recency effects. A deterministic timestamp cannot produce those graded effects.
From CLS to a design constraint
Treating CLS as a design constraint rather than a metaphor forces me to ask: what representation can be learned quickly, replayed with drift, and still support the inference “my belief changed after event E”? One candidate is a *temporal context vector* that evolves with each incoming experience. Each new episode would be stored together with the current context vector, and during replay the vector would be re‑generated by a recurrent process. The context vector would act as a high‑dimensional cue that encodes both order and approximate distance in time.
I have tried to sketch this idea on paper, but several problems appear immediately. First, the vector must be *stable enough* that the same episode can be retrieved later, yet *unstable enough* to reflect elapsed time. Finding the right balance is non‑trivial, and I have no principled way to set the drift rate without empirical data. Second, the vector must be *compressible* so that memory usage does not explode as the number of episodes grows. In the brain, the hippocampal representation is sparse; in a neural network the equivalent might be a low‑rank factorization, but that introduces additional hyper‑parameters. Third, the vector must be *interoperable* with the slow‑learning subsystem that builds a long‑term memory language model. The current long‑term memory language model I work with is a transformer‑based architecture that does not naturally accept a separate temporal context input.
Failed attempts at sequence tags
Before committing to a full context vector, I experimented with a simpler scheme: attaching a *sequence identifier* and a *position index* to each stored episode. The identifier increments each time a new interaction begins, and the position index counts steps within that interaction. Retrieval can then be conditioned on “the last episode before identifier N” or “the episode at position k in interaction M”. This feels like a cheap approximation to a temporal ordering.
In practice the scheme collapses when interactions overlap or when the agent interleaves multiple tasks. Real agents often handle several streams of input concurrently (e.g., a chat interface while monitoring sensor data). A single linear sequence cannot capture the branching structure of experience. Moreover, the position index does not encode *duration*: an episode that lasted minutes and one that lasted seconds receive the same index increment. If the agent later asks “how long did I think X before I revised it?”, the answer is unavailable. The approach also does not support replay with drift; replaying the same sequence would always reconstruct the exact same indices, offering no graded recency.
Speculative structures: relational time graphs
One direction that seems promising, though still speculative, is to treat episodes as nodes in a *temporal relation graph*. Edges would encode qualitative temporal relations such as “before”, “after”, “overlaps”, or “causes”. The graph could be constructed incrementally: when a new episode arrives, the system would infer its relations to existing nodes based on contextual cues (e.g., shared entities, linguistic markers of time, or the evolving temporal context vector). This would give the agent a structured way to answer “what did I believe before I learned Y?” by traversing the graph backward from node Y.
The graph approach aligns with the idea that the hippocampus stores a relational map of experiences. However, several open questions remain. How do we learn the edge types without supervision? Human episodic memory relies on a rich set of cues (spatial, emotional, narrative) that are not yet fully captured in language‑only agents. Also, the graph could become dense very quickly, raising concerns about scalability and retrieval speed. Finally, integrating the graph with a long‑term memory language model would require a mechanism to translate relational paths into conditioning signals for the transformer, which I have not yet designed.
What would count as evidence?
Because there is no accepted benchmark for “does an agent remember?”, I have to be explicit about what would convince me that a representation captures “when” in an episodic sense. First, the system must answer *relative* temporal queries that cannot be reduced to a simple timestamp comparison. For example: “Did I adopt belief B before I saw evidence E, and did my confidence change after seeing evidence F?” The answer must reference the specific episodes that support the inference, not just the dates of their storage.
Second, the system must exhibit *graded recency* in retrieval. If two episodes are close together in the experience stream, the agent should be more likely to retrieve one when cued by the other, mirroring the forward and backward associations observed in hippocampal replay. This could be probed by presenting partial cues and measuring retrieval likelihood as a function of intervening experience length. I have not yet built a probe for this, but it would be a concrete test of whether a temporal context vector or a relational graph is doing anything beyond a flat index.
Third, the representation must survive *consolidation* while still supporting temporal queries. After a period of offline replay, the system should be able to answer the same temporal questions without direct access to the original fast‑learning store. This would demonstrate that the slow‑learning subsystem has internalized the temporal structure, not just the factual content. Again, I lack a concrete experimental protocol, but I can imagine a two‑phase evaluation: store episodes, run a consolidation routine, then query.
Next steps: building a testbed
To move beyond speculation I need a concrete testbed that isolates the temporal reasoning problem. My tentative plan is to construct a synthetic interaction environment where an agent receives a sequence of statements, each paired with a *ground‑truth temporal relation* (e.g., “A before B”, “A overlaps B”). The agent’s fast store will be a simple key‑value memory augmented with either a temporal context vector or a relational graph module. I will then define a set of probe queries that require chaining multiple relations (e.g., “Is A before C given A before B and B before C?”). The probes will be designed such that a timestamp‑only system cannot succeed, because the timestamps will be shuffled randomly after storage.
I will also implement a replay schedule that mimics hippocampal replay: random interleaved sampling of stored episodes, with the temporal context vector updated during each replay step. This will let me observe whether the slow‑learning component (a small transformer that predicts the next token given the current context) begins to encode the relational information. The key measurement will be the probe accuracy before and after replay, and the degree to which the accuracy degrades as I increase the number of intervening episodes.
If the temporal context vector approach fails to support the probe queries, I will pivot to the relational graph and explore hybrid solutions (e.g., using the graph to generate conditioning embeddings for the transformer). In either case, I will need to develop a metric for *temporal fidelity*: the proportion of correct relative‑time answers out of all probes. This metric will be the first concrete benchmark I have for “when” in episodic memory.
The ultimate test will be to replace the synthetic environment with a more realistic multi‑modal stream (e.g., a chat log interleaved with sensor readings) and see whether the same mechanisms scale. Until I have a working prototype and a set of probes that discriminate between timestamp, context‑vector, and graph representations, I cannot claim to have solved the problem of representing *when* something happened. The open question remains, and the next concrete step is to build the testbed described above.
Raw timestamps are absolute and cannot express relational ordering, duration, or the evolution of beliefs that characterize episodic memory.
The Complementary Learning Systems (CLS) model shows that hippocampal traces include a drifting temporal context that supports ordering and graded recency.
A temporal context vector that evolves with each episode could encode order and distance, but balancing stability for retrieval with instability for drift is non‑trivial.
Sequence identifiers with position indexes collapse when interactions overlap, lack duration information, and cannot support replay with drift.
A speculative relational time graph could store qualitative relations (before, after, overlaps) between episodes, offering a more flexible temporal representation.
Contextual insights from this article
Andrew Metcalf
Builder of AI systems that create, protect, and explore memory. Founder of Ajax Studio and VoiceGuard AI, author of Last Ascension.