<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="agent-memory-lifecycle-3e76f14c" name="Agent memory — lifecycle">
    <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <object id="1" label="Agent memory — lifecycle" schemaVersion="1" diagramId="agent-memory-lifecycle-3e76f14c" canonicalAppearanceKey="tsx:src/app/(docs)/docs/concepts/agent-memory/page.tsx:lifecycleChart#1" sourceSha256="3e76f14ca31f7d662731c42b83490b997e0bf60de0b4d1a9fe6ab85e1914a1d5" metadataPayloadSha256="227b97db99258e550fab56325dd2dfc87c3b7a9540aaa1aaaa280b7338012401" generationKey="fac3d4a1c0f27b08fe01780906f50e6e28db1fc6a500ca4f212349ca6a631db0" concepts="[&quot;Agent memory&quot;,&quot;Lifecycle&quot;]" keywords="[&quot;kb_memory.recall (load per-agent memory)&quot;,&quot;kb_memory.remember (persist a durable fact)&quot;,&quot;kb_memory.forget (retract)&quot;,&quot;reason + call tools&quot;,&quot;token budget exceeded?&quot;,&quot;summarize older turns, keep facts&quot;,&quot;memory persists to next run&quot;]" application="{&quot;name&quot;:&quot;eli-ai&quot;,&quot;version&quot;:&quot;0.1.0&quot;}" packages="{&quot;mermaid&quot;:&quot;11.16.0&quot;,&quot;mermaidCli&quot;:&quot;11.16.0&quot;,&quot;playwright&quot;:&quot;1.62.1&quot;,&quot;playwrightCore&quot;:&quot;1.62.1&quot;,&quot;puppeteer&quot;:&quot;25.6.0&quot;,&quot;puppeteerCore&quot;:&quot;25.6.0&quot;}" environment="{&quot;architecture&quot;:&quot;x64&quot;,&quot;containerImage&quot;:&quot;playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109&quot;,&quot;node&quot;:&quot;v26.3.1&quot;,&quot;platform&quot;:&quot;linux&quot;,&quot;yarn&quot;:&quot;4.17.1&quot;}" renderer="{&quot;browser&quot;:{&quot;executableSha256&quot;:&quot;0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71&quot;,&quot;name&quot;:&quot;chromium&quot;,&quot;revision&quot;:&quot;1234&quot;,&quot;version&quot;:&quot;151.0.7922.34&quot;},&quot;font&quot;:{&quot;family&quot;:&quot;Eli Diagram Inter Variable&quot;,&quot;fileSha256&quot;:&quot;3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62&quot;,&quot;licenseSha256&quot;:&quot;3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345&quot;},&quot;mermaidConfigSha256&quot;:&quot;68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101&quot;,&quot;themeCssSha256&quot;:&quot;c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033&quot;}" adapterVersions="{&quot;diagramGenerator&quot;:&quot;2&quot;,&quot;drawioFlowchart&quot;:&quot;1&quot;,&quot;drawioGantt&quot;:&quot;1&quot;,&quot;drawioSequence&quot;:&quot;1&quot;,&quot;drawioState&quot;:&quot;1&quot;}" mermaidType="state" generatedAt="2026-08-12T23:36:22.127Z" mermaidSource="stateDiagram-v2&#10;  [*] --&gt; RunStart&#10;  RunStart --&gt; Recall: kb_memory.recall (load per-agent memory)&#10;  Recall --&gt; Working: reason + call tools&#10;  Working --&gt; Remember: kb_memory.remember (persist a durable fact)&#10;  Working --&gt; Forget: kb_memory.forget (retract)&#10;  Remember --&gt; Working&#10;  Forget --&gt; Working&#10;  Working --&gt; Compact: token budget exceeded?&#10;  Compact --&gt; Working: summarize older turns, keep facts&#10;  Working --&gt; RunEnd&#10;  RunEnd --&gt; [*]: memory persists to next run">
          <mxCell parent="0"/>
        </object>
        <object id="n:root_start" label="Start" mermaidId="root_start" mermaidShape="pseudostate">
          <mxCell parent="1" vertex="1" style="aspect=fixed;fillColor=#333333;fontColor=#333333;html=1;shape=ellipse;strokeColor=#333333;whiteSpace=wrap;">
            <mxGeometry x="461" y="8" width="14" height="14" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:RunStart" label="RunStart" mermaidId="RunStart" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="427.359375" y="72" width="81.28125" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Recall" label="Recall" mermaidId="Recall" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="437.289063" y="210" width="61.421875" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Working" label="Working" mermaidId="Working" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="428.625" y="324" width="78.75" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Remember" label="Remember" mermaidId="Remember" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="119.046875" y="462" width="97.90625" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Forget" label="Forget" mermaidId="Forget" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="375.726563" y="462" width="64.546875" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Compact" label="Compact" mermaidId="Compact" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="645.605469" y="462" width="84.609375" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:RunEnd" label="RunEnd" mermaidId="RunEnd" mermaidShape="state">
          <mxCell parent="1" vertex="1" style="arcSize=20;fillColor=#ECECFF;fontColor=#333333;html=1;rounded=1;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="882.179688" y="462" width="74.078125" height="40" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:root_end" label="End" mermaidId="root_end" mermaidShape="pseudostate">
          <mxCell parent="1" vertex="1" style="aspect=fixed;fillColor=#9370DB;fontColor=#333333;html=1;shape=doubleEllipse;strokeColor=#333333;whiteSpace=wrap;">
            <mxGeometry x="912.21875" y="600" width="14" height="14" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:edge0" label="" mermaidId="edge0" mermaidKind="transition">
          <mxCell parent="1" source="n:root_start" target="n:RunStart" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="468" y="22" as="sourcePoint"/>
              <mxPoint x="468" y="72" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="468" y="47"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge1" label="kb_memory.recall (load per-agent memory)" mermaidId="edge1" mermaidKind="transition">
          <mxCell parent="1" source="n:RunStart" target="n:Recall" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="468" y="112" as="sourcePoint"/>
              <mxPoint x="468" y="210" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="468" y="161"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge2" label="reason + call tools" mermaidId="edge2" mermaidKind="transition">
          <mxCell parent="1" source="n:Recall" target="n:Working" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="468" y="250" as="sourcePoint"/>
              <mxPoint x="468" y="324" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="468" y="287"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge3" label="kb_memory.remember (persist a durable fact)" mermaidId="edge3" mermaidKind="transition">
          <mxCell parent="1" source="n:Working" target="n:Remember" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="428.625" y="351.546875" as="sourcePoint"/>
              <mxPoint x="150.608696" y="462" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="108" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge4" label="kb_memory.forget (retract)" mermaidId="edge4" mermaidKind="transition">
          <mxCell parent="1" source="n:Working" target="n:Forget" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="433.217391" y="364" as="sourcePoint"/>
              <mxPoint x="390.608696" y="462" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="348" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge5" label="" mermaidId="edge5" mermaidKind="transition">
          <mxCell parent="1" source="n:Remember" target="n:Working" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="185.391304" y="462" as="sourcePoint"/>
              <mxPoint x="428.625" y="355.320313" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="228" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge6" label="" mermaidId="edge6" mermaidKind="transition">
          <mxCell parent="1" source="n:Forget" target="n:Working" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="425.391304" y="462" as="sourcePoint"/>
              <mxPoint x="468" y="364" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="468" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge7" label="token budget exceeded?" mermaidId="edge7" mermaidKind="transition">
          <mxCell parent="1" source="n:Working" target="n:Compact" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="500.83288" y="364" as="sourcePoint"/>
              <mxPoint x="657.000962" y="462" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="581.273438" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge8" label="summarize older turns, keep facts" mermaidId="edge8" mermaidKind="transition">
          <mxCell parent="1" source="n:Compact" target="n:Working" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="718.81935" y="462" as="sourcePoint"/>
              <mxPoint x="507.375" y="352.320015" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="794.546875" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge9" label="" mermaidId="edge9" mermaidKind="transition">
          <mxCell parent="1" source="n:Working" target="n:RunEnd" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="507.375" y="350.021193" as="sourcePoint"/>
              <mxPoint x="919.21875" y="462" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="919.21875" y="413"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:edge10" label="memory persists to next run" mermaidId="edge10" mermaidKind="transition">
          <mxCell parent="1" source="n:RunEnd" target="n:root_end" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="919.21875" y="502" as="sourcePoint"/>
              <mxPoint x="919.21875" y="599.993353" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="919.21875" y="551"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
