<?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: SAIF MODAN</title>
    <description>The latest articles on DEV Community by SAIF MODAN (@saif_modan).</description>
    <link>https://dev.to/saif_modan</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%2F4020702%2F4fc6b3b1-88e5-494a-af8c-4ccf271ba1f2.jpg</url>
      <title>DEV Community: SAIF MODAN</title>
      <link>https://dev.to/saif_modan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saif_modan"/>
    <language>en</language>
    <item>
      <title>Building AgentTrace: How I Made AI Agents Remember, Recover, and Resume with FalkorDB</title>
      <dc:creator>SAIF MODAN</dc:creator>
      <pubDate>Sun, 18 Oct 2026 14:33:43 +0000</pubDate>
      <link>https://dev.to/saif_modan/building-agenttrace-how-i-made-ai-agents-remember-recover-and-resume-with-falkordb-1md3</link>
      <guid>https://dev.to/saif_modan/building-agenttrace-how-i-made-ai-agents-remember-recover-and-resume-with-falkordb-1md3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6uf16xiobxd9b7iuj0tw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6uf16xiobxd9b7iuj0tw.jpg" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI agents are getting better at planning, writing code, and using tools. But there is still a frustrating problem: &lt;strong&gt;what happens when an agent forgets what it has already done?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine an AI agent working on a software project. It analyzes the source code, runs tests, encounters an error, and starts fixing it. Then its process crashes.&lt;/p&gt;

&lt;p&gt;When the agent restarts, several questions appear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which tasks were completed?&lt;/li&gt;
&lt;li&gt;Which actions failed?&lt;/li&gt;
&lt;li&gt;What caused the failure?&lt;/li&gt;
&lt;li&gt;Which dependencies are still blocked?&lt;/li&gt;
&lt;li&gt;Is it safe to retry an interrupted operation?&lt;/li&gt;
&lt;li&gt;How can another agent continue the work without starting from scratch?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A traditional conversation history or a simple task list isn't enough to answer all these questions reliably.&lt;/p&gt;

&lt;p&gt;That is the problem behind &lt;strong&gt;AgentTrace&lt;/strong&gt;, a graph-native execution-memory and coordination system built with FalkorDB for the WeMakeDevs × FalkorDB Graph Hacks 2026 hackathon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub repository:&lt;/strong&gt; &lt;a href="https://github.com/saifmodan2006/agenttrace" rel="noopener noreferrer"&gt;AgentTrace — Open Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Idea: Give Agents an Execution Memory
&lt;/h2&gt;

&lt;p&gt;Instead of depending entirely on the LLM's context window, AgentTrace records execution state inside a persistent graph.&lt;/p&gt;

&lt;p&gt;The graph stores tasks, dependencies, attempts, failures, recovery procedures, decisions, verification results, and checkpoints.&lt;/p&gt;

&lt;p&gt;More importantly, these are not just historical logs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The relationships actively determine what the agent can do next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent can ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What steps are ready to execute?&lt;/li&gt;
&lt;li&gt;What is preventing this task from running?&lt;/li&gt;
&lt;li&gt;Which earlier failure is relevant?&lt;/li&gt;
&lt;li&gt;What approved recovery procedure applies?&lt;/li&gt;
&lt;li&gt;What work was already verified before the process stopped?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FalkorDB answers these questions through graph queries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3uhj7x6luyfxv0akb4zv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3uhj7x6luyfxv0akb4zv.png" alt="AgentTrace Dashboard" width="800" height="865"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a Graph Database?
&lt;/h2&gt;

&lt;p&gt;An agent workflow naturally contains relationships.&lt;/p&gt;

&lt;p&gt;Consider a simple task sequence:&lt;/p&gt;

&lt;p&gt;Inspect Application → Run Tests → Build Application → Inspect Artifact&lt;/p&gt;

&lt;p&gt;The build must not execute if the tests have not passed.&lt;/p&gt;

&lt;p&gt;When the tests fail, a recovery action might need to be inserted as a new dependency.&lt;/p&gt;

&lt;p&gt;These connections are important. They should not exist only inside an LLM-generated plan.&lt;/p&gt;

&lt;p&gt;In AgentTrace, a task points toward its prerequisites through a &lt;code&gt;DEPENDS_ON&lt;/code&gt; relationship.&lt;/p&gt;

&lt;p&gt;The execution graph includes twelve node labels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Node&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AgentRun&lt;/td&gt;
&lt;td&gt;Overall execution goal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step&lt;/td&gt;
&lt;td&gt;Planned actions and dependencies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attempt&lt;/td&gt;
&lt;td&gt;Individual tool executions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent&lt;/td&gt;
&lt;td&gt;Planner, executor, verifier, and recovery workers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;td&gt;Execution history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure&lt;/td&gt;
&lt;td&gt;Recorded errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Procedure&lt;/td&gt;
&lt;td&gt;Reusable recovery knowledge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fact&lt;/td&gt;
&lt;td&gt;Facts learned during execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Artifact&lt;/td&gt;
&lt;td&gt;Generated files and outputs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decision&lt;/td&gt;
&lt;td&gt;Actions and supporting evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Checkpoint&lt;/td&gt;
&lt;td&gt;Persistent progress snapshots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resource&lt;/td&gt;
&lt;td&gt;Files and workspaces&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This graph becomes the shared execution state for the entire system.&lt;/p&gt;

&lt;h2&gt;
  
  
  How AgentTrace Works
&lt;/h2&gt;

&lt;p&gt;The architecture combines a React dashboard, a FastAPI backend, and FalkorDB.&lt;/p&gt;

&lt;p&gt;There are four cooperating agent roles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Planner&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creates a validated task plan with dependencies and expected outcomes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Executor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Selects eligible tasks, claims them, runs registered tools, and records actual results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Verifier&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Independently checks whether a task achieved its expected result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Recovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Investigates failures, retrieves supporting graph evidence, and introduces approved corrective actions.&lt;/p&gt;

&lt;p&gt;All four roles work against the same graph-backed memory manager.&lt;/p&gt;

&lt;p&gt;The important distinction is that a worker cannot simply choose any pending task.&lt;/p&gt;

&lt;p&gt;It must first consult the dependency graph.&lt;/p&gt;

&lt;h3&gt;
  
  
  Graph-driven scheduling
&lt;/h3&gt;

&lt;p&gt;A simplified version of the readiness query looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cypher"&gt;&lt;code&gt;&lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;r:&lt;/span&gt;&lt;span class="n"&gt;AgentRun&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt;&lt;span class="n"&gt;$run&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:HAS_STEP&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;s:&lt;/span&gt;&lt;span class="n"&gt;Step&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;OPTIONAL&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:DEPENDS_ON&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;d:&lt;/span&gt;&lt;span class="n"&gt;Step&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;deps&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;r.status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'running'&lt;/span&gt;
  &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;s.status&lt;/span&gt; &lt;span class="ow"&gt;IN&lt;/span&gt; &lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'pending'&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ready'&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'retryable'&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;
  &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;s.retry_after_ms&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;$now&lt;/span&gt;
  &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;s.attempt_count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;s.max_attempts&lt;/span&gt;
  &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;deps&lt;/span&gt;
    &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;d.status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'succeeded'&lt;/span&gt;
    &lt;span class="ow"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;d.verification_status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'passed'&lt;/span&gt;
  &lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deps&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;s.priority&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The production implementation adds lease and resource checks.&lt;/p&gt;

&lt;p&gt;The actual claim repeats eligibility checks inside an atomic graph write, creates an execution attempt, and records ownership information.&lt;/p&gt;

&lt;p&gt;This helps prevent two workers from claiming the same task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FalkorDB is not merely storing the workflow. It helps enforce the workflow.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Demo: An Agent Encounters a Real Failure
&lt;/h2&gt;

&lt;p&gt;To demonstrate AgentTrace, the project includes a controlled Python calculator application.&lt;/p&gt;

&lt;p&gt;The calculator contains a deliberately broken addition function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected behavior is addition, but the function subtracts.&lt;/p&gt;

&lt;p&gt;The executor runs real Python unit tests against this source.&lt;/p&gt;

&lt;p&gt;The tests fail.&lt;/p&gt;

&lt;p&gt;Rather than discarding that result, AgentTrace records the unsuccessful execution as an Attempt, together with its error evidence.&lt;/p&gt;

&lt;p&gt;The recovery component investigates the failure and checks whether it matches a supported, approved correction.&lt;/p&gt;

&lt;p&gt;In the demonstration, the failure is recognized as an addition defect.&lt;/p&gt;

&lt;p&gt;AgentTrace introduces a new repair task that changes the function to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But there is an important detail.&lt;/p&gt;

&lt;p&gt;The failed test step now depends on the repair step.&lt;/p&gt;

&lt;p&gt;The graph prevents the test from proceeding before the correction is applied and verified.&lt;/p&gt;

&lt;p&gt;This is where graph-based execution memory becomes useful: recovery actually changes the workflow's dependency structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verification matters
&lt;/h3&gt;

&lt;p&gt;After the repair, the tests run again.&lt;/p&gt;

&lt;p&gt;The verifier independently checks the result rather than trusting a tool's success message.&lt;/p&gt;

&lt;p&gt;The graph retains both the original failure and the successful attempt.&lt;/p&gt;

&lt;p&gt;The process also produces a checked build artifact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft6p4qid8f4yvqqzxogsh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft6p4qid8f4yvqqzxogsh.png" alt="AgentTrace Execution Graph and Evidence" width="800" height="1194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The original failure is not erased just because the workflow eventually succeeds.&lt;/p&gt;

&lt;p&gt;It remains part of the agent's execution memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Decisions Explainable
&lt;/h2&gt;

&lt;p&gt;Another goal was to make agent actions traceable.&lt;/p&gt;

&lt;p&gt;For example, why did the recovery component choose a particular repair?&lt;/p&gt;

&lt;p&gt;AgentTrace stores Decision nodes linked to relevant evidence, including Failure and Procedure nodes.&lt;/p&gt;

&lt;p&gt;A decision can therefore be investigated through the graph.&lt;/p&gt;

&lt;p&gt;A simplified evidence query is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cypher"&gt;&lt;code&gt;&lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;d:&lt;/span&gt;&lt;span class="n"&gt;Decision&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt;&lt;span class="n"&gt;$id&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;OPTIONAL&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="py"&gt;r:&lt;/span&gt;&lt;span class="n"&gt;BASED_ON&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="ss"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dashboard uses this information to show the relationships supporting a decision.&lt;/p&gt;

&lt;p&gt;This is different from asking an LLM to invent an explanation after executing an action.&lt;/p&gt;

&lt;p&gt;The evidence is associated with the decision when it is recorded.&lt;/p&gt;

&lt;p&gt;AgentTrace also implements multi-hop dependency impact analysis.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cypher"&gt;&lt;code&gt;&lt;span class="k"&gt;MATCH&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;affected:&lt;/span&gt;&lt;span class="n"&gt;Step&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ss"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;:DEPENDS_ON&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="ss"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
  &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="py"&gt;failed:&lt;/span&gt;&lt;span class="n"&gt;Step&lt;/span&gt; &lt;span class="ss"&gt;{&lt;/span&gt;&lt;span class="py"&gt;id:&lt;/span&gt;&lt;span class="n"&gt;$id&lt;/span&gt;&lt;span class="ss"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="n"&gt;affected&lt;/span&gt;&lt;span class="ss"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;nodes&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query identifies downstream tasks that depend on a particular step.&lt;/p&gt;

&lt;p&gt;It helps answer questions like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"If this task fails, which other tasks are affected?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Which independent tasks can still proceed safely?"&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens When the Agent Crashes?
&lt;/h2&gt;

&lt;p&gt;An execution-memory system should not depend on an uninterrupted process.&lt;/p&gt;

&lt;p&gt;AgentTrace uses persistent graph state, execution attempts, leases, and reconciliation logic to support resuming interrupted work.&lt;/p&gt;

&lt;p&gt;The repository includes a real worker-restart integration test.&lt;/p&gt;

&lt;p&gt;The test:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Executes and verifies an initial task.&lt;/li&gt;
&lt;li&gt;Starts a separate worker process.&lt;/li&gt;
&lt;li&gt;Allows that worker to claim another task.&lt;/li&gt;
&lt;li&gt;Terminates the worker process.&lt;/li&gt;
&lt;li&gt;Waits for the execution lease to expire.&lt;/li&gt;
&lt;li&gt;Starts a new worker.&lt;/li&gt;
&lt;li&gt;Checks that execution can continue.&lt;/li&gt;
&lt;li&gt;Confirms that previously completed work was not repeated unnecessarily.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The distinction between an interrupted action and a failed action matters.&lt;/p&gt;

&lt;p&gt;An interrupted read or test operation may be safe to retry.&lt;/p&gt;

&lt;p&gt;An external action with an uncertain outcome might not be.&lt;/p&gt;

&lt;p&gt;The system therefore performs reconciliation instead of blindly replaying every interrupted tool call.&lt;/p&gt;

&lt;p&gt;This demonstration covers a specific controlled interruption point, not every possible crash scenario.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real Challenge: FalkorDB Persistence
&lt;/h2&gt;

&lt;p&gt;One of the most interesting issues encountered during development was database durability.&lt;/p&gt;

&lt;p&gt;During testing, the chosen FalkorDB container image experienced a segmentation fault while replaying an AOF graph-effect record involving a constraint.&lt;/p&gt;

&lt;p&gt;This was observed with the pinned image used by AgentTrace; it is not a claim that every FalkorDB version has the same issue.&lt;/p&gt;

&lt;p&gt;The implementation was adjusted to use RDB snapshot persistence with synchronous checkpoint saves.&lt;/p&gt;

&lt;p&gt;Container stop, restart, and replacement tests subsequently passed with the persistent volume configuration.&lt;/p&gt;

&lt;p&gt;However, the tradeoff is important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RDB snapshots do not guarantee that every recent write survives an abrupt database or host failure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project explicitly documents this limitation rather than claiming perfect durability.&lt;/p&gt;

&lt;p&gt;The complete details are available in the &lt;a href="https://github.com/saifmodan2006/agenttrace/blob/main/docs/recovery-design.md" rel="noopener noreferrer"&gt;recovery design documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This experience reinforced an important lesson: persistent agent memory requires thinking about database recovery, not just application-level checkpoints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing and Validation
&lt;/h2&gt;

&lt;p&gt;AgentTrace was tested locally using real FalkorDB instances, backend tests, browser automation, and a controlled end-to-end demonstration.&lt;/p&gt;

&lt;p&gt;The recorded validation results were:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Validation&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Backend tests&lt;/td&gt;
&lt;td&gt;30 passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser tests&lt;/td&gt;
&lt;td&gt;3 passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend production build&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Python lint&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend lint&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker Compose validation&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worker crash/restart test&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database restart/replacement test&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The implementation also tested concurrent task claims, lease expiry, stale-result rejection, dependency traversal, tenant isolation, and graph-backed event replay.&lt;/p&gt;

&lt;p&gt;Representative local query measurements were:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Query&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Run lookup&lt;/td&gt;
&lt;td&gt;3.232 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Step lookup&lt;/td&gt;
&lt;td&gt;3.013 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Readiness traversal&lt;/td&gt;
&lt;td&gt;5.466 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-hop dependency traversal&lt;/td&gt;
&lt;td&gt;8.778 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These measurements came from small synthetic graphs in the local development environment, with client and network overhead included. They should not be interpreted as production-scale benchmarks.&lt;/p&gt;

&lt;p&gt;The detailed report is available in &lt;a href="https://github.com/saifmodan2006/agenttrace/blob/main/docs/validation.md" rel="noopener noreferrer"&gt;validation.md&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Building AgentTrace highlighted several important lessons about reliable AI-agent systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory should influence execution
&lt;/h3&gt;

&lt;p&gt;Storing conversation history is useful, but operational memory becomes more valuable when it helps determine which actions are safe and which dependencies remain unresolved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Failure is useful information
&lt;/h3&gt;

&lt;p&gt;A failed attempt contains evidence about the state of the system.&lt;/p&gt;

&lt;p&gt;Preserving that evidence allows the agent to investigate problems instead of repeatedly starting from incomplete context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verification and execution are different responsibilities
&lt;/h3&gt;

&lt;p&gt;A command finishing does not automatically mean a task has achieved its intended objective.&lt;/p&gt;

&lt;p&gt;Independent verification makes execution records more trustworthy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recovery is more than retrying
&lt;/h3&gt;

&lt;p&gt;Retrying an unsuccessful action without examining the cause can repeat the same failure or duplicate an external side effect.&lt;/p&gt;

&lt;p&gt;Graph-backed recovery can introduce new prerequisites and preserve the reasoning behind corrective actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Durability needs to be tested
&lt;/h3&gt;

&lt;p&gt;A system that survives a worker restart is not necessarily protected against every form of database or host failure.&lt;/p&gt;

&lt;p&gt;These are different reliability problems that require different tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current Limitations and What's Next
&lt;/h2&gt;

&lt;p&gt;AgentTrace is a working hackathon implementation, but it is not yet a general-purpose production agent platform.&lt;/p&gt;

&lt;p&gt;The current demonstration uses a deterministic plan and supports one controlled recovery scenario.&lt;/p&gt;

&lt;p&gt;Optional planning through an OpenAI-compatible model endpoint exists, but live-model behavior was not validated in the published local test report.&lt;/p&gt;

&lt;p&gt;The execution environment uses restricted tools but is not a hardened operating-system sandbox for arbitrary untrusted code.&lt;/p&gt;

&lt;p&gt;The system also does not yet provide automatic revalidation of every downstream result when a previous verification becomes stale.&lt;/p&gt;

&lt;p&gt;Future development could explore broader recovery procedures, more sophisticated memory retrieval, live-model evaluation, and stronger durability guarantees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built with FalkorDB
&lt;/h2&gt;

&lt;p&gt;AgentTrace demonstrates how a graph database can provide more than connected data storage.&lt;/p&gt;

&lt;p&gt;FalkorDB powers task dependencies, execution eligibility, failure relationships, coordination, memory retrieval, and recovery evidence.&lt;/p&gt;

&lt;p&gt;Without those graph operations, the central workflow cannot function in the same way.&lt;/p&gt;

&lt;p&gt;For this project, the most important idea is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An AI agent should not only remember what it said. It should remember what it did, what actually happened, why something failed, and what evidence supports its next action.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the foundation AgentTrace explores.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explore the Project
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/saifmodan2006/agenttrace" rel="noopener noreferrer"&gt;https://github.com/saifmodan2006/agenttrace&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Graph schema:&lt;/strong&gt; &lt;a href="https://github.com/saifmodan2006/agenttrace/blob/main/docs/graph-schema.md" rel="noopener noreferrer"&gt;https://github.com/saifmodan2006/agenttrace/blob/main/docs/graph-schema.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cypher queries:&lt;/strong&gt; &lt;a href="https://github.com/saifmodan2006/agenttrace/blob/main/docs/cypher-queries.md" rel="noopener noreferrer"&gt;https://github.com/saifmodan2006/agenttrace/blob/main/docs/cypher-queries.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local demo setup:&lt;/strong&gt; &lt;a href="https://github.com/saifmodan2006/agenttrace/blob/main/docs/demo-guide.md" rel="noopener noreferrer"&gt;https://github.com/saifmodan2006/agenttrace/blob/main/docs/demo-guide.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AgentTrace was developed with AI coding assistance, including OpenAI Codex. The implementation, automated validation, and assistance disclosure are documented in the public repository.&lt;/p&gt;

&lt;p&gt;This project was created for the &lt;strong&gt;WeMakeDevs × FalkorDB Graph Hacks 2026 Hackathon&lt;/strong&gt;, primarily under the Agent Memory and Coordination track, with additional graph-driven capabilities relevant to Agents That Act on Connected Data.&lt;/p&gt;

&lt;p&gt;If you are working on long-running AI agents or multi-agent workflows, I would be interested in hearing how you handle execution memory, failures, and recovery.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>falkordb</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
