Linea Docs

Agent Node

LLM node with tool use, structured output, long-term memory, and multi-step agentic loops.

Agent Node

The agent node is the primary AI node in Linea. It runs an LLM call with an agentic loop: the model can invoke built-in tools repeatedly until it produces a final answer or reaches maxSteps.

Configuration Fields

FieldTypeDefaultDescription
modelstringclaude-sonnet-4-6Model ID — e.g. claude-sonnet-4-6, claude-haiku-4-5-20251001, gpt-4o
systemPromptstringStatic instructions prepended as the system message (supports {{}})
instructionsstring"Process the input"The user-turn message (supports {{}})
toolsstring[][]Built-in tool names to enable (see table below)
toolApprovalsobject{}Per-tool approval override: { toolName: 'never' | 'always' | 'on_mutation' }
outputSchemastring (JSON)JSON Schema string — forces structured JSON output
enableLongTermMemorybooleanfalsePrepend recent cross-execution memories before inference
includeChatHistorybooleanfalseInject prior chatHistory turns as conversation context
maxStepsnumber10Maximum agentic loop iterations
maxTokensnumber4096Max output tokens per LLM call
temperaturenumber0.7Sampling temperature (ignored when tools are enabled — fixed at 0 for deterministic re-execution)
contextBudgetPctnumber0.8Fraction of the model's context window to use before truncating history

Built-in Tools

Enable any subset of these in the tools array:

Tool nameWhat it doesApproval
memory_storeStore a key-value fact in long-term memoryNever
memory_searchSemantic search of stored memoriesNever
http_requestMake an HTTP request to any URLon_mutation (GET auto-approved; POST/PUT/PATCH/DELETE require human)
run_javascriptExecute a JavaScript snippetAlways
ask_humanPause and ask the user a questionAlways
read_variableRead a workflow variable by nameNever
write_variableWrite a value to a workflow variableNever

When ask_human or a mutation-triggering tool fires, the execution is suspended. The workflow resumes via PATCH /executions/:id/respond with the human's answer.

Structured Output

Set outputSchema to a JSON Schema string. The agent is instructed to return only a JSON object matching the schema. The executor strips markdown code fences and parses the result automatically.

Example:

{
  "model": "claude-sonnet-4-6",
  "systemPrompt": "Classify the sentiment of the input text.",
  "instructions": "{{input.text}}",
  "outputSchema": "{\"type\":\"object\",\"properties\":{\"sentiment\":{\"type\":\"string\",\"enum\":[\"positive\",\"neutral\",\"negative\"]},\"confidence\":{\"type\":\"number\"}},\"required\":[\"sentiment\",\"confidence\"]}"
}

Output: { "sentiment": "positive", "confidence": 0.92 }

Long-term Memory

When enableLongTermMemory: true, the agent loads the 8 most recent memories from the workspace memory store and injects them into the user message before inference. The agent can also write new memories mid-run using the memory_store tool.

Long-term memory requires the memory_store and memory_search tools to be enabled. The enableLongTermMemory flag only controls whether recent memories are prepended — the tools control whether the agent can actively store/retrieve during a run.

Agent Output Shape

The node output stored in nodeResults and forwarded as lastOutput:

{
  __agentValue: string | object   // final answer (object if outputSchema used)
  __usage: { input_tokens, output_tokens, total_tokens }
  __toolCallLog: Array<{ step, name, args, result }>
  __modelId: string
  __provider: string
}

Context Compaction

When conversation history exceeds contextBudgetPct of the model's context window:

  1. Tool result messages are capped at 8 000 characters each
  2. Oldest non-system messages are dropped until within budget
  3. System messages are always preserved

Example Config

{
  "model": "claude-sonnet-4-6",
  "systemPrompt": "You are a helpful assistant. Be concise.",
  "instructions": "Summarize the following article: {{input.articleText}}",
  "tools": ["memory_store", "memory_search"],
  "enableLongTermMemory": true,
  "maxSteps": 5
}

On this page