This workflow corresponds to n8n.io template #5870 — we link there as the canonical source.
This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "YPje3UkavbHU2ZGD",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Build Your First AI Agent \u2013 Powered by Google Gemini with Memory",
"tags": [],
"nodes": [
{
"id": "67423dee-9bdc-4d37-8d55-ffe22afa1496",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
700,
-80
],
"parameters": {
"public": true,
"options": {
"loadPreviousSession": "memory"
}
},
"typeVersion": 1.1
},
{
"id": "e376fcb1-851f-43f0-bdb8-3aa8a157de7e",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1040,
-80
],
"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** \u2013 Use this tool to reason step-by-step before giving a final answer.\n2. **SerpAPI** \u2013 Use this to access verified external knowledge, including encyclopedic or factual data.\n3. **Calculator** \u2013 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": "d63f63bc-db0d-41f3-9bf3-e8b972f1cc11",
"name": "Think",
"type": "@n8n/n8n-nodes-langchain.toolThink",
"position": [
1280,
120
],
"parameters": {},
"typeVersion": 1
},
{
"id": "9abedfcd-fc7a-4a06-8712-3059f2dd3a9b",
"name": "SerpAPI",
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
"position": [
1640,
120
],
"parameters": {
"options": {}
},
"credentials": {
"serpApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "a160b2b1-d8b1-4699-94c5-1856ce06e18c",
"name": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
1460,
120
],
"parameters": {},
"typeVersion": 1
},
{
"id": "733e0cc3-5bfd-412e-9e57-63d3d2a98b5c",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1100,
120
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "0ca4de96-0a6b-47c6-8110-2c3074f30eef",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
-80
],
"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### \ud83d\udc49 https://n8n.io/creators/digimetalab/\n"
},
"typeVersion": 1
},
{
"id": "b19cd5f5-e802-4527-b7ba-fefa0fba79a5",
"name": "Sticky Note17",
"type": "n8n-nodes-base.stickyNote",
"position": [
1080,
260
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## \ud83d\udc46\nThis is a short term memory. It will remember the 5 previous interactions during the chat"
},
"typeVersion": 1
},
{
"id": "598cd112-c395-404c-bd01-e1218826cf2e",
"name": "Sticky Note18",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
260
],
"parameters": {
"color": 7,
"width": 170,
"height": 180,
"content": "## \ud83d\udc46\nYou can use the free Google Gemini options."
},
"typeVersion": 1
},
{
"id": "140122d5-4835-4157-b3e9-8e3ef3d74531",
"name": "Sticky Note19",
"type": "n8n-nodes-base.stickyNote",
"position": [
1440,
260
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## \ud83d\udc46\nThe Calculator is a tool that allows an agent to run mathematical calculations."
},
"typeVersion": 1
},
{
"id": "7cffe43a-1d47-42df-849e-dbb72f68f2d1",
"name": "Sticky Note20",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
260
],
"parameters": {
"color": 7,
"width": 150,
"height": 180,
"content": "## \ud83d\udc46\nThe Think is a tool Enables step-by-step reasoning before answering."
},
"typeVersion": 1
},
{
"id": "acacf20e-c28d-43da-83c8-7f5568c5500d",
"name": "Sticky Note21",
"type": "n8n-nodes-base.stickyNote",
"position": [
1620,
260
],
"parameters": {
"color": 7,
"width": 150,
"height": 240,
"content": "## \ud83d\udc46\nThe SerpAPI is a tool that allows Performs real-time Google Search using SerpAPI to retrieve factual, up-to-date information."
},
"typeVersion": 1
},
{
"id": "c2a726ed-e53d-46c0-809d-102a080e305e",
"name": "Groq Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
920,
120
],
"parameters": {
"model": "meta-llama/llama-4-maverick-17b-128e-instruct",
"options": {}
},
"credentials": {
"groqApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "8f401efd-9311-4415-8ffb-b8954fac992d",
"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
}
]
]
},
"Groq Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
groqApiserpApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
A reasoning agent that can think, search, calculate, and remember — powered by GROQ inference and ready to deploy in one click.
Source: https://n8n.io/workflows/5870/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
A smart personal assistant that can reason, search, calculate, and remember — powered by Google Gemini and ready in one click.
teste. Uses chatTrigger, agent, lmChatGroq, memoryBufferWindow. Chat trigger; 24 nodes.
This workflow deploys a fully autonomous "AI SEO Agency" inside your n8n instance.
pix-zap. Uses chatTrigger, agent, toolCalculator, toolWikipedia. Chat trigger; 21 nodes.
✨ Intro This workflow shows how to go beyond a “plain” AI chatbot by: