Linea Docs

Memory Node

Read, retrieve, or clear in-workflow key-value memory scoped to the current thread or execution.

Memory Node

The memory node operates on the in-workflow key-value store that persists within a single execution thread. It is distinct from the long-term memory system (see Memory System).

What It Does

The memory node reads from or clears the in-execution memory dictionary — a key-value store that persists within a single execution thread. Agent nodes can write to this dictionary via the memory_store tool.

Configuration Fields

FieldTypeDefaultDescription
memoryModesmart | retrieve | clearretrieveOperation to perform
memoryScopethread | workflow | userthreadScope label (informational for clear)
memoryQuerystring""Keyword filter for retrieve mode
memoryTopKnumber5Maximum results to return in retrieve mode
memoryAgentIdstringAttribution tag stored alongside writes

Modes

retrieve

Searches the in-execution memory dictionary for keys/values matching memoryQuery (case-insensitive substring match). Returns up to memoryTopK results:

{
  "memories": [
    { "key": "user_preference", "value": "dark mode", "text": "dark mode" }
  ],
  "count": 1,
  "query": "preference"
}

clear

Clears the in-workflow memory dictionary. Returns { "__clearMemory": true, "scope": "thread" }.

smart

Passthrough mode — returns the current memory snapshot for an upstream agent to reason about:

{ "memory": { "key": "value", ... }, "count": 2 }

For persistent, cross-execution memory with semantic search, use the enableLongTermMemory flag on the Agent node and the memory_store / memory_search built-in tools. The Memory node only operates on ephemeral within-execution state.

Example Config

{
  "memoryMode": "retrieve",
  "memoryQuery": "user preference",
  "memoryTopK": 3
}

On this page