构建您的第一个 AI Agent – 由 Google Gemini 提供支持并具备记忆功能

中级

这是一个Engineering、AI领域的自动化工作流,包含 13 个节点。主要使用 Agent、ToolThink、ChatTrigger、ToolSerpApi、ToolCalculator 等节点,结合人工智能技术实现智能自动化。 🤖 构建您的第一个 AI Agent – 由 Google Gemini 提供支持并具备记忆功能

前置要求
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "uJ3EzQF3mDFAnkeb",
  "meta": {
    "instanceId": "d56113bd7fa650b2ac10ad7d1c3d6997aa49fa4dd1df2270cd1ac1e53b86f03a",
    "templateCredsSetupCompleted": true
  },
  "name": "构建您的第一个 AI Agent – 由 Google Gemini 提供支持并具备记忆功能",
  "tags": [],
  "nodes": [
    {
      "id": "348eb0af-3b44-41f4-85be-05af1def4eb5",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -180,
        -180
      ],
      "webhookId": "f04048f5-3043-4250-ab36-aa282c819a69",
      "parameters": {
        "public": true,
        "options": {
          "loadPreviousSession": "memory"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6c914256-d2b6-4156-99e3-d88f62bfca66",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        160,
        -180
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are my intelligent personal assistant. Your role is to help me think critically, access structured external knowledge, and solve complex numerical problems. You have access to the following tools:\n\n1. **Think** – Use this tool to reason step-by-step before giving a final answer.\n2. **SerpAPI** – Use this to access verified external knowledge, including encyclopedic or factual data.\n3. **Calculator** – Use this to perform accurate numerical or mathematical computations.\n\nYour goals:\n- Understand my task or question deeply before responding.\n- When unsure, think step-by-step using the `Think` tool.\n- For factual knowledge or concepts, use the `SerpAPI` tool.\n- For numerical tasks or financial calculations, use the `Calculator`.\n- Always explain your steps in a concise and professional way unless instructed otherwise.\n- Keep answers short and efficient unless asked for elaboration.\n\nAlways act as a helpful, private, and reliable personal assistant."
        }
      },
      "typeVersion": 2
    },
    {
      "id": "85b68f2c-e656-44f2-8e2a-27066c99a0c6",
      "name": "思考",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        460,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1c1c954c-ef1a-4114-9898-65bb4626fbb8",
      "name": "SerpAPI",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        880,
        20
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "serpApi": {
          "id": "cSdemdubUv7MUHhQ",
          "name": "SerpAPI - DML"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8791e2c2-89f7-4e40-9520-8b8f35c0c6ba",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        40,
        20
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro-preview-06-05"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "O7KFdHkBYuFvFcAR",
          "name": "Google Gemini - DML"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e4704ec-e498-4d0c-a3ea-ab08fa7bf7ac",
      "name": "计算器",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        680,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bcf984a7-774e-454f-a082-4fea25741e83",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        260,
        20
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "e9f7eca2-5ad3-43e8-bde2-f8e7e75756f0",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -180
      ],
      "parameters": {
        "color": 6,
        "width": 320,
        "height": 580,
        "content": "## 作者"
      },
      "typeVersion": 1
    },
    {
      "id": "d78f8043-0a68-454d-a7dd-aea9e4773432",
      "name": "便签 17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 150,
        "height": 180,
        "content": "## 👆"
      },
      "typeVersion": 1
    },
    {
      "id": "59e98d56-42ea-4251-a287-82e8643f46aa",
      "name": "便签 18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 170,
        "height": 180,
        "content": "## 👆"
      },
      "typeVersion": 1
    },
    {
      "id": "a2dd7685-4702-41af-8124-e4d307317d65",
      "name": "便签19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 150,
        "height": 180,
        "content": "## 👆"
      },
      "typeVersion": 1
    },
    {
      "id": "8bad0027-784a-403d-b1db-149d68a6d022",
      "name": "便签20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 150,
        "height": 180,
        "content": "## 👆"
      },
      "typeVersion": 1
    },
    {
      "id": "c98f150a-cfd4-4edb-8d6c-5f48178e08a8",
      "name": "便签21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 150,
        "height": 240,
        "content": "## 👆"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e2e9ac71-0450-40b8-818c-f7cc30bd4d3a",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          },
          {
            "node": "When chat message received",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

这是一个中级难度的工作流,适用于Engineering、AI等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量13
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
DigiMetaLab

DigiMetaLab

@digimetalab

Digimetalab, Automation consultant with 3+ years helping Sales & Marketing streamline processes. We offer custom n8n solutions to boost efficiency. Book an initial consultation via our link for tailored automation.

外部链接
在 n8n.io 上查看 →

分享此工作流