Skip to content

Self-improving AI Employees for everyone

12.0 KB
Raw Blame
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="100%" role="img" aria-labelledby="title desc">
<title id="title">Agent Context vs. Memory</title>
<desc id="desc">Agent Context is the plain stored conversation: one agent_conversations row per (workflow, generation, agent node), loaded at run start and saved after every turn, so each firing continues the same conversation; the Context node on input-context is the opt-in switch and viewing panel. Memory is a separate explicit tool on input-tools: the model or a human remembers, recalls, updates or forgets versioned facts in an isolated namespace, and those items are never injected automatically. Sources: server/nodes/context/__init__.py; server/nodes/context/_descriptor.py; server/services/agent_context/conversation.py; server/services/agent_context/listeners.py; server/nodes/context/_handlers.py; server/nodes/tool/simple_memory/__init__.py; server/services/memory/tool_store.py; client/src/components/parameterPanel/ContextPanel.tsx; client/src/components/parameterPanel/MemoryToolPanel.tsx</desc>
<defs>
  <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/></marker>
  <style>
    .title { fill:#e8eaed; font:700 30px Geist,system-ui,sans-serif; }
    .subtitle { fill:#9aa1ac; font:400 18px Geist,system-ui,sans-serif; }
    .group-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:1.2px; }
    .type-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.8px; }
    .node-label { fill:#e8eaed; font:650 20px Geist,system-ui,sans-serif; }
    .node-detail { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .edge-label { fill:#e8eaed; font:500 16px Geist,system-ui,sans-serif; }
    .edge-protocol { fill:#9aa1ac; font:500 16px 'JetBrains Mono',ui-monospace,monospace; }
    .callout-title { fill:#e8eaed; font:650 18px Geist,system-ui,sans-serif; }
    .callout-text { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .legend { fill:#9aa1ac; font:500 16px Geist,system-ui,sans-serif; }
  </style>
</defs>
<rect width="1920" height="1080" fill="#0d0f13"/>
<text x="72" y="58" class="title">Agent Context vs. Memory</text>
<text x="72" y="91" class="subtitle">Stored-conversation continuity and explicit durable knowledge are separate systems</text>
<g data-group-id="context-plane"><rect x="72" y="140" width="720" height="800" rx="18" fill="#15171c" stroke="#bd93f9" stroke-width="2"/><text x="92" y="172" class="group-label">AGENT CONTEXT · STORED CONVERSATION</text></g><g data-group-id="memory-plane"><rect x="1128" y="140" width="720" height="800" rx="18" fill="#15171c" stroke="#50fa7b" stroke-width="2"/><text x="1148" y="172" class="group-label">MEMORY · EXPLICIT TOOL</text></g><g data-relationship-id="context-binds-runtime"><title>opt in at input-context</title><path d="M 400 300.0 L 430 430 L 790 430 L 810 520.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="481.6" y="415.0" width="236.79999999999998" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="600" y="433" class="edge-label" text-anchor="middle">opt in at input-context</text></g><g data-relationship-id="runtime-appends-context"><title>save messages after each turn</title><path d="M 810 520.0 L 650 520 L 650 603 L 420 602.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="524.0" y="505.0" width="252.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="650" y="523" class="edge-label" text-anchor="middle">save messages after each turn</text></g><g data-relationship-id="journal-compacts"><title>compact at COMPACTION_RATIO</title><path d="M 270.0 695 L 270 725 L 590 725 L 590.0 760" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="315.4" y="710.0" width="229.2" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="430" y="728" class="edge-label" text-anchor="middle">compact at COMPACTION_RATIO</text></g><g data-relationship-id="checkpoint-replays"><title>summary + current request seed</title><path d="M 740 835.0 L 780 835 L 780 700 L 960 700 L 960.0 645" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="694.0" y="705.0" width="252.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="820" y="723" class="edge-label" text-anchor="middle">summary + current request seed</text></g><g data-relationship-id="memory-registers-tool"><title>register tool at input-tools</title><path d="M 1520 300.0 L 1490 430 L 1130 430 L 1110 520.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1201.6" y="415.0" width="236.79999999999998" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1320" y="433" class="edge-label" text-anchor="middle" textLength="218.8" lengthAdjust="spacingAndGlyphs">register tool at input-tools</text></g><g data-relationship-id="runtime-invokes-memory"><title>remember / recall / update / forget</title><path d="M 1110 520.0 L 1290 520 L 1290 603 L 1500 602.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1145.0" y="505.0" width="290.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1290" y="523" class="edge-label" text-anchor="middle" textLength="272.0" lengthAdjust="spacingAndGlyphs">remember / recall / update / forget</text></g><g data-relationship-id="memory-persists-items"><title>persist isolated versioned items</title><path d="M 1650.0 695 L 1650 725 L 1330 725 L 1330.0 760" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1356.4" y="710.0" width="267.2" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1490" y="728" class="edge-label" text-anchor="middle" textLength="249.2" lengthAdjust="spacingAndGlyphs">persist isolated versioned items</text></g><g data-relationship-id="memory-returns-items"><title>return selected recalled items</title><path d="M 1180 835.0 L 1140 835 L 1140 700 L 960 700 L 960.0 645" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="974.0" y="665.0" width="252.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1100" y="683" class="edge-label" text-anchor="middle" textLength="234.0" lengthAdjust="spacingAndGlyphs">return selected recalled items</text></g><g data-component-id="context-node"><title>Context Node</title><rect x="120" y="220" width="280" height="160" rx="12" fill="#1b1e25" stroke="#bd93f9" stroke-width="2"/><rect x="120" y="220" width="280" height="7" rx="4" fill="#bd93f9"/><text x="138" y="246" class="type-label">OPT-IN SWITCH + PANEL</text><text x="138" y="272" class="node-label">Context Node</text><text x="138" y="298" class="node-detail" textLength="244.0" lengthAdjust="spacingAndGlyphs">output-context → input-context</text><text x="138" y="318" class="node-detail">view, clear, reset; no params</text></g><g data-component-id="context-journal"><title>agent_conversations</title><rect x="120" y="510" width="300" height="185" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="120" y="510" width="300" height="7" rx="4" fill="#ff79c6"/><text x="138" y="536" class="type-label">CONVERSATION STORE</text><text x="138" y="562" class="node-label">agent_conversations</text><text x="138" y="588" class="node-detail">one row per generation + agent</text><text x="138" y="608" class="node-detail">messages JSON, ts per message</text><text x="138" y="628" class="node-detail">loud loads, best-effort saves</text></g><g data-component-id="context-checkpoint"><title>Compaction summary</title><rect x="440" y="760" width="300" height="150" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="440" y="760" width="300" height="7" rx="4" fill="#ffb86c"/><text x="458" y="786" class="type-label">CONTEXT STATE</text><text x="458" y="812" class="node-label">Compaction summary</text><text x="458" y="838" class="node-detail">system prompt kept verbatim</text><text x="458" y="858" class="node-detail">summary rides a user turn</text></g><g data-component-id="agent-runtime"><title>Agent Runtime</title><rect x="810" y="395" width="300" height="250" rx="12" fill="#1b1e25" stroke="#bd93f9" stroke-width="2"/><rect x="810" y="395" width="300" height="7" rx="4" fill="#bd93f9"/><text x="828" y="421" class="type-label">SHARED CONSUMER</text><text x="828" y="447" class="node-label">Agent Runtime</text><text x="828" y="473" class="node-detail">sends the stored conversation</text><text x="828" y="493" class="node-detail">invokes Memory explicitly</text><text x="828" y="513" class="node-detail">keeps both namespaces separate</text></g><g data-component-id="memory-node"><title>Memory</title><rect x="1520" y="220" width="280" height="160" rx="12" fill="#1b1e25" stroke="#50fa7b" stroke-width="2"/><rect x="1520" y="220" width="280" height="7" rx="4" fill="#50fa7b"/><text x="1538" y="246" class="type-label">LOCKED TOOL</text><text x="1538" y="272" class="node-label">Memory</text><text x="1538" y="298" class="node-detail">output-tool → input-tools</text><text x="1538" y="318" class="node-detail">remember · recall · list</text><text x="1538" y="338" class="node-detail">get · update · forget</text></g><g data-component-id="memory-store"><title>MemoryToolStore</title><rect x="1500" y="510" width="300" height="185" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="1500" y="510" width="300" height="7" rx="4" fill="#ff79c6"/><text x="1518" y="536" class="type-label">DURABLE DATA</text><text x="1518" y="562" class="node-label">MemoryToolStore</text><text x="1518" y="588" class="node-detail">owner / workflow / node scope</text><text x="1518" y="608" class="node-detail">versioned idempotent mutations</text><text x="1518" y="628" class="node-detail">lexical + optional embedding</text></g><g data-component-id="memory-items"><title>Facts &amp; Decisions</title><rect x="1180" y="760" width="300" height="150" rx="12" fill="#1b1e25" stroke="#50fa7b" stroke-width="2"/><rect x="1180" y="760" width="300" height="7" rx="4" fill="#50fa7b"/><text x="1198" y="786" class="type-label">MEMORY ITEMS</text><text x="1198" y="812" class="node-label">Facts &amp; Decisions</text><text x="1198" y="838" class="node-detail">returned only when recalled</text><text x="1198" y="858" class="node-detail">never automatic transcript</text></g><g data-callout-id="context-invariant"><rect x="440" y="220" width="300" height="160" rx="10" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2" stroke-dasharray="7 6"/><text x="456" y="250" class="callout-title">Automatic continuity</text><text x="456" y="276" class="callout-text" textLength="268.0" lengthAdjust="spacingAndGlyphs">System managed; no model tool call</text><text x="456" y="298" class="callout-text">Same conversation across firings</text><text x="456" y="320" class="callout-text">Reset starts a new generation</text></g><g data-callout-id="memory-invariant"><rect x="1180" y="220" width="300" height="160" rx="10" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2" stroke-dasharray="7 6"/><text x="1196" y="250" class="callout-title">Explicit knowledge</text><text x="1196" y="276" class="callout-text" textLength="268.0" lengthAdjust="spacingAndGlyphs">Model or human chooses mutations</text><text x="1196" y="298" class="callout-text">Stable facts and decisions only</text><text x="1196" y="320" class="callout-text" textLength="268.0" lengthAdjust="spacingAndGlyphs">Clear never clears Agent Context</text></g>
<g aria-label="Legend"><circle cx="72" cy="1038" r="7" fill="#bd93f9"/><text x="86" y="1044" class="legend">Agents / system</text><circle cx="317" cy="1038" r="7" fill="#8be9fd"/><text x="331" y="1044" class="legend">Models / interfaces</text><circle cx="562" cy="1038" r="7" fill="#50fa7b"/><text x="576" y="1044" class="legend">Tools / results</text><circle cx="807" cy="1038" r="7" fill="#ff79c6"/><text x="821" y="1044" class="legend">Triggers / events</text><circle cx="1052" cy="1038" r="7" fill="#ffb86c"/><text x="1066" y="1044" class="legend">Workflow / runtime</text><circle cx="1297" cy="1038" r="7" fill="#f1fa8c"/><text x="1311" y="1044" class="legend">Security note</text></g>
</svg>