AI · 02 — Agent (tools + memory)

An agent that THINKS with a wired ◈ Model, REMEMBERS with a wired ◈ Memory (./ai-demo-memory), and ACTS with a warehouse-lookup tool — it CANNOT know the stock count without calling it (N-100 → 42). Run it twice and it remembers the conversation.

What’s inside

5 nodes — every type links to its full reference page.

StepNodeType
Task Inject input.inject
Agent AI Agent ai.agent
Ollama (local) AI Model ai.model
File memory Agent Memory ai.memory
Result Console utility.console

Import it

  1. Studio → Import — paste the JSON below (or the URL /docs/templates/ai-02-agent-tools-memory.json).
  2. Or ask the AI Copilot with the JSON pasted after the phrase:
    import this workflow json into a new workflow named "AI · 02 — Agent (tools + memory)"
  3. Any credentials the nodes need are ${credential.…} references — add them once in Admin → Credentials and the template picks them up. Nothing secret ships in a template.
The workflow document (flowdrome.workflow.v1, 5 node types)
{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "AI · 02 — Agent (tools + memory)",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Task",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "message": "How many units of SKU N-100 do we have in stock?",
          "sessionId": "ai-demo"
        }
      },
      "position": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "agent",
      "type": "ai.agent",
      "label": "Agent",
      "category": "ai",
      "config": {
        "provider": "ollama",
        "baseUrl": "",
        "apiKey": "",
        "model": "qwen2.5:1.5b",
        "models": [],
        "system": "You are a warehouse assistant. For ANY stock or inventory question you MUST call the check_inventory tool — you have no other way to know stock levels. Answer in one short sentence.",
        "outputFormat": "text",
        "temperature": 0.2,
        "maxTokens": 256,
        "maxIterations": 4,
        "historyLimit": 20,
        "memoryBackend": "file",
        "memoryDir": "./ai-demo-memory",
        "sessionKey": "{{ input.sessionId }}",
        "approval": "off",
        "tools": [
          {
            "type": "function",
            "name": "check_inventory",
            "description": "Look up how many units of a SKU are in stock. Call with the SKU code, e.g. 'N-100'.",
            "parameters": {
              "type": "object",
              "properties": {
                "sku": {
                  "type": "string"
                }
              },
              "required": [
                "sku"
              ]
            },
            "code": "var db = { 'N-100': 42, 'N-200': 7, 'N-300': 0 }; var k = String(args.sku || '').toUpperCase().trim(); return { sku: k, unitsInStock: db[k] === undefined ? 'unknown SKU' : db[k] };"
          }
        ]
      },
      "position": {
        "x": 530,
        "y": 0
      },
      "attachments": {
        "model": "llm",
        "memory": "mem"
      }
    },
    {
      "id": "llm",
      "type": "ai.model",
      "label": "Ollama (local)",
      "category": "ai",
      "config": {
        "provider": "ollama",
        "baseUrl": "",
        "apiKey": "",
        "model": "qwen2.5:1.5b",
        "models": [],
        "temperature": 0.2,
        "maxTokens": 512
      },
      "position": {
        "x": 530,
        "y": 222
      }
    },
    {
      "id": "mem",
      "type": "ai.memory",
      "label": "File memory",
      "category": "ai",
      "config": {
        "memoryBackend": "file",
        "memoryDir": "./ai-demo-memory",
        "sessionKey": "{{ input.sessionId }}",
        "historyLimit": 20
      },
      "position": {
        "x": 574,
        "y": 262
      }
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "Result",
      "category": "utility",
      "config": {
        "message": "Agent: {{ $json.text }}  (loop iterations: {{ $json.iterations }})"
      },
      "position": {
        "x": 1060,
        "y": 0
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "agent",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "agent",
      "sourcePort": "output",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "An agent that THINKS with a wired ◈ Model, REMEMBERS with a wired ◈ Memory (./ai-demo-memory), and ACTS with a warehouse-lookup tool — it CANNOT know the stock count without calling it (N-100 → 42). Run it twice and it remembers the conversation."
  }
}

Generated from the verified demo corpus — this exact document seeds and runs on a fresh Flowdrome. Raw JSON: ai-02-agent-tools-memory.json.