Skip to content
New

Introducing Scale: SurrealDB Cloud for high availability and scale

Learn more

1/4

Agent memory needs three clocks: tri-temporal belief history in Spectron

Engineering

Aug 4, 20266 min read

Dave MacLeod

Dave MacLeod

Show all posts

Agent memory needs three clocks: tri-temporal belief history in Spectron

Our newsletter

Get tutorials, AI agent recipes, webinars, and early product updates in your inbox every two weeks

Agent memory needs more than one clock

Most AI memory systems behave as if there is only one kind of time: now.

While fine for a chat log you never revisit, it is a poor model of how people (and good agents) actually remember. Facts actually have a number of temporal characteristics, which we can see if we take the fact "Ottawa is the capital of Canada".

  • When was it true in the world? For Ottawa, this was 1857.

  • When was it written into a database? That could be any time.

  • When was it believed by a particular mind? This could also vary, and could include a previously incorrect belief (e.g. those that assume Toronto is Canada's capital because it is the largest city)

Spectron treats those as three different clocks.

This post is a short tour of that idea. A follow-up will show the same machinery on real test data from Aeon's Surreal Renaissance, SurrealDB University's course book based on a story that takes place centuries in the future.

Let's take Napoleon as the next example as we learn the names of the terms Spectron uses to work with time.

Valid time is when something held in the world. Napoleon became Emperor of the French in 1804, a status that later ended. Spectron keeps both intervals, bby closing the old fact with with a valid_until, not erased. You can ask what was true as of certain dates, such as in 1816 when this would be superseded by something like "French general in exile".

System time (ingest time, for most practical purposes) is when the information hits the database. You might upload a biography on a Tuesday in 2026, which is given this stamp that ops and audit most care about. It answers: what did the store contain at wall-clock instant T?

Known time is when a mind first held the belief. Imagine a user who hears “Napoleon,” thinks of Neapolitan ice cream, and stores something like “Napoleon is a kind of ice cream.” Later the user learns that he was emperor of France. Spectron does not overwrite the mistake into oblivion. The correction supersedes the earlier belief. The learning moment is known time, which isnot 1804, and doesn't need to be the Tuesday you ran the import either.

Humans juggle these without thinking, whereas agents that only keep “latest chunk wins” collapse them into one blurry present. Spectron's tri-temporal model allows these to emulate human memory as close as possible, allowing agents that use Spectron as their memory layer to avoid frustrating overwrites or odd mashing together of important temporal data.

ClockQuestionNapoleon sketch
Valid timeWhen was this true?Emperor from 1804 until that status ended
System / ingest timeWhen did we store the data?Biography upload on Tuesday
Known timeWhen did we first believe it?Ice cream → emperor correction

In practice, known time will often equal ingest time because you may learn a fact in conversation and Spectron records it as you speak. More interesting cases are when they diverge, such as replayed chats, backfilled documents, or stories you stamp onto a narrative calendar. That is where observed_at comes in, allowing you to tell Spectron when the mind should treat this as learned, not only when the HTTP request arrived.

On top of this temporal model comes one more filter, which allows you to avoid displaying knowledge that a user should not be aware of yet.

Valid time alone cannot keep a franchise spoiler-safe. The films, TV shows, or books already happened. The question for an agent is: how far has this viewer got?

This is also known time, but on a synthetic timeline.

Suppose you pick one watching order and ingest the first Star Wars films into a Context. Stamp each film with observedAt at its place on that order, then recall with asOf set to “I’ve finished film N.” This allows you to determine what this viewer was allowed to know then.

For Star Wars there are two common orders that each contain a spoiler in their own right:

  • Release order (4 → 5 → 6 → 1 → 2 → 3)

  • Chronological order (1 → 2 → 3 → 4 → 5 → 6)

(The 4 → 5 → 1 → 2 → 3 → 6 order is also highly recommended but that doesn't change the major spoilers you encounter using release order)

Let's look at how the major spoilers work with these two paths.

Release order
Through A New Hope, Luke’s father is a mystery. After The Empire Strikes Back, the agent may know the reveal. Prequel tragedy is still in the future for this viewer, who will not be surprised by Anakin's fall to the Dark Side in episode 3.

Chronological order
A viewer who has only finished the second movie has no knowledge of a character Darth Vader and will probably assume that Anakin remains a good guy throughout his life, so the end of Episode 3 is the major spoiler. Meanwhile, the reveal in The Empire Strikes Back will not be a reveal.

Those are two spoiler-free paths. A single stamp sequence cannot serve both at once: “Vader is Luke’s father” becomes safe at different steps depending on the track. Supporting both means two discovery calendars — for example two scope tracks (view/release vs view/chrono), or two Contexts — each with facts stamped for that order. You need not re-upload six movie files twice; you do need two known-time timelines of what the mind may learn when. Valid time (Anakin falls in Episode III in the story) stays the same; only the learning order forks.

asOf walks belief history: attributes and relations dated after that instant stay dark.

The same pattern works for novels, handbooks, support tickets, and compliance audits (“what did we believe when we acted?”). Star Wars just makes the fork in the timeline obvious.

Clocks are easier to trust when you can falsify them.

In the next post we take Aeon's Surreal Renaissance — the long SurrealDB University course-book — ingest dated story pages into a Context, and run the same questions as of earlier calendar dates. Tunnel contents, noble family trees, and city names stay hidden until their reveal. That write-up includes the checks we actually ran, so you can see asOf move the frontier rather than take the metaphor on faith.

If you already have Spectron early access in Surrealist, the mental model above is enough to start stamping your own corpus. The follow-up is the worked example.

Related posts

Our newsletter

Get tutorials, AI agent recipes, webinars, and early product updates in your inbox every two weeks

SurrealDB

The context layer for AI agents.

Documents, graphs, vectors, time-series, and memory.
One transaction, one query, one deployment.

Explore with AI

Stay in the loop

Tutorials, AI agent recipes, and product updates, every two weeks.

Independently verified

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

Trust Centre

Copyright © 2026 SurrealDB Ltd. Registered in England and Wales. Company no. 13615201

Registered address: 3rd Floor 1 Ashley Road, Altrincham, Cheshire, WA14 2DT, United Kingdom

Trading address: Huckletree Oxford Circus, 213 Oxford Street, London, W1D 2LG, United Kingdom