构建您的第一个 AI Agent – 由 Google Gemini 提供支持并具备记忆功能
中级
这是一个Engineering, AI领域的自动化工作流,包含 13 个节点。主要使用 Agent, ToolThink, ChatTrigger, ToolSerpApi, ToolCalculator 等节点,结合人工智能技术实现智能自动化。 🤖 构建您的第一个 AI Agent – 由 Google Gemini 提供支持并具备记忆功能
前置要求
- •Google Gemini API Key
使用的节点 (13)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "uJ3EzQF3mDFAnkeb",
"meta": {
"instanceId": "d56113bd7fa650b2ac10ad7d1c3d6997aa49fa4dd1df2270cd1ac1e53b86f03a",
"templateCredsSetupCompleted": true
},
"name": "Build Your First AI Agent – Powered by Google Gemini with Memory",
"tags": [],
"nodes": [
{
"id": "348eb0af-3b44-41f4-85be-05af1def4eb5",
"name": "When chat message received",
"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": "Think",
"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 Chat Model",
"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": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
680,
20
],
"parameters": {},
"typeVersion": 1
},
{
"id": "bcf984a7-774e-454f-a082-4fea25741e83",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
260,
20
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "e9f7eca2-5ad3-43e8-bde2-f8e7e75756f0",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
-180
],
"parameters": {
"color": 6,
"width": 320,
"height": 580,
"content": "## Author\n\n## Digimetalab\nAutomation consultant from Bali, 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.\n\nFor business inquiries, email we at digimetalab@gmail.com\nOr message me on [Telegram](https://t.me/digimetalab) for a faster response.\n\n### Check out my other templates\n### 👉 https://n8n.io/creators/digimetalab/\n"
},
"typeVersion": 1
},
{
"id": "d78f8043-0a68-454d-a7dd-aea9e4773432",
"name": "Sticky Note17",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
160
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## 👆\nThis is a short term memory. It will remember the 5 previous interactions during the chat"
},
"typeVersion": 1
},
{
"id": "59e98d56-42ea-4251-a287-82e8643f46aa",
"name": "Sticky Note18",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
160
],
"parameters": {
"color": 7,
"width": 170,
"height": 180,
"content": "## 👆\nYou can use the free Google Gemini options."
},
"typeVersion": 1
},
{
"id": "a2dd7685-4702-41af-8124-e4d307317d65",
"name": "Sticky Note19",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
160
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## 👆\nThe Calculator is a tool that allows an agent to run mathematical calculations."
},
"typeVersion": 1
},
{
"id": "8bad0027-784a-403d-b1db-149d68a6d022",
"name": "Sticky Note20",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
160
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## 👆\nThe Think is a tool Enables step-by-step reasoning before answering."
},
"typeVersion": 1
},
{
"id": "c98f150a-cfd4-4edb-8d6c-5f48178e08a8",
"name": "Sticky Note21",
"type": "n8n-nodes-base.stickyNote",
"position": [
860,
160
],
"parameters": {
"color": 7,
"width": 150,
"height": 240,
"content": "## 👆\nThe SerpAPI is a tool that allows Performs real-time Google Search using SerpAPI to retrieve factual, up-to-date information."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "e2e9ac71-0450-40b8-818c-f7cc30bd4d3a",
"connections": {
"85b68f2c-e656-44f2-8e2a-27066c99a0c6": {
"ai_tool": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "ai_tool",
"index": 0
}
]
]
},
"1c1c954c-ef1a-4114-9898-65bb4626fbb8": {
"ai_tool": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "ai_tool",
"index": 0
}
]
]
},
"9e4704ec-e498-4d0c-a3ea-ab08fa7bf7ac": {
"ai_tool": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "ai_tool",
"index": 0
}
]
]
},
"bcf984a7-774e-454f-a082-4fea25741e83": {
"ai_memory": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "ai_memory",
"index": 0
},
{
"node": "348eb0af-3b44-41f4-85be-05af1def4eb5",
"type": "ai_memory",
"index": 0
}
]
]
},
"8791e2c2-89f7-4e40-9520-8b8f35c0c6ba": {
"ai_languageModel": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"348eb0af-3b44-41f4-85be-05af1def4eb5": {
"main": [
[
{
"node": "6c914256-d2b6-4156-99e3-d88f62bfca66",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 工程, 人工智能
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
代理 AI Anthropic Opus 4 和 Sonnet 4
Anthropic AI 代理:Claude Sonnet 4 和 Opus 4,具备思考和网络搜索工具
Agent
Http Request Tool
Tool Think
+
Agent
Http Request Tool
Tool Think
11 节点Davide
工程
自适应RAG策略:查询分类与检索(Gemini和Qdrant)
自适应RAG策略:查询分类与检索(Gemini和Qdrant)
Set
Switch
Summarize
+
Set
Switch
Summarize
39 节点dmr
工程
AI驱动的Telegram助手终极入门指南(PDF、Brave搜索和Google套件)
使用Gemini、RAG PDF搜索和Google套件构建多功能Telegram机器人
Set
Code
Wait
+
Set
Code
Wait
79 节点Issam AGGOUR
人工智能
数据分析师 Agent v3
用于电子表格的AI数据分析助手,基于NocoDB平台
Set
Noco Db Tool
Http Request
+
Set
Noco Db Tool
Http Request
10 节点Derek Cheung
工程
使用SQL数据库、RAG和路由代理构建AI驱动的技术雷达顾问
使用SQL数据库、RAG和路由代理构建AI驱动的技术雷达顾问
If
Code
Cron
+
If
Code
Cron
53 节点Sean Lon
工程
AI智能助手:与Supabase存储和Google Drive文件对话
AI智能助手:与Supabase存储和Google Drive文件对话
If
Set
Wait
+
If
Set
Wait
62 节点Mark Shcherbakov
工程
工作流信息
难度等级
中级
节点数量13
分类2
节点类型8
作者
DigiMetaLab
@digimetalabDigimetalab, 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 查看 →
分享此工作流