<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Revaldo</title>
    <description>The latest articles on DEV Community by Revaldo (@revaldo143).</description>
    <link>https://dev.to/revaldo143</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4191862%2F692adf2b-1430-4c3d-b3cc-9f4fdc97722d.jpg</url>
      <title>DEV Community: Revaldo</title>
      <link>https://dev.to/revaldo143</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/revaldo143"/>
    <language>en</language>
    <item>
      <title>My AI agent remembers *when* it believed things — valid-time memory on FalkorDB</title>
      <dc:creator>Revaldo</dc:creator>
      <pubDate>Sun, 18 Oct 2026 10:50:27 +0000</pubDate>
      <link>https://dev.to/revaldo143/my-ai-agent-remembers-when-it-believed-things-valid-time-memory-on-falkordb-3i08</link>
      <guid>https://dev.to/revaldo143/my-ai-agent-remembers-when-it-believed-things-valid-time-memory-on-falkordb-3i08</guid>
      <description>&lt;p&gt;My AI agent remembers when it believed things — valid-time memory on FalkorDB&lt;br&gt;
Built for Graph Hacks: Context for AI Agents (WeMakeDevs × FalkorDB), Track 2 — Agent Memory and Coordination.&lt;br&gt;
🎬 &lt;a href="https://youtu.be/c7qPwxheOiw" rel="noopener noreferrer"&gt;Demo video (2:13)&lt;/a&gt; · 💻 &lt;a href="https://github.com/Revaldo143/time-machine" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem: agents can't answer "what did you believe last Tuesday?"&lt;br&gt;
AI agents forget. Worse — when they change their mind, the old belief is gone.&lt;br&gt;
Ask any agent what it believed last Tuesday and you get a shrug. Vector memory stores what's similar. It can't store what was true when. Embeddings have no time axis, so "what did I believe on October 8th?" is a question no similarity search can answer.&lt;br&gt;
This isn't a cosmetic gap. When an agent takes an action based on a belief it later revised, you need to audit the belief it held at that time — not the one it holds now. Incident response, customer-facing decisions, anything with a paper trail: "why did you do that?" only makes sense as "what did you believe then?"&lt;br&gt;
The idea: put a validity interval on every belief&lt;br&gt;
TimeMachine stores agent memory as a graph in FalkorDB where every belief edge carries a validity interval:&lt;br&gt;
(:Agent)-[:BELIEVES {valid_from, valid_to}]-&amp;gt;(:Claim)-[:ABOUT]-&amp;gt;(:Topic)&lt;br&gt;
(:Claim)-[:SUPPORTED_BY {valid_from, valid_to}]-&amp;gt;(:Evidence)&lt;br&gt;
When the agent changes its mind, the old BELIEVES edge is closed (valid_to gets set) — never deleted. An as-of query filters edges to those valid at time T:&lt;br&gt;
MATCH (t:Topic {name: $topic})&amp;lt;-[:ABOUT]-(c:Claim)&amp;lt;-[b:BELIEVES]-(a:Agent)&lt;br&gt;
WHERE b.valid_from &amp;lt;= $as_of AND (b.valid_to IS NULL OR b.valid_to &amp;gt; $as_of)&lt;br&gt;
RETURN c.text AS belief, b.valid_from AS since&lt;br&gt;
That one query reconstructs the exact belief state the agent held at any moment in its past. The graph is a complete audit trail: every belief, every piece of evidence behind it, every change of mind — queryable at any timestamp.&lt;br&gt;
This is the valid-time temporal pattern from temporal-memory research (Zep/Graphiti-style work), implemented natively in Cypher rather than bolted onto a vector store.&lt;br&gt;
The demo: one outage, three truths&lt;br&gt;
I seeded a fictional 2-week incident — a checkout outage — as the demo dataset:&lt;br&gt;
Date&lt;br&gt;
Evidence lands&lt;br&gt;
Agent's belief&lt;br&gt;
Oct 4&lt;br&gt;
Cache hit rate 95% → 40%&lt;br&gt;
Cache misconfiguration&lt;br&gt;
Oct 7&lt;br&gt;
DB pool exhausted, 500 waiters&lt;br&gt;
Connection pool exhaustion&lt;br&gt;
Oct 10&lt;br&gt;
Deploy v2.4 halved pool 100 → 50&lt;br&gt;
Bad deploy v2.4&lt;br&gt;
Oct 14&lt;br&gt;
Traffic spiked 3× during sale&lt;br&gt;
Traffic spike overwhelmed the pool&lt;br&gt;
Same question, three different true answers — depending on when you ask:&lt;br&gt;
agent.ask("What caused the checkout outage?")                        # → traffic spike (today)&lt;br&gt;
agent.ask("What caused the checkout outage?", as_of="2026-10-08")    # → connection pool exhaustion&lt;br&gt;
agent.ask("What caused the checkout outage?", as_of="2026-10-05")    # → cache misconfiguration&lt;br&gt;
agent.why_changed("checkout-outage", "2026-10-10")                   # → deploy v2.4 halved the pool — PR #2214&lt;br&gt;
agent.timeline("checkout-outage")                                    # full belief history&lt;br&gt;
The twist: counterfactual time travel&lt;br&gt;
Here's the part I'm proudest of. Agents get asked "what if?" questions all the time, and they usually hallucinate the answer. TimeMachine answers them honestly — by forking reality.&lt;br&gt;
what_if() uses FalkorDB's multi-graph support to fork the belief graph, remove one piece of evidence, and recompute what the agent would believe in that alternate timeline:&lt;br&gt;
agent.ask("What if the traffic report never existed?")&lt;/p&gt;

&lt;h1&gt;
  
  
  In reality I believe: "traffic spike overwhelmed the pool" (since Oct 14).
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Without the evidence "traffic spiked 3× during sale" (cloudwatch: traffic report),
&lt;/h1&gt;

&lt;h1&gt;
  
  
  I would instead believe: "bad deploy v2.4" (since Oct 10).
&lt;/h1&gt;

&lt;p&gt;Same agent, same graph — a different past, a different truth. The fork happens in its own graph (timemachine_whatif), so the real belief history is untouched.&lt;br&gt;
Why FalkorDB — the decoration test&lt;br&gt;
One rule shaped this project: if the product still works once FalkorDB is taken out, the graph is decoration. So I made sure everything would stop working without it:&lt;br&gt;
A vector DB fundamentally cannot answer as-of questions — embeddings have no time axis. Valid-time filtering needs real graph traversal.&lt;br&gt;
As-of reconstruction has to run at in-memory speed inside the agent loop, not as an offline batch job.&lt;br&gt;
Counterfactual forks need native multi-graph support — clone the belief state, delete one evidence, recompute.&lt;br&gt;
Remove FalkorDB and this product dies. That's the point.&lt;br&gt;
Honest limitations&lt;br&gt;
This is a hackathon prototype, and the honest version is:&lt;br&gt;
The dataset is fictional. A real deployment needs ingestion from actual incident tooling, not a seeded timeline.&lt;br&gt;
The what-if is a replay, not a causal model. It re-runs the timeline minus one evidence; it doesn't model why beliefs changed, only when.&lt;br&gt;
Valid-time only, not bitemporal. I track when a belief was true, not when the agent learned it. Real systems will want both axes.&lt;br&gt;
The natural-language front end uses templates with optional LLM polish — it's a thin layer over the Cypher queries, which are the actual product.&lt;br&gt;
What's next&lt;br&gt;
Bitemporal memory (valid time × transaction time), belief confidence decay, and multi-agent shared memory where forks let teams explore "what if we had seen that evidence?" collaboratively.&lt;/p&gt;

&lt;p&gt;TimeMachine: memory with a past tense. Track 2 — Agent Memory and Coordination, Graph Hacks 2026.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>graphdatabase</category>
      <category>falkordb</category>
    </item>
  </channel>
</rss>
